refactor(scum): declare protected run requests
This commit is contained in:
@@ -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 = ©
|
||||
}
|
||||
}
|
||||
value.Snapshots = append([]GameClientBridgeSnapshotDeclaration(nil), value.Snapshots...)
|
||||
value.QueryTemplates = append([]GameClientBridgeQueryTemplateDeclaration(nil), value.QueryTemplates...)
|
||||
value.Pages = append([]GameClientBridgePageContract(nil), value.Pages...)
|
||||
|
||||
Reference in New Issue
Block a user