code cleanup

This commit is contained in:
Alec Maier
2019-09-14 19:17:52 -04:00
parent 1c7adcef5d
commit c00c5ddb17

View File

@@ -100,7 +100,7 @@ io.on('connection', function(socket) {
socket.on('joinGame', function(playerInfo) {
const game = activeGames[Object.keys(activeGames).find((key) => key === playerInfo.code)];
if (game && game.players.length < game.size) {
activeGames[Object.keys(activeGames).find((key) => key === playerInfo.code)].players.push({name: playerInfo.name, id: playerInfo.id});
game.players.push({name: playerInfo.name, id: playerInfo.id});
console.log(playerInfo.name + " joined the game!");
socket.emit('success');
} else {