fix bug can't join game if click with 1s before start

This commit is contained in:
evanpelle
2024-09-02 12:05:20 -07:00
parent 23cd55a398
commit 523552bc44
3 changed files with 3 additions and 1 deletions
+1
View File
@@ -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
+1
View File
@@ -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;
+1 -1
View File
@@ -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
}