No description
  • C# 61.2%
  • Python 19.4%
  • HTML 10.8%
  • Makefile 7.9%
  • Shell 0.7%
Find a file
2026-05-28 09:28:10 +00:00
.agent-guard chore: add .agent-guard/agent-guard.yaml marker file 2026-05-26 10:40:16 -07:00
.claude lockdown: sync to coily v2.45.0 [skip ci] 2026-05-28 09:28:10 +00:00
.coily Add .coily/coily.yaml so dev verbs route through coily 2026-05-18 15:19:04 -07:00
mod/src Initial commit: player-action recorder for Eco 2026-05-17 23:44:56 -07:00
src/eco_replay Initial commit: player-action recorder for Eco 2026-05-17 23:44:56 -07:00
.gitignore Initial commit: player-action recorder for Eco 2026-05-17 23:44:56 -07:00
Makefile Initial commit: player-action recorder for Eco 2026-05-17 23:44:56 -07:00
pyproject.toml Initial commit: player-action recorder for Eco 2026-05-17 23:44:56 -07:00
README.md Initial commit: player-action recorder for Eco 2026-05-17 23:44:56 -07:00
uv.lock Initial commit: player-action recorder for Eco 2026-05-17 23:44:56 -07:00

eco-replay

Player-action recorder for an Eco server, plus a small browser UI.

Built as a clean-room alternative to the closed-source Chronicler mod (mod.io), which ships Windows-only native SQLite and doesn't run on Linux servers. eco-replay is two pieces:

  1. C# Eco mod (mod/src/) — implements IGameActionAware, receives every GameAction Eco produces, and appends a row to SQLite (Storage/EcoReplay.db). Uses Microsoft.Data.Sqlite which bundles a Linux-native libe_sqlite3.so via SQLitePCLRaw, so it Just Works on Linux without a Windows interop dance.
  2. FastAPI web app (src/eco_replay/) — reads the mod's GET /api/v1/events?citizen=&type=&limit= JSON endpoint and renders a filterable HTMX/Tailwind UI.

Same pattern as the sibling eco-jobs-tracker: mod is source of truth, web app is the view.

Quick start

# Compile and stage the mod into the live EcoServer:
make install-mod
make restart-eco
make tail-eco          # watch logs for "Initializing EcoReplay..."

# Browse events:
make build-native
UPSTREAM_URL=http://localhost/api/v1/events make run-native
# http://localhost:4200/

Mock mode (no UPSTREAM_URL) returns canned events so the UI can be developed without an Eco server.

What gets recorded

Every GameAction Eco fires through ActionUtil.ActionPerformed. The recorder pulls out:

  • action_type — class name (ChatSent, PlaceBlock, CraftItem, …)
  • citizen — the user performing the action (via reflection on the Citizen property)
  • unix_time / game_time — when
  • body_json — best-effort flat JSON of the action's other properties (User/ItemStack/WorldObject references collapse to their Name)

Storage

Storage/EcoReplay.db next to Eco's own Game.db. WAL mode, indexed on unix_time, action_type, and citizen. Rides Eco's existing Storage/Backup/* backup loop for free.

Endpoints

Path Description
GET /api/v1/events List events. Query: citizen, type, limit (≤1000), since (unix seconds).
GET /api/v1/events/stats { ready, total }

See also