refactor(scum): declare protected run requests

This commit is contained in:
npc0-hue
2026-07-29 22:37:16 +08:00
parent d7465bfd32
commit 99be8f0f3a
28 changed files with 497 additions and 152 deletions
+19
View File
@@ -9,6 +9,7 @@ const (
GameClientBridgeCommandClaimed GameClientBridgeCommandState = "claimed"
GameClientBridgeCommandSucceeded GameClientBridgeCommandState = "succeeded"
GameClientBridgeCommandFailed GameClientBridgeCommandState = "failed"
GameClientBridgeCommandUnknown GameClientBridgeCommandState = "unknown"
GameClientBridgeCommandCancelled GameClientBridgeCommandState = "cancelled"
GameClientBridgeCommandExpired GameClientBridgeCommandState = "expired"
)
@@ -39,6 +40,17 @@ type GameClientBridgeCommandDeclaration struct {
ResultSchemaRef string
TimeoutSeconds int
MaxPayloadBytes int
ProtectedRequest *GameClientBridgeProtectedRequestDeclaration
}
// GameClientBridgeProtectedRequestDeclaration binds plugin-generated text to a
// logical server transport. It never carries its resolved connection details.
type GameClientBridgeProtectedRequestDeclaration struct {
Kind string
TransportKey string
TargetKey string
TextField string
MaxTextBytes int
}
type GameClientBridgeSnapshotDeclaration struct {
@@ -108,6 +120,7 @@ type GameClientBridgeResultStatus string
const (
GameClientBridgeResultSucceeded GameClientBridgeResultStatus = "succeeded"
GameClientBridgeResultFailed GameClientBridgeResultStatus = "failed"
GameClientBridgeResultUnknown GameClientBridgeResultStatus = "unknown"
GameClientBridgeResultCancelled GameClientBridgeResultStatus = "cancelled"
)
@@ -384,6 +397,12 @@ func CopyGameClientBridgePayload(value map[string]any) map[string]any {
func CopyGameClientBridgeManifest(value GameClientBridgeManifest) GameClientBridgeManifest {
value.Commands = append([]GameClientBridgeCommandDeclaration(nil), value.Commands...)
for index := range value.Commands {
if value.Commands[index].ProtectedRequest != nil {
copy := *value.Commands[index].ProtectedRequest
value.Commands[index].ProtectedRequest = &copy
}
}
value.Snapshots = append([]GameClientBridgeSnapshotDeclaration(nil), value.Snapshots...)
value.QueryTemplates = append([]GameClientBridgeQueryTemplateDeclaration(nil), value.QueryTemplates...)
value.Pages = append([]GameClientBridgePageContract(nil), value.Pages...)