[mirotalksfu] - WIP lobby
هذا الالتزام موجود في:
@@ -107,6 +107,7 @@ module.exports = class Room {
|
|||||||
shareMediaData: this.shareMediaData,
|
shareMediaData: this.shareMediaData,
|
||||||
dominantSpeaker: this.activeSpeakerObserverEnabled,
|
dominantSpeaker: this.activeSpeakerObserverEnabled,
|
||||||
peers: JSON.stringify([...this.peers]),
|
peers: JSON.stringify([...this.peers]),
|
||||||
|
peersCount: this.getPeersCount(),
|
||||||
maxParticipants: this.maxParticipants,
|
maxParticipants: this.maxParticipants,
|
||||||
maxParticipantsReached: this.peers.size > this.maxParticipants,
|
maxParticipantsReached: this.peers.size > this.maxParticipants,
|
||||||
globalLobby: this.globalLobby,
|
globalLobby: this.globalLobby,
|
||||||
|
|||||||
@@ -1923,7 +1923,7 @@ function startServer() {
|
|||||||
return cb('isLocked');
|
return cb('isLocked');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (room.isLobbyEnabled() && !isPresenter) {
|
if ((room.isLobbyEnabled() || room.isGlobalLobbyEnabled()) && !isPresenter) {
|
||||||
log.debug(
|
log.debug(
|
||||||
'The user is currently waiting to join the room because the lobby is enabled, and they are not a presenter'
|
'The user is currently waiting to join the room because the lobby is enabled, and they are not a presenter'
|
||||||
);
|
);
|
||||||
@@ -1935,11 +1935,6 @@ function startServer() {
|
|||||||
return cb('isLobby');
|
return cb('isLobby');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (room.isGlobalLobbyEnabled() && !isPresenter) {
|
|
||||||
log.debug('The user is currently waiting to join the room because the global lobby is enabled');
|
|
||||||
return cb('isGlobalLobby');
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((hostCfg.protected || hostCfg.user_auth) && isPresenter && !hostCfg.users_from_db) {
|
if ((hostCfg.protected || hostCfg.user_auth) && isPresenter && !hostCfg.users_from_db) {
|
||||||
const roomAllowedForUser = isRoomAllowedForUser('[Join]', peer_name, room.id);
|
const roomAllowedForUser = isRoomAllowedForUser('[Join]', peer_name, room.id);
|
||||||
if (!roomAllowedForUser) {
|
if (!roomAllowedForUser) {
|
||||||
@@ -2409,6 +2404,10 @@ function startServer() {
|
|||||||
room.setLocked(false);
|
room.setLocked(false);
|
||||||
room.broadCast(socket.id, 'roomAction', data.action);
|
room.broadCast(socket.id, 'roomAction', data.action);
|
||||||
break;
|
break;
|
||||||
|
case 'globalLobbyOn':
|
||||||
|
if (!room.isGlobalLobbyEnabled()) return;
|
||||||
|
room.setLobbyEnabled(true);
|
||||||
|
break;
|
||||||
case 'lobbyOn':
|
case 'lobbyOn':
|
||||||
if (!isPresenter) return;
|
if (!isPresenter) return;
|
||||||
room.setLobbyEnabled(true);
|
room.setLobbyEnabled(true);
|
||||||
|
|||||||
@@ -517,11 +517,6 @@ class RoomClient {
|
|||||||
return this.unlockTheRoom();
|
return this.unlockTheRoom();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (room === 'isGlobalLobby') {
|
|
||||||
console.warn('00-WARNING ----> Room GLOBAL Lobby Enabled, Try later presenter not in room');
|
|
||||||
return this.presenterNotInRoom();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (room === 'isLobby') {
|
if (room === 'isLobby') {
|
||||||
this.RoomIsLobby = true;
|
this.RoomIsLobby = true;
|
||||||
this.event(_EVENTS.lobbyOn);
|
this.event(_EVENTS.lobbyOn);
|
||||||
@@ -620,10 +615,15 @@ class RoomClient {
|
|||||||
this.getId('isUserPresenter').innerText = isPresenter;
|
this.getId('isUserPresenter').innerText = isPresenter;
|
||||||
window.localStorage.isReconnected = false;
|
window.localStorage.isReconnected = false;
|
||||||
|
|
||||||
|
// GLOBAL LOBBY ENABLED
|
||||||
if (room?.globalLobby) {
|
if (room?.globalLobby) {
|
||||||
localStorageSettings.lobby = true;
|
if (isPresenter) {
|
||||||
lS.setSettings(localStorageSettings);
|
localStorageSettings.lobby = true;
|
||||||
console.warn('7.1-WARNING ----> GLOBAL Room Lobby detected, save the config');
|
lS.setSettings(localStorageSettings);
|
||||||
|
console.warn('7.1-WARNING ----> GLOBAL Room Lobby detected, save the config');
|
||||||
|
}
|
||||||
|
rc.roomAction('globalLobbyOn', true, false);
|
||||||
|
console.warn('7.1-WARNING ----> GLOBAL Room Lobby detected');
|
||||||
}
|
}
|
||||||
|
|
||||||
handleRules(isPresenter);
|
handleRules(isPresenter);
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم