teleportxr 1.0.44 → 1.0.45
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 +15 -0
- package/package.json +1 -1
package/client/client.js
CHANGED
|
@@ -305,19 +305,27 @@ class Client {
|
|
|
305
305
|
let time_now_us=core.getTimestampUs();
|
|
306
306
|
let originAckWaitTimeUs=BigInt(3000000);// three seconds
|
|
307
307
|
if(this.setupCommand.startTimestamp_utc_unix_us==0)
|
|
308
|
+
{
|
|
309
|
+
console.log("Start timestamp is not set, so not sending origin.");
|
|
308
310
|
return ;
|
|
311
|
+
}
|
|
309
312
|
// If we sent it, and haven't timed out waiting for ack...
|
|
310
313
|
if(this.currentOriginState.serverTimeSentUs!=BigInt(0)
|
|
311
314
|
&&(time_now_us-this.currentOriginState.serverTimeSentUs)<originAckWaitTimeUs)
|
|
312
315
|
{
|
|
316
|
+
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
317
|
return;
|
|
314
318
|
}
|
|
315
319
|
if (!this.webRtcConnection)
|
|
316
320
|
{
|
|
321
|
+
console.log("WebRTC connection is not established, so not sending origin.");
|
|
317
322
|
return;
|
|
318
323
|
}
|
|
319
324
|
if(this.currentOriginState.originClientHas==BigInt(0))
|
|
325
|
+
{
|
|
326
|
+
console.log("Origin client has is 0, so not sending origin.");
|
|
320
327
|
return;
|
|
328
|
+
}
|
|
321
329
|
this.currentOriginState.valid_counter++;
|
|
322
330
|
this.geometryService.SetOriginNode(this.currentOriginState.originClientHas);
|
|
323
331
|
var setp=new command.SetOriginNodeCommand();
|
|
@@ -330,7 +338,9 @@ class Client {
|
|
|
330
338
|
this.currentOriginState.ackId=setp.uint64_ackId;
|
|
331
339
|
this.currentOriginState.acknowledged=false;
|
|
332
340
|
this.currentOriginState.serverTimeSentUs=core.getTimestampUs();
|
|
341
|
+
console.log("\n===== NODE SERVER SENDING SETORIGINCOMMAND =====");
|
|
333
342
|
console.log("Sending SetOriginNodeCommand with origin uid "+setp.uint64_originNodeUid+" and ackId "+setp.uint64_ackId);
|
|
343
|
+
console.log("\n===== END SETORIGINCOMMAND =====");
|
|
334
344
|
this.SendCommand(setp);
|
|
335
345
|
}
|
|
336
346
|
SendLighting()
|
|
@@ -338,15 +348,20 @@ class Client {
|
|
|
338
348
|
let time_now_us=core.getTimestampUs();
|
|
339
349
|
let ackWaitTimeUs=BigInt(3000000);// three seconds
|
|
340
350
|
if(this.setupCommand.startTimestamp_utc_unix_us==0)
|
|
351
|
+
{
|
|
352
|
+
console.log("Start timestamp is not set, so not sending lighting.");
|
|
341
353
|
return;
|
|
354
|
+
}
|
|
342
355
|
// If we sent it, and haven't timed out waiting for ack...
|
|
343
356
|
if(this.currentLightingState.serverTimeSentUs!=BigInt(0)
|
|
344
357
|
&&(time_now_us-this.currentLightingState.serverTimeSentUs)<ackWaitTimeUs)
|
|
345
358
|
{
|
|
359
|
+
console.log("Waiting for acknowledgement of SetLightingCommand with ackId "+this.currentLightingState.ackId+". Time since sent: "+(time_now_us-this.currentLightingState.serverTimeSentUs)+" us.");
|
|
346
360
|
return;
|
|
347
361
|
}
|
|
348
362
|
if (!this.webRtcConnection)
|
|
349
363
|
{
|
|
364
|
+
console.log("WebRTC connection is not established, so not sending lighting.");
|
|
350
365
|
return;
|
|
351
366
|
}
|
|
352
367
|
|
package/package.json
CHANGED