feat: add controlled scum player state patches

This commit is contained in:
npc0-hue
2026-07-28 16:10:06 +08:00
parent 1e31a87888
commit f496fb12ec
25 changed files with 1017 additions and 48 deletions
@@ -169,6 +169,16 @@
"resultSchemaRef": "schemas/bridge/maintenance-prepare.result.schema.json",
"timeoutSeconds": 120,
"maxPayloadBytes": 4096
},
{
"type": "game-state.patch",
"title": "Patch SCUM player state",
"permission": "server.game-client.maintenance",
"approvalLevel": "platform-admin",
"payloadSchemaRef": "schemas/bridge/game-state-patch.payload.schema.json",
"resultSchemaRef": "schemas/bridge/game-state-patch.result.schema.json",
"timeoutSeconds": 120,
"maxPayloadBytes": 4096
}
],
"snapshots": [
@@ -193,6 +203,13 @@
"keepForSeconds": 86400,
"maxRecords": 1000
},
{
"type": "player.state",
"schemaVersion": "1",
"schemaRef": "schemas/bridge/player-state.snapshot.schema.json",
"keepForSeconds": 86400,
"maxRecords": 1000
},
{
"type": "squads",
"schemaVersion": "1",
@@ -0,0 +1,15 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "SCUMGameStatePatchPayload",
"type": "object",
"additionalProperties": false,
"required": ["playerId", "gameVersion", "expectedStateVersion", "safetyWindow", "reason", "changes"],
"properties": {
"playerId": { "type": "string", "maxLength": 96, "pattern": "^[A-Za-z0-9_.:-]{1,96}$" },
"gameVersion": { "const": "0.9.700.90357" },
"expectedStateVersion": { "type": "string", "maxLength": 96, "pattern": "^[A-Za-z0-9_.:-]{1,96}$" },
"safetyWindow": { "type": "string", "maxLength": 96, "pattern": "^[A-Za-z0-9_.:-]{1,96}$" },
"reason": { "type": "string", "minLength": 4, "maxLength": 240 },
"changes": { "type": "array", "minItems": 1, "maxItems": 8, "uniqueItems": true, "items": { "type": "object", "additionalProperties": false, "required": ["fieldKey", "before", "after"], "properties": { "fieldKey": { "enum": ["skills.running", "attributes.strength"] }, "before": { "type": "number", "minimum": 0, "maximum": 10 }, "after": { "type": "number", "minimum": 0, "maximum": 10 } } } }
}
}
@@ -0,0 +1,13 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "SCUMGameStatePatchResult",
"type": "object",
"additionalProperties": false,
"required": ["status", "confirmedStateVersion", "confirmedFields"],
"properties": {
"status": { "enum": ["confirmed", "rejected", "failed"] },
"confirmedStateVersion": { "type": "string", "maxLength": 96, "pattern": "^[A-Za-z0-9_.:-]{1,96}$" },
"confirmedFields": { "type": "object", "additionalProperties": false, "required": ["skills.running", "attributes.strength"], "properties": { "skills.running": { "type": "number", "minimum": 0, "maximum": 10 }, "attributes.strength": { "type": "number", "minimum": 0, "maximum": 10 } } },
"message": { "type": "string", "maxLength": 200 }
}
}
@@ -0,0 +1,16 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "SCUMPlayerStateSnapshot",
"type": "object",
"additionalProperties": false,
"required": ["playerId", "gameVersion", "stateVersion", "maintenanceVerified", "playerOnline", "fields"],
"properties": {
"playerId": { "type": "string", "maxLength": 96, "pattern": "^[A-Za-z0-9_.:-]{1,96}$" },
"gameVersion": { "type": "string", "maxLength": 64, "pattern": "^[0-9][0-9A-Za-z._-]{0,63}$" },
"stateVersion": { "type": "string", "maxLength": 96, "pattern": "^[A-Za-z0-9_.:-]{1,96}$" },
"safetyWindow": { "type": "string", "maxLength": 96, "pattern": "^[A-Za-z0-9_.:-]{1,96}$" },
"maintenanceVerified": { "type": "boolean" },
"playerOnline": { "type": "boolean" },
"fields": { "type": "object", "additionalProperties": false, "required": ["skills.running", "attributes.strength"], "properties": { "skills.running": { "type": "number", "minimum": 0, "maximum": 10 }, "attributes.strength": { "type": "number", "minimum": 0, "maximum": 10 } } }
}
}