Fix type-of
Signed-off-by: James Ketrenos <james_eikona@ketrenos.com>
This commit is contained in:
parent
62489e925f
commit
be5c23d9fc
@ -3175,7 +3175,7 @@ const sendUpdateToPlayers = async (game, update) => {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!session.ws) {
|
if (!session.ws) {
|
||||||
console.log(`${_session.id}: -> sendUpdateToPlayers: ` +
|
console.log(`${session.id}: -> sendUpdateToPlayers: ` +
|
||||||
`Currently no connection.`);
|
`Currently no connection.`);
|
||||||
} else {
|
} else {
|
||||||
session.ws.send(message);
|
session.ws.send(message);
|
||||||
@ -3481,12 +3481,13 @@ router.ws("/ws/:id", async (ws, req) => {
|
|||||||
if (game.state === 'winner' || game.state === 'lobby') {
|
if (game.state === 'winner' || game.state === 'lobby') {
|
||||||
let dead = true;
|
let dead = true;
|
||||||
for (let id in game.sessions) {
|
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;
|
dead = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (dead) {
|
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. ` +
|
addChatMessage(game, null, `No more active players in game. ` +
|
||||||
`It is being removed from the server.`);
|
`It is being removed from the server.`);
|
||||||
sendUpdateToPlayers(game, {
|
sendUpdateToPlayers(game, {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user