Add moderation permissions and durable player records

This commit is contained in:
2026-10-15 21:06:08 -04:00
parent c1758cce25
commit c91d49c298
17 changed files with 699 additions and 21 deletions
+8
View File
@@ -3,6 +3,7 @@ import type { GameTelemetry, ServerTiming } from '../../telemetry.js';
import { MIN_RECORDED_ROUND } from '../../match-history.js';
import { recordLeaderboardTelemetry } from './leaderboard-ingest.js';
import { latestGameSubmission } from './status-evidence.js';
import { observeModerationPlayers } from '../moderation/core.js';
export function listTelemetry(): GameTelemetry[] {
const rows = db()
@@ -33,6 +34,13 @@ export function saveTelemetryWithOutcome(report: GameTelemetry): {
? JSON.parse(row.payload)
: undefined;
const recorded = recordLeaderboardTelemetry(handle, report);
const game = (
handle
.prepare('SELECT game FROM leaderboard_matches WHERE id=?')
.get(recorded.matchId) as { game: string }
).game;
if (game === 't5' || game === 't6')
observeModerationPlayers(handle, game, report.players, report.receivedAt);
if (!recorded.current) {
return {
telemetry: { ...report, timing: { matchId: recorded.matchId, players: {} } },