@colyseus/sdk 0.17.33 → 0.17.34

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 (54) hide show
  1. package/LICENSE +2 -1
  2. package/README.md +27 -0
  3. package/build/3rd_party/discord.cjs +1 -1
  4. package/build/3rd_party/discord.mjs +1 -1
  5. package/build/Auth.cjs +1 -1
  6. package/build/Auth.mjs +1 -1
  7. package/build/Client.cjs +1 -1
  8. package/build/Client.mjs +1 -1
  9. package/build/Connection.cjs +1 -1
  10. package/build/Connection.mjs +1 -1
  11. package/build/HTTP.bkp.d.ts +103 -0
  12. package/build/HTTP.cjs +1 -1
  13. package/build/HTTP.mjs +1 -1
  14. package/build/HTTP_bkp.d.ts +18 -0
  15. package/build/Protocol.cjs +34 -0
  16. package/build/Protocol.cjs.map +1 -0
  17. package/build/Protocol.d.ts +21 -0
  18. package/build/Protocol.mjs +34 -0
  19. package/build/Protocol.mjs.map +1 -0
  20. package/build/Room.cjs +1 -1
  21. package/build/Room.mjs +1 -1
  22. package/build/Storage.cjs +1 -1
  23. package/build/Storage.mjs +1 -1
  24. package/build/core/nanoevents.cjs +1 -1
  25. package/build/core/nanoevents.mjs +1 -1
  26. package/build/core/signal.cjs +1 -1
  27. package/build/core/signal.mjs +1 -1
  28. package/build/core/utils.cjs +1 -1
  29. package/build/core/utils.mjs +1 -1
  30. package/build/debug.cjs +1 -1
  31. package/build/debug.mjs +1 -1
  32. package/build/errors/Errors.cjs +1 -1
  33. package/build/errors/Errors.mjs +1 -1
  34. package/build/index.cjs +1 -1
  35. package/build/index.mjs +1 -1
  36. package/build/legacy.cjs +1 -1
  37. package/build/legacy.mjs +1 -1
  38. package/build/serializer/NoneSerializer.cjs +1 -1
  39. package/build/serializer/NoneSerializer.mjs +1 -1
  40. package/build/serializer/SchemaSerializer.cjs +1 -1
  41. package/build/serializer/SchemaSerializer.mjs +1 -1
  42. package/build/serializer/Serializer.cjs +1 -1
  43. package/build/serializer/Serializer.mjs +1 -1
  44. package/build/transport/H3Transport.cjs +1 -1
  45. package/build/transport/H3Transport.mjs +1 -1
  46. package/build/transport/WebSocketTransport.cjs +1 -1
  47. package/build/transport/WebSocketTransport.mjs +1 -1
  48. package/dist/colyseus-cocos-creator.js +16 -4
  49. package/dist/colyseus-cocos-creator.js.map +1 -1
  50. package/dist/colyseus.d.ts +4148 -0
  51. package/dist/colyseus.js +16 -4
  52. package/dist/colyseus.js.map +1 -1
  53. package/dist/debug.js +1 -1
  54. package/package.json +1 -1
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.33 - @colyseus/schema 4.0.11
6
+ // colyseus.js@0.17.34 - @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) :
@@ -4218,7 +4218,11 @@
4218
4218
  const ref = changeTree.ref;
4219
4219
  // Assign unique `refId` to ref if it doesn't have one yet.
4220
4220
  if (ref[$refId] === undefined) {
4221
- ref[$refId] = this.getNextUniqueId();
4221
+ Object.defineProperty(ref, $refId, {
4222
+ value: this.getNextUniqueId(),
4223
+ enumerable: false,
4224
+ writable: true
4225
+ });
4222
4226
  }
4223
4227
  const refId = ref[$refId];
4224
4228
  const isNewChangeTree = (this.changeTrees[refId] === undefined);
@@ -4660,7 +4664,11 @@
4660
4664
  // for decoding
4661
4665
  addRef(refId, ref, incrementCount = true) {
4662
4666
  this.refs.set(refId, ref);
4663
- ref[$refId] = refId;
4667
+ Object.defineProperty(ref, $refId, {
4668
+ value: refId,
4669
+ enumerable: false,
4670
+ writable: true
4671
+ });
4664
4672
  if (incrementCount) {
4665
4673
  this.refCount[refId] = (this.refCount[refId] || 0) + 1;
4666
4674
  }
@@ -5352,11 +5360,15 @@
5352
5360
  const collection = instance[propertyName];
5353
5361
  // Collection not available yet. Listen for its availability before attaching the handler.
5354
5362
  if (!collection || collection[$refId] === undefined) {
5355
- removeHandler = this.addCallback(instance[$refId], propertyName, (value, _) => {
5363
+ let removePropertyCallback;
5364
+ removePropertyCallback = this.addCallback(instance[$refId], propertyName, (value, _) => {
5356
5365
  if (value !== null && value !== undefined) {
5366
+ // Remove the property listener now that collection is available
5367
+ removePropertyCallback();
5357
5368
  removeHandler = this.addCallback(value[$refId], operation, handler);
5358
5369
  }
5359
5370
  });
5371
+ removeHandler = removePropertyCallback;
5360
5372
  return removeOnAdd;
5361
5373
  }
5362
5374
  else {