Working version with new streaming and DB

This commit is contained in:
erik 2025-05-22 15:30:45 +00:00
parent c20d54d037
commit c418221575
8 changed files with 302 additions and 37 deletions

View file

@ -144,13 +144,27 @@ After connecting, send JSON messages matching the `TelemetrySnapshot` schema. Fo
"z": 10.2,
"kills": 42,
"deaths": 1,
"rares_found": 2,
"prismatic_taper_count": 17,
"vt_state": "Combat",
"kills_per_hour": "N/A",
"onlinetime": "00:05:00"
}
}
```
Each message above is sent as its own JSON object over the WebSocket (one frame per event). When you want to report a rare spawn, send a standalone `rare` event instead of embedding rare counts in telemetry. For example:
```json
{
"type": "rare",
"timestamp": "2025-04-22T13:48:00Z",
"character_name": "MyCharacter",
"mob": "Golden Gryphon",
"ew": 150.5,
"ns": 350.7,
"z": 5.0,
"additional_info": "first sighting of the day"
}
```
### Chat messages
You can also send chat envelopes over the same WebSocket to display messages in the browser. Fields:
@ -177,6 +191,10 @@ For a complete reference of JSON payloads accepted by the backend (over `/ws/pos
- **Chat events** (`type`: "chat")
- **Rare events** (`type`: "rare")
Notes on payload changes:
- Spawn events no longer require the `z` coordinate; if omitted, the server defaults it to 0.0.
- Telemetry events have removed the `latency_ms` field; please omit it from your payloads.
Each entry shows all required and optional fields, their types, and example values.
### GET /live