Change to total number of peers, not just joined. Styling.

auto_join_3.3
Håvar Aambø Fosstveit 2020-05-05 09:56:21 +02:00
parent e2421f094f
commit 7adcef19a3
1 changed files with 6 additions and 1 deletions

View File

@ -218,7 +218,12 @@ class Room extends EventEmitter
peer.roles.some((role) => accessFromRoles.BYPASS_ROOM_LOCK.includes(role)) peer.roles.some((role) => accessFromRoles.BYPASS_ROOM_LOCK.includes(role))
) )
this._peerJoining(peer); this._peerJoining(peer);
else if ('maxUsersPerRoom' in config &&(this._getJoinedPeers().length + this._lobby.peerList().length) >= config.maxUsersPerRoom) else if (
'maxUsersPerRoom' in config &&
(
Object.keys(this._peers).length +
this._lobby.peerList().length
) >= config.maxUsersPerRoom)
{ {
this._handleOverRoomLimit(peer); this._handleOverRoomLimit(peer);
} }