teleportxr 1.0.51 → 1.0.53
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 +8 -4
- package/package.json +1 -1
package/client/client.js
CHANGED
|
@@ -267,8 +267,10 @@ class Client {
|
|
|
267
267
|
return;
|
|
268
268
|
}
|
|
269
269
|
var msg =new message.AcknowledgementMessage();
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
// data arrives from the WebSocket signaling channel as a Node Buffer (Uint8Array view over a pooled
|
|
271
|
+
// ArrayBuffer), so we must wrap its underlying buffer using byteOffset/byteLength rather than passing
|
|
272
|
+
// the Buffer directly to DataView.
|
|
273
|
+
var dataView =new DataView(data.buffer,data.byteOffset,data.byteLength);
|
|
272
274
|
core.decodeFromDataView(msg,dataView,0);
|
|
273
275
|
if(msg.uint64_ackId==this.currentOriginState.ackId)
|
|
274
276
|
{
|
|
@@ -557,9 +559,11 @@ class Client {
|
|
|
557
559
|
console.log("Handshake claims to have "<<handshakeMessage.uint64_resourceCount<<" resources but has only enough data for "+numReceived);
|
|
558
560
|
}
|
|
559
561
|
else {
|
|
562
|
+
// Wrap the Node Buffer correctly: use its underlying ArrayBuffer together with
|
|
563
|
+
// byteOffset (Buffers may share a pooled ArrayBuffer, so offset 0 is wrong).
|
|
564
|
+
var dataView =new DataView(data.buffer, data.byteOffset, data.byteLength);
|
|
560
565
|
var offset =message.HandshakeMessage.sizeof();
|
|
561
|
-
|
|
562
|
-
for(let i=0;i<this.handshakeMessage.resourceCount;i++ ) {
|
|
566
|
+
for(let i=0;i<handshakeMessage.uint64_resourceCount;i++ ) {
|
|
563
567
|
var uid=dataView.getBigUint64(offset,core.endian);
|
|
564
568
|
this.geometryService.ConfirmResource(uid);
|
|
565
569
|
offset+=core.UID_SIZE;
|
package/package.json
CHANGED