mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-22 04:43:49 +00:00
don't send desync message to client until fixed.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user