Files
electric-cherry/src/lib/match-history.ts
T
2026-10-01 11:45:23 -04:00

45 lines
1.3 KiB
TypeScript

// Reset/abandoned games at round 1 do not qualify as gameplay records.
export const MIN_RECORDED_ROUND = 2;
export interface ServerMatch {
id: number;
server: string;
server_deleted_at?: string | null;
map: string;
startedAt: string;
endedAt: string | null;
status: 'active' | 'completed' | 'interrupted';
startPlayers: number | null;
uniquePlayers: number;
endPlayers: number | null;
durationMs: number | null;
finalRound: number | null;
}
export interface MatchPlayer {
guid: string;
name: string;
hasStats: boolean;
presentAtEnd: boolean;
canViewProfile: boolean;
firstSeenAt: string;
lastSeenAt: string;
// Combat counters and score are the highest reported values; rounds survived
// counts observed progression. These are not a final scoreboard snapshot.
// A player seen only at game_start has no observed gameplay stats.
highestRound: number | null;
roundsSurvived: number | null;
kills: number | null;
headshots: number | null;
downs: number | null;
revives: number | null;
bestScore: number | null;
}
export interface MatchDetail extends ServerMatch {
status: 'completed';
game: string;
startObserved: boolean;
players: MatchPlayer[];
}