don't send desync message to client until fixed.

This commit is contained in:
Evan
2025-02-27 20:17:04 -08:00
parent 1c21d26660
commit da2c842004
+13
View File
@@ -32,6 +32,8 @@ export class GameServer {
duration: 1, // per 1 second
});
private outOfSyncClients = new Set<ClientID>();
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,