@colyseus/sdk 0.17.35 → 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.
- 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 +1 -1
- package/build/HTTP.mjs +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 +22 -4
- package/build/debug.cjs.map +1 -1
- package/build/debug.mjs +22 -4
- 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 +1 -1
- package/dist/colyseus.js +1 -1
- package/dist/debug.js +22 -4
- package/dist/debug.js.map +1 -1
- package/package.json +1 -1
- package/src/debug.ts +19 -3
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.
|
|
6
|
+
// colyseus.js@0.17.37
|
|
7
7
|
import { Client } from './Client.mjs';
|
|
8
8
|
import { CloseCode } from '@colyseus/shared-types';
|
|
9
9
|
|
|
@@ -2345,10 +2345,11 @@ function applyMonkeyPatches() {
|
|
|
2345
2345
|
// Generate a consistent room ID
|
|
2346
2346
|
const roomId = room.roomId;
|
|
2347
2347
|
const sessionId = room.sessionId;
|
|
2348
|
-
// Generate unique panel ID: use
|
|
2349
|
-
|
|
2348
|
+
// Generate unique panel ID: use roomId + sessionId to avoid collisions
|
|
2349
|
+
// when the same sessionId is reused across rooms (e.g. QueueRoom handoff)
|
|
2350
|
+
const uniquePanelId = roomId + '_' + (sessionId && sessionId !== 'N/A' && sessionId !== ''
|
|
2350
2351
|
? sessionId
|
|
2351
|
-
:
|
|
2352
|
+
: Date.now() + '-' + Math.random().toString(36).substring(2, 9));
|
|
2352
2353
|
const transport = room.connection?.transport;
|
|
2353
2354
|
const endpoint = transport.ws?.url || 'N/A';
|
|
2354
2355
|
const debugInfo = {
|
|
@@ -2477,6 +2478,23 @@ function applyMonkeyPatches() {
|
|
|
2477
2478
|
return originalOnMessage.apply(this, arguments);
|
|
2478
2479
|
}
|
|
2479
2480
|
};
|
|
2481
|
+
// Monkey-patch: delay onclose so it fires AFTER any pending onmessage
|
|
2482
|
+
// callbacks scheduled via setTimeout (latency simulation). Without this,
|
|
2483
|
+
// onclose → onLeave → clearRefs() runs before delayed messages are
|
|
2484
|
+
// decoded, causing "refId not found" schema decoder errors.
|
|
2485
|
+
const originalOnClose = transport.events.onclose;
|
|
2486
|
+
transport.events.onclose = function (event) {
|
|
2487
|
+
if (preferences.latencySimulation.enabled && preferences.latencySimulation.delay > 0) {
|
|
2488
|
+
setTimeout(function () {
|
|
2489
|
+
if (originalOnClose)
|
|
2490
|
+
originalOnClose.call(this, event);
|
|
2491
|
+
}, preferences.latencySimulation.delay + 1);
|
|
2492
|
+
}
|
|
2493
|
+
else {
|
|
2494
|
+
if (originalOnClose)
|
|
2495
|
+
return originalOnClose.apply(this, arguments);
|
|
2496
|
+
}
|
|
2497
|
+
};
|
|
2480
2498
|
// Monkey-patch: sending messages through room connection
|
|
2481
2499
|
const originalSend = room.connection.send.bind(room.connection);
|
|
2482
2500
|
room.connection.send = function (data) {
|