name :)
This commit is contained in:
parent
d399f2b65f
commit
07da40dce7
4 changed files with 30 additions and 14 deletions
|
|
@ -76,10 +76,11 @@ wss.on('message', async ({socket, data}) => {
|
|||
const msgType = msg[0]
|
||||
switch (msgType) {
|
||||
case Protocol.EV_CLIENT_INIT: {
|
||||
const name = msg[1]
|
||||
if (!Game.exists(gameId)) {
|
||||
await Game.createGame(gameId, TARGET_TILES, Util.choice(IMAGES))
|
||||
}
|
||||
Game.addPlayer(gameId, clientId)
|
||||
Game.addPlayer(gameId, clientId, name)
|
||||
Game.addSocket(gameId, socket)
|
||||
|
||||
notify(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue