Destroy text and borders

This commit is contained in:
2021-06-14 12:06:49 +02:00
parent c4a8c84db2
commit 00d868f963
3 changed files with 15 additions and 6 deletions

View File

@@ -63,6 +63,15 @@ io.on('connection', socket => {
gameState['players'].splice(index, 1);
gameState['positions'].splice(index, 1);
}
socket.leave(socket.room);
if (gameState['players'].length === 0) {
gameState['players'] = [];
gameState['positions'] = [];
gameState['whosNext'] = 0;
gameState['started'] = false;
}
}
generate_log_message(socket.room, socket.username, "LEFT", "");