bancho.js 0.11.0 → 0.11.2

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/CHANGELOG.md CHANGED
@@ -2,15 +2,28 @@
2
2
 
3
3
  ## Version 0.11
4
4
 
5
+ ### Version 0.11.2
6
+
7
+ - BanchoLobby: Fix mods listener never unset in `updateSettings`
8
+ Caused some "memory leak" warning (`MaxListenersExceededWarning`) to be fired (without any impact, per nodejs doc).
9
+ Rest assured, you'd have to execute a LOT of `updateSettings` call in the same lobby to notice any increase in resources usage...
10
+
11
+ - BanchoLobby: Fix `!mp settings` never firing again on user lookup error
12
+ Never encountered this, also the id should be in cache from the `playerJoined` event anyway, but there is always a possibility...
13
+
14
+ ### Version 0.11.1
15
+
16
+ - Fix typings compilation on recent TypeScript versions
17
+
5
18
  ### Version 0.11.0
6
19
 
7
20
  - **Add ability to set default gamemode for fetching users from API**
8
21
  In order to optimize API calls in your application, you can rely on bancho.js' existing API data.
9
- The new `gamemode` parameter in the bancho.js config object allows you to specify which gamemode data to receive when fetching an user to save more API calls in certain scenarios.
22
+ The new `gamemode` parameter in the bancho.js config object allows you to specify which gamemode data to receive when fetching an user to save more API calls in certain applications.
10
23
 
11
24
  - **BanchoLobby: When updating from an FFA to a team-based mode, reset teams**
12
- Whenn enabling teams, all players in the lobby are assigned a default team. They're assigned predictably based on their slots.
13
- bancho.js now applies the same algorithm when changing team mode.
25
+ When enabling teams, all players in the lobby are assigned a default team by Bancho. They're assigned predictably based on their slots.
26
+ bancho.js now applies the same logic when changing team mode.
14
27
 
15
28
  ## Version 0.10
16
29
 
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![NPM](https://nodei.co/npm/bancho.js.png?compact=true)](https://nodei.co/npm/bancho.js/)
4
4
  [![pipeline status](https://git.cartooncraft.fr/ThePooN/bancho.js/badges/master/pipeline.svg)](https://git.cartooncraft.fr/ThePooN/bancho.js/commits/master)
5
5
 
6
- ## Current release: 0.11.0
6
+ ## Current release: 0.11.2
7
7
 
8
8
  # Introduction
9
9
 
package/index.d.ts CHANGED
@@ -353,7 +353,7 @@ declare module "bancho.js" {
353
353
  * Current size of the lobby
354
354
  */
355
355
  size: number
356
- gamemode: nodesu.Mode[keyof nodesu.Mode]
356
+ gamemode: nodesu.ModeType
357
357
  /**
358
358
  * Beatmap fetched from the API (late/not as reliable, use beatmapId when possible)
359
359
  *
@@ -834,12 +834,13 @@ class BanchoLobby extends EventEmitter {
834
834
  amountOfPlayers = playersRegex.playersAmount;
835
835
  if(amountOfPlayers == 0) {
836
836
  this.pushSlotsUpdateQueue(() => {
837
- this.slots = this._createSlotsArray();
837
+ this.slots = slots;
838
838
  this.slotsUpdateCallback();
839
839
  if(initializeMods)
840
840
  this.mods = [];
841
- callerResolve();
842
841
  this.updateSettingsPromise = null;
842
+ this.removeListener("mods", modsListener);
843
+ callerResolve();
843
844
  });
844
845
  this.channel.removeListener("message", listener);
845
846
  }
@@ -891,12 +892,15 @@ class BanchoLobby extends EventEmitter {
891
892
  this.slotsUpdateCallback();
892
893
  if(initializeMods)
893
894
  this.mods = [];
894
- callerResolve();
895
895
  this.updateSettingsPromise = null;
896
+ this.removeListener("mods", modsListener);
897
+ callerResolve();
896
898
  });
897
899
  this.channel.removeListener("message", listener);
898
900
  }
899
901
  }, (err) => {
902
+ this.updateSettingsPromise = null;
903
+ this.removeListener("mods", modsListener);
900
904
  callerReject(err);
901
905
  });
902
906
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bancho.js",
3
- "version": "0.11.0",
3
+ "version": "0.11.2",
4
4
  "description": "Interface with Bancho over IRC, made easy and reliable",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",