Files
catan/docs/replay_format.md
dan 46a07f548b
Some checks failed
ci / tests (push) Has been cancelled
Add microservices, web UI, and replay tooling
2025-12-25 03:28:40 +03:00

33 lines
1.0 KiB
Markdown
Raw 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"],
"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"}
],
"actions": [
{
"idx": 1,
"ts": "2024-03-01T12:01:00Z",
"actor": "Alice",
"action": {"type": "roll", "payload": {}},
"applied": true,
"meta": {}
}
]
}
```
Импорт в аналитический сервис сохраняет реплей в базу и делает его доступным в UI.