Fix active and match timer drift between status polls

Persist occupancy transitions with telemetry and carry timer anchors through live updates. Cover delayed polling, lobby rejoining, and lifecycle boundaries with regression tests.

Fixes #47
This commit is contained in:
2026-09-27 23:29:04 -04:00
parent b904ddbc48
commit 2fa3792482
8 changed files with 210 additions and 15 deletions
+3 -3
View File
@@ -89,9 +89,9 @@ CREATE TABLE IF NOT EXISTS servers (
created_by TEXT, -- 'ui' | operator identifier
destroyed_at TEXT, -- ISO ts when tombstoned (row usually deleted; kept as safety net)
-- Occupancy + match timers. active_since / inactive_since are mutually
-- exclusive: exactly one is non-null while a server is reachable. RCON
-- outages do NOT clear either — timers survive transient unreachability
-- and resume from the same anchor when the server comes back.
-- exclusive. Accepted telemetry records transitions immediately; status
-- polls provide the RCON fallback. Outages do NOT clear either — timers
-- survive transient unreachability and resume from the same anchor.
active_since TEXT, -- ISO ts of last 0 -> >0 player transition
inactive_since TEXT, -- ISO ts of last >0 -> 0 player transition
game_started_at TEXT, -- receipt time of the script's game_start