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
+9 -1
View File
@@ -22,9 +22,17 @@ export interface PlayerTiming {
roundStarted: number | null;
}
/** Server-owned anchors, included so successive live reports keep the same timers. */
export interface ServerTiming {
activeSince: string | null;
inactiveSince: string | null;
gameStartedAt: string | null;
gameEndedAt: string | null;
}
export type GameTelemetry = GameEvent & {
receivedAt: string;
timing?: { matchId: number; players: Record<string, PlayerTiming> };
timing?: { matchId: number; players: Record<string, PlayerTiming>; server?: ServerTiming };
};
/** Validate the four script payloads; beta state is never part of the protocol. */