teleportxr 1.0.43 → 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 +16 -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,6 +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 =====");
|
|
342
|
+
console.log("Sending SetOriginNodeCommand with origin uid "+setp.uint64_originNodeUid+" and ackId "+setp.uint64_ackId);
|
|
343
|
+
console.log("\n===== END SETORIGINCOMMAND =====");
|
|
333
344
|
this.SendCommand(setp);
|
|
334
345
|
}
|
|
335
346
|
SendLighting()
|
|
@@ -337,15 +348,20 @@ class Client {
|
|
|
337
348
|
let time_now_us=core.getTimestampUs();
|
|
338
349
|
let ackWaitTimeUs=BigInt(3000000);// three seconds
|
|
339
350
|
if(this.setupCommand.startTimestamp_utc_unix_us==0)
|
|
351
|
+
{
|
|
352
|
+
console.log("Start timestamp is not set, so not sending lighting.");
|
|
340
353
|
return;
|
|
354
|
+
}
|
|
341
355
|
// If we sent it, and haven't timed out waiting for ack...
|
|
342
356
|
if(this.currentLightingState.serverTimeSentUs!=BigInt(0)
|
|
343
357
|
&&(time_now_us-this.currentLightingState.serverTimeSentUs)<ackWaitTimeUs)
|
|
344
358
|
{
|
|
359
|
+
console.log("Waiting for acknowledgement of SetLightingCommand with ackId "+this.currentLightingState.ackId+". Time since sent: "+(time_now_us-this.currentLightingState.serverTimeSentUs)+" us.");
|
|
345
360
|
return;
|
|
346
361
|
}
|
|
347
362
|
if (!this.webRtcConnection)
|
|
348
363
|
{
|
|
364
|
+
console.log("WebRTC connection is not established, so not sending lighting.");
|
|
349
365
|
return;
|
|
350
366
|
}
|
|
351
367
|
|
package/package.json
CHANGED