hypixel-api-reborn 10.0.0 → 11.0.0
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/.prettierrc +13 -0
- package/README.md +27 -15
- package/package.json +60 -58
- package/src/API/getAPIStatus.js +8 -8
- package/src/API/getBoosters.js +6 -6
- package/src/API/getGameCounts.js +6 -6
- package/src/API/getGuild.js +18 -18
- package/src/API/getLeaderboards.js +13 -13
- package/src/API/getPlayer.js +22 -27
- package/src/API/getRecentGames.js +18 -18
- package/src/API/getServerInfo.js +66 -77
- package/src/API/getStatus.js +8 -8
- package/src/API/getWatchdogStats.js +6 -6
- package/src/API/index.js +19 -23
- package/src/API/skyblock/getEndedSkyblockAuctions.js +10 -10
- package/src/API/skyblock/getSkyblockAuctions.js +64 -64
- package/src/API/skyblock/getSkyblockAuctionsByPlayer.js +11 -11
- package/src/API/skyblock/getSkyblockBazaar.js +10 -10
- package/src/API/skyblock/getSkyblockMember.js +28 -25
- package/src/API/skyblock/getSkyblockNews.js +6 -6
- package/src/API/skyblock/getSkyblockProfiles.js +44 -41
- package/src/Client.js +406 -450
- package/src/Errors.js +44 -39
- package/src/Private/defaultCache.js +77 -78
- package/src/Private/rateLimit.js +79 -98
- package/src/Private/requests.js +65 -54
- package/src/Private/updater.js +45 -45
- package/src/Private/uuidCache.js +37 -33
- package/src/Private/validate.js +97 -97
- package/src/index.js +82 -83
- package/src/structures/APIIncident.js +78 -78
- package/src/structures/APIStatus.js +47 -47
- package/src/structures/Boosters/Booster.js +83 -87
- package/src/structures/Color.js +129 -129
- package/src/structures/Game.js +164 -160
- package/src/structures/GameCounts.js +151 -151
- package/src/structures/Guild/Guild.js +204 -218
- package/src/structures/Guild/GuildMember.js +66 -66
- package/src/structures/Guild/GuildRank.js +48 -48
- package/src/structures/ItemBytes.js +33 -36
- package/src/structures/Leaderboard.js +31 -31
- package/src/structures/MiniGames/Arcade.js +567 -569
- package/src/structures/MiniGames/ArenaBrawl.js +52 -56
- package/src/structures/MiniGames/BedWars.js +423 -351
- package/src/structures/MiniGames/BlitzSurvivalGames.js +172 -148
- package/src/structures/MiniGames/BuildBattle.js +53 -53
- package/src/structures/MiniGames/CopsAndCrims.js +90 -90
- package/src/structures/MiniGames/Duels.js +694 -630
- package/src/structures/MiniGames/MegaWalls.js +137 -137
- package/src/structures/MiniGames/MurderMystery.js +93 -93
- package/src/structures/MiniGames/Paintball.js +67 -67
- package/src/structures/MiniGames/Pit.js +19 -19
- package/src/structures/MiniGames/Quakecraft.js +101 -101
- package/src/structures/MiniGames/SkyWars.js +508 -559
- package/src/structures/MiniGames/SmashHeroes.js +144 -151
- package/src/structures/MiniGames/SpeedUHC.js +115 -57
- package/src/structures/MiniGames/TNTGames.js +116 -116
- package/src/structures/MiniGames/TurboKartRacers.js +201 -176
- package/src/structures/MiniGames/UHC.js +164 -143
- package/src/structures/MiniGames/VampireZ.js +60 -60
- package/src/structures/MiniGames/Walls.js +52 -52
- package/src/structures/MiniGames/Warlords.js +62 -62
- package/src/structures/MiniGames/WoolWars.js +123 -0
- package/src/structures/Pet.js +96 -97
- package/src/structures/Pets.js +64 -64
- package/src/structures/Player.js +433 -449
- package/src/structures/PlayerCosmetics.js +100 -95
- package/src/structures/RecentGame.js +57 -57
- package/src/structures/ServerInfo.js +78 -78
- package/src/structures/SkyBlock/Auctions/Auction.js +104 -104
- package/src/structures/SkyBlock/Auctions/AuctionInfo.js +54 -54
- package/src/structures/SkyBlock/Auctions/BaseAuction.js +45 -45
- package/src/structures/SkyBlock/Auctions/Bid.js +48 -48
- package/src/structures/SkyBlock/Auctions/PartialAuction.js +25 -25
- package/src/structures/SkyBlock/Bazzar/Order.js +38 -38
- package/src/structures/SkyBlock/Bazzar/Product.js +53 -53
- package/src/structures/SkyBlock/News/SkyblockNews.js +60 -68
- package/src/structures/SkyBlock/SkyblockInventoryItem.js +124 -130
- package/src/structures/SkyBlock/SkyblockMember.js +820 -687
- package/src/structures/SkyBlock/SkyblockPet.js +71 -71
- package/src/structures/SkyBlock/SkyblockProfile.js +60 -60
- package/src/structures/Status.js +41 -41
- package/src/structures/Watchdog/Stats.js +36 -36
- package/src/utils/Constants.js +2789 -809
- package/src/utils/SkyblockUtils.js +208 -164
- package/src/utils/arrayTools.js +4 -4
- package/src/utils/divide.js +5 -5
- package/src/utils/guildExp.js +57 -67
- package/src/utils/index.js +13 -13
- package/src/utils/isGuildID.js +3 -3
- package/src/utils/isUUID.js +5 -5
- package/src/utils/oscillation.js +15 -23
- package/src/utils/removeSnakeCase.js +22 -35
- package/src/utils/rgbToHexColor.js +8 -8
- package/src/utils/romanize.js +11 -13
- package/src/utils/toIGN.js +20 -20
- package/src/utils/toUuid.js +19 -19
- package/src/utils/varInt.js +17 -21
- package/typings/index.d.ts +3532 -2644
- package/src/API/getFriends.js +0 -14
- package/src/API/getKeyInfo.js +0 -10
- package/src/API/getRankedSkyWars.js +0 -11
- package/src/structures/Friend.js +0 -38
- package/src/structures/KeyInfo.js +0 -42
- package/src/structures/MiniGames/SkyWarsRanked.js +0 -45
package/src/structures/Game.js
CHANGED
|
@@ -1,160 +1,164 @@
|
|
|
1
|
-
const { games } = require('../utils/Constants');
|
|
2
|
-
/**
|
|
3
|
-
* Game class
|
|
4
|
-
*/
|
|
5
|
-
class Game {
|
|
6
|
-
/**
|
|
7
|
-
* @param {GameId|GameCode} game Game ID or Game Code
|
|
8
|
-
*/
|
|
9
|
-
constructor
|
|
10
|
-
/**
|
|
11
|
-
* Input
|
|
12
|
-
* @type {GameId|GameCode}
|
|
13
|
-
*/
|
|
14
|
-
this.game = game.toString().toLowerCase();
|
|
15
|
-
const result = games.find((g) => g.code.toLowerCase() === this.game || g.id.toString() === this.game || g.name.toLowerCase() === this.game);
|
|
16
|
-
/**
|
|
17
|
-
* ID of game
|
|
18
|
-
* @type {GameId}
|
|
19
|
-
*/
|
|
20
|
-
this.id = result ? result.id : 'Not Found';
|
|
21
|
-
/**
|
|
22
|
-
* Codename of game
|
|
23
|
-
* @type {GameCode}
|
|
24
|
-
*/
|
|
25
|
-
this.code = result ? result.code : 'Not Found';
|
|
26
|
-
/**
|
|
27
|
-
* Name of game
|
|
28
|
-
* @type {GameString}
|
|
29
|
-
*/
|
|
30
|
-
this.name = result ? result.name : 'Not Found';
|
|
31
|
-
/**
|
|
32
|
-
* Whether the game is found
|
|
33
|
-
* @type {boolean}
|
|
34
|
-
*/
|
|
35
|
-
this.found = !!result;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Returns regular game name
|
|
40
|
-
* @return {GameString}
|
|
41
|
-
*/
|
|
42
|
-
toString
|
|
43
|
-
return this.name;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Static list of game IDs ( The list has the same order as CODES or NAMES )
|
|
48
|
-
* @type {GameId[]}
|
|
49
|
-
*/
|
|
50
|
-
static get IDS() {
|
|
51
|
-
return games.map((x) => x.id);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Static list of game codes
|
|
56
|
-
* @type {GameCode[]}
|
|
57
|
-
*/
|
|
58
|
-
static get CODES() {
|
|
59
|
-
return games.map((x) => x.code);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Static list of game strings
|
|
64
|
-
* @type {GameString[]}
|
|
65
|
-
*/
|
|
66
|
-
static get NAMES() {
|
|
67
|
-
return games.map((x) => x.name);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* @typedef {string} GameString
|
|
72
|
-
* * QUAKECRAFT: `Quake Craft`
|
|
73
|
-
* * WALLS: `Walls`
|
|
74
|
-
* * PAINTBALL: `Paintball`
|
|
75
|
-
* * SURVIVAL_GAMES: `Blitz Survival Games`
|
|
76
|
-
* * TNTGAMES: `The TNT Games`
|
|
77
|
-
* * VAMPIREZ: `VAMPIREZ`
|
|
78
|
-
* * WALLS3: `Mega Walls`
|
|
79
|
-
* * ARCADE: `Arcade`
|
|
80
|
-
* * ARENA: `Arena Brawl`
|
|
81
|
-
* * UHC: `UHC Champions`
|
|
82
|
-
* * MCGO: `Cops And Crims`
|
|
83
|
-
* * WARLORDS: `Warlords`
|
|
84
|
-
* * SUPER_SMASH: `Smash Heroes`
|
|
85
|
-
* * GINGERBREAD: `Turbo Kart Racers`
|
|
86
|
-
* * HOUSING: `Housing`
|
|
87
|
-
* * SKYWARS: `SkyWars`
|
|
88
|
-
* * TRUE_COMBAT: `Crazy Walls`
|
|
89
|
-
* * SPEED_UHC: `Speed UHC`
|
|
90
|
-
* * SKYCLASH: `SkyClash`
|
|
91
|
-
* * LEGACY: `Classic Games`
|
|
92
|
-
* * PROTOTYPE: `Prototype`
|
|
93
|
-
* * BEDWARS: `BedWars`
|
|
94
|
-
* * MURDER_MYSTERY: `Murder Mystery`
|
|
95
|
-
* * BUILD_BATTLE: `Build Battle`
|
|
96
|
-
* * DUELS: `Duels`
|
|
97
|
-
* * SKYBLOCK: `SkyBlock`
|
|
98
|
-
* * PIT: `The Pit`
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
*
|
|
104
|
-
* *
|
|
105
|
-
* *
|
|
106
|
-
* *
|
|
107
|
-
* *
|
|
108
|
-
* *
|
|
109
|
-
* *
|
|
110
|
-
* *
|
|
111
|
-
* *
|
|
112
|
-
* *
|
|
113
|
-
* *
|
|
114
|
-
* *
|
|
115
|
-
* *
|
|
116
|
-
* *
|
|
117
|
-
* *
|
|
118
|
-
* *
|
|
119
|
-
* *
|
|
120
|
-
* *
|
|
121
|
-
* *
|
|
122
|
-
* *
|
|
123
|
-
* *
|
|
124
|
-
* *
|
|
125
|
-
* *
|
|
126
|
-
* *
|
|
127
|
-
* *
|
|
128
|
-
* *
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
*
|
|
132
|
-
* *
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
*
|
|
136
|
-
* *
|
|
137
|
-
* *
|
|
138
|
-
* *
|
|
139
|
-
* *
|
|
140
|
-
* *
|
|
141
|
-
* *
|
|
142
|
-
* *
|
|
143
|
-
* *
|
|
144
|
-
* *
|
|
145
|
-
* *
|
|
146
|
-
* *
|
|
147
|
-
* *
|
|
148
|
-
* *
|
|
149
|
-
* *
|
|
150
|
-
* *
|
|
151
|
-
* *
|
|
152
|
-
* *
|
|
153
|
-
* *
|
|
154
|
-
* *
|
|
155
|
-
* *
|
|
156
|
-
* *
|
|
157
|
-
* *
|
|
158
|
-
* *
|
|
159
|
-
|
|
160
|
-
|
|
1
|
+
const { games } = require('../utils/Constants');
|
|
2
|
+
/**
|
|
3
|
+
* Game class
|
|
4
|
+
*/
|
|
5
|
+
class Game {
|
|
6
|
+
/**
|
|
7
|
+
* @param {GameId|GameCode} game Game ID or Game Code
|
|
8
|
+
*/
|
|
9
|
+
constructor(game) {
|
|
10
|
+
/**
|
|
11
|
+
* Input
|
|
12
|
+
* @type {GameId|GameCode}
|
|
13
|
+
*/
|
|
14
|
+
this.game = game.toString().toLowerCase();
|
|
15
|
+
const result = games.find((g) => g.code.toLowerCase() === this.game || g.id.toString() === this.game || g.name.toLowerCase() === this.game);
|
|
16
|
+
/**
|
|
17
|
+
* ID of game
|
|
18
|
+
* @type {GameId}
|
|
19
|
+
*/
|
|
20
|
+
this.id = result ? result.id : 'Not Found';
|
|
21
|
+
/**
|
|
22
|
+
* Codename of game
|
|
23
|
+
* @type {GameCode}
|
|
24
|
+
*/
|
|
25
|
+
this.code = result ? result.code : 'Not Found';
|
|
26
|
+
/**
|
|
27
|
+
* Name of game
|
|
28
|
+
* @type {GameString}
|
|
29
|
+
*/
|
|
30
|
+
this.name = result ? result.name : 'Not Found';
|
|
31
|
+
/**
|
|
32
|
+
* Whether the game is found
|
|
33
|
+
* @type {boolean}
|
|
34
|
+
*/
|
|
35
|
+
this.found = !!result;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Returns regular game name
|
|
40
|
+
* @return {GameString}
|
|
41
|
+
*/
|
|
42
|
+
toString() {
|
|
43
|
+
return this.name;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Static list of game IDs ( The list has the same order as CODES or NAMES )
|
|
48
|
+
* @type {GameId[]}
|
|
49
|
+
*/
|
|
50
|
+
static get IDS() {
|
|
51
|
+
return games.map((x) => x.id);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Static list of game codes
|
|
56
|
+
* @type {GameCode[]}
|
|
57
|
+
*/
|
|
58
|
+
static get CODES() {
|
|
59
|
+
return games.map((x) => x.code);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Static list of game strings
|
|
64
|
+
* @type {GameString[]}
|
|
65
|
+
*/
|
|
66
|
+
static get NAMES() {
|
|
67
|
+
return games.map((x) => x.name);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* @typedef {string} GameString
|
|
72
|
+
* * QUAKECRAFT: `Quake Craft`
|
|
73
|
+
* * WALLS: `Walls`
|
|
74
|
+
* * PAINTBALL: `Paintball`
|
|
75
|
+
* * SURVIVAL_GAMES: `Blitz Survival Games`
|
|
76
|
+
* * TNTGAMES: `The TNT Games`
|
|
77
|
+
* * VAMPIREZ: `VAMPIREZ`
|
|
78
|
+
* * WALLS3: `Mega Walls`
|
|
79
|
+
* * ARCADE: `Arcade`
|
|
80
|
+
* * ARENA: `Arena Brawl`
|
|
81
|
+
* * UHC: `UHC Champions`
|
|
82
|
+
* * MCGO: `Cops And Crims`
|
|
83
|
+
* * WARLORDS: `Warlords`
|
|
84
|
+
* * SUPER_SMASH: `Smash Heroes`
|
|
85
|
+
* * GINGERBREAD: `Turbo Kart Racers`
|
|
86
|
+
* * HOUSING: `Housing`
|
|
87
|
+
* * SKYWARS: `SkyWars`
|
|
88
|
+
* * TRUE_COMBAT: `Crazy Walls`
|
|
89
|
+
* * SPEED_UHC: `Speed UHC`
|
|
90
|
+
* * SKYCLASH: `SkyClash`
|
|
91
|
+
* * LEGACY: `Classic Games`
|
|
92
|
+
* * PROTOTYPE: `Prototype`
|
|
93
|
+
* * BEDWARS: `BedWars`
|
|
94
|
+
* * MURDER_MYSTERY: `Murder Mystery`
|
|
95
|
+
* * BUILD_BATTLE: `Build Battle`
|
|
96
|
+
* * DUELS: `Duels`
|
|
97
|
+
* * SKYBLOCK: `SkyBlock`
|
|
98
|
+
* * PIT: `The Pit`
|
|
99
|
+
* * REPLAY: `Replay`
|
|
100
|
+
* * SMP: `SMP`
|
|
101
|
+
*/
|
|
102
|
+
/**
|
|
103
|
+
* @typedef {string} GameCode
|
|
104
|
+
* * QUAKECRAFT
|
|
105
|
+
* * WALLS
|
|
106
|
+
* * PAINTBALL
|
|
107
|
+
* * SURVIVAL_GAMES
|
|
108
|
+
* * TNTGAMES
|
|
109
|
+
* * VAMPIREZ
|
|
110
|
+
* * WALLS3
|
|
111
|
+
* * ARCADE
|
|
112
|
+
* * ARENA
|
|
113
|
+
* * UHC
|
|
114
|
+
* * MCGO
|
|
115
|
+
* * WARLORDS
|
|
116
|
+
* * SUPER_SMASH
|
|
117
|
+
* * GINGERBREAD
|
|
118
|
+
* * HOUSING
|
|
119
|
+
* * SKYWARS
|
|
120
|
+
* * TRUE_COMBAT
|
|
121
|
+
* * SPEED_UHC
|
|
122
|
+
* * SKYCLASH
|
|
123
|
+
* * LEGACY
|
|
124
|
+
* * PROTOTYPE
|
|
125
|
+
* * BEDWARS
|
|
126
|
+
* * MURDER_MYSTERY
|
|
127
|
+
* * BUILD_BATTLE
|
|
128
|
+
* * DUELS
|
|
129
|
+
* * SKYBLOCK
|
|
130
|
+
* * PIT
|
|
131
|
+
* * REPLAY
|
|
132
|
+
* * SMP
|
|
133
|
+
*/
|
|
134
|
+
/**
|
|
135
|
+
* @typedef {number} GameId
|
|
136
|
+
* * QUAKECRAFT: `2`
|
|
137
|
+
* * WALLS: `3`
|
|
138
|
+
* * PAINTBALL: `4`
|
|
139
|
+
* * SURVIVAL_GAMES: `5`
|
|
140
|
+
* * TNTGAMES: `6`
|
|
141
|
+
* * VAMPIREZ: `7`
|
|
142
|
+
* * WALLS3: `13`
|
|
143
|
+
* * ARCADE: `14`
|
|
144
|
+
* * ARENA: `17`
|
|
145
|
+
* * UHC: `20`
|
|
146
|
+
* * MCGO: `21`
|
|
147
|
+
* * BATTLEGROUND: `23`
|
|
148
|
+
* * SUPER_SMASH: `24`
|
|
149
|
+
* * GINGERBREAD: `25`
|
|
150
|
+
* * HOUSING: `26`
|
|
151
|
+
* * SKYWARS: `51`
|
|
152
|
+
* * TRUE_COMBAT: `52`
|
|
153
|
+
* * SPEED_UHC: `54`
|
|
154
|
+
* * SKYCLASH: `55`
|
|
155
|
+
* * LEGACY: `56`
|
|
156
|
+
* * PROTOTYPE: `57`
|
|
157
|
+
* * BEDWARS: `58`
|
|
158
|
+
* * MURDER_MYSTERY: `59`
|
|
159
|
+
* * BUILD_BATTLE: `60`
|
|
160
|
+
* * DUELS: `61`
|
|
161
|
+
* * SKYBLOCK: `63`
|
|
162
|
+
* * PIT: `64`
|
|
163
|
+
*/
|
|
164
|
+
module.exports = Game;
|
|
@@ -1,151 +1,151 @@
|
|
|
1
|
-
const { MiniGamesString } = require('../utils/Constants');
|
|
2
|
-
const { removeSnakeCaseString, recursive } = require('../utils/removeSnakeCase');
|
|
3
|
-
/**
|
|
4
|
-
* GameCounts class
|
|
5
|
-
*/
|
|
6
|
-
class GameCounts {
|
|
7
|
-
/**
|
|
8
|
-
* @param {object} data
|
|
9
|
-
*/
|
|
10
|
-
constructor
|
|
11
|
-
/**
|
|
12
|
-
* Player count in Main lobby
|
|
13
|
-
* @name GameCounts#mainLobby
|
|
14
|
-
* @type {object}
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* Player count in Tournament lobby
|
|
18
|
-
* @name GameCounts#tournamentLobby
|
|
19
|
-
* @type {object}
|
|
20
|
-
*/
|
|
21
|
-
/**
|
|
22
|
-
* Player count in SkyWars
|
|
23
|
-
* @name GameCounts#skywars
|
|
24
|
-
* @type {object}
|
|
25
|
-
*/
|
|
26
|
-
/**
|
|
27
|
-
* Player count in The Prototype
|
|
28
|
-
* @name GameCounts#prototype
|
|
29
|
-
* @type {object}
|
|
30
|
-
*/
|
|
31
|
-
/**
|
|
32
|
-
* Player count in BedWars
|
|
33
|
-
* @name GameCounts#bedwars
|
|
34
|
-
* @type {object}
|
|
35
|
-
*/
|
|
36
|
-
/**
|
|
37
|
-
* Player count in The Classic Games
|
|
38
|
-
* @name GameCounts#classicGames
|
|
39
|
-
* @type {object}
|
|
40
|
-
*/
|
|
41
|
-
/**
|
|
42
|
-
* Player count in Housing
|
|
43
|
-
* @name GameCounts#housing
|
|
44
|
-
* @type {object}
|
|
45
|
-
*/
|
|
46
|
-
/**
|
|
47
|
-
* Player count in Blitz Survival Games
|
|
48
|
-
* @name GameCounts#blitzSurvivalGames
|
|
49
|
-
* @type {object}
|
|
50
|
-
*/
|
|
51
|
-
/**
|
|
52
|
-
* Player count in UHC Champions
|
|
53
|
-
* @name GameCounts#uhcChampions
|
|
54
|
-
* @type {object}
|
|
55
|
-
*/
|
|
56
|
-
/**
|
|
57
|
-
* Player count in The Pit
|
|
58
|
-
* @name GameCounts#thePit
|
|
59
|
-
* @type {object}
|
|
60
|
-
*/
|
|
61
|
-
/**
|
|
62
|
-
* Player count in SkyBlock
|
|
63
|
-
* @name GameCounts#skyblock
|
|
64
|
-
* @type {object}
|
|
65
|
-
*/
|
|
66
|
-
/**
|
|
67
|
-
* Player count in Warlords
|
|
68
|
-
* @name GameCounts#warlords
|
|
69
|
-
* @type {object}
|
|
70
|
-
*/
|
|
71
|
-
/**
|
|
72
|
-
* Player count in Smash Heroes
|
|
73
|
-
* @name GameCounts#smashHeroes
|
|
74
|
-
* @type {object}
|
|
75
|
-
*/
|
|
76
|
-
/**
|
|
77
|
-
* Player count in Cops And Crims
|
|
78
|
-
* @name GameCounts#copsAndCrims
|
|
79
|
-
* @type {object}
|
|
80
|
-
*/
|
|
81
|
-
/**
|
|
82
|
-
* Player count in Speed UHC
|
|
83
|
-
* @name GameCounts#speedUhc
|
|
84
|
-
* @type {object}
|
|
85
|
-
*/
|
|
86
|
-
/**
|
|
87
|
-
* Player count in Arcade
|
|
88
|
-
* @name GameCounts#arcade
|
|
89
|
-
* @type {object}
|
|
90
|
-
*/
|
|
91
|
-
/**
|
|
92
|
-
* Player count in The TNT Games
|
|
93
|
-
* @name GameCounts#theTntGames
|
|
94
|
-
* @type {object}
|
|
95
|
-
*/
|
|
96
|
-
/**
|
|
97
|
-
* Player count in Duels
|
|
98
|
-
* @name GameCounts#duels
|
|
99
|
-
* @type {object}
|
|
100
|
-
*/
|
|
101
|
-
/**
|
|
102
|
-
* Player count in Murder Mystery
|
|
103
|
-
* @name GameCounts#murderMystery
|
|
104
|
-
* @type {object}
|
|
105
|
-
*/
|
|
106
|
-
/**
|
|
107
|
-
* Player count in Mega Walls
|
|
108
|
-
* @name GameCounts#megaWalls
|
|
109
|
-
* @type {object}
|
|
110
|
-
*/
|
|
111
|
-
/**
|
|
112
|
-
* Player count in SMP
|
|
113
|
-
* @name GameCounts#smp
|
|
114
|
-
* @type {object}
|
|
115
|
-
*/
|
|
116
|
-
/**
|
|
117
|
-
* Player count in Replay
|
|
118
|
-
* @name GameCounts#replay
|
|
119
|
-
* @type {object}
|
|
120
|
-
*/
|
|
121
|
-
/**
|
|
122
|
-
* Player count in Limbo
|
|
123
|
-
* @name GameCounts#limbo
|
|
124
|
-
* @type {object}
|
|
125
|
-
*/
|
|
126
|
-
/**
|
|
127
|
-
* Player count in Idle
|
|
128
|
-
* @name GameCounts#idle
|
|
129
|
-
* @type {object}
|
|
130
|
-
*/
|
|
131
|
-
/**
|
|
132
|
-
* Player count in Queue
|
|
133
|
-
* @name GameCounts#queue
|
|
134
|
-
* @type {object}
|
|
135
|
-
*/
|
|
136
|
-
/**
|
|
137
|
-
* Current player count
|
|
138
|
-
* @type {number}
|
|
139
|
-
*/
|
|
140
|
-
this.playerCount = data.playerCount;
|
|
141
|
-
for (const game in data.games) {
|
|
142
|
-
if (Object.prototype.hasOwnProperty.call(MiniGamesString, game)) {
|
|
143
|
-
const objectName = MiniGamesString[game].toUpperCase().replace(/ +/g, '_');
|
|
144
|
-
this[removeSnakeCaseString(objectName)] = recursive(data.games[game], true);
|
|
145
|
-
} else {
|
|
146
|
-
this[removeSnakeCaseString(game)] = recursive(data.games[game], true);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
module.exports = GameCounts;
|
|
1
|
+
const { MiniGamesString } = require('../utils/Constants');
|
|
2
|
+
const { removeSnakeCaseString, recursive } = require('../utils/removeSnakeCase');
|
|
3
|
+
/**
|
|
4
|
+
* GameCounts class
|
|
5
|
+
*/
|
|
6
|
+
class GameCounts {
|
|
7
|
+
/**
|
|
8
|
+
* @param {object} data
|
|
9
|
+
*/
|
|
10
|
+
constructor(data) {
|
|
11
|
+
/**
|
|
12
|
+
* Player count in Main lobby
|
|
13
|
+
* @name GameCounts#mainLobby
|
|
14
|
+
* @type {object}
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Player count in Tournament lobby
|
|
18
|
+
* @name GameCounts#tournamentLobby
|
|
19
|
+
* @type {object}
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Player count in SkyWars
|
|
23
|
+
* @name GameCounts#skywars
|
|
24
|
+
* @type {object}
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* Player count in The Prototype
|
|
28
|
+
* @name GameCounts#prototype
|
|
29
|
+
* @type {object}
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* Player count in BedWars
|
|
33
|
+
* @name GameCounts#bedwars
|
|
34
|
+
* @type {object}
|
|
35
|
+
*/
|
|
36
|
+
/**
|
|
37
|
+
* Player count in The Classic Games
|
|
38
|
+
* @name GameCounts#classicGames
|
|
39
|
+
* @type {object}
|
|
40
|
+
*/
|
|
41
|
+
/**
|
|
42
|
+
* Player count in Housing
|
|
43
|
+
* @name GameCounts#housing
|
|
44
|
+
* @type {object}
|
|
45
|
+
*/
|
|
46
|
+
/**
|
|
47
|
+
* Player count in Blitz Survival Games
|
|
48
|
+
* @name GameCounts#blitzSurvivalGames
|
|
49
|
+
* @type {object}
|
|
50
|
+
*/
|
|
51
|
+
/**
|
|
52
|
+
* Player count in UHC Champions
|
|
53
|
+
* @name GameCounts#uhcChampions
|
|
54
|
+
* @type {object}
|
|
55
|
+
*/
|
|
56
|
+
/**
|
|
57
|
+
* Player count in The Pit
|
|
58
|
+
* @name GameCounts#thePit
|
|
59
|
+
* @type {object}
|
|
60
|
+
*/
|
|
61
|
+
/**
|
|
62
|
+
* Player count in SkyBlock
|
|
63
|
+
* @name GameCounts#skyblock
|
|
64
|
+
* @type {object}
|
|
65
|
+
*/
|
|
66
|
+
/**
|
|
67
|
+
* Player count in Warlords
|
|
68
|
+
* @name GameCounts#warlords
|
|
69
|
+
* @type {object}
|
|
70
|
+
*/
|
|
71
|
+
/**
|
|
72
|
+
* Player count in Smash Heroes
|
|
73
|
+
* @name GameCounts#smashHeroes
|
|
74
|
+
* @type {object}
|
|
75
|
+
*/
|
|
76
|
+
/**
|
|
77
|
+
* Player count in Cops And Crims
|
|
78
|
+
* @name GameCounts#copsAndCrims
|
|
79
|
+
* @type {object}
|
|
80
|
+
*/
|
|
81
|
+
/**
|
|
82
|
+
* Player count in Speed UHC
|
|
83
|
+
* @name GameCounts#speedUhc
|
|
84
|
+
* @type {object}
|
|
85
|
+
*/
|
|
86
|
+
/**
|
|
87
|
+
* Player count in Arcade
|
|
88
|
+
* @name GameCounts#arcade
|
|
89
|
+
* @type {object}
|
|
90
|
+
*/
|
|
91
|
+
/**
|
|
92
|
+
* Player count in The TNT Games
|
|
93
|
+
* @name GameCounts#theTntGames
|
|
94
|
+
* @type {object}
|
|
95
|
+
*/
|
|
96
|
+
/**
|
|
97
|
+
* Player count in Duels
|
|
98
|
+
* @name GameCounts#duels
|
|
99
|
+
* @type {object}
|
|
100
|
+
*/
|
|
101
|
+
/**
|
|
102
|
+
* Player count in Murder Mystery
|
|
103
|
+
* @name GameCounts#murderMystery
|
|
104
|
+
* @type {object}
|
|
105
|
+
*/
|
|
106
|
+
/**
|
|
107
|
+
* Player count in Mega Walls
|
|
108
|
+
* @name GameCounts#megaWalls
|
|
109
|
+
* @type {object}
|
|
110
|
+
*/
|
|
111
|
+
/**
|
|
112
|
+
* Player count in SMP
|
|
113
|
+
* @name GameCounts#smp
|
|
114
|
+
* @type {object}
|
|
115
|
+
*/
|
|
116
|
+
/**
|
|
117
|
+
* Player count in Replay
|
|
118
|
+
* @name GameCounts#replay
|
|
119
|
+
* @type {object}
|
|
120
|
+
*/
|
|
121
|
+
/**
|
|
122
|
+
* Player count in Limbo
|
|
123
|
+
* @name GameCounts#limbo
|
|
124
|
+
* @type {object}
|
|
125
|
+
*/
|
|
126
|
+
/**
|
|
127
|
+
* Player count in Idle
|
|
128
|
+
* @name GameCounts#idle
|
|
129
|
+
* @type {object}
|
|
130
|
+
*/
|
|
131
|
+
/**
|
|
132
|
+
* Player count in Queue
|
|
133
|
+
* @name GameCounts#queue
|
|
134
|
+
* @type {object}
|
|
135
|
+
*/
|
|
136
|
+
/**
|
|
137
|
+
* Current player count
|
|
138
|
+
* @type {number}
|
|
139
|
+
*/
|
|
140
|
+
this.playerCount = data.playerCount;
|
|
141
|
+
for (const game in data.games) {
|
|
142
|
+
if (Object.prototype.hasOwnProperty.call(MiniGamesString, game)) {
|
|
143
|
+
const objectName = MiniGamesString[game].toUpperCase().replace(/ +/g, '_');
|
|
144
|
+
this[removeSnakeCaseString(objectName)] = recursive(data.games[game], true);
|
|
145
|
+
} else {
|
|
146
|
+
this[removeSnakeCaseString(game)] = recursive(data.games[game], true);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
module.exports = GameCounts;
|