Fix stale match liveness and stop handling (Refs #136)
CI / checks (push) Successful in 5m15s
CI / checks (push) Successful in 5m15s
This commit is contained in:
@@ -67,7 +67,15 @@ export function recordLeaderboardTelemetry(handle: Database.Database, report: Ga
|
||||
'SELECT * FROM leaderboard_matches WHERE server = ? AND server_deleted_at IS NULL ORDER BY id DESC LIMIT 1'
|
||||
)
|
||||
.get(report.server) as Match | undefined;
|
||||
if (match?.last_fingerprint === signature && match.map_key === identity.key) return;
|
||||
if (match?.last_fingerprint === signature && match.map_key === identity.key) {
|
||||
// Unchanged gameplay still proves an open match is reporting. Keep the
|
||||
// duplicate from changing participation, counters, or completed results.
|
||||
if (match.status === 'active')
|
||||
handle
|
||||
.prepare('UPDATE leaderboard_matches SET last_received_at = ? WHERE id = ?')
|
||||
.run(report.receivedAt, match.id);
|
||||
if (match.status !== 'interrupted') return;
|
||||
}
|
||||
|
||||
const isStart = report.event === 'game_start';
|
||||
const round = isStart ? 0 : report.round;
|
||||
|
||||
Reference in New Issue
Block a user