diff --git a/src/client/Transport.ts b/src/client/Transport.ts
index acca558c8..d76107ef2 100644
--- a/src/client/Transport.ts
+++ b/src/client/Transport.ts
@@ -131,7 +131,7 @@ export class Transport {
gameID: this.gameID,
})))
}
- }, 10000);
+ }, 5 * 1000);
}
}
diff --git a/src/client/index.html b/src/client/index.html
index cb8c873e5..039737a21 100644
--- a/src/client/index.html
+++ b/src/client/index.html
@@ -28,7 +28,7 @@
OpenFront.io
- (v0.12.2)
+ (v0.12.3)
diff --git a/src/server/GameServer.ts b/src/server/GameServer.ts
index 1946803de..20fbede82 100644
--- a/src/server/GameServer.ts
+++ b/src/server/GameServer.ts
@@ -30,6 +30,8 @@ export class GameServer {
private endTurnIntervalID
+ private lastPingUpdate = 0
+
constructor(
public readonly id: string,
public readonly createdAt: number,
@@ -77,6 +79,7 @@ export class GameServer {
}
}
if (clientMsg.type == "ping") {
+ this.lastPingUpdate = Date.now()
client.lastPing = Date.now()
}
})
@@ -210,7 +213,11 @@ export class GameServer {
return GamePhase.Lobby
}
- if (this.activeClients.length == 0 && now > this.createdAt + this.config.lobbyLifetime() + 30 * 1000) { // wait at least 30s before ending game
+ const noActive = this.activeClients.length
+ const warmupOver = now > this.createdAt + this.config.lobbyLifetime() + 30 * 1000
+ const noRecentPings = now > this.lastPingUpdate + 20 * 1000
+
+ if (noActive && warmupOver && noRecentPings) {
return GamePhase.Finished
}