From 87bcd3a89580da021525f18f938d1801e44a9910 Mon Sep 17 00:00:00 2001 From: Stefan Otto Date: Thu, 31 Oct 2019 05:34:54 +0100 Subject: [PATCH] fix logic for room entry --- server/lib/Room.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/server/lib/Room.js b/server/lib/Room.js index 7f604a3..bf4f107 100644 --- a/server/lib/Room.js +++ b/server/lib/Room.js @@ -126,16 +126,15 @@ class Room extends EventEmitter return; } - else if ( - this._locked || - (Boolean(config.requireSignInToAccess) && !peer.authenticated) - ) + else if ( this._locked ) { this._parkPeer(peer); - - if (!this._locked) - this._notification(peer.socket, 'signInRequired'); - + return; + } + else if ( Boolean(config.requireSignInToAccess) && this.checkEmpty()) + { + this._parkPeer(peer); + this._notification(peer.socket, 'signInRequired'); return; } @@ -875,6 +874,7 @@ class Room extends EventEmitter this._notification(peer.socket, 'unlockRoom', { peerId : peer.id }, true); + this._lobby.promoteAllPeers(); // Return no error cb();