[mirotalksfu] - WIP lobby

هذا الالتزام موجود في:
Miroslav Pejic
2025-09-10 22:50:07 +02:00
الأصل 831e80ac67
التزام 76064a2ef9
3 ملفات معدلة مع 14 إضافات و14 حذوفات

عرض الملف

@@ -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);