mirror of
https://github.com/AlecM33/Werewolf.git
synced 2025-12-26 15:57:50 +01:00
tracking of players accross session using id in storage, create game button for the host that is disabled until lobby is full. synchronized lobby state.
This commit is contained in:
@@ -39,7 +39,7 @@ io.on('connection', function(socket) {
|
||||
onSucess();
|
||||
});
|
||||
socket.on('joinGame', function(playerInfo) {
|
||||
activeGames[Object.keys(activeGames).find((key) => key === playerInfo.code)].players[socket.id] = playerInfo.name;
|
||||
activeGames[Object.keys(activeGames).find((key) => key === playerInfo.code)].players[socket.id] = {name: playerInfo.name, id: playerInfo.id};
|
||||
});
|
||||
socket.on('requestState', function(data) {
|
||||
if(Object.keys(socket.rooms).includes(data.code) === false) {
|
||||
|
||||
Reference in New Issue
Block a user