teleportxr 1.0.76 → 1.0.78

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.
@@ -255,7 +255,12 @@ class GeometryService {
255
255
  }
256
256
 
257
257
  var node = this.scene.GetNode(node_uid);
258
- console.log("Adding node ", node.name, " for client ", this.clientID);
258
+ if(diff>0 && !already_present)
259
+ console.log("Adding node ", node.name, " for client ", this.clientID);
260
+ else if(diff<0 && already_present)
261
+ console.log("Removing node ", node.name, " for client ", this.clientID);
262
+ else
263
+ console.log("Changing node ", node.name, " count from ", old_count, " to ", old_count+diff, " for client ", this.clientID);
259
264
  this.streamedNodes.set(node_uid, old_count + diff);
260
265
  var meshResources = [];
261
266
  node.components.forEach((component) => {
@@ -121,6 +121,10 @@ class WebRtcConnection extends EventEmitter
121
121
  this.peerConnection = null;
122
122
  }
123
123
  this.peerConnection =new DefaultRTCPeerConnection({ sdpSemantics: 'unified-plan', iceServers: this.iceServers, iceTransportPolicy: this.iceTransportPolicy});
124
+ // New PeerConnection means new data channels — the "all channels open"
125
+ // callback must be allowed to fire again. Without this reset the latch from
126
+ // the previous PeerConnection's lifetime suppresses UpdateStreaming kick.
127
+ this._dataChannelsOpenFired = false;
124
128
  this.beforeOffer();
125
129
  this.connectionTimer = this.options.setTimeout(() =>
126
130
  {
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "name": "teleportxr",
18
18
  "description": "Teleport Spatial Server on node.js",
19
- "version": "1.0.76",
19
+ "version": "1.0.78",
20
20
  "repository": {
21
21
  "type": "git",
22
22
  "url": "git+https://github.com/simul/teleport-nodejs.git"
package/signaling.js CHANGED
@@ -133,14 +133,20 @@ function processInitialRequest(clientID, signalingClient, content) {
133
133
  // Apparently the CLIENT thinks they've disconnected.
134
134
  // The client might, as far as we know, have lost the information it needs to continue the connection.
135
135
  // Therefore we should resend everything required.
136
- //signalingClient.ChangeSignalingState(SignalingState.STREAMING);
137
136
  console.log(
138
137
  "Warning: Client " +
139
138
  clientID +
140
139
  " reconnected, but we didn't know we'd lost them."
141
140
  );
142
- // It may be just that the connection request was already in flight when we accepted its predecessor.
143
- //sendResponseToClient(clientID);
141
+ // Tear down any stale Client + WebRtcConnection from the previous incarnation.
142
+ // Without this the next handshake's StartStreaming() races against the old
143
+ // peer connection's still-open data channels, and the reliable channel the
144
+ // server publishes commands to ends up being the wrong one — Origin/Lighting
145
+ // acks never come back and the server eventually gives up.
146
+ disconnectClient(clientID);
147
+ if (webRtcConnectionManager)
148
+ webRtcConnectionManager.destroyConnection(clientID);
149
+ signalingClient.ChangeSignalingState(SignalingState.START);
144
150
  startStreaming(signalingClient);
145
151
  return;
146
152
  }