teleportxr 1.0.44 → 1.0.46

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/client/client.js CHANGED
@@ -127,7 +127,10 @@ class Client {
127
127
  this.clientDynamicLighting=new core.ClientDynamicLighting();
128
128
  // Session is (re)starting; the client has zero state, so retract any
129
129
  // outstanding ack tracking from a previous session and force a resend.
130
- this.currentOriginState = new OriginState();
130
+ // Clear acknowledgement state but preserve the origin uid that was already set.
131
+ this.currentOriginState.acknowledged = false;
132
+ this.currentOriginState.serverTimeSentUs = BigInt(0);
133
+ this.currentOriginState.ackId = 0;
131
134
  this.currentLightingState = new LightingState();
132
135
  this.setupCommand.float32_draw_distance=10.0;
133
136
  if(this.scene)
@@ -305,19 +308,27 @@ class Client {
305
308
  let time_now_us=core.getTimestampUs();
306
309
  let originAckWaitTimeUs=BigInt(3000000);// three seconds
307
310
  if(this.setupCommand.startTimestamp_utc_unix_us==0)
311
+ {
312
+ console.log("Start timestamp is not set, so not sending origin.");
308
313
  return ;
314
+ }
309
315
  // If we sent it, and haven't timed out waiting for ack...
310
316
  if(this.currentOriginState.serverTimeSentUs!=BigInt(0)
311
317
  &&(time_now_us-this.currentOriginState.serverTimeSentUs)<originAckWaitTimeUs)
312
318
  {
319
+ console.log("Waiting for acknowledgement of SetOriginNodeCommand with origin uid "+this.currentOriginState.originClientHas+" and ackId "+this.currentOriginState.ackId+". Time since sent: "+(time_now_us-this.currentOriginState.serverTimeSentUs)+" us.");
313
320
  return;
314
321
  }
315
322
  if (!this.webRtcConnection)
316
323
  {
324
+ console.log("WebRTC connection is not established, so not sending origin.");
317
325
  return;
318
326
  }
319
327
  if(this.currentOriginState.originClientHas==BigInt(0))
328
+ {
329
+ console.log("Origin client has is 0, so not sending origin.");
320
330
  return;
331
+ }
321
332
  this.currentOriginState.valid_counter++;
322
333
  this.geometryService.SetOriginNode(this.currentOriginState.originClientHas);
323
334
  var setp=new command.SetOriginNodeCommand();
@@ -330,7 +341,9 @@ class Client {
330
341
  this.currentOriginState.ackId=setp.uint64_ackId;
331
342
  this.currentOriginState.acknowledged=false;
332
343
  this.currentOriginState.serverTimeSentUs=core.getTimestampUs();
344
+ console.log("\n===== NODE SERVER SENDING SETORIGINCOMMAND =====");
333
345
  console.log("Sending SetOriginNodeCommand with origin uid "+setp.uint64_originNodeUid+" and ackId "+setp.uint64_ackId);
346
+ console.log("\n===== END SETORIGINCOMMAND =====");
334
347
  this.SendCommand(setp);
335
348
  }
336
349
  SendLighting()
@@ -338,15 +351,20 @@ class Client {
338
351
  let time_now_us=core.getTimestampUs();
339
352
  let ackWaitTimeUs=BigInt(3000000);// three seconds
340
353
  if(this.setupCommand.startTimestamp_utc_unix_us==0)
354
+ {
355
+ console.log("Start timestamp is not set, so not sending lighting.");
341
356
  return;
357
+ }
342
358
  // If we sent it, and haven't timed out waiting for ack...
343
359
  if(this.currentLightingState.serverTimeSentUs!=BigInt(0)
344
360
  &&(time_now_us-this.currentLightingState.serverTimeSentUs)<ackWaitTimeUs)
345
361
  {
362
+ console.log("Waiting for acknowledgement of SetLightingCommand with ackId "+this.currentLightingState.ackId+". Time since sent: "+(time_now_us-this.currentLightingState.serverTimeSentUs)+" us.");
346
363
  return;
347
364
  }
348
365
  if (!this.webRtcConnection)
349
366
  {
367
+ console.log("WebRTC connection is not established, so not sending lighting.");
350
368
  return;
351
369
  }
352
370
 
@@ -42,7 +42,7 @@ class ClientManager
42
42
  return null;
43
43
  }
44
44
  var origin_uid=this.addClientNodeAndReturnOriginUid(clientID);
45
- if(origin_uid==0){
45
+ if(origin_uid==0) {
46
46
  error("Failed to create a root node for client "+clientID);
47
47
  return null;
48
48
  }
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "name": "teleportxr",
17
17
  "description": "Teleport Spatial Server on node.js",
18
- "version": "1.0.44",
18
+ "version": "1.0.46",
19
19
  "repository": {
20
20
  "type": "git",
21
21
  "url": "git+https://github.com/simul/teleport-nodejs.git"