@rian8337/osu-droid-utilities 4.0.0-beta.10 → 4.0.0-beta.100

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/dist/index.js CHANGED
@@ -1,224 +1,139 @@
1
1
  'use strict';
2
2
 
3
3
  var osuBase = require('@rian8337/osu-base');
4
- var osuDroidReplayAnalyzer = require('@rian8337/osu-droid-replay-analyzer');
4
+
5
+ /******************************************************************************
6
+ Copyright (c) Microsoft Corporation.
7
+
8
+ Permission to use, copy, modify, and/or distribute this software for any
9
+ purpose with or without fee is hereby granted.
10
+
11
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
12
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
14
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17
+ PERFORMANCE OF THIS SOFTWARE.
18
+ ***************************************************************************** */
19
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
20
+
21
+
22
+ function __awaiter(thisArg, _arguments, P, generator) {
23
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
24
+ return new (P || (P = Promise))(function (resolve, reject) {
25
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
26
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
27
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
28
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
29
+ });
30
+ }
31
+
32
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
33
+ var e = new Error(message);
34
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
35
+ };
5
36
 
6
37
  /**
7
38
  * Represents an osu!droid score.
8
39
  */
9
40
  class Score {
10
41
  /**
11
- * The uid of the player.
12
- */
13
- uid;
14
- /**
15
- * The ID of the score.
16
- */
17
- scoreID;
18
- /**
19
- * The player's name.
20
- */
21
- username;
22
- /**
23
- * The title of the beatmap.
24
- */
25
- title;
26
- /**
27
- * The maximum combo achieved in the play.
28
- */
29
- combo;
30
- /**
31
- * The score achieved in the play.
32
- */
33
- score;
34
- /**
35
- * The rank achieved in the play.
36
- */
37
- rank;
38
- /**
39
- * The date of which the play was set.
40
- */
41
- date;
42
- /**
43
- * The accuracy achieved in the play.
44
- */
45
- accuracy;
46
- /**
47
- * Enabled modifications in the score.
48
- */
49
- mods;
50
- /**
51
- * MD5 hash of the play.
42
+ * The amount of 300s in the play.
52
43
  */
53
- hash;
54
- /**
55
- * The speed multiplier of the play.
56
- */
57
- speedMultiplier = 1;
44
+ get perfect() {
45
+ return this.accuracy.n300;
46
+ }
58
47
  /**
59
- * Whether to use old statistics for this score when calculating with `MapStats`.
60
- *
61
- * Otherwise, this denotes whether the score was set in version 1.6.7 or lower.
48
+ * The amount of 100s in the play.
62
49
  */
63
- oldStatistics;
50
+ get good() {
51
+ return this.accuracy.n100;
52
+ }
64
53
  /**
65
- * The forced AR of the play.
54
+ * The amount of 50s in the play.
66
55
  */
67
- forcedAR;
56
+ get bad() {
57
+ return this.accuracy.n50;
58
+ }
68
59
  /**
69
- * The replay of the score.
60
+ * The amount of misses in the play.
70
61
  */
71
- replay;
62
+ get miss() {
63
+ return this.accuracy.nmiss;
64
+ }
72
65
  /**
73
- * The complete mod string of this score (mods, speed multiplier, and force AR combined).
66
+ * The complete mod string of this score.
74
67
  */
75
68
  get completeModString() {
76
- let finalString = `+${this.mods.length > 0 ? this.mods.map((v) => v.acronym) : "No Mod"}`;
77
- if (this.forcedAR !== undefined || this.speedMultiplier !== 1) {
78
- finalString += " (";
79
- if (this.forcedAR !== undefined) {
80
- finalString += `AR${this.forcedAR}`;
81
- }
82
- if (this.speedMultiplier !== 1) {
83
- if (this.forcedAR !== undefined) {
84
- finalString += ", ";
85
- }
86
- finalString += `${this.speedMultiplier}x`;
87
- }
88
- finalString += ")";
69
+ if (this.mods.isEmpty) {
70
+ return `+No Mod`;
89
71
  }
90
- return finalString;
72
+ return `+${osuBase.ModUtil.modsToOrderedString(this.mods)}`;
91
73
  }
92
- constructor(values) {
93
- this.uid = values?.uid ?? 0;
94
- this.scoreID = values?.scoreID ?? 0;
95
- this.username = values?.username ?? "";
96
- this.title = values?.title ?? "";
97
- this.combo = values?.combo ?? 0;
98
- this.score = values?.score ?? 0;
99
- this.rank = values?.rank ?? "";
100
- this.date = new Date(values?.date ?? 0);
101
- this.accuracy = values?.accuracy ?? new osuBase.Accuracy({});
102
- this.hash = values?.hash ?? "";
103
- const modstrings = (values?.mods ?? "").split("|");
104
- let actualMods = "";
105
- for (const str of modstrings) {
106
- if (!str) {
107
- continue;
108
- }
109
- if (str.startsWith("AR")) {
110
- this.forcedAR = parseFloat(str.replace("AR", ""));
111
- }
112
- else if (str.startsWith("x")) {
113
- this.speedMultiplier = parseFloat(str.replace("x", ""));
114
- }
115
- else {
116
- actualMods += str;
117
- }
118
- }
119
- this.mods = osuBase.ModUtil.droidStringToMods(actualMods);
120
- // The pipe was added in 1.6.8 first pre-release (https://github.com/osudroid/osu-droid/commit/c08c406f4b2e535ed1ec43607a72fd8f70f8e316),
121
- // so we can use that information to infer whether the score was set on version 1.6.7 or lower.
122
- this.oldStatistics = !(values?.mods ?? "").includes("|");
74
+ constructor(apiScore) {
75
+ this.id = apiScore.id;
76
+ this.uid = apiScore.uid;
77
+ this.username = apiScore.username;
78
+ this.title = apiScore.filename;
79
+ this.combo = apiScore.combo;
80
+ this.score = apiScore.score;
81
+ this.rank = apiScore.mark;
82
+ this.date = new Date(apiScore.date * 1000);
83
+ this.mods = osuBase.ModUtil.deserializeMods(apiScore.mods);
84
+ this.accuracy = new osuBase.Accuracy({
85
+ n300: apiScore.perfect,
86
+ n100: apiScore.good,
87
+ n50: apiScore.bad,
88
+ nmiss: apiScore.miss,
89
+ });
90
+ this.sliderHeadHits = apiScore.sliderHeadHit;
91
+ this.sliderTickHits = apiScore.sliderTickHit;
92
+ this.sliderRepeatHits = apiScore.sliderRepeatHit;
93
+ this.sliderEndHits = apiScore.sliderEndHit;
94
+ this.hash = apiScore.hash;
95
+ this.pp = apiScore.pp;
96
+ this.ppMultiplier = apiScore.ppMultiplier;
123
97
  }
124
98
  /**
125
99
  * Retrieves score information on a beatmap from a player.
126
100
  *
127
101
  * @param uid The uid of the player.
128
102
  * @param hash The MD5 hash of the beatmap.
103
+ * @param fetchBestPP Whether to retrieve the score in terms of the best performance points rather than best score. Defaults to `false`.
129
104
  * @returns The score, `null` if the score is not found.
130
105
  */
131
- static async getFromHash(uid, hash) {
132
- const score = new Score();
133
- const apiRequestBuilder = new osuBase.DroidAPIRequestBuilder()
134
- .setEndpoint("scoresearchv2.php")
135
- .addParameter("uid", uid)
136
- .addParameter("hash", hash);
137
- const result = await apiRequestBuilder.sendRequest();
138
- if (result.statusCode !== 200) {
139
- throw new Error("Error retrieving score data");
140
- }
141
- const entry = result.data.toString("utf-8").split("<br>");
142
- entry.shift();
143
- if (entry.length === 0) {
144
- return null;
145
- }
146
- score.fillInformation(entry[0]);
147
- return score;
148
- }
149
- /**
150
- * Fills this instance with score information.
151
- *
152
- * @param info The score information from API response to fill with.
153
- */
154
- fillInformation(info) {
155
- const play = info.split(" ");
156
- this.scoreID = parseInt(play[0]);
157
- this.uid = parseInt(play[1]);
158
- this.username = play[2];
159
- this.score = parseInt(play[3]);
160
- this.combo = parseInt(play[4]);
161
- this.rank = play[5];
162
- const modstrings = play[6].split("|");
163
- let actualMods = "";
164
- for (const str of modstrings) {
165
- if (!str) {
166
- continue;
106
+ static getFromHash(uid_1, hash_1) {
107
+ return __awaiter(this, arguments, void 0, function* (uid, hash, fetchBestPP = false) {
108
+ const apiRequestBuilder = new osuBase.DroidAPIRequestBuilder()
109
+ .setEndpoint("scoresearchv2.php")
110
+ .addParameter("uid", uid)
111
+ .addParameter("hash", hash);
112
+ if (fetchBestPP) {
113
+ apiRequestBuilder.addParameter("order", "pp");
167
114
  }
168
- if (str.startsWith("AR")) {
169
- this.forcedAR = parseFloat(str.replace("AR", ""));
115
+ const result = yield apiRequestBuilder.sendRequest();
116
+ if (result.statusCode !== 200) {
117
+ throw new Error(`Error retrieving score data: ${result.describeFailure()}`);
170
118
  }
171
- else if (str.startsWith("x")) {
172
- this.speedMultiplier = parseFloat(str.replace("x", ""));
119
+ let response;
120
+ try {
121
+ response = JSON.parse(result.data.toString("utf-8"));
173
122
  }
174
- else {
175
- actualMods += str;
123
+ catch (_a) {
124
+ return null;
176
125
  }
177
- }
178
- this.mods = osuBase.ModUtil.droidStringToMods(actualMods);
179
- this.oldStatistics = !play[6].includes("|");
180
- this.accuracy = new osuBase.Accuracy({
181
- n300: parseInt(play[8]),
182
- n100: parseInt(play[9]),
183
- n50: parseInt(play[10]),
184
- nmiss: parseInt(play[11]),
126
+ if (response.length === 0) {
127
+ return null;
128
+ }
129
+ return new Score(response[0]);
185
130
  });
186
- const date = new Date(parseInt(play[12]) * 1000);
187
- date.setUTCHours(date.getUTCHours() + 8);
188
- // https://stackoverflow.com/a/63199512
189
- const tz = date
190
- .toLocaleString("en", {
191
- timeZone: "Europe/Berlin",
192
- timeStyle: "long",
193
- })
194
- .split(" ")
195
- .slice(-1)[0];
196
- const dateString = date.toString();
197
- const msOffset = Date.parse(`${dateString} UTC`) - Date.parse(`${dateString} ${tz}`);
198
- date.setUTCMilliseconds(date.getUTCMilliseconds() - msOffset);
199
- this.date = date;
200
- this.title = play[13]
201
- .substring(0, play[13].length - 4)
202
- .replace(/_/g, " ");
203
- this.hash = play[14];
204
- return this;
205
- }
206
- /**
207
- * Downloads the replay of this score.
208
- */
209
- async downloadReplay() {
210
- if (!this.scoreID || this.replay) {
211
- return;
212
- }
213
- this.replay = await new osuDroidReplayAnalyzer.ReplayAnalyzer({
214
- scoreID: this.scoreID,
215
- }).analyze();
216
131
  }
217
132
  /**
218
133
  * Returns a string representative of the class.
219
134
  */
220
135
  toString() {
221
- return `Player: ${this.username}, uid: ${this.uid}, title: ${this.title}, score: ${this.score}, combo: ${this.combo}, rank: ${this.rank}, acc: ${this.accuracy}%, date: ${this.date}, mods: ${this.mods}, hash: ${this.hash}`;
136
+ return `Player: ${this.username}, uid: ${this.uid.toString()}, title: ${this.title}, score: ${this.score.toString()}, combo: ${this.combo.toString()}, rank: ${this.rank}, acc: ${(this.accuracy.value * 100).toFixed(2)}%, date: ${this.date.toString()}, mods: ${osuBase.ModUtil.modsToOrderedString(this.mods)}, hash: ${this.hash}`;
222
137
  }
223
138
  }
224
139
 
@@ -226,131 +141,94 @@ class Score {
226
141
  * Represents an osu!droid player.
227
142
  */
228
143
  class Player {
229
- /**
230
- * The uid of the player.
231
- */
232
- uid = 0;
233
- /**
234
- * The username of the player.
235
- */
236
- username = "";
237
144
  /**
238
145
  * The avatar URL of the player.
239
146
  */
240
- avatarURL = "";
241
- /**
242
- * The location of the player based on ISO 3166-1 country codes. See {@link https://en.wikipedia.org/wiki/ISO_3166-1 this} Wikipedia page for more information.
243
- */
244
- location = "";
245
- /**
246
- * The email that is attached to the player's account.
247
- */
248
- email = "";
249
- /**
250
- * The overall rank of the player.
251
- */
252
- rank = 0;
253
- /**
254
- * The total score of the player.
255
- */
256
- score = 0;
257
- /**
258
- * The overall accuracy of the player.
259
- */
260
- accuracy = 0;
261
- /**
262
- * The amount of times the player has played.
263
- */
264
- playCount = 0;
265
- /**
266
- * Recent plays of the player.
267
- */
268
- recentPlays = [];
147
+ get avatarUrl() {
148
+ return `https://osudroid.moe/user/avatar?id=${this.id.toString()}`;
149
+ }
150
+ constructor(apiPlayer) {
151
+ /**
152
+ * The user ID of the player.
153
+ */
154
+ this.id = 0;
155
+ /**
156
+ * The username of the player.
157
+ */
158
+ this.username = "";
159
+ /**
160
+ * The location of the player based on ISO 3166-1 country codes. See {@link https://en.wikipedia.org/wiki/ISO_3166-1 this} Wikipedia page for more information.
161
+ */
162
+ this.location = "";
163
+ /**
164
+ * The overall rank of the player.
165
+ */
166
+ this.rank = 0;
167
+ /**
168
+ * The total score of the player.
169
+ */
170
+ this.score = 0;
171
+ /**
172
+ * The total performance points of the player.
173
+ */
174
+ this.pp = 0;
175
+ /**
176
+ * The overall accuracy of the player.
177
+ */
178
+ this.accuracy = 0;
179
+ /**
180
+ * The amount of times the player has played.
181
+ */
182
+ this.playCount = 0;
183
+ /**
184
+ * Recent plays of the player.
185
+ */
186
+ this.recentPlays = [];
187
+ this.id = apiPlayer.id;
188
+ this.username = apiPlayer.username;
189
+ this.score = apiPlayer.score;
190
+ this.playCount = apiPlayer.playcount;
191
+ this.accuracy = apiPlayer.accuracy * 100;
192
+ this.location = apiPlayer.region;
193
+ this.rank = apiPlayer.rank;
194
+ this.pp = apiPlayer.pp;
195
+ for (const score of apiPlayer.recent) {
196
+ this.recentPlays.push(new Score(Object.assign(Object.assign({}, score), { uid: this.id, username: this.username })));
197
+ }
198
+ }
269
199
  /**
270
200
  * Retrieves a player's info based on their username.
271
201
  *
272
202
  * @param uidOrUsername The uid or username of the player.
273
203
  * @returns The player, `null` if the player is not found.
274
204
  */
275
- static async getInformation(uidOrUsername) {
276
- const player = new Player();
277
- const apiRequestBuilder = new osuBase.DroidAPIRequestBuilder()
278
- .setEndpoint("getuserinfo.php")
279
- .addParameter(typeof uidOrUsername === "number" ? "uid" : "username", uidOrUsername);
280
- const result = await apiRequestBuilder.sendRequest();
281
- if (result.statusCode !== 200) {
282
- throw new Error("Error retrieving player data");
283
- }
284
- const data = result.data.toString("utf-8");
285
- const resArr = data.split("<br>");
286
- const headerRes = resArr[0].split(" ");
287
- if (headerRes[0] === "FAILED") {
288
- return null;
289
- }
290
- player.fillInformation(data);
291
- return player;
292
- }
293
- /**
294
- * Fills this instance with player information.
295
- *
296
- * @param info The player information from API response to fill with.
297
- */
298
- fillInformation(info) {
299
- const resArr = info.split("<br>");
300
- const headerRes = resArr[0].split(" ");
301
- if (headerRes[0] === "FAILED") {
302
- return this;
303
- }
304
- const obj = JSON.parse(resArr[1]);
305
- this.uid = parseInt(headerRes[1]);
306
- this.username = headerRes[2];
307
- this.score = parseInt(headerRes[3]);
308
- this.playCount = parseInt(headerRes[4]);
309
- this.accuracy = parseFloat((parseFloat(headerRes[5]) * 100).toFixed(2));
310
- this.email = headerRes[6];
311
- this.location = headerRes[7];
312
- this.avatarURL = `https://osudroid.moe/user/avatar?id=${this.uid}&s=200`;
313
- this.rank = obj.rank;
314
- const recent = obj.recent;
315
- for (const play of recent) {
316
- // https://stackoverflow.com/a/63199512
317
- const date = new Date((play.date + 3600 * 8) * 1000);
318
- const tz = date
319
- .toLocaleString("en", {
320
- timeZone: "Europe/Berlin",
321
- timeStyle: "long",
322
- })
323
- .split(" ")
324
- .slice(-1)[0];
325
- const dateString = date.toString();
326
- const msOffset = Date.parse(`${dateString} UTC`) -
327
- Date.parse(`${dateString} ${tz}`);
328
- this.recentPlays.push(new Score({
329
- uid: this.uid,
330
- username: this.username,
331
- scoreID: play.scoreid,
332
- score: play.score,
333
- accuracy: new osuBase.Accuracy({
334
- n300: play.perfect,
335
- n100: play.good,
336
- n50: play.bad,
337
- nmiss: play.miss,
338
- }),
339
- rank: play.mark,
340
- combo: play.combo,
341
- title: play.filename,
342
- date: date.getTime() - msOffset,
343
- mods: play.mode,
344
- hash: play.hash,
345
- }));
346
- }
347
- return this;
205
+ static getInformation(uidOrUsername) {
206
+ return __awaiter(this, void 0, void 0, function* () {
207
+ const apiRequestBuilder = new osuBase.DroidAPIRequestBuilder()
208
+ .setEndpoint("getuserinfo.php")
209
+ .addParameter(typeof uidOrUsername === "number" ? "uid" : "username", uidOrUsername);
210
+ const result = yield apiRequestBuilder.sendRequest();
211
+ if (result.statusCode !== 200) {
212
+ throw new Error(`Error retrieving player data: ${result.describeFailure()}`);
213
+ }
214
+ let response;
215
+ try {
216
+ response = JSON.parse(result.data.toString("utf-8"));
217
+ }
218
+ catch (_a) {
219
+ return null;
220
+ }
221
+ if (!response.id) {
222
+ return null;
223
+ }
224
+ return new Player(response);
225
+ });
348
226
  }
349
227
  /**
350
228
  * Returns a string representative of the class.
351
229
  */
352
230
  toString() {
353
- return `Username: ${this.username}\nUID: ${this.uid}\nRank: ${this.rank}\nScore: ${this.score}\nPlay count: ${this.playCount}`;
231
+ return `Username: ${this.username}\nUID: ${this.id.toString()}\nRank: ${this.rank.toString()}\nScore: ${this.score.toString()}\nPlay count: ${this.playCount.toString()}`;
354
232
  }
355
233
  }
356
234
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rian8337/osu-droid-utilities",
3
- "version": "4.0.0-beta.10",
3
+ "version": "4.0.0-beta.100",
4
4
  "description": "A module containing utilities for osu!droid.",
5
5
  "keywords": [
6
6
  "osu",
@@ -12,9 +12,12 @@
12
12
  "main": "dist/index.js",
13
13
  "typings": "typings/index.d.ts",
14
14
  "typedocMain": "src/index.ts",
15
+ "engines": {
16
+ "node": ">=18"
17
+ },
15
18
  "files": [
16
- "dist/**",
17
- "typings/**"
19
+ "dist/index.js",
20
+ "typings/index.d.ts"
18
21
  ],
19
22
  "repository": {
20
23
  "type": "git",
@@ -22,19 +25,18 @@
22
25
  },
23
26
  "scripts": {
24
27
  "build": "rollup -c ../../rollup.config.mjs",
25
- "lint": "eslint --ext ts",
26
- "prepare": "npm run build",
27
- "test": "jest"
28
+ "lint": "eslint 'src/**/*.ts'",
29
+ "prepublishOnly": "pnpm build",
30
+ "test": "jest --silent"
28
31
  },
29
32
  "bugs": {
30
33
  "url": "https://github.com/Rian8337/osu-droid-module/issues"
31
34
  },
32
35
  "dependencies": {
33
- "@rian8337/osu-base": "^4.0.0-beta.9",
34
- "@rian8337/osu-droid-replay-analyzer": "^4.0.0-beta.10"
36
+ "@rian8337/osu-base": "4.0.0-beta.100"
35
37
  },
36
38
  "publishConfig": {
37
39
  "access": "public"
38
40
  },
39
- "gitHead": "1c0b73e79e1887eca9692548ff553fec1e750e31"
41
+ "gitHead": "b99083d44f14ca2af1d38ad294b361aad6ebc647"
40
42
  }
@@ -1,15 +1,53 @@
1
- import { Accuracy, Mod, IModApplicableToDroid } from '@rian8337/osu-base';
2
- import { ReplayAnalyzer } from '@rian8337/osu-droid-replay-analyzer';
1
+ import { ScoreRank, SerializedMod, Accuracy, ModMap } from '@rian8337/osu-base';
3
2
 
4
- interface ScoreInformation {
3
+ interface APIScore {
4
+ readonly id: number;
5
+ readonly uid: number;
6
+ readonly username: string;
7
+ readonly filename: string;
8
+ readonly score: number;
9
+ readonly combo: number;
10
+ readonly mark: ScoreRank;
11
+ readonly mods: SerializedMod[];
12
+ readonly accuracy: number;
13
+ readonly perfect: number;
14
+ readonly good: number;
15
+ readonly bad: number;
16
+ readonly miss: number;
17
+ readonly sliderHeadHit: number | null;
18
+ readonly sliderTickHit: number | null;
19
+ readonly sliderRepeatHit: number | null;
20
+ readonly sliderEndHit: number | null;
21
+ readonly date: number;
22
+ readonly hash: string;
23
+ readonly pp: number | null;
24
+ readonly ppMultiplier: number | null;
25
+ }
26
+
27
+ interface APIPlayer {
28
+ readonly id: number;
29
+ readonly username: string;
30
+ readonly score: number;
31
+ readonly playcount: number;
32
+ readonly accuracy: number;
33
+ readonly region: string;
34
+ readonly rank: number;
35
+ readonly pp: number;
36
+ readonly recent: Omit<APIScore, "uid" | "username">[];
37
+ }
38
+
39
+ /**
40
+ * Represents an osu!droid score.
41
+ */
42
+ declare class Score {
5
43
  /**
6
- * The uid of the player.
44
+ * The ID of the score.
7
45
  */
8
- uid?: number;
46
+ id: number;
9
47
  /**
10
- * The ID of the score.
48
+ * The uid of the player.
11
49
  */
12
- scoreID?: number;
50
+ uid: number;
13
51
  /**
14
52
  * The player's name.
15
53
  */
@@ -29,113 +67,81 @@ interface ScoreInformation {
29
67
  /**
30
68
  * The rank achieved in the play.
31
69
  */
32
- rank: string;
70
+ rank: ScoreRank;
33
71
  /**
34
72
  * The date of which the play was set.
35
73
  */
36
- date: Date | number;
74
+ date: Date;
37
75
  /**
38
76
  * The accuracy achieved in the play.
39
77
  */
40
78
  accuracy: Accuracy;
41
79
  /**
42
- * Enabled modifications in the score, including force AR and custom speed multiplier.
43
- */
44
- mods: string;
45
- /**
46
- * MD5 hash of the play.
47
- */
48
- hash: string;
49
- }
50
- /**
51
- * Represents an osu!droid score.
52
- */
53
- declare class Score {
54
- /**
55
- * The uid of the player.
80
+ * The amount of 300s in the play.
56
81
  */
57
- uid: number;
58
- /**
59
- * The ID of the score.
60
- */
61
- scoreID: number;
62
- /**
63
- * The player's name.
64
- */
65
- username: string;
82
+ get perfect(): number;
66
83
  /**
67
- * The title of the beatmap.
84
+ * The amount of 100s in the play.
68
85
  */
69
- title: string;
86
+ get good(): number;
70
87
  /**
71
- * The maximum combo achieved in the play.
88
+ * The amount of 50s in the play.
72
89
  */
73
- combo: number;
90
+ get bad(): number;
74
91
  /**
75
- * The score achieved in the play.
92
+ * The amount of misses in the play.
76
93
  */
77
- score: number;
94
+ get miss(): number;
78
95
  /**
79
- * The rank achieved in the play.
96
+ * Enabled modifications in the score.
80
97
  */
81
- rank: string;
98
+ mods: ModMap;
82
99
  /**
83
- * The date of which the play was set.
100
+ * MD5 hash of the play.
84
101
  */
85
- date: Date;
102
+ hash: string;
86
103
  /**
87
- * The accuracy achieved in the play.
104
+ * The amount of slider heads hit in the play.
88
105
  */
89
- accuracy: Accuracy;
106
+ sliderHeadHits: number | null;
90
107
  /**
91
- * Enabled modifications in the score.
108
+ * The amount of slider ticks hit in the play.
92
109
  */
93
- mods: (Mod & IModApplicableToDroid)[];
110
+ sliderTickHits: number | null;
94
111
  /**
95
- * MD5 hash of the play.
112
+ * The amount of slider repeats hit in the play.
96
113
  */
97
- hash: string;
114
+ sliderRepeatHits: number | null;
98
115
  /**
99
- * The speed multiplier of the play.
116
+ * The amount of slider ends hit in the play.
100
117
  */
101
- speedMultiplier: number;
118
+ sliderEndHits: number | null;
102
119
  /**
103
- * Whether to use old statistics for this score when calculating with `MapStats`.
120
+ * The performance points value of the play.
104
121
  *
105
- * Otherwise, this denotes whether the score was set in version 1.6.7 or lower.
122
+ * This is the final value, affected by {@link ppMultiplier}. To get the raw pp value, divide by said multiplier.
106
123
  */
107
- oldStatistics: boolean;
124
+ pp: number | null;
108
125
  /**
109
- * The forced AR of the play.
110
- */
111
- forcedAR?: number;
112
- /**
113
- * The replay of the score.
126
+ * The pp multiplier of the play.
127
+ *
128
+ * This is applied directly to {@link pp} during calculation.
114
129
  */
115
- replay?: ReplayAnalyzer;
130
+ ppMultiplier: number | null;
116
131
  /**
117
- * The complete mod string of this score (mods, speed multiplier, and force AR combined).
132
+ * The complete mod string of this score.
118
133
  */
119
134
  get completeModString(): string;
120
- constructor(values?: ScoreInformation);
135
+ constructor(apiScore: APIScore);
121
136
  /**
122
137
  * Retrieves score information on a beatmap from a player.
123
138
  *
124
139
  * @param uid The uid of the player.
125
140
  * @param hash The MD5 hash of the beatmap.
141
+ * @param fetchBestPP Whether to retrieve the score in terms of the best performance points rather than best score. Defaults to `false`.
126
142
  * @returns The score, `null` if the score is not found.
127
143
  */
128
- static getFromHash(uid: number, hash: string): Promise<Score | null>;
129
- /**
130
- * Fills this instance with score information.
131
- *
132
- * @param info The score information from API response to fill with.
133
- */
134
- fillInformation(info: string): Score;
135
- /**
136
- * Downloads the replay of this score.
137
- */
138
- downloadReplay(): Promise<void>;
144
+ static getFromHash(uid: number, hash: string, fetchBestPP?: boolean): Promise<Score | null>;
139
145
  /**
140
146
  * Returns a string representative of the class.
141
147
  */
@@ -147,9 +153,9 @@ declare class Score {
147
153
  */
148
154
  declare class Player {
149
155
  /**
150
- * The uid of the player.
156
+ * The user ID of the player.
151
157
  */
152
- uid: number;
158
+ id: number;
153
159
  /**
154
160
  * The username of the player.
155
161
  */
@@ -157,15 +163,11 @@ declare class Player {
157
163
  /**
158
164
  * The avatar URL of the player.
159
165
  */
160
- avatarURL: string;
166
+ get avatarUrl(): string;
161
167
  /**
162
168
  * The location of the player based on ISO 3166-1 country codes. See {@link https://en.wikipedia.org/wiki/ISO_3166-1 this} Wikipedia page for more information.
163
169
  */
164
170
  location: string;
165
- /**
166
- * The email that is attached to the player's account.
167
- */
168
- email: string;
169
171
  /**
170
172
  * The overall rank of the player.
171
173
  */
@@ -174,6 +176,10 @@ declare class Player {
174
176
  * The total score of the player.
175
177
  */
176
178
  score: number;
179
+ /**
180
+ * The total performance points of the player.
181
+ */
182
+ pp: number;
177
183
  /**
178
184
  * The overall accuracy of the player.
179
185
  */
@@ -186,6 +192,7 @@ declare class Player {
186
192
  * Recent plays of the player.
187
193
  */
188
194
  readonly recentPlays: Score[];
195
+ constructor(apiPlayer: APIPlayer);
189
196
  /**
190
197
  * Retrieves a player's info based on their username.
191
198
  *
@@ -193,12 +200,6 @@ declare class Player {
193
200
  * @returns The player, `null` if the player is not found.
194
201
  */
195
202
  static getInformation(uidOrUsername: string | number): Promise<Player | null>;
196
- /**
197
- * Fills this instance with player information.
198
- *
199
- * @param info The player information from API response to fill with.
200
- */
201
- fillInformation(info: string): Player;
202
203
  /**
203
204
  * Returns a string representative of the class.
204
205
  */
@@ -206,3 +207,4 @@ declare class Player {
206
207
  }
207
208
 
208
209
  export { Player, Score };
210
+ export type { APIPlayer, APIScore };
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../src/Score.ts","../src/Player.ts"],"sourcesContent":[null,null],"names":["Accuracy","ModUtil","DroidAPIRequestBuilder","ReplayAnalyzer"],"mappings":";;;;;AAmEA;;AAEG;MACU,KAAK,CAAA;AACd;;AAEG;AACH,IAAA,GAAG,CAAS;AAEZ;;AAEG;AACH,IAAA,OAAO,CAAS;AAEhB;;AAEG;AACH,IAAA,QAAQ,CAAS;A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