bancho.js 0.12.1 → 0.12.3
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/.gitlab-ci.yml +2 -0
- package/CHANGELOG.md +9 -0
- package/README.md +1 -1
- package/lib/BanchoUser.js +4 -0
- package/lib/Multiplayer/Enums/BanchoMods.js +8 -4
- package/package.json +1 -1
- package/tests/units/WhereUnit.js +7 -1
package/.gitlab-ci.yml
CHANGED
|
@@ -15,6 +15,7 @@ eslint:
|
|
|
15
15
|
|
|
16
16
|
irc:
|
|
17
17
|
stage: test
|
|
18
|
+
resource_group: irc
|
|
18
19
|
script:
|
|
19
20
|
- npm config set script-shell "/bin/bash"
|
|
20
21
|
- npm i
|
|
@@ -23,6 +24,7 @@ irc:
|
|
|
23
24
|
|
|
24
25
|
irc-with-weak-value-map:
|
|
25
26
|
stage: test
|
|
27
|
+
resource_group: irc
|
|
26
28
|
script:
|
|
27
29
|
- npm config set script-shell "/bin/bash"
|
|
28
30
|
- npm i
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
## Version 0.12
|
|
4
4
|
|
|
5
|
+
### Version 0.12.3
|
|
6
|
+
|
|
7
|
+
- Catch undefined location response
|
|
8
|
+
|
|
9
|
+
### Version 0.12.2
|
|
10
|
+
|
|
11
|
+
- Update BanchoMods
|
|
12
|
+
See https://git.cartooncraft.fr/ThePooN/bancho.js/-/commit/799862a6ef404e4068ea35cb8a2a6f319178871c
|
|
13
|
+
|
|
5
14
|
### Version 0.12.1
|
|
6
15
|
|
|
7
16
|
- Only unready affected player on team change
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://nodei.co/npm/bancho.js/)
|
|
4
4
|
[](https://git.cartooncraft.fr/ThePooN/bancho.js/commits/master)
|
|
5
5
|
|
|
6
|
-
## Current release: 0.12.
|
|
6
|
+
## Current release: 0.12.3
|
|
7
7
|
|
|
8
8
|
# Introduction
|
|
9
9
|
|
package/lib/BanchoUser.js
CHANGED
|
@@ -201,6 +201,10 @@ class BanchoUser extends EventEmitter {
|
|
|
201
201
|
reject(new Error("User is offline"));
|
|
202
202
|
return afterAnswer();
|
|
203
203
|
}
|
|
204
|
+
if(message.message == "The user's location could not be determined.") {
|
|
205
|
+
reject(new Error("User's location could not be determined"));
|
|
206
|
+
return afterAnswer();
|
|
207
|
+
}
|
|
204
208
|
const m = answerRegex.exec(message.message);
|
|
205
209
|
if(m && m[1] == this.ircUsername) {
|
|
206
210
|
resolve(m[2]);
|
|
@@ -4,6 +4,7 @@ const Enum = Object.freeze({
|
|
|
4
4
|
None: new BanchoMod(0, "none", "None"),
|
|
5
5
|
NoFail: new BanchoMod(1, "nf", "NoFail"),
|
|
6
6
|
Easy: new BanchoMod(2, "ez", "Easy"),
|
|
7
|
+
TouchDevice: new BanchoMod(4, "td", "TouchDevice"),
|
|
7
8
|
Hidden: new BanchoMod(8, "hd", "Hidden"),
|
|
8
9
|
HardRock: new BanchoMod(16, "hr", "HardRock"),
|
|
9
10
|
SuddenDeath: new BanchoMod(32, "sd", "SuddenDeath"),
|
|
@@ -12,7 +13,7 @@ const Enum = Object.freeze({
|
|
|
12
13
|
HalfTime: new BanchoMod(256, "ht", "HalfTime"),
|
|
13
14
|
Nightcore: new BanchoMod(512, "nc", "Nightcore"),
|
|
14
15
|
Flashlight: new BanchoMod(1024, "fl", "Flashlight"),
|
|
15
|
-
Autoplay: new BanchoMod(2048, "at", "
|
|
16
|
+
Autoplay: new BanchoMod(2048, "at", "Autoplay"),
|
|
16
17
|
SpunOut: new BanchoMod(4096, "so", "SpunOut"),
|
|
17
18
|
Relax2: new BanchoMod(8192, "ap", "Relax2"),
|
|
18
19
|
Perfect: new BanchoMod(16384, "pf", "Perfect"),
|
|
@@ -23,12 +24,15 @@ const Enum = Object.freeze({
|
|
|
23
24
|
Key8: new BanchoMod(524288, "k8", "Key8"),
|
|
24
25
|
FadeIn: new BanchoMod(1048576, "fi", "FadeIn"),
|
|
25
26
|
Random: new BanchoMod(2097152, "rn", "Random"),
|
|
26
|
-
|
|
27
|
+
Cinema: new BanchoMod(4194304, "cm", "Cinema"),
|
|
28
|
+
Target: new BanchoMod(8388608, "tp", "Target"),
|
|
27
29
|
Key9: new BanchoMod(16777216, "k9", "Key9"),
|
|
28
|
-
|
|
30
|
+
KeyCoop: new BanchoMod(33554432, "co", "KeyCoop"),
|
|
29
31
|
Key1: new BanchoMod(67108864, "k1", "Key1"),
|
|
30
32
|
Key3: new BanchoMod(134217728, "k3", "Key3"),
|
|
31
|
-
Key2: new BanchoMod(268435456, "k2", "Key2")
|
|
33
|
+
Key2: new BanchoMod(268435456, "k2", "Key2"),
|
|
34
|
+
ScoreV2: new BanchoMod(536870912, "sv2", "ScoreV2"),
|
|
35
|
+
Mirror: new BanchoMod(1073741824, "mr", "Mirror"),
|
|
32
36
|
});
|
|
33
37
|
|
|
34
38
|
/**
|
package/package.json
CHANGED
package/tests/units/WhereUnit.js
CHANGED
|
@@ -9,7 +9,13 @@ class WhereUnit extends TestUnit {
|
|
|
9
9
|
|
|
10
10
|
run() {
|
|
11
11
|
return new Promise((resolve, reject) =>
|
|
12
|
-
this.client.getSelf().where()
|
|
12
|
+
this.client.getSelf().where()
|
|
13
|
+
.then(() => resolve(this.fulFillGoal(TestGoals.Where)))
|
|
14
|
+
.catch((err) => {
|
|
15
|
+
if(err && err.message === "User's location could not be determined")
|
|
16
|
+
return resolve(this.fulFillGoal(TestGoals.Where));
|
|
17
|
+
reject(err);
|
|
18
|
+
})
|
|
13
19
|
);
|
|
14
20
|
}
|
|
15
21
|
}
|