diff --git a/TODO.txt b/TODO.txt index 32d56bc19..ab4208461 100644 --- a/TODO.txt +++ b/TODO.txt @@ -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 diff --git a/src/client/Client.ts b/src/client/Client.ts index fa1d50de3..9b2af9fe0 100644 --- a/src/client/Client.ts +++ b/src/client/Client.ts @@ -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; diff --git a/src/server/GameServer.ts b/src/server/GameServer.ts index e55ebb862..8eb835c8a 100644 --- a/src/server/GameServer.ts +++ b/src/server/GameServer.ts @@ -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 }