telemersive-bus 0.6.11 → 0.6.12

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 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
- await this.communicator.reconnect(null);
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
 
@@ -5,7 +5,7 @@ class Version {
5
5
  }
6
6
 
7
7
  getProtocolVersion = () => {
8
- return '0.0.5';
8
+ return '0.6.12';
9
9
  }
10
10
  }
11
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "telemersive-bus",
3
- "version": "0.6.11",
3
+ "version": "0.6.12",
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": {