Simplify telemetry to three game events

This commit is contained in:
2026-09-18 15:35:21 -04:00
parent 6d903adb31
commit 5bb49a776e
29 changed files with 658 additions and 1314 deletions
+3 -5
View File
@@ -3,7 +3,6 @@ import { emit } from './bus.js';
import type { BetaStage } from './bus.js';
import { komodoConfigured, rconConfigured } from '../config.js';
import { rconGetPlayerCount } from '../integrations/rcon.js';
import { scanForMatchEnd } from '../fleet/match-log.js';
import { refreshRestartRollout, restartInRollout, rolloutHealth, rolloutWaitReason } from './restart-rollout.js';
import { plannedBetaTick } from './beta-plan-runner.js';
@@ -12,6 +11,7 @@ interface BetaServerActiveRow {
server: string;
stage: BetaStage;
healthy_at: string | null;
match_seen_at: string | null;
wait_for_health: number;
wait_for_match: number;
}
@@ -101,7 +101,7 @@ async function runBetaTick(): Promise<{ processed: number }> {
const rows = db()
.prepare(
`SELECT bs.beta_id AS beta_id, bs.server AS server, bs.stage AS stage,
bs.healthy_at AS healthy_at,
bs.healthy_at AS healthy_at, bs.match_seen_at AS match_seen_at,
b.wait_for_health AS wait_for_health, b.wait_for_match AS wait_for_match
FROM beta_servers bs
JOIN betas b ON b.id = bs.beta_id
@@ -181,9 +181,7 @@ async function advance(row: BetaServerActiveRow): Promise<void> {
return;
}
case 'awaiting-match': {
const since = row.healthy_at ?? nowIso();
const result = await scanForMatchEnd(row.server, since);
if (!result.ended) return;
if (!row.match_seen_at) return;
transition(row.beta_id, row.server, 'ready');
return;
}