mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-08-18 09:14:09 +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
|
duration: 1, // per 1 second
|
||||||
});
|
});
|
||||||
|
|
||||||
|
private outOfSyncClients = new Set<ClientID>();
|
||||||
|
|
||||||
private maxGameDuration = 3 * 60 * 60 * 1000; // 3 hours
|
private maxGameDuration = 3 * 60 * 60 * 1000; // 3 hours
|
||||||
|
|
||||||
private turns: Turn[] = [];
|
private turns: Turn[] = [];
|
||||||
@@ -424,6 +426,17 @@ export class GameServer {
|
|||||||
outOfSyncClients = this.activeClients;
|
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({
|
const serverDesync = ServerDesyncSchema.safeParse({
|
||||||
type: "desync",
|
type: "desync",
|
||||||
turn: lastHashTurn,
|
turn: lastHashTurn,
|
||||||
|
|||||||
Reference in New Issue
Block a user