fix multiple join on game invite
This commit is contained in:
parent
96d8ffb5d4
commit
e3dd85d0f5
1 changed files with 8 additions and 4 deletions
|
|
@ -438,10 +438,14 @@ class StateI {
|
||||||
) {
|
) {
|
||||||
this.fastify.log.warn(
|
this.fastify.log.warn(
|
||||||
'user trying to connect to a game he\'s not part of: gameId:' +
|
'user trying to connect to a game he\'s not part of: gameId:' +
|
||||||
g_id +
|
g_id + ' userId:' + sock.authUser.id);
|
||||||
' userId:' +
|
return JoinRes.no;
|
||||||
sock.authUser.id,
|
}
|
||||||
);
|
if (game.userOnPage[0] === true && game.userOnPage[1] === true)
|
||||||
|
{
|
||||||
|
this.fastify.log.warn(
|
||||||
|
'user trying to connect to a game he\'s already joined: gameId:' +
|
||||||
|
g_id + ' userId:' + sock.authUser.id);
|
||||||
return JoinRes.no;
|
return JoinRes.no;
|
||||||
}
|
}
|
||||||
game.userOnPage[game.userLeft === sock.authUser.id ? 0 : 1] = true;
|
game.userOnPage[game.userLeft === sock.authUser.id ? 0 : 1] = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue