auto_join_3.3
Håvar Aambø Fosstveit 2020-05-19 14:26:19 +02:00
parent a0a23109a9
commit d9cce46505
3 changed files with 22 additions and 16 deletions

View File

@ -106,6 +106,12 @@
"no-invalid-regexp": 2,
"no-invalid-this": 2,
"no-irregular-whitespace": 2,
"no-trailing-spaces": [
"error",
{
"ignoreComments": true
}
],
"no-lonely-if": 2,
"no-mixed-operators": 2,
"no-mixed-spaces-and-tabs": 2,

View File

@ -83,9 +83,9 @@ class Peer extends EventEmitter
{
if (this.closed)
return;
logger.debug('"disconnect" event [id:%s]', this.id);
this.close();
});
}
@ -208,7 +208,7 @@ class Peer extends EventEmitter
const oldDisplayName = this._displayName;
this._displayName = displayName;
this.emit('displayNameChanged', { oldDisplayName });
}
}
@ -225,7 +225,7 @@ class Peer extends EventEmitter
const oldPicture = this._picture;
this._picture = picture;
this.emit('pictureChanged', { oldPicture });
}
}

View File

@ -493,7 +493,7 @@ class Room extends EventEmitter
peer.socket.handshake.session.save();
let turnServers;
if ('turnAPIURI' in config)
{
try
@ -507,7 +507,7 @@ class Room extends EventEmitter
'ip' : peer.socket.request.connection.remoteAddress
}
});
turnServers = [ {
urls : data.uris,
username : data.username,
@ -518,7 +518,7 @@ class Room extends EventEmitter
{
if ('backupTurnServers' in config)
turnServers = config.backupTurnServers;
logger.error('_peerJoining() | error on REST turn [error:"%o"]', error);
}
}
@ -526,7 +526,7 @@ class Room extends EventEmitter
{
turnServers = config.backupTurnServers;
}
this._notification(peer.socket, 'roomReady', { turnServers });
}
})
@ -779,7 +779,7 @@ class Room extends EventEmitter
// initiate mediasoup Transports and be ready when he later joins.
const { forceTcp, producing, consuming } = request.data;
const webRtcTransportOptions =
{
...config.mediasoup.webRtcTransport,
@ -1187,7 +1187,7 @@ class Room extends EventEmitter
throw new Error('peer not authorized');
const { chatMessage } = request.data;
this._chatHistory.push(chatMessage);
// Spread to others
@ -1206,7 +1206,7 @@ class Room extends EventEmitter
{
if (!this._hasPermission(peer, MODERATE_CHAT))
throw new Error('peer not authorized');
this._chatHistory = [];
// Spread to others
@ -1259,7 +1259,7 @@ class Room extends EventEmitter
case 'setAccessCode':
{
const { accessCode } = request.data;
this._accessCode = accessCode;
// Spread to others
@ -1279,7 +1279,7 @@ class Room extends EventEmitter
case 'setJoinByAccessCode':
{
const { joinByAccessCode } = request.data;
this._joinByAccessCode = joinByAccessCode;
// Spread to others
@ -1328,7 +1328,7 @@ class Room extends EventEmitter
throw new Error('peer not authorized');
const { magnetUri } = request.data;
this._fileHistory.push({ peerId: peer.id, magnetUri: magnetUri });
// Spread to others
@ -1347,7 +1347,7 @@ class Room extends EventEmitter
{
if (!this._hasPermission(peer, MODERATE_FILES))
throw new Error('peer not authorized');
this._fileHistory = [];
// Spread to others
@ -1907,7 +1907,7 @@ class Room extends EventEmitter
for (const routerId of this._mediasoupRouters.keys())
{
const routerLoad =
const routerLoad =
Object.values(this._peers).filter((peer) => peer.routerId === routerId).length;
if (routerLoad < load)