teleportxr 1.0.75 → 1.0.77

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.
@@ -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.75",
19
+ "version": "1.0.77",
20
20
  "repository": {
21
21
  "type": "git",
22
22
  "url": "git+https://github.com/simul/teleport-nodejs.git"
package/scene/node.js CHANGED
@@ -267,12 +267,12 @@ class Node {
267
267
  this.components.push(m);
268
268
  }
269
269
  setCanvasComponent(canvas_path) {
270
- this. components.forEach((component) => {
270
+ this.components.forEach((component) => {
271
271
  if (component.getType() == NodeDataType.TextCanvas) {
272
272
  component.canvasPath = canvas_path;
273
273
  component.data_uid = resources.GetResourceUidFromUrl(
274
- core.GeometryPayloadType.FontAtlas,
275
- canvas_name
274
+ core.GeometryPayloadType.TextCanvas,
275
+ canvas_path
276
276
  );
277
277
  return;
278
278
  }
@@ -280,7 +280,7 @@ class Node {
280
280
  var tc = new TextCanvasComponent();
281
281
  tc.canvasPath = canvas_path;
282
282
  tc.data_uid = resources.GetResourceUidFromUrl(
283
- core.GeometryPayloadType.FontAtlas,
283
+ core.GeometryPayloadType.TextCanvas,
284
284
  canvas_path
285
285
  );
286
286
  this.components.push(tc);
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
  }