@rian8337/osu-droid-utilities 4.0.0-beta.1 → 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 +171 -296
- package/package.json +11 -9
- package/typings/index.d.ts +87 -85
- package/dist/index.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,225 +1,139 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var osuBase = require('@rian8337/osu-base');
|
|
4
|
-
|
|
5
|
-
|
|
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
|
+
};
|
|
6
36
|
|
|
7
37
|
/**
|
|
8
38
|
* Represents an osu!droid score.
|
|
9
39
|
*/
|
|
10
40
|
class Score {
|
|
11
41
|
/**
|
|
12
|
-
* The
|
|
13
|
-
*/
|
|
14
|
-
uid;
|
|
15
|
-
/**
|
|
16
|
-
* The ID of the score.
|
|
17
|
-
*/
|
|
18
|
-
scoreID;
|
|
19
|
-
/**
|
|
20
|
-
* The player's name.
|
|
21
|
-
*/
|
|
22
|
-
username;
|
|
23
|
-
/**
|
|
24
|
-
* The title of the beatmap.
|
|
25
|
-
*/
|
|
26
|
-
title;
|
|
27
|
-
/**
|
|
28
|
-
* The maximum combo achieved in the play.
|
|
29
|
-
*/
|
|
30
|
-
combo;
|
|
31
|
-
/**
|
|
32
|
-
* The score achieved in the play.
|
|
33
|
-
*/
|
|
34
|
-
score;
|
|
35
|
-
/**
|
|
36
|
-
* The rank achieved in the play.
|
|
37
|
-
*/
|
|
38
|
-
rank;
|
|
39
|
-
/**
|
|
40
|
-
* The date of which the play was set.
|
|
41
|
-
*/
|
|
42
|
-
date;
|
|
43
|
-
/**
|
|
44
|
-
* The accuracy achieved in the play.
|
|
45
|
-
*/
|
|
46
|
-
accuracy;
|
|
47
|
-
/**
|
|
48
|
-
* Enabled modifications in the score.
|
|
49
|
-
*/
|
|
50
|
-
mods;
|
|
51
|
-
/**
|
|
52
|
-
* MD5 hash of the play.
|
|
42
|
+
* The amount of 300s in the play.
|
|
53
43
|
*/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
*/
|
|
58
|
-
speedMultiplier = 1;
|
|
44
|
+
get perfect() {
|
|
45
|
+
return this.accuracy.n300;
|
|
46
|
+
}
|
|
59
47
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* Otherwise, this denotes whether the score was set in version 1.6.7 or lower.
|
|
48
|
+
* The amount of 100s in the play.
|
|
63
49
|
*/
|
|
64
|
-
|
|
50
|
+
get good() {
|
|
51
|
+
return this.accuracy.n100;
|
|
52
|
+
}
|
|
65
53
|
/**
|
|
66
|
-
* The
|
|
54
|
+
* The amount of 50s in the play.
|
|
67
55
|
*/
|
|
68
|
-
|
|
56
|
+
get bad() {
|
|
57
|
+
return this.accuracy.n50;
|
|
58
|
+
}
|
|
69
59
|
/**
|
|
70
|
-
* The
|
|
60
|
+
* The amount of misses in the play.
|
|
71
61
|
*/
|
|
72
|
-
|
|
62
|
+
get miss() {
|
|
63
|
+
return this.accuracy.nmiss;
|
|
64
|
+
}
|
|
73
65
|
/**
|
|
74
|
-
* The complete mod string of this score
|
|
66
|
+
* The complete mod string of this score.
|
|
75
67
|
*/
|
|
76
68
|
get completeModString() {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
finalString += " (";
|
|
80
|
-
if (this.forcedAR !== undefined) {
|
|
81
|
-
finalString += `AR${this.forcedAR}`;
|
|
82
|
-
}
|
|
83
|
-
if (this.speedMultiplier !== 1) {
|
|
84
|
-
if (this.forcedAR !== undefined) {
|
|
85
|
-
finalString += ", ";
|
|
86
|
-
}
|
|
87
|
-
finalString += `${this.speedMultiplier}x`;
|
|
88
|
-
}
|
|
89
|
-
finalString += ")";
|
|
69
|
+
if (this.mods.isEmpty) {
|
|
70
|
+
return `+No Mod`;
|
|
90
71
|
}
|
|
91
|
-
return
|
|
72
|
+
return `+${osuBase.ModUtil.modsToOrderedString(this.mods)}`;
|
|
92
73
|
}
|
|
93
|
-
constructor(
|
|
94
|
-
this.
|
|
95
|
-
this.
|
|
96
|
-
this.username =
|
|
97
|
-
this.title =
|
|
98
|
-
this.combo =
|
|
99
|
-
this.score =
|
|
100
|
-
this.rank =
|
|
101
|
-
this.date = new Date(
|
|
102
|
-
this.
|
|
103
|
-
this.
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
else {
|
|
117
|
-
actualMods += str;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
this.mods = osuBase.ModUtil.droidStringToMods(actualMods);
|
|
121
|
-
// The pipe was added in 1.6.8 first pre-release (https://github.com/osudroid/osu-droid/commit/c08c406f4b2e535ed1ec43607a72fd8f70f8e316),
|
|
122
|
-
// so we can use that information to infer whether the score was set on version 1.6.7 or lower.
|
|
123
|
-
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;
|
|
124
97
|
}
|
|
125
98
|
/**
|
|
126
99
|
* Retrieves score information on a beatmap from a player.
|
|
127
100
|
*
|
|
128
101
|
* @param uid The uid of the player.
|
|
129
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`.
|
|
130
104
|
* @returns The score, `null` if the score is not found.
|
|
131
105
|
*/
|
|
132
|
-
static
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
throw new Error("Error retrieving score data");
|
|
141
|
-
}
|
|
142
|
-
const entry = result.data.toString("utf-8").split("<br>");
|
|
143
|
-
entry.shift();
|
|
144
|
-
if (entry.length === 0) {
|
|
145
|
-
return null;
|
|
146
|
-
}
|
|
147
|
-
score.fillInformation(entry[0]);
|
|
148
|
-
return score;
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Fills this instance with score information.
|
|
152
|
-
*
|
|
153
|
-
* @param info The score information from API response to fill with.
|
|
154
|
-
*/
|
|
155
|
-
fillInformation(info) {
|
|
156
|
-
const play = info.split(" ");
|
|
157
|
-
this.scoreID = parseInt(play[0]);
|
|
158
|
-
this.uid = parseInt(play[1]);
|
|
159
|
-
this.username = play[2];
|
|
160
|
-
this.score = parseInt(play[3]);
|
|
161
|
-
this.combo = parseInt(play[4]);
|
|
162
|
-
this.rank = play[5];
|
|
163
|
-
const modstrings = play[6].split("|");
|
|
164
|
-
let actualMods = "";
|
|
165
|
-
for (const str of modstrings) {
|
|
166
|
-
if (!str) {
|
|
167
|
-
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");
|
|
168
114
|
}
|
|
169
|
-
|
|
170
|
-
|
|
115
|
+
const result = yield apiRequestBuilder.sendRequest();
|
|
116
|
+
if (result.statusCode !== 200) {
|
|
117
|
+
throw new Error(`Error retrieving score data: ${result.describeFailure()}`);
|
|
171
118
|
}
|
|
172
|
-
|
|
173
|
-
|
|
119
|
+
let response;
|
|
120
|
+
try {
|
|
121
|
+
response = JSON.parse(result.data.toString("utf-8"));
|
|
174
122
|
}
|
|
175
|
-
|
|
176
|
-
|
|
123
|
+
catch (_a) {
|
|
124
|
+
return null;
|
|
177
125
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
n300: parseInt(play[8]),
|
|
183
|
-
n100: parseInt(play[9]),
|
|
184
|
-
n50: parseInt(play[10]),
|
|
185
|
-
nmiss: parseInt(play[11]),
|
|
126
|
+
if (response.length === 0) {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
return new Score(response[0]);
|
|
186
130
|
});
|
|
187
|
-
const date = new Date(parseInt(play[12]) * 1000);
|
|
188
|
-
date.setUTCHours(date.getUTCHours() + 8);
|
|
189
|
-
// https://stackoverflow.com/a/63199512
|
|
190
|
-
const tz = date
|
|
191
|
-
.toLocaleString("en", {
|
|
192
|
-
timeZone: "Europe/Berlin",
|
|
193
|
-
timeStyle: "long",
|
|
194
|
-
})
|
|
195
|
-
.split(" ")
|
|
196
|
-
.slice(-1)[0];
|
|
197
|
-
const dateString = date.toString();
|
|
198
|
-
const msOffset = Date.parse(`${dateString} UTC`) - Date.parse(`${dateString} ${tz}`);
|
|
199
|
-
date.setUTCMilliseconds(date.getUTCMilliseconds() - msOffset);
|
|
200
|
-
this.date = date;
|
|
201
|
-
this.title = play[13]
|
|
202
|
-
.substring(0, play[13].length - 4)
|
|
203
|
-
.replace(/_/g, " ");
|
|
204
|
-
this.hash = play[14];
|
|
205
|
-
return this;
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Downloads the replay of this score.
|
|
209
|
-
*/
|
|
210
|
-
async downloadReplay() {
|
|
211
|
-
if (!this.scoreID || this.replay) {
|
|
212
|
-
return;
|
|
213
|
-
}
|
|
214
|
-
this.replay = await new osuDroidReplayAnalyzer.ReplayAnalyzer({
|
|
215
|
-
scoreID: this.scoreID,
|
|
216
|
-
}).analyze();
|
|
217
131
|
}
|
|
218
132
|
/**
|
|
219
133
|
* Returns a string representative of the class.
|
|
220
134
|
*/
|
|
221
135
|
toString() {
|
|
222
|
-
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}`;
|
|
223
137
|
}
|
|
224
138
|
}
|
|
225
139
|
|
|
@@ -227,133 +141,94 @@ class Score {
|
|
|
227
141
|
* Represents an osu!droid player.
|
|
228
142
|
*/
|
|
229
143
|
class Player {
|
|
230
|
-
/**
|
|
231
|
-
* The uid of the player.
|
|
232
|
-
*/
|
|
233
|
-
uid = 0;
|
|
234
|
-
/**
|
|
235
|
-
* The username of the player.
|
|
236
|
-
*/
|
|
237
|
-
username = "";
|
|
238
144
|
/**
|
|
239
145
|
* The avatar URL of the player.
|
|
240
146
|
*/
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
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
|
+
}
|
|
270
199
|
/**
|
|
271
200
|
* Retrieves a player's info based on their username.
|
|
272
201
|
*
|
|
273
202
|
* @param uidOrUsername The uid or username of the player.
|
|
274
203
|
* @returns The player, `null` if the player is not found.
|
|
275
204
|
*/
|
|
276
|
-
static
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
* @param info The player information from API response to fill with.
|
|
298
|
-
*/
|
|
299
|
-
fillInformation(info) {
|
|
300
|
-
const resArr = info.split("<br>");
|
|
301
|
-
const headerRes = resArr[0].split(" ");
|
|
302
|
-
if (headerRes[0] === "FAILED") {
|
|
303
|
-
return this;
|
|
304
|
-
}
|
|
305
|
-
const obj = JSON.parse(resArr[1]);
|
|
306
|
-
this.uid = parseInt(headerRes[1]);
|
|
307
|
-
this.username = headerRes[2];
|
|
308
|
-
this.score = parseInt(headerRes[3]);
|
|
309
|
-
this.playCount = parseInt(headerRes[4]);
|
|
310
|
-
this.accuracy = parseFloat((parseFloat(headerRes[5]) * 100).toFixed(2));
|
|
311
|
-
this.email = headerRes[6];
|
|
312
|
-
this.location = headerRes[7];
|
|
313
|
-
this.avatarURL = `https://osudroid.moe/user/avatar?id=${node_crypto.createHash("md5")
|
|
314
|
-
.update(this.email.trim().toLowerCase())
|
|
315
|
-
.digest("hex")}&s=200`;
|
|
316
|
-
this.rank = obj.rank;
|
|
317
|
-
const recent = obj.recent;
|
|
318
|
-
for (const play of recent) {
|
|
319
|
-
// https://stackoverflow.com/a/63199512
|
|
320
|
-
const date = new Date((play.date + 3600 * 8) * 1000);
|
|
321
|
-
const tz = date
|
|
322
|
-
.toLocaleString("en", {
|
|
323
|
-
timeZone: "Europe/Berlin",
|
|
324
|
-
timeStyle: "long",
|
|
325
|
-
})
|
|
326
|
-
.split(" ")
|
|
327
|
-
.slice(-1)[0];
|
|
328
|
-
const dateString = date.toString();
|
|
329
|
-
const msOffset = Date.parse(`${dateString} UTC`) -
|
|
330
|
-
Date.parse(`${dateString} ${tz}`);
|
|
331
|
-
this.recentPlays.push(new Score({
|
|
332
|
-
uid: this.uid,
|
|
333
|
-
username: this.username,
|
|
334
|
-
scoreID: play.scoreid,
|
|
335
|
-
score: play.score,
|
|
336
|
-
accuracy: new osuBase.Accuracy({
|
|
337
|
-
n300: play.perfect,
|
|
338
|
-
n100: play.good,
|
|
339
|
-
n50: play.bad,
|
|
340
|
-
nmiss: play.miss,
|
|
341
|
-
}),
|
|
342
|
-
rank: play.mark,
|
|
343
|
-
combo: play.combo,
|
|
344
|
-
title: play.filename,
|
|
345
|
-
date: date.getTime() - msOffset,
|
|
346
|
-
mods: play.mode,
|
|
347
|
-
hash: play.hash,
|
|
348
|
-
}));
|
|
349
|
-
}
|
|
350
|
-
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
|
+
});
|
|
351
226
|
}
|
|
352
227
|
/**
|
|
353
228
|
* Returns a string representative of the class.
|
|
354
229
|
*/
|
|
355
230
|
toString() {
|
|
356
|
-
return `Username: ${this.username}\nUID: ${this.
|
|
231
|
+
return `Username: ${this.username}\nUID: ${this.id.toString()}\nRank: ${this.rank.toString()}\nScore: ${this.score.toString()}\nPlay count: ${this.playCount.toString()}`;
|
|
357
232
|
}
|
|
358
233
|
}
|
|
359
234
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rian8337/osu-droid-utilities",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
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
|
|
26
|
-
"
|
|
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": "
|
|
34
|
-
"@rian8337/osu-droid-replay-analyzer": "^4.0.0-beta.1"
|
|
36
|
+
"@rian8337/osu-base": "4.0.0-beta.100"
|
|
35
37
|
},
|
|
36
38
|
"publishConfig": {
|
|
37
39
|
"access": "public"
|
|
38
40
|
},
|
|
39
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "b99083d44f14ca2af1d38ad294b361aad6ebc647"
|
|
40
42
|
}
|
package/typings/index.d.ts
CHANGED
|
@@ -1,15 +1,53 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ReplayAnalyzer } from '@rian8337/osu-droid-replay-analyzer';
|
|
1
|
+
import { ScoreRank, SerializedMod, Accuracy, ModMap } from '@rian8337/osu-base';
|
|
3
2
|
|
|
4
|
-
interface
|
|
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
|
|
44
|
+
* The ID of the score.
|
|
7
45
|
*/
|
|
8
|
-
|
|
46
|
+
id: number;
|
|
9
47
|
/**
|
|
10
|
-
* The
|
|
48
|
+
* The uid of the player.
|
|
11
49
|
*/
|
|
12
|
-
|
|
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:
|
|
70
|
+
rank: ScoreRank;
|
|
33
71
|
/**
|
|
34
72
|
* The date of which the play was set.
|
|
35
73
|
*/
|
|
36
|
-
date: Date
|
|
74
|
+
date: Date;
|
|
37
75
|
/**
|
|
38
76
|
* The accuracy achieved in the play.
|
|
39
77
|
*/
|
|
40
78
|
accuracy: Accuracy;
|
|
41
79
|
/**
|
|
42
|
-
*
|
|
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
|
-
|
|
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
|
|
84
|
+
* The amount of 100s in the play.
|
|
68
85
|
*/
|
|
69
|
-
|
|
86
|
+
get good(): number;
|
|
70
87
|
/**
|
|
71
|
-
* The
|
|
88
|
+
* The amount of 50s in the play.
|
|
72
89
|
*/
|
|
73
|
-
|
|
90
|
+
get bad(): number;
|
|
74
91
|
/**
|
|
75
|
-
* The
|
|
92
|
+
* The amount of misses in the play.
|
|
76
93
|
*/
|
|
77
|
-
|
|
94
|
+
get miss(): number;
|
|
78
95
|
/**
|
|
79
|
-
*
|
|
96
|
+
* Enabled modifications in the score.
|
|
80
97
|
*/
|
|
81
|
-
|
|
98
|
+
mods: ModMap;
|
|
82
99
|
/**
|
|
83
|
-
*
|
|
100
|
+
* MD5 hash of the play.
|
|
84
101
|
*/
|
|
85
|
-
|
|
102
|
+
hash: string;
|
|
86
103
|
/**
|
|
87
|
-
* The
|
|
104
|
+
* The amount of slider heads hit in the play.
|
|
88
105
|
*/
|
|
89
|
-
|
|
106
|
+
sliderHeadHits: number | null;
|
|
90
107
|
/**
|
|
91
|
-
*
|
|
108
|
+
* The amount of slider ticks hit in the play.
|
|
92
109
|
*/
|
|
93
|
-
|
|
110
|
+
sliderTickHits: number | null;
|
|
94
111
|
/**
|
|
95
|
-
*
|
|
112
|
+
* The amount of slider repeats hit in the play.
|
|
96
113
|
*/
|
|
97
|
-
|
|
114
|
+
sliderRepeatHits: number | null;
|
|
98
115
|
/**
|
|
99
|
-
* The
|
|
116
|
+
* The amount of slider ends hit in the play.
|
|
100
117
|
*/
|
|
101
|
-
|
|
118
|
+
sliderEndHits: number | null;
|
|
102
119
|
/**
|
|
103
|
-
*
|
|
120
|
+
* The performance points value of the play.
|
|
104
121
|
*
|
|
105
|
-
*
|
|
122
|
+
* This is the final value, affected by {@link ppMultiplier}. To get the raw pp value, divide by said multiplier.
|
|
106
123
|
*/
|
|
107
|
-
|
|
124
|
+
pp: number | null;
|
|
108
125
|
/**
|
|
109
|
-
* The
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
|
|
130
|
+
ppMultiplier: number | null;
|
|
116
131
|
/**
|
|
117
|
-
* The complete mod string of this score
|
|
132
|
+
* The complete mod string of this score.
|
|
118
133
|
*/
|
|
119
134
|
get completeModString(): string;
|
|
120
|
-
constructor(
|
|
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
|
|
156
|
+
* The user ID of the player.
|
|
151
157
|
*/
|
|
152
|
-
|
|
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
|
-
|
|
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","createHash"],"mappings":";;;;;;AAmEA;;AAEG;MACU,KAAK,CAAA;AACd;;AAEG;AACH,IAAA,GAAG,CAAS;AAEZ;;AAEG;AACH,IAAA,OAAO,CAAS;AAEhB;;AAEG;AACH,IAAA,QAAQ,CAAS;AAEjB;;AAEG;AACH,IAAA,KAAK,CAAS;AAEd;;AAEG;AACH,IAAA,KAAK,CAAS;AAEd;;AAEG;AACH,IAAA,KAAK,CAAS;AAEd;;AAEG;AACH,IAAA,IAAI,CAAS;AAEb;;AAEG;AACH,IAAA,IAAI,CAAO;AAEX;;AAEG;AACH,IAAA,QAAQ,CAAW;AAEnB;;AAEG;AACH,IAAA,IAAI,CAAkC;AAEtC;;AAEG;AACH,IAAA,IAAI,CAAS;AAEb;;AAEG;IACH,eAAe,GAAW,CAAC,CAAC;AAE5B;;;;AAIG;AACH,IAAA,aAAa,CAAU;AAEvB;;AAEG;AACH,IAAA,QAAQ,CAAU;AAElB;;AAEG;AACH,IAAA,MAAM,CAAkB;AAExB;;AAE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