1
0

Fix type-of

Signed-off-by: James Ketrenos <james_eikona@ketrenos.com>
This commit is contained in:
James Ketrenos 2022-03-18 17:05:23 -07:00
parent 62489e925f
commit be5c23d9fc

View File

@ -3175,7 +3175,7 @@ const sendUpdateToPlayers = async (game, update) => {
continue;
}
if (!session.ws) {
console.log(`${_session.id}: -> sendUpdateToPlayers: ` +
console.log(`${session.id}: -> sendUpdateToPlayers: ` +
`Currently no connection.`);
} else {
session.ws.send(message);
@ -3481,12 +3481,13 @@ router.ws("/ws/:id", async (ws, req) => {
if (game.state === 'winner' || game.state === 'lobby') {
let dead = true;
for (let id in game.sessions) {
if (game.sessions[id].live && game.sessions[id].color) {
if (game.sessions[id].live && game.sessions[id].name) {
dead = false;
}
}
if (dead) {
console.log(`${session.id}: No more players in ${game.id}. Removing.`);
console.log(`${session.id}: No more players in ${game.id}. ` +
`Removing.`);
addChatMessage(game, null, `No more active players in game. ` +
`It is being removed from the server.`);
sendUpdateToPlayers(game, {