Move game log processing into SCUM companion

This commit is contained in:
npc0-hue
2026-09-02 10:18:27 +08:00
parent 7d9c1b7e9e
commit 40ac46ba17
14 changed files with 328 additions and 232 deletions
+3 -60
View File
@@ -59,25 +59,6 @@ type GameClientBridgeQueryProjectionDeclaration struct {
MergeExisting bool
}
type GameClientBridgeLogProjectionStepDeclaration struct {
Pattern string
}
type GameClientBridgeLogProjectionTargetDeclaration struct {
Collection string
UpsertKeys []string
CaptureMappings map[string]string
HashMappings map[string]string
FixedValues map[string]string
ObservedAtField string
}
type GameClientBridgeLogProjectionPresenceDeclaration struct {
TimestampField string
ActiveWindowSeconds int
ActivityTarget *GameClientBridgeLogProjectionTargetDeclaration
}
type GameClientBridgeLifecycleProjectionDeclaration struct {
Key string
Capabilities []string
@@ -102,20 +83,9 @@ type GameClientBridgeBulkActivityTargetDeclaration struct {
ObservedAtField string
}
type GameClientBridgeLogProjectionDeclaration struct {
Key string
StreamKeys []string
Steps []GameClientBridgeLogProjectionStepDeclaration
CorrelationFields []string
MaxInterveningLines int
Target GameClientBridgeLogProjectionTargetDeclaration
Presence *GameClientBridgeLogProjectionPresenceDeclaration
}
type GameClientBridgeDataPackDeclaration struct {
Key string
DatabaseUserVersion int
LogParserRefs []string
ConfigMapRefs []string
DataRefs []string
}
@@ -156,7 +126,6 @@ type GameClientBridgeManifest struct {
Commands []GameClientBridgeCommandDeclaration
Snapshots []GameClientBridgeSnapshotDeclaration
QueryTemplates []GameClientBridgeQueryTemplateDeclaration
LogProjections []GameClientBridgeLogProjectionDeclaration
LifecycleProjections []GameClientBridgeLifecycleProjectionDeclaration
DataPacks []GameClientBridgeDataPackDeclaration
Retention GameClientBridgeRetention
@@ -330,6 +299,9 @@ type GameClientBridgeSnapshotIngestRequest struct {
Retention GameClientBridgeRetention
}
// GameClientBridgeLogStreamRequest authorizes a component to receive the
// opaque log channel for its bound server. The platform never interprets the
// log body; parsing and business projections remain plugin-owned.
type GameClientBridgeLogStreamRequest struct {
SessionToken string
}
@@ -440,17 +412,12 @@ func CopyGameClientBridgeManifest(value GameClientBridgeManifest) GameClientBrid
for index := range value.QueryTemplates {
value.QueryTemplates[index] = CopyGameClientBridgeQueryTemplateDeclaration(value.QueryTemplates[index])
}
value.LogProjections = append([]GameClientBridgeLogProjectionDeclaration(nil), value.LogProjections...)
for index := range value.LogProjections {
value.LogProjections[index] = CopyGameClientBridgeLogProjectionDeclaration(value.LogProjections[index])
}
value.LifecycleProjections = append([]GameClientBridgeLifecycleProjectionDeclaration(nil), value.LifecycleProjections...)
for index := range value.LifecycleProjections {
value.LifecycleProjections[index] = CopyGameClientBridgeLifecycleProjectionDeclaration(value.LifecycleProjections[index])
}
value.DataPacks = append([]GameClientBridgeDataPackDeclaration(nil), value.DataPacks...)
for index := range value.DataPacks {
value.DataPacks[index].LogParserRefs = CopyStringSlice(value.DataPacks[index].LogParserRefs)
value.DataPacks[index].ConfigMapRefs = CopyStringSlice(value.DataPacks[index].ConfigMapRefs)
value.DataPacks[index].DataRefs = CopyStringSlice(value.DataPacks[index].DataRefs)
}
@@ -507,30 +474,6 @@ func CopyGameClientBridgeBulkActivityTargetDeclaration(value GameClientBridgeBul
return value
}
func CopyGameClientBridgeLogProjectionDeclaration(value GameClientBridgeLogProjectionDeclaration) GameClientBridgeLogProjectionDeclaration {
value.StreamKeys = CopyStringSlice(value.StreamKeys)
value.Steps = append([]GameClientBridgeLogProjectionStepDeclaration(nil), value.Steps...)
value.CorrelationFields = CopyStringSlice(value.CorrelationFields)
value.Target = CopyGameClientBridgeLogProjectionTargetDeclaration(value.Target)
if value.Presence != nil {
presence := *value.Presence
if presence.ActivityTarget != nil {
activityTarget := CopyGameClientBridgeLogProjectionTargetDeclaration(*presence.ActivityTarget)
presence.ActivityTarget = &activityTarget
}
value.Presence = &presence
}
return value
}
func CopyGameClientBridgeLogProjectionTargetDeclaration(value GameClientBridgeLogProjectionTargetDeclaration) GameClientBridgeLogProjectionTargetDeclaration {
value.UpsertKeys = CopyStringSlice(value.UpsertKeys)
value.CaptureMappings = CopyStringMap(value.CaptureMappings)
value.HashMappings = CopyStringMap(value.HashMappings)
value.FixedValues = CopyStringMap(value.FixedValues)
return value
}
func copyGameClientBridgePayloadValue(value any) any {
switch typed := value.(type) {
case map[string]any: