teleportxr 1.0.35 → 1.0.37

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
@@ -143,9 +143,26 @@ class Client {
143
143
  }
144
144
  }
145
145
 
146
- // Log the setup command for debugging
146
+ // Log the setup command for debugging - in the CORRECT C++ struct byte order
147
147
  console.log("\n===== NODE SERVER SENDING SETUPCOMMAND =====");
148
- console.log(JSON.stringify(this.setupCommand, (key, value) => {
148
+ const logObj = {
149
+ CommandPayloadType: this.setupCommand.CommandPayloadType_commandPayloadType,
150
+ debug_stream: this.setupCommand.uint32_debug_stream,
151
+ debug_network_packets: this.setupCommand.uint32_debug_network_packets,
152
+ requiredLatencyMs: this.setupCommand.int32_requiredLatencyMs,
153
+ idle_connection_timeout: this.setupCommand.uint32_idle_connection_timeout,
154
+ session_id: this.setupCommand.uint64_session_id,
155
+ video_config: this.setupCommand.VideoConfig_video_config,
156
+ draw_distance: this.setupCommand.float32_draw_distance,
157
+ axesStandard: this.setupCommand.AxesStandard_axesStandard,
158
+ audio_input_enabled: this.setupCommand.uint8_audio_input_enabled,
159
+ using_ssl: this.setupCommand.bool_using_ssl,
160
+ startTimestamp_utc_unix_us: this.setupCommand.int64_startTimestamp_utc_unix_us,
161
+ backgroundMode: this.setupCommand.BackgroundMode_backgroundMode,
162
+ backgroundColour: this.setupCommand.vec4_backgroundColour,
163
+ backgroundTexture: this.setupCommand.uid_backgroundTexture
164
+ };
165
+ console.log(JSON.stringify(logObj, (key, value) => {
149
166
  if (typeof value === 'bigint') {
150
167
  return value.toString();
151
168
  }
@@ -157,6 +174,7 @@ class Client {
157
174
  }
158
175
  SendCommand(command){
159
176
  let array=core.encodeToUint8Array(command);
177
+ console.log("SendCommand: encoded to", array.length, "bytes, expected", command.size(), "bytes");
160
178
  this.signalingSend(array);
161
179
  }
162
180
  // 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
- console.log("Total size: " + byteOffset + "\n");
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
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "name": "teleportxr",
17
17
  "description": "Teleport Spatial Server on node.js",
18
- "version": "1.0.35",
18
+ "version": "1.0.37",
19
19
  "repository": {
20
20
  "type": "git",
21
21
  "url": "git+https://github.com/simul/teleport-nodejs.git"