Add SCUM trade catalog projections

This commit is contained in:
npc0-hue
2026-08-27 16:14:59 +08:00
parent 316efbe780
commit a0e7ae362b
16 changed files with 267 additions and 23 deletions
@@ -347,6 +347,27 @@
"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
}
]
},
@@ -484,6 +505,75 @@
}
],
"logProjections": [
{
"key": "scum.trade.catalog",
"streamKeys": [
"scum.trade"
],
"steps": [
{
"pattern": "^\\d{4}\\.\\d{2}\\.\\d{2}-\\d{2}\\.\\d{2}\\.\\d{2}: \\[Trade\\] Tradeable \\((?P<itemCode>[A-Za-z0-9_.-]{1,128}) \\(x(?P<quantity>\\d{1,9})\\)\\) (?P<tradeVerb>purchased|sold) by .*?\\((?P<steamId>\\d{1,50})\\) for (?P<price>-?\\d{1,12})$"
}
],
"correlationFields": [
"itemCode"
],
"maxInterveningLines": 0,
"target": {
"collection": "scum_trade_goods",
"upsertKeys": [
"code"
],
"captureMappings": {
"code": "itemCode"
},
"fixedValues": {
"catalogType": "item",
"source": "scum.trade"
},
"observedAtField": "lastSeenAt"
}
},
{
"key": "scum.trade.events",
"streamKeys": [
"scum.trade"
],
"steps": [
{
"pattern": "^\\d{4}\\.\\d{2}\\.\\d{2}-\\d{2}\\.\\d{2}\\.\\d{2}: \\[Trade\\] Tradeable \\((?P<itemCode>[A-Za-z0-9_.-]{1,128}) \\(x(?P<quantity>\\d{1,9})\\)\\) (?P<tradeVerb>purchased|sold) by .*?\\((?P<steamId>\\d{1,50})\\) for (?P<price>-?\\d{1,12})$"
}
],
"correlationFields": [
"steamId",
"itemCode",
"tradeVerb"
],
"maxInterveningLines": 0,
"target": {
"collection": "scum_trade_events",
"upsertKeys": [
"steamId",
"itemCode",
"tradeVerb",
"quantity",
"price",
"observedAt"
],
"captureMappings": {
"steamId": "steamId",
"itemCode": "itemCode",
"tradeVerb": "tradeVerb",
"quantity": "quantity",
"price": "price"
},
"fixedValues": {
"eventType": "trade",
"source": "scum.trade"
},
"observedAtField": "observedAt"
}
},
{
"key": "scum.battleye.login",
"streamKeys": [