Files
catan/docs/replay_format.md
dan 2499deb071
All checks were successful
ci / tests (push) Successful in 21s
Refresh web UI and make ML imports optional
2025-12-25 09:15:10 +03:00

34 lines
1.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Replay Format
JSON-формат реплея (v1) хранит сид партии и список применённых действий. Состояние восстанавливается повторным проигрыванием событий.
Пример:
```json
{
"version": 1,
"id": "d7b4b593-0f2a-4c3f-9d90-6f6a8a3ddf2e",
"created_at": "2024-03-01T12:00:00Z",
"seed": 123456,
"players": ["Alice", "Bob", "Cara"],
"winner": "Alice",
"slots": [
{"slot_id": 1, "name": "Alice", "user_id": 1, "is_ai": false, "ready": true, "color": "red"},
{"slot_id": 2, "name": "Bob", "user_id": null, "is_ai": true, "ai_kind": "random", "ready": true, "color": "blue"},
{"slot_id": 3, "name": "Cara", "user_id": null, "is_ai": true, "ai_kind": "model", "ready": true, "color": "orange"}
],
"actions": [
{
"idx": 1,
"ts": "2024-03-01T12:01:00Z",
"actor": "Alice",
"action": {"type": "roll", "payload": {}},
"applied": true,
"meta": {}
}
]
}
```
Импорт в аналитический сервис сохраняет реплей в базу и делает его доступным в UI.