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,