fix rejoining the game for some clients

This commit is contained in:
RandyJC
2025-12-08 23:12:05 +01:00
parent 3317925d08
commit d8a9fb2dca
2 changed files with 9 additions and 16 deletions

View File

@@ -281,18 +281,6 @@ io.on("connection", (socket) => {
return
}
if (!game.started) {
game.players = game.players.filter((p) => p.id !== socket.id)
io.to(game.manager.id).emit("manager:removePlayer", player.id)
io.to(game.manager.id).emit("manager:players", game.players)
io.to(game.gameId).emit("game:totalPlayers", game.players.length)
console.log(`Removed player ${player.username} from game ${game.gameId}`)
return
}
player.connected = false
io.to(game.gameId).emit("game:totalPlayers", game.players.length)
io.to(game.manager.id).emit("manager:players", game.players)