telemersive-bus 0.6.10 → 0.6.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/BusManager.js +20 -6
- package/package.json +1 -1
package/lib/BusManager.js
CHANGED
|
@@ -222,14 +222,28 @@ class BusManager {
|
|
|
222
222
|
console.log(` -> peer '${_message.peerName}' not joined anymore - reject from room`);
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
+
let room_ID = -1;
|
|
226
|
+
let room_UUID = -1;
|
|
227
|
+
|
|
228
|
+
// we also check if the room is still existing..
|
|
229
|
+
if (this.rooms[_message.roomName] !== undefined){
|
|
230
|
+
// we only set the id and UUID if the room still exists.
|
|
231
|
+
room_ID = this.rooms[_message.roomName].roomId;
|
|
232
|
+
room_UUID = this.rooms[_message.roomName].roomUUID;
|
|
233
|
+
} else {
|
|
234
|
+
accessGrant = false;
|
|
235
|
+
reason = "room doesn't exist anymore";
|
|
236
|
+
console.log(` -> peer '${_message.peerName}' reject from non existing room '${_message.roomName}'`);
|
|
237
|
+
}
|
|
238
|
+
|
|
225
239
|
await this.publishRoomAccess(
|
|
226
240
|
accessGrant,
|
|
227
241
|
_message.peerId,
|
|
228
242
|
_message.clientId,
|
|
229
243
|
_message.peerName,
|
|
230
244
|
_message.roomName,
|
|
231
|
-
|
|
232
|
-
|
|
245
|
+
room_ID,
|
|
246
|
+
room_UUID,
|
|
233
247
|
_message.roomPwd,
|
|
234
248
|
reason);
|
|
235
249
|
|
|
@@ -539,9 +553,6 @@ class BusManager {
|
|
|
539
553
|
if (this.rooms.hasOwnProperty(_roomName)) {
|
|
540
554
|
console.log(` <- remove room '${_roomName}' with id '${this.rooms[_roomName].roomId}' `);
|
|
541
555
|
try {
|
|
542
|
-
// stop the ports
|
|
543
|
-
await this.stopServerSidePortScripts(_roomName, this.rooms[_roomName].roomId);
|
|
544
|
-
|
|
545
556
|
// stop the and cleanup the room chat
|
|
546
557
|
if (this.chatManagers.hasOwnProperty(_roomName)) {
|
|
547
558
|
// stop the chatManager and delete it for this rom
|
|
@@ -567,7 +578,8 @@ class BusManager {
|
|
|
567
578
|
// and by now all retained messages in this room have been cleaned up
|
|
568
579
|
await this.communicator.unsubscribe(this.busTopics.baseRoomSubTopics(_roomName).build());
|
|
569
580
|
|
|
570
|
-
delete
|
|
581
|
+
// stop the ports and delete room for good
|
|
582
|
+
await this.stopServerSidePortScripts(_roomName, this.rooms[_roomName].roomId);
|
|
571
583
|
} catch (e) {
|
|
572
584
|
console.log(` <! exception while removing room '${_roomName}': '${e.message}' `);
|
|
573
585
|
}
|
|
@@ -681,6 +693,8 @@ class BusManager {
|
|
|
681
693
|
console.error(` ...: ${err}. Interrupting process of stopping open stage control instance on port ${_roomId * 1000 + 900}.`);
|
|
682
694
|
}
|
|
683
695
|
console.log(` <- stopped all ports for room ${_roomName}`);
|
|
696
|
+
delete this.rooms[_roomName];
|
|
697
|
+
console.log(` <- removed room ${_roomName}`);
|
|
684
698
|
}else {
|
|
685
699
|
console.log(` ...stopped no ports for room ${_roomName}: no switchboard url/port defined`);
|
|
686
700
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "telemersive-bus",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.11",
|
|
4
4
|
"description": "MQTT based data protocol to manage unlimited peers, connected by rooms, where all peers joined to a room can exchange private data. It provides a simple chat mechanism, latency pinging, publish-subscribe mechanism (based on mqtt) and a OSC-like data stream. ",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"directories": {
|