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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "yolkbot",
3
3
  "description": "create a shell shockers (self) bot in under 10 lines.",
4
- "version": "0.1.1-alpha.28",
4
+ "version": "0.1.1-alpha.29",
5
5
  "keywords": [
6
6
  "shell shockers",
7
7
  "shellshock.io",
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) {