@colyseus/sdk 0.17.36 → 0.17.38
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.mjs +1 -1
- package/build/Connection.cjs +1 -1
- package/build/Connection.mjs +1 -1
- package/build/HTTP.cjs +3 -4
- package/build/HTTP.cjs.map +1 -1
- package/build/HTTP.mjs +3 -4
- package/build/HTTP.mjs.map +1 -1
- package/build/Room.cjs +1 -1
- package/build/Room.mjs +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 +18 -1
- package/build/debug.cjs.map +1 -1
- package/build/debug.mjs +18 -1
- package/build/debug.mjs.map +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 +3 -4
- package/dist/colyseus-cocos-creator.js.map +1 -1
- package/dist/colyseus.js +3 -4
- package/dist/colyseus.js.map +1 -1
- package/dist/debug.js +18 -1
- package/dist/debug.js.map +1 -1
- package/package.json +3 -3
- package/src/HTTP.ts +2 -3
- package/src/debug.ts +15 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@colyseus/sdk",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.38",
|
|
4
4
|
"description": "Colyseus Multiplayer SDK for JavaScript/TypeScript",
|
|
5
5
|
"author": "Endel Dreyer",
|
|
6
6
|
"license": "MIT",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"typescript": "^5.9.3",
|
|
83
83
|
"vite": "^5.0.11",
|
|
84
84
|
"vitest": "^2.1.1",
|
|
85
|
-
"@colyseus/core": "^0.17.
|
|
85
|
+
"@colyseus/core": "^0.17.40"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
88
|
"@colyseus/core": "0.17.x"
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"scripts": {
|
|
99
|
-
"test": "vitest --dir test --reporter verbose",
|
|
99
|
+
"test": "vitest run --dir test --reporter verbose",
|
|
100
100
|
"start": "vite --config example/vite.config.ts",
|
|
101
101
|
"build": "rollup -c rollup.config.mjs",
|
|
102
102
|
"build-dist-dts": "dts-bundle-generator --config dts-generator.json",
|
package/src/HTTP.ts
CHANGED
|
@@ -525,11 +525,10 @@ export class HTTP<R extends Router | Router["endpoints"]> {
|
|
|
525
525
|
|
|
526
526
|
let data: any;
|
|
527
527
|
|
|
528
|
-
|
|
529
|
-
if (contentType?.indexOf("json")) {
|
|
528
|
+
if (contentType?.includes("json")) {
|
|
530
529
|
data = await raw.json();
|
|
531
530
|
|
|
532
|
-
} else if (contentType?.
|
|
531
|
+
} else if (contentType?.includes("text")) {
|
|
533
532
|
data = await raw.text();
|
|
534
533
|
|
|
535
534
|
} else {
|
package/src/debug.ts
CHANGED
|
@@ -2782,6 +2782,21 @@ function applyMonkeyPatches() {
|
|
|
2782
2782
|
}
|
|
2783
2783
|
};
|
|
2784
2784
|
|
|
2785
|
+
// Monkey-patch: delay onclose so it fires AFTER any pending onmessage
|
|
2786
|
+
// callbacks scheduled via setTimeout (latency simulation). Without this,
|
|
2787
|
+
// onclose → onLeave → clearRefs() runs before delayed messages are
|
|
2788
|
+
// decoded, causing "refId not found" schema decoder errors.
|
|
2789
|
+
const originalOnClose = transport.events.onclose;
|
|
2790
|
+
transport.events.onclose = function(event) {
|
|
2791
|
+
if (preferences.latencySimulation.enabled && preferences.latencySimulation.delay > 0) {
|
|
2792
|
+
setTimeout(function() {
|
|
2793
|
+
if (originalOnClose) originalOnClose.call(this, event);
|
|
2794
|
+
}, preferences.latencySimulation.delay + 1);
|
|
2795
|
+
} else {
|
|
2796
|
+
if (originalOnClose) return originalOnClose.apply(this, arguments);
|
|
2797
|
+
}
|
|
2798
|
+
};
|
|
2799
|
+
|
|
2785
2800
|
// Monkey-patch: sending messages through room connection
|
|
2786
2801
|
const originalSend = room.connection.send.bind(room.connection);
|
|
2787
2802
|
room.connection.send = function(data: any) {
|