@colyseus/sdk 0.17.34 → 0.17.36
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/LICENSE +1 -2
- 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 +8 -3
- package/build/Room.cjs.map +1 -1
- package/build/Room.d.ts +6 -0
- package/build/Room.mjs +8 -3
- 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 +12 -11
- package/build/debug.cjs.map +1 -1
- package/build/debug.mjs +12 -11
- 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 +8 -3
- package/dist/colyseus-cocos-creator.js.map +1 -1
- package/dist/colyseus.js +8 -3
- package/dist/colyseus.js.map +1 -1
- package/dist/debug.js +12 -11
- package/dist/debug.js.map +1 -1
- package/package.json +2 -2
- package/src/Room.ts +15 -2
- package/src/debug.ts +11 -10
- package/README.md +0 -27
- package/build/HTTP.bkp.d.ts +0 -103
- package/build/HTTP_bkp.d.ts +0 -18
- package/build/Protocol.cjs +0 -34
- package/build/Protocol.cjs.map +0 -1
- package/build/Protocol.d.ts +0 -21
- package/build/Protocol.mjs +0 -34
- package/build/Protocol.mjs.map +0 -1
- package/dist/colyseus.d.ts +0 -4148
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.36 - @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) :
|
|
@@ -8603,6 +8603,7 @@
|
|
|
8603
8603
|
this.onJoin = createSignal();
|
|
8604
8604
|
// reconnection logic
|
|
8605
8605
|
this.reconnection = {
|
|
8606
|
+
enabled: true,
|
|
8606
8607
|
retryCount: 0,
|
|
8607
8608
|
maxRetries: 15,
|
|
8608
8609
|
delay: 100,
|
|
@@ -8650,7 +8651,7 @@
|
|
|
8650
8651
|
e.code === CloseCode.GOING_AWAY ||
|
|
8651
8652
|
e.code === CloseCode.MAY_TRY_RECONNECT) {
|
|
8652
8653
|
this.onDrop.invoke(e.code, e.reason);
|
|
8653
|
-
this.handleReconnection();
|
|
8654
|
+
this.handleReconnection(e.code, e.reason);
|
|
8654
8655
|
}
|
|
8655
8656
|
else {
|
|
8656
8657
|
this.onLeave.invoke(e.code, e.reason);
|
|
@@ -8889,7 +8890,11 @@
|
|
|
8889
8890
|
default: throw new Error("invalid message type.");
|
|
8890
8891
|
}
|
|
8891
8892
|
}
|
|
8892
|
-
handleReconnection() {
|
|
8893
|
+
handleReconnection(code, reason) {
|
|
8894
|
+
if (!this.reconnection.enabled) {
|
|
8895
|
+
this.onLeave.invoke(code, reason);
|
|
8896
|
+
return;
|
|
8897
|
+
}
|
|
8893
8898
|
if (Date.now() - this.joinedAtTime < this.reconnection.minUptime) {
|
|
8894
8899
|
console.info(`[Colyseus reconnection]: ${String.fromCodePoint(0x274C)} Room has not been up for long enough for automatic reconnection. (min uptime: ${this.reconnection.minUptime}ms)`); // ❌
|
|
8895
8900
|
this.onLeave.invoke(CloseCode.ABNORMAL_CLOSURE, "Room uptime too short for reconnection.");
|