yolkbot 0.1.1-alpha.28 → 0.1.1-alpha.29
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/browser/build/global.js +1 -1
- package/browser/build/module.js +1 -1
- package/package.json +1 -1
- package/src/bot.js +3 -2
package/package.json
CHANGED
package/src/bot.js
CHANGED
|
@@ -561,6 +561,7 @@ export class Bot {
|
|
|
561
561
|
this.game.socket.onclose = (e) => {
|
|
562
562
|
// console.log('Game socket closed:', e.code, Object.entries(CloseCode).filter(([, v]) => v == e.code));
|
|
563
563
|
this.emit('close', e.code);
|
|
564
|
+
this.quit(true, true);
|
|
564
565
|
}
|
|
565
566
|
}
|
|
566
567
|
|
|
@@ -1867,7 +1868,7 @@ export class Bot {
|
|
|
1867
1868
|
return result;
|
|
1868
1869
|
}
|
|
1869
1870
|
|
|
1870
|
-
quit(noCleanup = false) {
|
|
1871
|
+
quit(noCleanup = false, finishDispatches = false) {
|
|
1871
1872
|
if (this.intents.includes(this.Intents.PLAYER_HEALTH))
|
|
1872
1873
|
clearInterval(this.healthIntervalId);
|
|
1873
1874
|
|
|
@@ -1876,7 +1877,7 @@ export class Bot {
|
|
|
1876
1877
|
this.game.socket.close();
|
|
1877
1878
|
this.matchmaker.close();
|
|
1878
1879
|
|
|
1879
|
-
this._dispatches = [];
|
|
1880
|
+
if (!finishDispatches) this._dispatches = [];
|
|
1880
1881
|
this._packetQueue = [];
|
|
1881
1882
|
|
|
1882
1883
|
if (!noCleanup) {
|