From b449d6ef9b8a9af78fb653fbd468204c4c515eed Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 27 Feb 2025 20:17:04 -0800 Subject: [PATCH] don't send desync message to client until fixed. --- src/server/GameServer.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/server/GameServer.ts b/src/server/GameServer.ts index 9544419a7..1225538d3 100644 --- a/src/server/GameServer.ts +++ b/src/server/GameServer.ts @@ -32,6 +32,8 @@ export class GameServer { duration: 1, // per 1 second }); + private outOfSyncClients = new Set(); + private maxGameDuration = 3 * 60 * 60 * 1000; // 3 hours private turns: Turn[] = []; @@ -424,6 +426,17 @@ export class GameServer { outOfSyncClients = this.activeClients; } + for (const oos of outOfSyncClients) { + if (!this.outOfSyncClients.has(oos.clientID)) { + console.warn( + `Game ${this.id}: has out of sync client ${oos.clientID} on turn ${lastHashTurn}`, + ); + this.outOfSyncClients.add(oos.clientID); + } + } + return; + // TODO: renable this once desync issue fixed + const serverDesync = ServerDesyncSchema.safeParse({ type: "desync", turn: lastHashTurn,