Simplify telemetry to three game events
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { parseServerName, zombieMapBySlug } from './map-aliases.js';
|
||||
import { freshStatusTimestamp } from './server-freshness.js';
|
||||
import type { ZombieGame } from './map-aliases.js';
|
||||
import type { RoundTelemetry } from './telemetry.js';
|
||||
import type { GameTelemetry } from './telemetry.js';
|
||||
import type { Health, RosterPlayer } from './ui/stores/servers.js';
|
||||
import { mapTitle, serverTitle } from './ui/server-labels.js';
|
||||
|
||||
@@ -63,8 +63,8 @@ export function fleetIdentity(server: FleetServer) {
|
||||
};
|
||||
}
|
||||
|
||||
export function currentRound(server: FleetServer, report: RoundTelemetry | undefined, now: number): number | null {
|
||||
if (!report || !freshServer(server, now) || !server.active_since || !server.game_started_at
|
||||
export function currentRound(server: FleetServer, report: GameTelemetry | undefined, now: number): number | null {
|
||||
if (!report || report.event !== 'round_change' || !freshServer(server, now) || !server.active_since || !server.game_started_at
|
||||
|| server.game_ended_at || (server.last_players ?? 0) === 0) return null;
|
||||
const received = Date.parse(report.receivedAt);
|
||||
const age = now - received;
|
||||
|
||||
Reference in New Issue
Block a user