Rebuild SCUM plugin-owned data flow

This commit is contained in:
npc0-hue
2026-08-18 07:01:17 +08:00
parent 302f1f64b7
commit 98bf944f4c
39 changed files with 1832 additions and 223 deletions
@@ -127,11 +127,18 @@
"type": "announcement.send",
"title": "Send SCUM announcement",
"permission": "server.game-client.command",
"approvalLevel": "none",
"approvalLevel": "operator",
"payloadSchemaRef": "schemas/bridge/announcement.payload.schema.json",
"resultSchemaRef": "schemas/bridge/announcement.result.schema.json",
"timeoutSeconds": 60,
"maxPayloadBytes": 4096
"maxPayloadBytes": 4096,
"protectedRequest": {
"kind": "rcon",
"transportKey": "scum-management",
"targetKey": "scum-management",
"textField": "requestText",
"maxTextBytes": 2048
}
},
{
"type": "companion.diagnostics",
@@ -293,9 +300,11 @@
"parameterSchemaRef": "schemas/bridge/queries/scum-player-profile.parameters.schema.json",
"resultSchemaRef": "schemas/bridge/queries/scum-player-profile.result.schema.json",
"sqlRef": "sql/scum-db-v57/users.sql",
"pollIntervalSeconds": 3,
"rowTarget": {
"collection": "scum_users",
"upsertKeys": ["userProfileId"],
"upsertKeys": ["steamId"],
"writeMode": "merge",
"columnMappings": { "userProfileId": "userProfileId", "steamId": "steamId", "gamePlayerId": "gamePlayerId", "displayName": "displayName", "squadId": "squadId", "squadName": "squadName", "famePoints": "famePoints", "normalBalance": "normalBalance", "goldBalance": "goldBalance", "x": "x", "y": "y", "z": "z", "lastLoginTime": "lastLoginTime", "lastSaveTime": "lastSaveTime" }
},
"maxRows": 500,
@@ -311,9 +320,11 @@
"parameterSchemaRef": "schemas/bridge/queries/scum-squads.parameters.schema.json",
"resultSchemaRef": "schemas/bridge/queries/scum-squads.result.schema.json",
"sqlRef": "sql/scum-db-v57/squads.sql",
"pollIntervalSeconds": 1800,
"rowTarget": {
"collection": "scum_squads",
"upsertKeys": ["squadId"],
"writeMode": "replace",
"columnMappings": { "squadId": "squadId", "name": "name", "leaderProfileId": "leaderProfileId", "leaderPlayerId": "leaderPlayerId", "memberCount": "memberCount", "score": "score", "memberLimit": "memberLimit", "message": "message", "info": "info", "lastMemberLoginTime": "lastMemberLoginTime" }
},
"maxRows": 500,
@@ -329,9 +340,11 @@
"parameterSchemaRef": "schemas/bridge/queries/scum-squad-members.parameters.schema.json",
"resultSchemaRef": "schemas/bridge/queries/scum-squad-members.result.schema.json",
"sqlRef": "sql/scum-db-v57/squad-members.sql",
"pollIntervalSeconds": 1800,
"rowTarget": {
"collection": "scum_squad_members",
"upsertKeys": ["squadId", "userProfileId"],
"upsertKeys": ["squadId", "steamId"],
"writeMode": "replace",
"columnMappings": { "squadId": "squadId", "userProfileId": "userProfileId", "gamePlayerId": "gamePlayerId", "steamId": "steamId", "displayName": "displayName", "rank": "rank", "isLeader": "isLeader" }
},
"maxRows": 500,
@@ -347,9 +360,11 @@
"parameterSchemaRef": "schemas/bridge/queries/scum-vehicles.parameters.schema.json",
"resultSchemaRef": "schemas/bridge/queries/scum-vehicles.result.schema.json",
"sqlRef": "sql/scum-db-v57/vehicles.sql",
"pollIntervalSeconds": 3,
"rowTarget": {
"collection": "scum_vehicles",
"upsertKeys": ["vehicleId"],
"writeMode": "replace",
"columnMappings": { "vehicleId": "vehicleId", "entityId": "entityId", "className": "className", "label": "label", "x": "x", "y": "y", "z": "z", "lastAccessTime": "lastAccessTime", "isFunctional": "isFunctional" }
},
"maxRows": 500,
@@ -365,9 +380,11 @@
"parameterSchemaRef": "schemas/bridge/queries/scum-flags.parameters.schema.json",
"resultSchemaRef": "schemas/bridge/queries/scum-flags.result.schema.json",
"sqlRef": "sql/scum-db-v57/flags.sql",
"pollIntervalSeconds": 1800,
"rowTarget": {
"collection": "scum_flags",
"upsertKeys": ["flagId"],
"writeMode": "replace",
"columnMappings": { "flagId": "flagId", "entityId": "entityId", "baseId": "baseId", "ownerProfileId": "ownerProfileId", "ownerPlayerId": "ownerPlayerId", "ownerSquadId": "ownerSquadId", "ownerSquadName": "ownerSquadName", "overtakerProfileId": "overtakerProfileId", "overtakeEndTime": "overtakeEndTime", "ownershipConfidence": "ownershipConfidence", "x": "x", "y": "y", "z": "z" }
},
"maxRows": 500,
@@ -383,9 +400,11 @@
"parameterSchemaRef": "schemas/bridge/queries/scum-positions.parameters.schema.json",
"resultSchemaRef": "schemas/bridge/queries/scum-positions.result.schema.json",
"sqlRef": "sql/scum-db-v57/map-points.sql",
"pollIntervalSeconds": 3,
"rowTarget": {
"collection": "scum_map_points",
"upsertKeys": ["subjectType", "subjectId"],
"writeMode": "replace",
"columnMappings": { "subjectType": "subjectType", "subjectId": "subjectId", "userProfileId": "userProfileId", "gamePlayerId": "gamePlayerId", "vehicleId": "vehicleId", "entityId": "entityId", "baseId": "baseId", "x": "x", "y": "y", "z": "z", "observedAt": "observedAt" }
},
"maxRows": 500,
@@ -401,9 +420,11 @@
"parameterSchemaRef": "schemas/bridge/queries/scum-tasks.parameters.schema.json",
"resultSchemaRef": "schemas/bridge/queries/scum-tasks.result.schema.json",
"sqlRef": "sql/scum-db-v57/tasks.sql",
"pollIntervalSeconds": 1800,
"rowTarget": {
"collection": "scum_tasks",
"upsertKeys": ["taskRecordId"],
"writeMode": "replace",
"columnMappings": { "taskRecordId": "taskRecordId", "taskKind": "taskKind", "userProfileId": "userProfileId", "mapId": "mapId", "trackingDataSetId": "trackingDataSetId", "dataAssetPath": "dataAssetPath", "sequenceIndex": "sequenceIndex", "isTracked": "isTracked", "state": "state", "completionDeadline": "completionDeadline" }
},
"maxRows": 500,
@@ -419,9 +440,11 @@
"parameterSchemaRef": "schemas/bridge/queries/scum-events.parameters.schema.json",
"resultSchemaRef": "schemas/bridge/queries/scum-events.result.schema.json",
"sqlRef": "sql/scum-db-v57/events.sql",
"pollIntervalSeconds": 1800,
"rowTarget": {
"collection": "scum_native_event_rounds",
"upsertKeys": ["eventRecordId"],
"writeMode": "replace",
"columnMappings": { "eventRecordId": "eventRecordId", "eventId": "eventId", "roundId": "roundId", "userProfileId": "userProfileId", "startTime": "startTime", "endTime": "endTime", "state": "state", "score": "score", "enemyKills": "enemyKills", "teamKills": "teamKills", "deaths": "deaths", "assists": "assists", "headshots": "headshots" }
},
"maxRows": 500,
@@ -437,15 +460,54 @@
"parameterSchemaRef": "schemas/bridge/queries/scum-native-timed-gifts.parameters.schema.json",
"resultSchemaRef": "schemas/bridge/queries/scum-native-timed-gifts.result.schema.json",
"sqlRef": "sql/scum-db-v57/native-timed-gifts.sql",
"pollIntervalSeconds": 1800,
"rowTarget": {
"collection": "scum_timed_gift_events",
"upsertKeys": ["timedGiftId"],
"writeMode": "replace",
"columnMappings": { "timedGiftId": "timedGiftId", "userProfileId": "userProfileId", "mapId": "mapId", "spawnTime": "spawnTime", "spawnAt": "spawnAt" }
},
"maxRows": 500,
"timeoutSeconds": 15
}
],
"logProjections": [
{
"key": "scum.battleye.login",
"streamKeys": ["scum.console.stdout"],
"steps": [
{ "pattern": "Player \"(?P<displayName>[^\"]+)\" reported as player (?P<slot>\\d+)" },
{ "pattern": "Player (?P<slot>\\d+) SteamID \\(assumed\\): (?P<steamId>\\d+)" }
],
"correlationFields": ["slot"],
"maxInterveningLines": 8,
"target": {
"collection": "scum_users",
"upsertKeys": ["steamId"],
"captureMappings": { "steamId": "steamId", "displayName": "displayName", "slot": "slot" },
"fixedValues": { "online": "true", "source": "process.stdout" },
"observedAtField": "lastLoginObservedAt"
},
"presence": {
"timestampField": "lastLoginObservedAt",
"activeWindowSeconds": 600,
"activityTarget": {
"collection": "scum_activity_events",
"upsertKeys": ["steamId", "observedAt"],
"captureMappings": { "steamId": "steamId", "displayName": "displayName" },
"fixedValues": { "eventType": "login", "source": "process.stdout" },
"observedAtField": "observedAt"
},
"announcement": {
"profileKey": "scum-client-manager",
"commandType": "announcement.send",
"textField": "requestText",
"newTextTemplate": "#announce 欢迎新玩家 {{displayName}} 加入服务器!",
"returningTextTemplate": "#announce 欢迎 {{displayName}} 继续游戏!"
}
}
}
],
"dataPacks": [
{
"key": "scum-db-v57",