show other player hands

This commit is contained in:
Zutatensuppe 2020-11-08 01:56:36 +01:00
parent ca387b53ec
commit 36e5f8437d
4 changed files with 359 additions and 316 deletions

View file

@ -48,12 +48,14 @@ wss.on('message', ({socket, data}) => {
// a new player (or previous player) joined
games[gid] = games[gid] || {puzzle: null, players: {}}
games[gid].players[uid] = parsed.player
games[gid].players[uid] = {id: uid, x: 0, y: 0, down: false}
wss.notifyOne({
type: 'init',
puzzle: games[gid].puzzle,
players: games[gid].players,
game: {
puzzle: games[gid].puzzle,
players: games[gid].players,
},
}, socket)
} break;