@colyseus/sdk 0.17.19 → 0.17.20

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.
Files changed (45) hide show
  1. package/build/3rd_party/discord.cjs +1 -1
  2. package/build/3rd_party/discord.mjs +1 -1
  3. package/build/Auth.cjs +1 -1
  4. package/build/Auth.mjs +1 -1
  5. package/build/Client.cjs +1 -1
  6. package/build/Client.mjs +1 -1
  7. package/build/Connection.cjs +1 -1
  8. package/build/Connection.mjs +1 -1
  9. package/build/HTTP.cjs +1 -1
  10. package/build/HTTP.mjs +1 -1
  11. package/build/Room.cjs +1 -1
  12. package/build/Room.mjs +1 -1
  13. package/build/Storage.cjs +1 -1
  14. package/build/Storage.mjs +1 -1
  15. package/build/core/nanoevents.cjs +1 -1
  16. package/build/core/nanoevents.mjs +1 -1
  17. package/build/core/signal.cjs +1 -1
  18. package/build/core/signal.mjs +1 -1
  19. package/build/core/utils.cjs +1 -1
  20. package/build/core/utils.mjs +1 -1
  21. package/build/debug.cjs +1 -1
  22. package/build/debug.mjs +1 -1
  23. package/build/errors/Errors.cjs +1 -1
  24. package/build/errors/Errors.mjs +1 -1
  25. package/build/index.cjs +1 -1
  26. package/build/index.mjs +1 -1
  27. package/build/legacy.cjs +1 -1
  28. package/build/legacy.mjs +1 -1
  29. package/build/serializer/NoneSerializer.cjs +1 -1
  30. package/build/serializer/NoneSerializer.mjs +1 -1
  31. package/build/serializer/SchemaSerializer.cjs +1 -1
  32. package/build/serializer/SchemaSerializer.mjs +1 -1
  33. package/build/serializer/Serializer.cjs +1 -1
  34. package/build/serializer/Serializer.mjs +1 -1
  35. package/build/transport/H3Transport.cjs +1 -1
  36. package/build/transport/H3Transport.mjs +1 -1
  37. package/build/transport/WebSocketTransport.cjs +1 -1
  38. package/build/transport/WebSocketTransport.mjs +1 -1
  39. package/dist/colyseus-cocos-creator.js +14 -5
  40. package/dist/colyseus-cocos-creator.js.map +1 -1
  41. package/dist/colyseus.js +14 -5
  42. package/dist/colyseus.js.map +1 -1
  43. package/dist/debug.js +1 -1
  44. package/dist/debug.js.map +1 -1
  45. package/package.json +4 -4
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  'use strict';
8
8
 
