@needle-tools/engine 4.4.0-beta.8 → 4.4.0-beta.9

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/dist/vendor.js CHANGED
@@ -11815,7 +11815,7 @@ class ec {
11815
11815
  return this._options.retry.backoff;
11816
11816
  }
11817
11817
  /**
11818
- * Whether the websocket was closed by the user. A websocket is closed by the user if the close().
11818
+ * Whether the websocket was closed by the user. A websocket is closed by the user by calling close().
11819
11819
  *
11820
11820
  * @return true if the websocket was closed by the user, false otherwise.
11821
11821
  */
@@ -11815,7 +11815,7 @@ class ec {
11815
11815
  return this._options.retry.backoff;
11816
11816
  }
11817
11817
  /**
11818
- * Whether the websocket was closed by the user. A websocket is closed by the user if the close().
11818
+ * Whether the websocket was closed by the user. A websocket is closed by the user by calling close().
11819
11819
  *
11820
11820
  * @return true if the websocket was closed by the user, false otherwise.
11821
11821
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@needle-tools/engine",
3
- "version": "4.4.0-beta.8",
4
- "description": "Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development with great integrations into editors like Unity or Blender - and can be deployed onto any device! It is flexible, extensible and networking and XR are built-in",
3
+ "version": "4.4.0-beta.9",
4
+ "description": "Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development with great integrations into editors like Unity or Blender - and can be deployed onto any device! It is flexible, extensible and networking and XR are built-in.",
5
5
  "main": "dist/needle-engine.min.js",
6
6
  "exports": {
7
7
  ".": {
@@ -122,7 +122,10 @@ export async function resolveLicense(args = null) {
122
122
  return null;
123
123
  }
124
124
  else if (!licenseResponse.ok) {
125
- console.error("[needle-license] ERROR: Failed to fetch license");
125
+ if (licenseResponse.status === 500)
126
+ console.error(`[needle-license] ERROR: Failed to fetch license (${licenseResponse.status})`);
127
+ else
128
+ console.log(`[needle-license] No license found (${licenseResponse.status})`);
126
129
  return null;
127
130
  }
128
131
 
@@ -138,7 +141,6 @@ function tryParseLicense(str) {
138
141
  try {
139
142
  /** @type {{needle_engine_license:string}} */
140
143
  const licenseJson = JSON.parse(str);
141
- console.log("\n");
142
144
  if (licenseJson.needle_engine_license) {
143
145
  console.log(`[needle-license] INFO: Successfully received \"${licenseJson.needle_engine_license?.toUpperCase()}\" license`)
144
146
  return licenseJson.needle_engine_license;
@@ -269,7 +271,9 @@ export async function getPublicIdentifier(project_id) {
269
271
  // we need to to wait for the root URL to return a response
270
272
  async function waitForLicenseServer() {
271
273
  // Make sure the licensing server is running
272
- runCommand("npx", ["--yes", NEEDLE_CLOUD_CLI_NAME, "start-server"]);
274
+ const startcmd = runCommand("npx", ["--yes", NEEDLE_CLOUD_CLI_NAME, "start-server"]);
275
+ let isRunning = true;
276
+ startcmd.then(() => isRunning = false);
273
277
 
274
278
  let attempts = 0;
275
279
  const maxAttempts = 10;
@@ -280,8 +284,18 @@ async function waitForLicenseServer() {
280
284
  signal: timeout
281
285
  }).catch(err => {
282
286
  if (err.cause?.code === "ECONNREFUSED") {
283
- console.warn("[needle-license] WARN: Stop waiting for license server because the connection was actively refused. (ECONNREFUSED)");
284
- attempts += maxAttempts;
287
+ if (!isRunning) {
288
+ console.error("[needle-license] ERR: Failed to connect to license server (ECONNREFUSED)");
289
+ }
290
+ else {
291
+ // Waiting for server to start
292
+ // EConnectRefuse happen if starting the license server for the first time
293
+ }
294
+ }
295
+ else {
296
+ if (attempts === maxAttempts) {
297
+ console.error("[needle-license] ERR: Failed to start license server...", err.message);
298
+ }
285
299
  }
286
300
  });
287
301
  if (response) {