mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 08:11:38 +00:00
fix bug can't join game if click with 1s before start
This commit is contained in:
@@ -81,6 +81,7 @@
|
||||
* Create exit to menu button DONE 9/2/2024
|
||||
* show next game in menu DONE 9/2/2024
|
||||
* BUG: attacks starts slow but gets faster DONE 9/2/2024
|
||||
* BUG: can't join game if click with 1s before start DONE 9/2/2024
|
||||
* test & deploy game
|
||||
|
||||
--- v2 Release
|
||||
|
||||
@@ -100,6 +100,7 @@ class Client {
|
||||
}
|
||||
|
||||
private async joinLobby(lobby: Lobby) {
|
||||
console.log(`joining lobby ${lobby.id}`)
|
||||
const lobbyButton = document.getElementById('lobby-button');
|
||||
if (lobbyButton) {
|
||||
this.isLobbyHighlighted = !this.isLobbyHighlighted;
|
||||
|
||||
@@ -134,7 +134,7 @@ export class GameServer {
|
||||
return GamePhase.Lobby
|
||||
}
|
||||
|
||||
if (this.clients.length == 0) {
|
||||
if (this.clients.length == 0 && Date.now() > this.createdAt + this.config.lobbyLifetime() + 30 * 60) { // wait at least 30s before ending game
|
||||
return GamePhase.Finished
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user