teleportxr 1.0.35 → 1.0.36
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 +1 -0
- package/core/core.js +4 -2
- package/package.json +1 -1
package/client/client.js
CHANGED
|
@@ -157,6 +157,7 @@ class Client {
|
|
|
157
157
|
}
|
|
158
158
|
SendCommand(command){
|
|
159
159
|
let array=core.encodeToUint8Array(command);
|
|
160
|
+
console.log("SendCommand: encoded to", array.length, "bytes, expected", command.size(), "bytes");
|
|
160
161
|
this.signalingSend(array);
|
|
161
162
|
}
|
|
162
163
|
// We call StartStreaming once the SetupCommand has been acknowledged.
|
package/core/core.js
CHANGED
|
@@ -55,6 +55,7 @@ function SizeOfType(member) {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
function encodeIntoDataView(obj, dataView, byteOffset) {
|
|
58
|
+
const startOffset = byteOffset;
|
|
58
59
|
for (let [key, value] of Object.entries(obj)) {
|
|
59
60
|
let first_underscore = key.search('_');
|
|
60
61
|
var name = key.substring(first_underscore + 1, key.end);
|
|
@@ -87,10 +88,11 @@ function encodeIntoDataView(obj, dataView, byteOffset) {
|
|
|
87
88
|
if (sz == 0 || sz == NaN) {
|
|
88
89
|
throw new Error("Can't find size of " + key + " in " + obj.toString());
|
|
89
90
|
}
|
|
91
|
+
console.log("Offset " + byteOffset + ": " + sz + " bytes\t" + tp + " " + name + " = " + value.toString().substring(0, 20));
|
|
90
92
|
byteOffset += sz;
|
|
91
|
-
console.log(byteOffset + ": " + sz + " bytes\t\t" + tp + " " + name + " " + value.toString());
|
|
92
93
|
}
|
|
93
|
-
|
|
94
|
+
const totalSize = byteOffset - startOffset;
|
|
95
|
+
console.log("ENCODED TOTAL: " + totalSize + " bytes (offsets " + startOffset + " to " + byteOffset + ")\n");
|
|
94
96
|
return byteOffset;
|
|
95
97
|
}
|
|
96
98
|
|
package/package.json
CHANGED