@colyseus/sdk 0.17.36 → 0.17.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.
Files changed (46) 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 +18 -1
  22. package/build/debug.cjs.map +1 -1
  23. package/build/debug.mjs +18 -1
  24. package/build/debug.mjs.map +1 -1
  25. package/build/errors/Errors.cjs +1 -1
  26. package/build/errors/Errors.mjs +1 -1
  27. package/build/index.cjs +1 -1
  28. package/build/index.mjs +1 -1
  29. package/build/legacy.cjs +1 -1
  30. package/build/legacy.mjs +1 -1
  31. package/build/serializer/NoneSerializer.cjs +1 -1
  32. package/build/serializer/NoneSerializer.mjs +1 -1
  33. package/build/serializer/SchemaSerializer.cjs +1 -1
  34. package/build/serializer/SchemaSerializer.mjs +1 -1
  35. package/build/serializer/Serializer.cjs +1 -1
  36. package/build/serializer/Serializer.mjs +1 -1
  37. package/build/transport/H3Transport.cjs +1 -1
  38. package/build/transport/H3Transport.mjs +1 -1
  39. package/build/transport/WebSocketTransport.cjs +1 -1
  40. package/build/transport/WebSocketTransport.mjs +1 -1
  41. package/dist/colyseus-cocos-creator.js +1 -1
  42. package/dist/colyseus.js +1 -1
  43. package/dist/debug.js +18 -1
  44. package/dist/debug.js.map +1 -1
  45. package/package.json +1 -1
  46. package/src/debug.ts +15 -0
@@ -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.36
6
+ // colyseus.js@0.17.37
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.36
6
+ // colyseus.js@0.17.37
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.36
6
+ // colyseus.js@0.17.37
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.36
6
+ // colyseus.js@0.17.37
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.36
6
+ // colyseus.js@0.17.37
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.36
6
+ // colyseus.js@0.17.37
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.36
6
+ // colyseus.js@0.17.37
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.36
6
+ // colyseus.js@0.17.37
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.36
6
+ // colyseus.js@0.17.37
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.36
6
+ // colyseus.js@0.17.37
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.36
6
+ // colyseus.js@0.17.37
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.36
6
+ // colyseus.js@0.17.37
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.36
6
+ // colyseus.js@0.17.37
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.36
6
+ // colyseus.js@0.17.37
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.36
6
+ // colyseus.js@0.17.37
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.36
6
+ // colyseus.js@0.17.37
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.36 - @colyseus/schema 4.0.13
6
+ // colyseus.js@0.17.37 - @colyseus/schema 4.0.13
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) :
package/dist/colyseus.js 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.36 - @colyseus/schema 4.0.13
6
+ // colyseus.js@0.17.37 - @colyseus/schema 4.0.13
7
7
  (function (global, factory) {
8
8
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
9
9
  typeof define === 'function' && define.amd ? define('@colyseus/sdk', ['exports'], factory) :
package/dist/debug.js 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.36
6
+ // colyseus.js@0.17.37
7
7
  (function (Client_ts, sharedTypes) {
8
8
  'use strict';
9
9
 
@@ -2485,6 +2485,23 @@
2485
2485
  return originalOnMessage.apply(this, arguments);
2486
2486
  }
2487
2487
  };
2488
+ // Monkey-patch: delay onclose so it fires AFTER any pending onmessage
2489
+ // callbacks scheduled via setTimeout (latency simulation). Without this,
2490
+ // onclose → onLeave → clearRefs() runs before delayed messages are
2491
+ // decoded, causing "refId not found" schema decoder errors.
2492
+ const originalOnClose = transport.events.onclose;
2493
+ transport.events.onclose = function (event) {
2494
+ if (preferences.latencySimulation.enabled && preferences.latencySimulation.delay > 0) {
2495
+ setTimeout(function () {
2496
+ if (originalOnClose)
2497
+ originalOnClose.call(this, event);
2498
+ }, preferences.latencySimulation.delay + 1);
2499
+ }
2500
+ else {
2501
+ if (originalOnClose)
2502
+ return originalOnClose.apply(this, arguments);
2503
+ }
2504
+ };
2488
2505
  // Monkey-patch: sending messages through room connection
2489
2506
  const originalSend = room.connection.send.bind(room.connection);
2490
2507
  room.connection.send = function (data) {