@colyseus/sdk 0.17.19 → 0.17.21
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/build/3rd_party/discord.cjs +1 -1
- package/build/3rd_party/discord.mjs +1 -1
- package/build/Auth.cjs +1 -1
- package/build/Auth.mjs +1 -1
- package/build/Client.cjs +1 -1
- package/build/Client.cjs.map +1 -1
- package/build/Client.d.ts +9 -9
- package/build/Client.mjs +1 -1
- package/build/Client.mjs.map +1 -1
- package/build/Connection.cjs +1 -1
- package/build/Connection.mjs +1 -1
- package/build/HTTP.cjs +1 -1
- package/build/HTTP.mjs +1 -1
- package/build/Room.cjs +2 -2
- package/build/Room.cjs.map +1 -1
- package/build/Room.d.ts +2 -2
- package/build/Room.mjs +2 -2
- package/build/Room.mjs.map +1 -1
- package/build/Storage.cjs +1 -1
- package/build/Storage.mjs +1 -1
- package/build/core/nanoevents.cjs +1 -1
- package/build/core/nanoevents.mjs +1 -1
- package/build/core/signal.cjs +1 -1
- package/build/core/signal.mjs +1 -1
- package/build/core/utils.cjs +1 -1
- package/build/core/utils.mjs +1 -1
- package/build/debug.cjs +1 -1
- package/build/debug.mjs +1 -1
- package/build/errors/Errors.cjs +1 -1
- package/build/errors/Errors.mjs +1 -1
- package/build/index.cjs +1 -1
- package/build/index.mjs +1 -1
- package/build/legacy.cjs +1 -1
- package/build/legacy.mjs +1 -1
- package/build/serializer/NoneSerializer.cjs +1 -1
- package/build/serializer/NoneSerializer.mjs +1 -1
- package/build/serializer/SchemaSerializer.cjs +1 -1
- package/build/serializer/SchemaSerializer.mjs +1 -1
- package/build/serializer/Serializer.cjs +1 -1
- package/build/serializer/Serializer.mjs +1 -1
- package/build/transport/H3Transport.cjs +1 -1
- package/build/transport/H3Transport.mjs +1 -1
- package/build/transport/WebSocketTransport.cjs +1 -1
- package/build/transport/WebSocketTransport.mjs +1 -1
- package/dist/colyseus-cocos-creator.js +15 -6
- package/dist/colyseus-cocos-creator.js.map +1 -1
- package/dist/colyseus.js +15 -6
- package/dist/colyseus.js.map +1 -1
- package/dist/debug.js +2 -2
- package/dist/debug.js.map +1 -1
- package/package.json +3 -3
- package/src/Client.ts +21 -21
- package/src/Room.ts +11 -3
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.
|
|
6
|
+
// colyseus.js@0.17.21 - @colyseus/schema 4.0.5
|
|
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) :
|
|
@@ -3831,6 +3831,15 @@
|
|
|
3831
3831
|
static is(type) {
|
|
3832
3832
|
return typeof (type[Symbol.metadata]) === "object";
|
|
3833
3833
|
}
|
|
3834
|
+
/**
|
|
3835
|
+
* Check if a value is an instance of Schema.
|
|
3836
|
+
* This method uses duck-typing to avoid issues with multiple @colyseus/schema versions.
|
|
3837
|
+
* @param obj Value to check
|
|
3838
|
+
* @returns true if the value is a Schema instance
|
|
3839
|
+
*/
|
|
3840
|
+
static isSchema(obj) {
|
|
3841
|
+
return typeof obj?.assign === "function";
|
|
3842
|
+
}
|
|
3834
3843
|
/**
|
|
3835
3844
|
* Track property changes
|
|
3836
3845
|
*/
|
|
@@ -5035,13 +5044,13 @@
|
|
|
5035
5044
|
// trigger onRemove on child structure.
|
|
5036
5045
|
//
|
|
5037
5046
|
if ((change.op & exports$1.OPERATION.DELETE) === exports$1.OPERATION.DELETE &&
|
|
5038
|
-
change.previousValue
|
|
5047
|
+
Schema.isSchema(change.previousValue)) {
|
|
5039
5048
|
const deleteCallbacks = callbacks[change.previousValue[$refId]]?.[exports$1.OPERATION.DELETE];
|
|
5040
5049
|
for (let i = deleteCallbacks?.length - 1; i >= 0; i--) {
|
|
5041
5050
|
deleteCallbacks[i]();
|
|
5042
5051
|
}
|
|
5043
5052
|
}
|
|
5044
|
-
if (ref
|
|
5053
|
+
if (Schema.isSchema(ref)) {
|
|
5045
5054
|
//
|
|
5046
5055
|
// Handle schema instance
|
|
5047
5056
|
//
|
|
@@ -5425,7 +5434,7 @@
|
|
|
5425
5434
|
// trigger onRemove on child structure.
|
|
5426
5435
|
//
|
|
5427
5436
|
if ((change.op & exports$1.OPERATION.DELETE) === exports$1.OPERATION.DELETE &&
|
|
5428
|
-
change.previousValue
|
|
5437
|
+
Schema.isSchema(change.previousValue)) {
|
|
5429
5438
|
const childRefId = change.previousValue[$refId];
|
|
5430
5439
|
const deleteCallbacks = this.callbacks[childRefId]?.[exports$1.OPERATION.DELETE];
|
|
5431
5440
|
if (deleteCallbacks) {
|
|
@@ -5434,7 +5443,7 @@
|
|
|
5434
5443
|
}
|
|
5435
5444
|
}
|
|
5436
5445
|
}
|
|
5437
|
-
if (ref
|
|
5446
|
+
if (Schema.isSchema(ref)) {
|
|
5438
5447
|
//
|
|
5439
5448
|
// Handle Schema instance
|
|
5440
5449
|
//
|
|
@@ -8558,7 +8567,7 @@
|
|
|
8558
8567
|
this.joinedAtTime = 0;
|
|
8559
8568
|
this.onMessageHandlers = createNanoEvents();
|
|
8560
8569
|
_Room_lastPingTime.set(this, 0);
|
|
8561
|
-
_Room_pingCallback.set(this,
|
|
8570
|
+
_Room_pingCallback.set(this, undefined);
|
|
8562
8571
|
this.name = name;
|
|
8563
8572
|
this.packr = new Packr();
|
|
8564
8573
|
// msgpackr workaround: force buffer to be created.
|