Keep SCUM data parsing plugin-owned

This commit is contained in:
npc0-hue
2026-09-09 10:13:47 +08:00
parent 4f20fcaf5b
commit 84380105fc
13 changed files with 149 additions and 402 deletions
@@ -239,21 +239,7 @@
"sqlRef": "sql/scum-db-v57/users.sql",
"pollIntervalSeconds": 3,
"maxRows": 500,
"timeoutSeconds": 15,
"projections": [
{
"collection": "scum_users",
"rowPath": "rows",
"upsertKeys": [
"steamId"
],
"fixedValues": {
"source": "run.sqlite.scum.player.profile"
},
"observedAtField": "profileSampledAt",
"mergeExisting": true
}
]
"timeoutSeconds": 15
},
{
"key": "scum.squads",
@@ -295,66 +281,7 @@
"sqlRef": "sql/scum-db-v57/vehicles.sql",
"pollIntervalSeconds": 3,
"maxRows": 500,
"timeoutSeconds": 15,
"projections": [
{
"collection": "scum_vehicles",
"rowPath": "rows",
"upsertKeys": [
"vehicleId"
],
"fixedValues": {
"source": "run.sqlite.scum.vehicles"
},
"observedAtField": "sampledAt"
},
{
"collection": "scum_trajectories",
"rowPath": "rows",
"upsertKeys": [
"subjectType",
"subjectId",
"sampledAt"
],
"fieldMappings": {
"subjectId": "vehicleId",
"vehicleId": "vehicleId",
"entityId": "entityId",
"className": "className",
"label": "label",
"x": "x",
"y": "y",
"z": "z",
"lastAccessTime": "lastAccessTime"
},
"fixedValues": {
"subjectType": "vehicle",
"source": "run.sqlite.scum.vehicles"
},
"observedAtField": "sampledAt"
},
{
"collection": "scum_trade_goods",
"rowPath": "rows",
"upsertKeys": [
"code"
],
"fieldMappings": {
"className": "className"
},
"fixedValues": {
"code": "#spawnvehicle {{className}}",
"spawnCommand": "#spawnvehicle {{className}}",
"catalogType": "vehicle",
"type": "21",
"typeName": "其他载具",
"imagePath": "/original/{{className}}.webp",
"source": "run.sqlite.scum.vehicles"
},
"observedAtField": "lastSeenAt",
"mergeExisting": true
}
]
"timeoutSeconds": 15
},
{
"key": "scum.flags",
@@ -382,69 +309,7 @@
"sqlRef": "sql/scum-db-v57/map-points.sql",
"pollIntervalSeconds": 3,
"maxRows": 500,
"timeoutSeconds": 15,
"projections": [
{
"collection": "scum_users",
"rowPath": "rows",
"matchField": "subjectType",
"matchValue": "player",
"upsertKeys": [
"steamId"
],
"fieldMappings": {
"steamId": "subjectId",
"userProfileId": "userProfileId",
"gamePlayerId": "gamePlayerId",
"x": "x",
"y": "y",
"z": "z",
"lastPositionObservedAt": "observedAt"
},
"fixedValues": {
"source": "run.sqlite.scum.positions"
},
"observedAtField": "positionSampledAt"
},
{
"collection": "scum_map_points",
"rowPath": "rows",
"upsertKeys": [
"subjectType",
"subjectId"
],
"fixedValues": {
"source": "run.sqlite.scum.positions"
},
"observedAtField": "sampledAt"
},
{
"collection": "scum_trajectories",
"rowPath": "rows",
"matchField": "subjectType",
"matchValue": "player",
"upsertKeys": [
"subjectType",
"subjectId",
"sampledAt"
],
"fieldMappings": {
"subjectType": "subjectType",
"subjectId": "subjectId",
"steamId": "subjectId",
"userProfileId": "userProfileId",
"gamePlayerId": "gamePlayerId",
"x": "x",
"y": "y",
"z": "z",
"observedAt": "observedAt"
},
"fixedValues": {
"source": "run.sqlite.scum.positions"
},
"observedAtField": "sampledAt"
}
]
"timeoutSeconds": 15
},
{
"key": "scum.tasks",
@@ -489,121 +354,6 @@
"timeoutSeconds": 15
}
],
"lifecycleProjections": [
{
"key": "scum.lifecycle.stop-logout",
"capabilities": [
"process.stop"
],
"target": {
"collection": "scum_users",
"matchField": "online",
"matchValue": "true",
"fixedValues": {
"online": "false",
"status": "offline",
"logoutReason": "server-stop",
"source": "run.lifecycle"
},
"observedAtField": "lastLogoutObservedAt",
"activityTarget": {
"collection": "scum_activity_events",
"upsertKeys": [
"steamId",
"observedAt",
"eventType"
],
"rowMappings": {
"steamId": "steamId",
"displayName": "displayName"
},
"fixedValues": {
"eventType": "logout",
"reason": "server-stop",
"source": "run.lifecycle"
},
"observedAtField": "observedAt"
}
}
},
{
"key": "scum.lifecycle.restart-logout",
"capabilities": [
"process.restart"
],
"target": {
"collection": "scum_users",
"matchField": "online",
"matchValue": "true",
"fixedValues": {
"online": "false",
"status": "offline",
"logoutReason": "server-stop",
"source": "run.lifecycle"
},
"observedAtField": "lastLogoutObservedAt",
"activityTarget": {
"collection": "scum_activity_events",
"upsertKeys": [
"steamId",
"observedAt",
"eventType"
],
"rowMappings": {
"steamId": "steamId",
"displayName": "displayName"
},
"fixedValues": {
"eventType": "logout",
"reason": "server-stop",
"source": "run.lifecycle"
},
"observedAtField": "observedAt"
}
}
},
{
"key": "scum.lifecycle.status-logout",
"capabilities": [
"process.status"
],
"processStates": [
"stopped",
"not-started",
"exited"
],
"target": {
"collection": "scum_users",
"matchField": "online",
"matchValue": "true",
"fixedValues": {
"online": "false",
"status": "offline",
"logoutReason": "server-stop",
"source": "run.lifecycle"
},
"observedAtField": "lastLogoutObservedAt",
"activityTarget": {
"collection": "scum_activity_events",
"upsertKeys": [
"steamId",
"observedAt",
"eventType"
],
"rowMappings": {
"steamId": "steamId",
"displayName": "displayName"
},
"fixedValues": {
"eventType": "logout",
"reason": "server-stop",
"source": "run.lifecycle"
},
"observedAtField": "observedAt"
}
}
}
],
"dataPacks": [
{
"key": "scum-db-v57",
@@ -1068,7 +818,6 @@
"bundleIntegritySha256": "sha256:3488b316d909e597024f8f31c7bc96ab8019f643d74a528dc442d3df0dc3d54e",
"permissions": [
"server.read",
"server.logs.read",
"server.remote.access",
"server.game-client.read",
"server.game-client.command",