telemersive-bus 0.6.11 → 0.6.13
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/BusClient.js +12 -12
- package/lib/BusManager.js +1 -1
- package/lib/utils/version.js +1 -1
- package/package.json +1 -1
package/lib/BusClient.js
CHANGED
|
@@ -132,7 +132,17 @@ class BusClient {
|
|
|
132
132
|
// we reconnect with the final clientID. this protects this peer from a
|
|
133
133
|
// potential BAD ACTOR spoofing as itself.
|
|
134
134
|
this.communicator.setClientID(this.peer.getClientId());
|
|
135
|
-
|
|
135
|
+
|
|
136
|
+
console.log(` <-- reconnect to broker with correct last will...`);
|
|
137
|
+
// we reconnect again and set this time the correct last will message
|
|
138
|
+
// with the room info and password
|
|
139
|
+
// this should be done before we internally join the room and subscribe to all the
|
|
140
|
+
// topics
|
|
141
|
+
await this.communicator.reconnect(
|
|
142
|
+
new BusMsgPub(
|
|
143
|
+
this.busTopics.peerLeaving().build(),
|
|
144
|
+
PeerCredentials, 2, false).encode(this.peer.getCredentials()));
|
|
145
|
+
console.log(` <-- ... reconnected.`);
|
|
136
146
|
|
|
137
147
|
// if connection was successful, subscribe to roomAccess topic
|
|
138
148
|
await this.communicator.subscribe(new BusMsgSub(this.busTopics.basePeerRoomAccess(this.peer.getClientId()).build(), this.onRoomJoined, RoomAccess, 2));
|
|
@@ -140,6 +150,7 @@ class BusClient {
|
|
|
140
150
|
// now we start the timeout thread
|
|
141
151
|
this.joinTimeout = setTimeout(this.joinedTimeout,5000);
|
|
142
152
|
|
|
153
|
+
console.log(` <-- send request to create / join room...`);
|
|
143
154
|
// now we can send the room create message - knowing the manager
|
|
144
155
|
// will resend the answer to a clientID protected topic
|
|
145
156
|
await this.communicator.publish(
|
|
@@ -192,17 +203,6 @@ class BusClient {
|
|
|
192
203
|
if(!this.peer.isJoined()){
|
|
193
204
|
console.log(`<-- access to room ${_message.roomName} accepted.`);
|
|
194
205
|
|
|
195
|
-
console.log(` <-- reconnect to broker with correct last will...`);
|
|
196
|
-
// we reconnect again and set this time the correct last will message
|
|
197
|
-
// with the room info and password
|
|
198
|
-
// this should be done before we internally join the room and subscribe to all the
|
|
199
|
-
// topics
|
|
200
|
-
await this.communicator.reconnect(
|
|
201
|
-
new BusMsgPub(
|
|
202
|
-
this.busTopics.peerLeaving().build(),
|
|
203
|
-
PeerCredentials, 2, false).encode(this.peer.getCredentials()));
|
|
204
|
-
console.log(` <-- ... reconnected.`);
|
|
205
|
-
|
|
206
206
|
// now we can join the peer and give it its room id
|
|
207
207
|
await this.peer.join(_message.roomId, _message.roomUuid);
|
|
208
208
|
|
package/lib/BusManager.js
CHANGED
|
@@ -209,7 +209,7 @@ class BusManager {
|
|
|
209
209
|
|
|
210
210
|
// if even one joined peer replies to the room ping,
|
|
211
211
|
// the room can be removed from this list
|
|
212
|
-
if (
|
|
212
|
+
if (_message.roomName in this.roomHousekeep) {
|
|
213
213
|
delete this.roomHousekeep[_message.roomName];
|
|
214
214
|
}
|
|
215
215
|
}
|
package/lib/utils/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "telemersive-bus",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.13",
|
|
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": {
|