feat(scum): rebuild plugin-owned management data

This commit is contained in:
npc0-hue
2026-08-15 12:43:09 +08:00
parent 92b1159cc8
commit 65353cf269
113 changed files with 3116 additions and 8058 deletions
+33
View File
@@ -69,8 +69,23 @@ type GameClientBridgeQueryTemplateDeclaration struct {
TargetKey string
ParameterSchemaRef string
ResultSchemaRef string
SQLRef string
MaxRows int
TimeoutSeconds int
RowTarget *PluginDataRowTargetDeclaration
}
type PluginDataRowTargetDeclaration struct {
Collection string
UpsertKeys []string
ColumnMappings map[string]string
}
type GameClientBridgeDataPackDeclaration struct {
Key string
DatabaseUserVersion int
LogParserRefs []string
ConfigMapRefs []string
}
type GameClientBridgeOperationKind string
@@ -155,6 +170,7 @@ type GameClientBridgeManifest struct {
Commands []GameClientBridgeCommandDeclaration
Snapshots []GameClientBridgeSnapshotDeclaration
QueryTemplates []GameClientBridgeQueryTemplateDeclaration
DataPacks []GameClientBridgeDataPackDeclaration
OperationTemplates []GameClientBridgeOperationTemplateDeclaration
Retention GameClientBridgeRetention
Pages []GameClientBridgePageContract
@@ -453,6 +469,17 @@ func CopyGameClientBridgeManifest(value GameClientBridgeManifest) GameClientBrid
}
value.Snapshots = append([]GameClientBridgeSnapshotDeclaration(nil), value.Snapshots...)
value.QueryTemplates = append([]GameClientBridgeQueryTemplateDeclaration(nil), value.QueryTemplates...)
for index := range value.QueryTemplates {
if value.QueryTemplates[index].RowTarget != nil {
copy := CopyPluginDataRowTargetDeclaration(*value.QueryTemplates[index].RowTarget)
value.QueryTemplates[index].RowTarget = &copy
}
}
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.OperationTemplates = append([]GameClientBridgeOperationTemplateDeclaration(nil), value.OperationTemplates...)
value.Pages = append([]GameClientBridgePageContract(nil), value.Pages...)
value.Features = append([]GameClientBridgeFeatureDeclaration(nil), value.Features...)
@@ -470,6 +497,12 @@ func CopyGameClientBridgeManifest(value GameClientBridgeManifest) GameClientBrid
return value
}
func CopyPluginDataRowTargetDeclaration(value PluginDataRowTargetDeclaration) PluginDataRowTargetDeclaration {
value.UpsertKeys = CopyStringSlice(value.UpsertKeys)
value.ColumnMappings = CopyStringMap(value.ColumnMappings)
return value
}
func copyGameClientBridgePayloadValue(value any) any {
switch typed := value.(type) {
case map[string]any:
+5 -2
View File
@@ -4,16 +4,19 @@ import "testing"
func TestCopyGameClientBridgeDeclarationsCopiesQueryTemplateSlices(t *testing.T) {
manifest := GameClientBridgeManifest{
QueryTemplates: []GameClientBridgeQueryTemplateDeclaration{{Key: "player.lookup"}},
QueryTemplates: []GameClientBridgeQueryTemplateDeclaration{{Key: "player.lookup", RowTarget: &PluginDataRowTargetDeclaration{Collection: "users", UpsertKeys: []string{"userId"}, ColumnMappings: map[string]string{"userId": "user_id"}}}},
DataPacks: []GameClientBridgeDataPackDeclaration{{Key: "db-v1", LogParserRefs: []string{"logs.json"}, ConfigMapRefs: []string{"config.json"}}},
OperationTemplates: []GameClientBridgeOperationTemplateDeclaration{{Key: "player.fame.set"}},
Pages: []GameClientBridgePageContract{{PageKey: "players", QueryTemplateKeys: []string{"player.lookup"}, OperationKeys: []string{"player.fame.set"}}},
}
manifestCopy := CopyGameClientBridgeManifest(manifest)
manifestCopy.QueryTemplates[0].Key = "mutated"
manifestCopy.QueryTemplates[0].RowTarget.ColumnMappings["userId"] = "mutated"
manifestCopy.DataPacks[0].LogParserRefs[0] = "mutated"
manifestCopy.OperationTemplates[0].Key = "mutated"
manifestCopy.Pages[0].QueryTemplateKeys[0] = "mutated"
manifestCopy.Pages[0].OperationKeys[0] = "mutated"
if manifest.QueryTemplates[0].Key != "player.lookup" || manifest.OperationTemplates[0].Key != "player.fame.set" || manifest.Pages[0].QueryTemplateKeys[0] != "player.lookup" || manifest.Pages[0].OperationKeys[0] != "player.fame.set" {
if manifest.QueryTemplates[0].Key != "player.lookup" || manifest.QueryTemplates[0].RowTarget.ColumnMappings["userId"] != "user_id" || manifest.DataPacks[0].LogParserRefs[0] != "logs.json" || manifest.OperationTemplates[0].Key != "player.fame.set" || manifest.Pages[0].QueryTemplateKeys[0] != "player.lookup" || manifest.Pages[0].OperationKeys[0] != "player.fame.set" {
t.Fatalf("manifest copy aliases query template declarations: source=%#v copy=%#v", manifest, manifestCopy)
}
-144
View File
@@ -1,144 +0,0 @@
package domain
import "time"
const SCUMRewardDeliverCommandType = "reward.deliver"
const SCUMGiftNotificationCommandType = "player.notify"
type SCUMGiftItemDefinition struct {
Key string
Label string
MaximumQuantity int
}
type SCUMGiftItemCatalog struct {
GameVersion string
Items []SCUMGiftItemDefinition
}
var SCUMGiftItemCatalogs = []SCUMGiftItemCatalog{{GameVersion: "0.9.700.90357", Items: []SCUMGiftItemDefinition{{Key: "bandage", Label: "绷带", MaximumQuantity: 20}, {Key: "water-bottle", Label: "饮用水", MaximumQuantity: 10}, {Key: "improvised-spear", Label: "简易长矛", MaximumQuantity: 2}}}}
type GameGiftItem struct {
CatalogItemKey string
Label string
Quantity int
}
type GameGiftCatalog struct {
ID string
ServerInstanceID string
Name string
GameVersion string
DraftItems []GameGiftItem
LatestRevisionID string
CreatedBy string
UpdatedAt time.Time
CreatedAt time.Time
}
type GameGiftRevision struct {
ID string
CatalogID string
ServerInstanceID string
Revision int
GameVersion string
Items []GameGiftItem
PublishedBy string
PublishedAt time.Time
}
type GameGiftGrantStatus string
const (
GameGiftGrantPendingApproval GameGiftGrantStatus = "pending-approval"
GameGiftGrantQueued GameGiftGrantStatus = "queued"
GameGiftGrantDelivered GameGiftGrantStatus = "delivered"
GameGiftGrantNotificationFailed GameGiftGrantStatus = "notification_failed"
GameGiftGrantFailed GameGiftGrantStatus = "failed"
GameGiftGrantUnknown GameGiftGrantStatus = "unknown"
)
type GameGiftGrant struct {
ID string
ServerInstanceID string
CatalogID string
RevisionID string
RevisionNumber int
GameVersion string
Items []GameGiftItem
GamePlayerRecordID string
GamePlayerID string
PlayerDisplayName string
Notice string
IdempotencyKey string
RequesterID string
ApproverID string
Status GameGiftGrantStatus
DeliveryCommandID string
NotificationCommandID string
DeliverySummary string
NotificationSummary string
CreatedAt time.Time
ApprovedAt time.Time
CompletedAt time.Time
UpdatedAt time.Time
}
type GameGiftCatalogFilter struct {
ServerInstanceID string
Limit int
}
type GameGiftRevisionFilter struct {
CatalogID string
ServerInstanceID string
Limit int
}
type GameGiftGrantFilter struct {
ServerInstanceID string
GamePlayerRecordID string
IdempotencyKey string
Limit int
}
type GameGiftCatalogRequest struct {
ID string
Name string
GameVersion string
Items []GameGiftItem
}
type GameGiftGrantRequest struct {
RevisionID string
GamePlayerRecordID string
Notice string
IdempotencyKey string
}
func CopyGameGiftItems(items []GameGiftItem) []GameGiftItem {
return append([]GameGiftItem(nil), items...)
}
func CopyGameGiftCatalog(value GameGiftCatalog) GameGiftCatalog {
value.DraftItems = CopyGameGiftItems(value.DraftItems)
return value
}
func CopyGameGiftRevision(value GameGiftRevision) GameGiftRevision {
value.Items = CopyGameGiftItems(value.Items)
return value
}
func CopyGameGiftGrant(value GameGiftGrant) GameGiftGrant {
value.Items = CopyGameGiftItems(value.Items)
return value
}
func SCUMGiftCatalogForVersion(version string) (SCUMGiftItemCatalog, bool) {
for _, catalog := range SCUMGiftItemCatalogs {
if catalog.GameVersion == version {
return catalog, true
}
}
return SCUMGiftItemCatalog{}, false
}
func SCUMGiftItemForVersion(version, key string) (SCUMGiftItemDefinition, bool) {
catalog, ok := SCUMGiftCatalogForVersion(version)
if !ok {
return SCUMGiftItemDefinition{}, false
}
for _, item := range catalog.Items {
if item.Key == key {
return item, true
}
}
return SCUMGiftItemDefinition{}, false
}
-103
View File
@@ -1,103 +0,0 @@
package domain
import "time"
const SCUMMapTrajectoryMapID = "scum-island"
// GameMapTrajectoryDeclaration is plugin-owned metadata used to safely project world coordinates.
type GameMapTrajectoryDeclaration struct {
MapID, MapVersion string
WorldMinX, WorldMinY, WorldMaxX, WorldMaxY float64
ImageWidth, ImageHeight, Precision, SampleDistance float64
SampleIntervalSeconds, RetentionSeconds int
}
type GameMapTrackEntityKind string
const (
GameMapTrackEntityPlayer GameMapTrackEntityKind = "player"
GameMapTrackEntityVehicle GameMapTrackEntityKind = "vehicle"
)
type GameMapTrackPoint struct {
ID, EventID, ServerInstanceID, MapID, MapVersion, EntityID, GamePlayerRecordID, Source string
EntityKind GameMapTrackEntityKind
MapX, MapY float64
OccurredAt, CollectedAt, ExpiresAt time.Time
}
type GameMapTrackPointFilter struct {
ServerInstanceID, MapID, MapVersion, EntityID string
EntityKind GameMapTrackEntityKind
OccurredAfter, OccurredBefore time.Time
Limit int
}
type GamePlayerVehicleSegment struct {
ID, EventID, ServerInstanceID, GamePlayerRecordID, GamePlayerID, VehicleID, MapID, MapVersion string
StartedAt, EndedAt, ExpiresAt time.Time
}
type GamePlayerVehicleSegmentFilter struct {
ServerInstanceID, GamePlayerRecordID, VehicleID, MapID, MapVersion string
OccurredAfter, OccurredBefore time.Time
Limit int
}
type GameMapTrajectoryQuery struct {
ServerInstanceID string
From, To time.Time
PlayerRecordIDs, VehicleIDs []string
}
type GameMapTrajectoryEntity struct {
Kind GameMapTrackEntityKind
EntityID, GamePlayerRecordID, Label string
Points []GameMapTrackPoint
CollectedAt time.Time
Sources []string
}
type GameMapTrajectorySegment struct {
GamePlayerRecordID, VehicleID string
StartedAt, EndedAt time.Time
}
type GameMapTrajectoryView struct {
Status, Reason string
Map GameMapTrajectoryDeclaration
From, To time.Time
Players, Vehicles []GameMapTrajectoryEntity
RideSegments []GameMapTrajectorySegment
}
func CopyGameMapTrajectoryDeclaration(v GameMapTrajectoryDeclaration) GameMapTrajectoryDeclaration {
return v
}
func CopyGameMapTrackPoint(v GameMapTrackPoint) GameMapTrackPoint { return v }
func CopyGameMapTrackPoints(v []GameMapTrackPoint) []GameMapTrackPoint {
out := make([]GameMapTrackPoint, len(v))
copy(out, v)
return out
}
func CopyGamePlayerVehicleSegment(v GamePlayerVehicleSegment) GamePlayerVehicleSegment { return v }
func CopyGamePlayerVehicleSegments(v []GamePlayerVehicleSegment) []GamePlayerVehicleSegment {
out := make([]GamePlayerVehicleSegment, len(v))
copy(out, v)
return out
}
func CopyGameMapTrajectoryQuery(v GameMapTrajectoryQuery) GameMapTrajectoryQuery {
v.PlayerRecordIDs = CopyStringSlice(v.PlayerRecordIDs)
v.VehicleIDs = CopyStringSlice(v.VehicleIDs)
return v
}
func CopyGameMapTrajectoryView(v GameMapTrajectoryView) GameMapTrajectoryView {
v.Map = CopyGameMapTrajectoryDeclaration(v.Map)
v.Players = append([]GameMapTrajectoryEntity(nil), v.Players...)
v.Vehicles = append([]GameMapTrajectoryEntity(nil), v.Vehicles...)
for i := range v.Players {
v.Players[i].Points = CopyGameMapTrackPoints(v.Players[i].Points)
v.Players[i].Sources = CopyStringSlice(v.Players[i].Sources)
}
for i := range v.Vehicles {
v.Vehicles[i].Points = CopyGameMapTrackPoints(v.Vehicles[i].Points)
v.Vehicles[i].Sources = CopyStringSlice(v.Vehicles[i].Sources)
}
v.RideSegments = append([]GameMapTrajectorySegment(nil), v.RideSegments...)
return v
}
-114
View File
@@ -1,114 +0,0 @@
package domain
import "time"
const SCUMPlayerStatePatchCommandType = "game-state.patch"
const SCUMPlayerStateSnapshotType = "player.state"
type GamePlayerStateFieldKind string
const (
GamePlayerStateFieldSkill GamePlayerStateFieldKind = "skill"
GamePlayerStateFieldAttribute GamePlayerStateFieldKind = "attribute"
)
type GamePlayerStateFieldDefinition struct {
Key string
Label string
Kind GamePlayerStateFieldKind
Minimum float64
Maximum float64
}
type GamePlayerStateCatalog struct {
GameVersion string
Fields []GamePlayerStateFieldDefinition
}
var SCUMPlayerStateCatalogs = []GamePlayerStateCatalog{{GameVersion: "0.9.700.90357", Fields: []GamePlayerStateFieldDefinition{{Key: "skills.running", Label: "跑步技能", Kind: GamePlayerStateFieldSkill, Minimum: 0, Maximum: 10}, {Key: "attributes.strength", Label: "力量属性", Kind: GamePlayerStateFieldAttribute, Minimum: 0, Maximum: 10}}}}
type GamePlayerStateSnapshot struct {
ServerInstanceID string
GamePlayerRecordID string
GamePlayerID string
GameVersion string
StateVersion string
SafetyWindow string
MaintenanceVerified bool
PlayerOnline bool
Fields map[string]float64
ObservedAt time.Time
}
type GamePlayerStatePatchStatus string
const (
GamePlayerStatePatchPendingApproval GamePlayerStatePatchStatus = "pending-approval"
GamePlayerStatePatchQueued GamePlayerStatePatchStatus = "queued"
GamePlayerStatePatchExecutionFailed GamePlayerStatePatchStatus = "execution-failed"
GamePlayerStatePatchExecutionUnknown GamePlayerStatePatchStatus = "execution-unknown"
GamePlayerStatePatchConfirmationFailed GamePlayerStatePatchStatus = "confirmation-failed"
GamePlayerStatePatchConfirmed GamePlayerStatePatchStatus = "confirmed"
)
type GamePlayerStatePatchChange struct {
FieldKey string
Before float64
After float64
}
type GamePlayerStatePatch struct {
ID string
ServerInstanceID string
GamePlayerRecordID string
GamePlayerID string
GameVersion string
ExpectedStateVersion string
SafetyWindow string
Changes []GamePlayerStatePatchChange
Reason string
RequesterID string
ApproverID string
Status GamePlayerStatePatchStatus
BridgeCommandID string
ExecutionSummary string
ConfirmedStateVersion string
CreatedAt time.Time
ApprovedAt time.Time
CompletedAt time.Time
UpdatedAt time.Time
}
type GamePlayerStatePatchFilter struct {
ServerInstanceID string
GamePlayerRecordID string
Limit int
}
type GamePlayerStatePatchRequest struct {
GameVersion string
ExpectedStateVersion string
SafetyWindow string
Changes []GamePlayerStatePatchChange
Reason string
}
func CopyGamePlayerStatePatch(value GamePlayerStatePatch) GamePlayerStatePatch {
value.Changes = append([]GamePlayerStatePatchChange(nil), value.Changes...)
return value
}
func SCUMPlayerStateCatalogForVersion(version string) (GamePlayerStateCatalog, bool) {
for _, catalog := range SCUMPlayerStateCatalogs {
if catalog.GameVersion == version {
return catalog, true
}
}
return GamePlayerStateCatalog{}, false
}
func GamePlayerStateFieldForVersion(version, key string) (GamePlayerStateFieldDefinition, bool) {
catalog, ok := SCUMPlayerStateCatalogForVersion(version)
if !ok {
return GamePlayerStateFieldDefinition{}, false
}
for _, field := range catalog.Fields {
if field.Key == key {
return field, true
}
}
return GamePlayerStateFieldDefinition{}, false
}
-111
View File
@@ -1,111 +0,0 @@
package domain
import "time"
// GamePlayer is a local game identity and is never a platform console user.
type GamePlayer struct {
ID string
ServerInstanceID string
GamePlayerID string
DisplayName string
FirstSeenAt time.Time
LastSeenAt time.Time
LastEventAt time.Time
CreatedAt time.Time
UpdatedAt time.Time
}
type GamePlayerFilter struct {
ServerInstanceID string
Search string
Limit int
}
// GamePlayerAlias preserves a bounded name history for one local game player.
type GamePlayerAlias struct {
ID string
GamePlayerRecordID string
ServerInstanceID string
Alias string
FirstSeenAt time.Time
LastSeenAt time.Time
}
type GamePlayerAliasFilter struct {
GamePlayerRecordID string
ServerInstanceID string
Limit int
}
// GamePlayerSession records a successful, bounded SCUM session. No raw network data is present.
type GamePlayerSession struct {
ID string
GamePlayerRecordID string
ServerInstanceID string
SourceSessionID string
StartedAt time.Time
EndedAt time.Time
EndReason string
LastEventAt time.Time
}
type GamePlayerSessionFilter struct {
GamePlayerRecordID string
ServerInstanceID string
OpenOnly bool
Limit int
}
// GameAccessAttempt is review evidence. NetworkCorrelationKey is an irreversible server-local HMAC output.
type GameAccessAttempt struct {
ID string
ServerInstanceID string
GamePlayerRecordID string
EventID string
OccurredAt time.Time
Outcome string
Reason string
NetworkCorrelationKey string
ExpiresAt time.Time
}
type GameAccessAttemptFilter struct {
ServerInstanceID string
GamePlayerRecordID string
Limit int
}
type GameSecuritySignalStatus string
const (
GameSecuritySignalOpen GameSecuritySignalStatus = "open"
GameSecuritySignalReviewRequired GameSecuritySignalStatus = "review-required"
GameSecuritySignalExpired GameSecuritySignalStatus = "expired"
)
// GameSecuritySignal is evidence for manual review; it carries no enforcement action.
type GameSecuritySignal struct {
ID string
ServerInstanceID string
GamePlayerRecordID string
RuleKey string
Status GameSecuritySignalStatus
EvidenceCount int
Summary string
FirstObservedAt time.Time
LastObservedAt time.Time
ExpiresAt time.Time
}
type GameSecuritySignalFilter struct {
ServerInstanceID string
GamePlayerRecordID string
Limit int
}
type GamePlayerProfile struct {
Player GamePlayer
Aliases []GamePlayerAlias
Sessions []GamePlayerSession
AccessAttempts []GameAccessAttempt
SecuritySignals []GameSecuritySignal
}
func CopyGamePlayer(v GamePlayer) GamePlayer { return v }
func CopyGamePlayerAlias(v GamePlayerAlias) GamePlayerAlias { return v }
func CopyGamePlayerSession(v GamePlayerSession) GamePlayerSession { return v }
func CopyGameAccessAttempt(v GameAccessAttempt) GameAccessAttempt { return v }
func CopyGameSecuritySignal(v GameSecuritySignal) GameSecuritySignal { return v }
+20
View File
@@ -23,6 +23,26 @@ type PluginDataFilter struct {
Limit int
}
type PluginDataMutationOperation string
const (
PluginDataMutationPut PluginDataMutationOperation = "put"
PluginDataMutationDelete PluginDataMutationOperation = "delete"
)
type PluginDataMutation struct {
Operation PluginDataMutationOperation
Key string
Value map[string]any
}
type PluginDataTransaction struct {
PluginID string
ServerInstanceID string
Collection string
Mutations []PluginDataMutation
}
func CopyPluginDataRecord(value PluginDataRecord) PluginDataRecord {
value.Value = CopyGameClientBridgePayload(value.Value)
return value
-15
View File
@@ -633,7 +633,6 @@ type GamePluginManifest struct {
RemoteAccess GamePluginRemoteAccess
RuntimeProfiles GamePluginRuntimeProfiles
GameClientBridge GameClientBridgeManifest
MapTrajectories *GameMapTrajectoryDeclaration
}
type GamePluginManifestRegistration struct {
@@ -673,7 +672,6 @@ type GamePlugin struct {
RemoteAccess GamePluginRemoteAccess
RuntimeProfiles GamePluginRuntimeProfiles
GameClientBridge GameClientBridgeManifest
MapTrajectories *GameMapTrajectoryDeclaration
ValidationViolations []string
Status GamePluginStatus
}
@@ -701,7 +699,6 @@ type PluginMarketplacePlugin struct {
RemoteAccess GamePluginRemoteAccess
RuntimeProfiles GamePluginRuntimeProfiles
GameClientBridge GameClientBridgeManifest
MapTrajectories *GameMapTrajectoryDeclaration
ValidationViolations []string
Status GamePluginStatus
Source string
@@ -1694,10 +1691,6 @@ func CopyGamePlugin(plugin GamePlugin) GamePlugin {
plugin.RemoteAccess = CopyGamePluginRemoteAccess(plugin.RemoteAccess)
plugin.RuntimeProfiles = CopyGamePluginRuntimeProfiles(plugin.RuntimeProfiles)
plugin.GameClientBridge = CopyGameClientBridgeManifest(plugin.GameClientBridge)
if plugin.MapTrajectories != nil {
value := CopyGameMapTrajectoryDeclaration(*plugin.MapTrajectories)
plugin.MapTrajectories = &value
}
plugin.ValidationViolations = CopyStringSlice(plugin.ValidationViolations)
return plugin
}
@@ -1715,10 +1708,6 @@ func CopyPluginMarketplacePlugin(plugin PluginMarketplacePlugin) PluginMarketpla
plugin.RemoteAccess = CopyGamePluginRemoteAccess(plugin.RemoteAccess)
plugin.RuntimeProfiles = CopyGamePluginRuntimeProfiles(plugin.RuntimeProfiles)
plugin.GameClientBridge = CopyGameClientBridgeManifest(plugin.GameClientBridge)
if plugin.MapTrajectories != nil {
value := CopyGameMapTrajectoryDeclaration(*plugin.MapTrajectories)
plugin.MapTrajectories = &value
}
plugin.ValidationViolations = CopyStringSlice(plugin.ValidationViolations)
return plugin
}
@@ -1764,10 +1753,6 @@ func CopyGamePluginManifest(manifest GamePluginManifest) GamePluginManifest {
manifest.RemoteAccess = CopyGamePluginRemoteAccess(manifest.RemoteAccess)
manifest.RuntimeProfiles = CopyGamePluginRuntimeProfiles(manifest.RuntimeProfiles)
manifest.GameClientBridge = CopyGameClientBridgeManifest(manifest.GameClientBridge)
if manifest.MapTrajectories != nil {
value := CopyGameMapTrajectoryDeclaration(*manifest.MapTrajectories)
manifest.MapTrajectories = &value
}
return manifest
}
-185
View File
@@ -1,185 +0,0 @@
package domain
import "time"
type SCUMProjectionSubject string
const (
SCUMProjectionSubjectPlayer SCUMProjectionSubject = "player"
SCUMProjectionSubjectLiveState SCUMProjectionSubject = "player-live-state"
SCUMProjectionSubjectSquad SCUMProjectionSubject = "squad"
SCUMProjectionSubjectMember SCUMProjectionSubject = "squad-member"
SCUMProjectionSubjectVehicle SCUMProjectionSubject = "vehicle"
SCUMProjectionSubjectFlag SCUMProjectionSubject = "flag"
SCUMProjectionSubjectPosition SCUMProjectionSubject = "position"
)
type SCUMProjectionFilter struct {
ServerInstanceID string
GamePlayerID string
GamePlayerRecordID string
UserProfileID string
SteamID string
SquadID string
VehicleID string
FlagID string
SubjectType SCUMProjectionSubject
QueryKey string
Freshness SCUMProjectionFreshness
Search string
Limit int
}
type SCUMPlayerLiveState struct {
ID string
ServerInstanceID string
GamePlayerRecordID string
GamePlayerID string
UserProfileID string
SteamID string
DisplayName string
SquadID string
SquadName string
Online bool
FamePoints float64
NormalBalance float64
GoldBalance float64
LastLoginAt time.Time
LastLogoutAt time.Time
LastSaveTime time.Time
Position SCUMCurrentPosition
UnknownFields map[string]any
Freshness SCUMProjectionFreshnessState
CreatedAt time.Time
UpdatedAt time.Time
}
type SCUMSquad struct {
ID string
ServerInstanceID string
SquadID string
Name string
LeaderProfileID string
LeaderPlayerID string
MemberCount int
Score float64
UnknownFields map[string]any
Freshness SCUMProjectionFreshnessState
CreatedAt time.Time
UpdatedAt time.Time
}
type SCUMSquadMember struct {
ID string
ServerInstanceID string
SquadID string
UserProfileID string
GamePlayerRecordID string
GamePlayerID string
SteamID string
DisplayName string
Rank string
IsLeader bool
JoinedAt time.Time
UnknownFields map[string]any
Freshness SCUMProjectionFreshnessState
CreatedAt time.Time
UpdatedAt time.Time
}
type SCUMVehicle struct {
ID string
ServerInstanceID string
VehicleID string
EntityID string
ClassName string
Label string
OwnerProfileID string
OwnerPlayerID string
SquadID string
Position SCUMCurrentPosition
UnknownFields map[string]any
Freshness SCUMProjectionFreshnessState
CreatedAt time.Time
UpdatedAt time.Time
}
type SCUMFlag struct {
ID string
ServerInstanceID string
FlagID string
EntityID string
OwnerProfileID string
OwnerPlayerID string
OwnerSquadID string
OwnerSquadName string
OwnershipConfidence string
Position SCUMCurrentPosition
UnknownFields map[string]any
Freshness SCUMProjectionFreshnessState
CreatedAt time.Time
UpdatedAt time.Time
}
type SCUMCurrentPosition struct {
ID string
ServerInstanceID string
SubjectType SCUMProjectionSubject
SubjectID string
GamePlayerRecordID string
GamePlayerID string
VehicleID string
EntityID string
MapID string
MapVersion string
X float64
Y float64
Z float64
HasCoordinates bool
LastSaveTime time.Time
Freshness SCUMProjectionFreshnessState
CreatedAt time.Time
UpdatedAt time.Time
}
func SCUMProjectionStateUnknown() SCUMProjectionFreshnessState {
return SCUMProjectionFreshnessState{Status: SCUMProjectionUnknown}
}
func CopySCUMPlayerLiveState(value SCUMPlayerLiveState) SCUMPlayerLiveState {
value.Position = CopySCUMCurrentPosition(value.Position)
value.UnknownFields = CopyGameClientBridgePayload(value.UnknownFields)
value.Freshness = CopySCUMProjectionFreshnessState(value.Freshness)
return value
}
func CopySCUMSquad(value SCUMSquad) SCUMSquad {
value.UnknownFields = CopyGameClientBridgePayload(value.UnknownFields)
value.Freshness = CopySCUMProjectionFreshnessState(value.Freshness)
return value
}
func CopySCUMSquadMember(value SCUMSquadMember) SCUMSquadMember {
value.UnknownFields = CopyGameClientBridgePayload(value.UnknownFields)
value.Freshness = CopySCUMProjectionFreshnessState(value.Freshness)
return value
}
func CopySCUMVehicle(value SCUMVehicle) SCUMVehicle {
value.Position = CopySCUMCurrentPosition(value.Position)
value.UnknownFields = CopyGameClientBridgePayload(value.UnknownFields)
value.Freshness = CopySCUMProjectionFreshnessState(value.Freshness)
return value
}
func CopySCUMFlag(value SCUMFlag) SCUMFlag {
value.Position = CopySCUMCurrentPosition(value.Position)
value.UnknownFields = CopyGameClientBridgePayload(value.UnknownFields)
value.Freshness = CopySCUMProjectionFreshnessState(value.Freshness)
return value
}
func CopySCUMCurrentPosition(value SCUMCurrentPosition) SCUMCurrentPosition {
value.Freshness = CopySCUMProjectionFreshnessState(value.Freshness)
return value
}
-282
View File
@@ -1,282 +0,0 @@
package domain
import "time"
type SCUMObservationStatus string
const (
SCUMObservationAccepted SCUMObservationStatus = "accepted"
SCUMObservationStale SCUMObservationStatus = "stale"
SCUMObservationFailed SCUMObservationStatus = "failed"
)
type SCUMProjectionFreshness string
const (
SCUMProjectionFresh SCUMProjectionFreshness = "fresh"
SCUMProjectionStale SCUMProjectionFreshness = "stale"
SCUMProjectionUnknown SCUMProjectionFreshness = "unknown"
)
type SCUMWorkflowStatus string
const (
SCUMWorkflowDraft SCUMWorkflowStatus = "draft"
SCUMWorkflowQueued SCUMWorkflowStatus = "queued"
SCUMWorkflowRunning SCUMWorkflowStatus = "running"
SCUMWorkflowWaiting SCUMWorkflowStatus = "waiting"
SCUMWorkflowBlocked SCUMWorkflowStatus = "blocked"
SCUMWorkflowConfirming SCUMWorkflowStatus = "confirming"
SCUMWorkflowConfirmed SCUMWorkflowStatus = "confirmed"
SCUMWorkflowFailed SCUMWorkflowStatus = "failed"
SCUMWorkflowUnknown SCUMWorkflowStatus = "unknown"
SCUMWorkflowCancelled SCUMWorkflowStatus = "cancelled"
)
type SCUMWorkflowStepStatus string
const (
SCUMWorkflowStepQueued SCUMWorkflowStepStatus = "queued"
SCUMWorkflowStepRunning SCUMWorkflowStepStatus = "running"
SCUMWorkflowStepWaiting SCUMWorkflowStepStatus = "waiting"
SCUMWorkflowStepBlocked SCUMWorkflowStepStatus = "blocked"
SCUMWorkflowStepConfirming SCUMWorkflowStepStatus = "confirming"
SCUMWorkflowStepConfirmed SCUMWorkflowStepStatus = "confirmed"
SCUMWorkflowStepFailed SCUMWorkflowStepStatus = "failed"
SCUMWorkflowStepUnknown SCUMWorkflowStepStatus = "unknown"
SCUMWorkflowStepCancelled SCUMWorkflowStepStatus = "cancelled"
)
type SCUMSafeSummary struct {
Title string
Message string
Details map[string]string
}
type SCUMDataObservation struct {
ID string
ServerInstanceID string
PluginID string
Source string
QueryKey string
SubjectType string
SubjectID string
Sequence uint64
Checksum string
Status SCUMObservationStatus
ErrorCode string
SafeSummary SCUMSafeSummary
ObservedAt time.Time
ReceivedAt time.Time
}
type SCUMObservationResult struct {
ServerInstanceID string
PluginID string
Source string
QueryKey string
Sequence uint64
Checksum string
Status SCUMObservationStatus
ErrorCode string
SafeSummary SCUMSafeSummary
ObservedAt time.Time
ReceivedAt time.Time
Rows []map[string]any
}
type SCUMProjectionFreshnessState struct {
Status SCUMProjectionFreshness
ObservationID string
Source string
QueryKey string
Sequence uint64
Checksum string
StaleReason string
ObservedAt time.Time
ReceivedAt time.Time
}
type SCUMMutationGuard struct {
FieldKey string
Before any
After any
MaxRowsAffected int
SafetyWindow string
BackupRef string
RequiresOfflinePlayer bool
RequiresMaintenance bool
RequiresBackup bool
}
type SCUMOperationConfirmation struct {
Status string
ObservationID string
ConfirmedFields map[string]any
AffectedRows int
MutationChecksum string
Checksum string
ObservedAt time.Time
SafeSummary SCUMSafeSummary
}
type SCUMOperationRequest struct {
ID string
ServerInstanceID string
PluginID string
TemplateKey string
PlayerID string
RequesterID string
ApproverID string
ApprovalLevel GameClientBridgeApprovalLevel
Payload map[string]any
Guard SCUMMutationGuard
Confirmation SCUMOperationConfirmation
Status SCUMWorkflowStepStatus
Reason string
IdempotencyKey string
RunJobID string
SafeSummary SCUMSafeSummary
AuditReferences []string
CreatedAt time.Time
ApprovedAt time.Time
CompletedAt time.Time
UpdatedAt time.Time
}
type SCUMOperationRequestFilter struct {
ServerInstanceID string
PluginID string
TemplateKey string
PlayerID string
RequesterID string
Status SCUMWorkflowStepStatus
IdempotencyKey string
Limit int
}
type SCUMWorkflowInstanceFilter struct {
ServerInstanceID string
PluginID string
TemplateKey string
RequestedBy string
Status SCUMWorkflowStatus
IdempotencyKey string
Limit int
}
type SCUMWorkflowStepFilter struct {
WorkflowID string
ServerInstanceID string
StepKey string
Status SCUMWorkflowStepStatus
MutatesState *bool
Limit int
}
type SCUMWorkflowInstance struct {
ID string
ServerInstanceID string
PluginID string
TemplateKey string
RequestedBy string
IdempotencyKey string
Status SCUMWorkflowStatus
CurrentStepKey string
Input map[string]any
SafeSummary SCUMSafeSummary
BlockerReason string
AuditReferences []string
CreatedAt time.Time
UpdatedAt time.Time
CompletedAt time.Time
}
type SCUMWorkflowStep struct {
ID string
WorkflowID string
ServerInstanceID string
StepKey string
DependsOn []string
Status SCUMWorkflowStepStatus
OperationKey string
QueryTemplateKey string
Capability string
TargetKey string
JobID string
Attempt int
MaxAttempts int
MutatesState bool
Confirmation SCUMOperationConfirmation
SafeSummary SCUMSafeSummary
BlockerReason string
AuditReferences []string
CreatedAt time.Time
UpdatedAt time.Time
CompletedAt time.Time
}
func CopySCUMSafeSummary(value SCUMSafeSummary) SCUMSafeSummary {
value.Details = CopyStringMap(value.Details)
return value
}
func CopySCUMDataObservation(value SCUMDataObservation) SCUMDataObservation {
value.SafeSummary = CopySCUMSafeSummary(value.SafeSummary)
return value
}
func CopySCUMObservationResult(value SCUMObservationResult) SCUMObservationResult {
value.SafeSummary = CopySCUMSafeSummary(value.SafeSummary)
value.Rows = CopyGameClientBridgeRows(value.Rows)
return value
}
func CopyGameClientBridgeRows(values []map[string]any) []map[string]any {
if values == nil {
return nil
}
out := make([]map[string]any, len(values))
for index, row := range values {
out[index] = CopyGameClientBridgePayload(row)
}
return out
}
func CopySCUMProjectionFreshnessState(value SCUMProjectionFreshnessState) SCUMProjectionFreshnessState {
return value
}
func CopySCUMMutationGuard(value SCUMMutationGuard) SCUMMutationGuard {
return value
}
func CopySCUMOperationConfirmation(value SCUMOperationConfirmation) SCUMOperationConfirmation {
value.ConfirmedFields = CopyGameClientBridgePayload(value.ConfirmedFields)
value.SafeSummary = CopySCUMSafeSummary(value.SafeSummary)
return value
}
func CopySCUMOperationRequest(value SCUMOperationRequest) SCUMOperationRequest {
value.Payload = CopyGameClientBridgePayload(value.Payload)
value.Guard = CopySCUMMutationGuard(value.Guard)
value.Confirmation = CopySCUMOperationConfirmation(value.Confirmation)
value.SafeSummary = CopySCUMSafeSummary(value.SafeSummary)
value.AuditReferences = CopyStringSlice(value.AuditReferences)
return value
}
func CopySCUMWorkflowInstance(value SCUMWorkflowInstance) SCUMWorkflowInstance {
value.Input = CopyGameClientBridgePayload(value.Input)
value.SafeSummary = CopySCUMSafeSummary(value.SafeSummary)
value.AuditReferences = CopyStringSlice(value.AuditReferences)
return value
}
func CopySCUMWorkflowStep(value SCUMWorkflowStep) SCUMWorkflowStep {
value.DependsOn = CopyStringSlice(value.DependsOn)
value.Confirmation = CopySCUMOperationConfirmation(value.Confirmation)
value.SafeSummary = CopySCUMSafeSummary(value.SafeSummary)
value.AuditReferences = CopyStringSlice(value.AuditReferences)
return value
}