9
9
  /**
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  /**
8
8
  * Discord Embedded App SDK
9
9
  * https://github.com/colyseus/colyseus/issues/707
package/build/Auth.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  'use strict';
8
8
 
9
9
  var tslib = require('tslib');
package/build/Auth.mjs CHANGED
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  import { getItem, removeItem, setItem } from './Storage.mjs';
8
8
  import { createNanoEvents } from './core/nanoevents.mjs';
9
9
 
package/build/Client.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  'use strict';
8
8
 
9
9
  var tslib = require('tslib');
package/build/Client.mjs CHANGED
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  import { Protocol, CloseCode } from '@colyseus/shared-types';
8
8
  import { ServerError, MatchMakeError } from './errors/Errors.mjs';
9
9
  import { Room } from './Room.mjs';
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  'use strict';
8
8
 
9
9
  var tslib = require('tslib');
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  import { H3TransportTransport } from './transport/H3Transport.mjs';
8
8
  import { WebSocketTransport } from './transport/WebSocketTransport.mjs';
9
9
  import { CloseCode } from '@colyseus/shared-types';
package/build/HTTP.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  'use strict';
8
8
 
9
9
  var tslib = require('tslib');
package/build/HTTP.mjs CHANGED
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  import { ServerError } from './errors/Errors.mjs';
8
8
 
9
9
  function isJSONSerializable(value) {
package/build/Room.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  'use strict';
8
8
 
9
9
  var tslib = require('tslib');
package/build/Room.mjs CHANGED
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  import { CloseCode, Protocol } from '@colyseus/shared-types';
8
8
  import { Decoder, encode, decode } from '@colyseus/schema';
9
9
  import { Packr, unpack } from '@colyseus/msgpackr';
package/build/Storage.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  'use strict';
8
8
 
9
9
  var tslib = require('tslib');
package/build/Storage.mjs CHANGED
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  /// <reference path="../typings/cocos-creator.d.ts" />
8
8
  /**
9
9
  * We do not assign 'storage' to window.localStorage immediatelly for React
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  'use strict';
8
8
 
9
9
  /**
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  /**
8
8
  * The MIT License (MIT)
9
9
  *
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  'use strict';
8
8
 
9
9
  class EventEmitter {
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  class EventEmitter {
8
8
  handlers = [];
9
9
  register(cb, once = false) {
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  'use strict';
8
8
 
9
9
  function now() {
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  function now() {
8
8
  return typeof (performance) !== 'undefined' ? performance.now() : Date.now();
9
9
  }
package/build/debug.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  'use strict';
8
8
 
9
9
  var Client = require('./Client.cjs');
package/build/debug.mjs CHANGED
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  import { Client } from './Client.mjs';
8
8
  import { CloseCode } from '@colyseus/shared-types';
9
9
 
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  'use strict';
8
8
 
9
9
  class ServerError extends Error {
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  class ServerError extends Error {
8
8
  code;
9
9
  headers;
package/build/index.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  'use strict';
8
8
 
9
9
  require('./legacy.cjs');
package/build/index.mjs CHANGED
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  import './legacy.mjs';
8
8
  export { Client, ColyseusSDK } from './Client.mjs';
9
9
  export { Room } from './Room.mjs';
package/build/legacy.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  'use strict';
8
8
 
9
9
  //
package/build/legacy.mjs CHANGED
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  //
8
8
  // Polyfills for legacy environments
9
9
  //
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  'use strict';
8
8
 
9
9
  class NoneSerializer {
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  class NoneSerializer {
8
8
  setState(rawState) { }
9
9
  getState() { return null; }
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  'use strict';
8
8
 
9
9
  var schema = require('@colyseus/schema');
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  import { getDecoderStateCallbacks, Reflection, Decoder } from '@colyseus/schema';
8
8
 
9
9
  //
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  'use strict';
8
8
 
9
9
  const serializers = {};
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  const serializers = {};
8
8
  function registerSerializer(id, serializer) {
9
9
  serializers[id] = serializer;
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  'use strict';
8
8
 
9
9
  var tslib = require('tslib');
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  import { encode, decode } from '@colyseus/schema';
8
8
 
9
9
  class H3TransportTransport {
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  'use strict';
8
8
 
9
9
  var NodeWebSocket = require('ws');
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19
6
+ // colyseus.js@0.17.20
7
7
  import NodeWebSocket from 'ws';
8
8
  import { CloseCode } from '@colyseus/shared-types';
9
9
 
@@ -3,7 +3,7 @@
3
3
  // This software is released under the MIT License.
4
4
  // https://opensource.org/license/MIT
5
5
  //
6
- // colyseus.js@0.17.19 - @colyseus/schema 4.0.4
6
+ // colyseus.js@0.17.20 - @colyseus/schema 4.0.5
7
7
  // THIS VERSION USES "XMLHttpRequest" INSTEAD OF "fetch" FOR COMPATIBILITY WITH COCOS CREATOR
8
8
  (function (global, factory) {
9
9
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
@@ -3832,6 +3832,15 @@
3832
3832
  static is(type) {
3833
3833
  return typeof (type[Symbol.metadata]) === "object";
3834
3834
  }
3835
+ /**
3836
+ * Check if a value is an instance of Schema.
3837
+ * This method uses duck-typing to avoid issues with multiple @colyseus/schema versions.
3838
+ * @param obj Value to check
3839
+ * @returns true if the value is a Schema instance
3840
+ */
3841
+ static isSchema(obj) {
3842
+ return typeof obj?.assign === "function";
3843
+ }
3835
3844
  /**
3836
3845
  * Track property changes
3837
3846
  */
@@ -5036,13 +5045,13 @@
5036
5045
  // trigger onRemove on child structure.
5037
5046
  //
5038
5047
  if ((change.op & exports$1.OPERATION.DELETE) === exports$1.OPERATION.DELETE &&
5039
- change.previousValue instanceof Schema) {
5048
+ Schema.isSchema(change.previousValue)) {
5040
5049
  const deleteCallbacks = callbacks[change.previousValue[$refId]]?.[exports$1.OPERATION.DELETE];
5041
5050
  for (let i = deleteCallbacks?.length - 1; i >= 0; i--) {
5042
5051
  deleteCallbacks[i]();
5043
5052
  }
5044
5053
  }
5045
- if (ref instanceof Schema) {
5054
+ if (Schema.isSchema(ref)) {
5046
5055
  //
5047
5056
  // Handle schema instance
5048
5057
  //
@@ -5426,7 +5435,7 @@
5426
5435
  // trigger onRemove on child structure.
5427
5436
  //
5428
5437
  if ((change.op & exports$1.OPERATION.DELETE) === exports$1.OPERATION.DELETE &&
5429
- change.previousValue instanceof Schema) {
5438
+ Schema.isSchema(change.previousValue)) {
5430
5439
  const childRefId = change.previousValue[$refId];
5431
5440
  const deleteCallbacks = this.callbacks[childRefId]?.[exports$1.OPERATION.DELETE];
5432
5441
  if (deleteCallbacks) {
@@ -5435,7 +5444,7 @@
5435
5444
  }
5436
5445
  }
5437
5446
  }
5438
- if (ref instanceof Schema) {
5447
+ if (Schema.isSchema(ref)) {
5439
5448
  //
5440
5449
  // Handle Schema instance
5441
5450
  //