@rian8337/osu-droid-replay-analyzer 2.0.0-alpha.3 → 2.0.0-alpha.4

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.
Files changed (2) hide show
  1. package/package.json +6 -7
  2. package/typings/index.d.ts +651 -636
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rian8337/osu-droid-replay-analyzer",
3
- "version": "2.0.0-alpha.3",
3
+ "version": "2.0.0-alpha.4",
4
4
  "description": "A replay analyzer for analyzing osu!droid replay files.",
5
5
  "keywords": [
6
6
  "osu",
@@ -22,18 +22,17 @@
22
22
  "url": "git+https://github.com/Rian8337/osu-droid-module.git"
23
23
  },
24
24
  "scripts": {
25
- "build": "rollup -c ../../rollup.config.js",
25
+ "build": "dts-gen -m java-deserialization -o -f ./node_modules/java-deserialization/src/index.d.ts && rollup -c ../../rollup.config.js",
26
26
  "lint": "eslint --ext ts",
27
- "prepare": "dts-gen -m java-deserialization -o -f ./node_modules/java-deserialization/src/index.d.ts && npm run build",
28
27
  "test": "echo \"No tests for this module\""
29
28
  },
30
29
  "bugs": {
31
30
  "url": "https://github.com/Rian8337/osu-droid-module/issues"
32
31
  },
33
32
  "dependencies": {
34
- "@rian8337/osu-base": "^2.0.0-alpha.0",
35
- "@rian8337/osu-difficulty-calculator": "^2.0.0-alpha.2",
36
- "@rian8337/osu-rebalance-difficulty-calculator": "^2.0.0-alpha.2",
33
+ "@rian8337/osu-base": "^2.0.0-alpha.4",
34
+ "@rian8337/osu-difficulty-calculator": "^2.0.0-alpha.4",
35
+ "@rian8337/osu-rebalance-difficulty-calculator": "^2.0.0-alpha.4",
37
36
  "java-deserialization": "^0.1.0",
38
37
  "unzipper": "^0.10.11"
39
38
  },
@@ -45,5 +44,5 @@
45
44
  "publishConfig": {
46
45
  "access": "public"
47
46
  },
48
- "gitHead": "2dcada0b1b3986ea9637472b2b34e6b51c0ea40d"
47
+ "gitHead": "d7ebd2e4178199a8ccede5e409bbeaaafae62b35"
49
48
  }
@@ -1,653 +1,668 @@
1
- import { Accuracy, Mod, Beatmap } from '@rian8337/osu-base';
2
- import { DroidStarRating } from '@rian8337/osu-difficulty-calculator';
3
- import { DroidStarRating as DroidStarRating$1 } from '@rian8337/osu-rebalance-difficulty-calculator';
1
+ import { Accuracy, Mod, Beatmap } from "@rian8337/osu-base";
2
+ import { DroidStarRating } from "@rian8337/osu-difficulty-calculator";
3
+ import { DroidStarRating as DroidStarRating$1 } from "@rian8337/osu-rebalance-difficulty-calculator";
4
4
 
5
- /**
6
- * Movement type of a cursor in an osu!droid replay.
7
- */
8
- declare enum movementType {
9
- DOWN = 0,
10
- MOVE = 1,
11
- UP = 2
5
+ /**
6
+ * Movement type of a cursor in an osu!droid replay.
7
+ */
8
+ declare enum movementType {
9
+ DOWN = 0,
10
+ MOVE = 1,
11
+ UP = 2,
12
12
  }
13
13
 
14
- /**
15
- * Contains information about a cursor instance.
16
- */
17
- interface CursorInformation {
18
- /**
19
- * The movement size of the cursor instance.
20
- */
21
- size: number;
22
- /**
23
- * The time during which this cursor instance is active in milliseconds.
24
- */
25
- time: number[];
26
- /**
27
- * The x coordinates of this cursor instance in osu!pixels.
28
- */
29
- x: number[];
30
- /**
31
- * The y coordinates of this cursor instance in osu!pixels.
32
- */
33
- y: number[];
34
- /**
35
- * The hit results of this cursor instance.
36
- */
37
- id: number[];
38
- }
39
- /**
40
- * Represents a cursor instance in an osu!droid replay.
41
- *
42
- * Stores cursor movement data such as x and y coordinates, movement size, etc.
43
- *
44
- * This is used when analyzing replays using replay analyzer.
45
- */
46
- declare class CursorData implements CursorInformation {
47
- size: number;
48
- readonly time: number[];
49
- readonly x: number[];
50
- readonly y: number[];
51
- readonly id: movementType[];
52
- constructor(values: CursorInformation);
14
+ /**
15
+ * Contains information about a cursor instance.
16
+ */
17
+ interface CursorInformation {
18
+ /**
19
+ * The movement size of the cursor instance.
20
+ */
21
+ size: number;
22
+ /**
23
+ * The time during which this cursor instance is active in milliseconds.
24
+ */
25
+ time: number[];
26
+ /**
27
+ * The x coordinates of this cursor instance in osu!pixels.
28
+ */
29
+ x: number[];
30
+ /**
31
+ * The y coordinates of this cursor instance in osu!pixels.
32
+ */
33
+ y: number[];
34
+ /**
35
+ * The hit results of this cursor instance.
36
+ */
37
+ id: number[];
38
+ }
39
+ /**
40
+ * Represents a cursor instance in an osu!droid replay.
41
+ *
42
+ * Stores cursor movement data such as x and y coordinates, movement size, etc.
43
+ *
44
+ * This is used when analyzing replays using replay analyzer.
45
+ */
46
+ declare class CursorData implements CursorInformation {
47
+ size: number;
48
+ readonly time: number[];
49
+ readonly x: number[];
50
+ readonly y: number[];
51
+ readonly id: movementType[];
52
+ constructor(values: CursorInformation);
53
53
  }
54
54
 
55
- /**
56
- * Represents an exported replay's JSON structure.
57
- */
58
- interface ExportedReplayJSON {
59
- /**
60
- * The version of the exported replay.
61
- */
62
- version: number;
63
- /**
64
- * Data of the exported replay.
65
- */
66
- replaydata: {
67
- /**
68
- * The path towards the beatmap's `.osu` file from the song directory of the game.
69
- */
70
- filename: string;
71
- /**
72
- * The name of the player.
73
- */
74
- playername: string;
75
- /**
76
- * The name of the replay file.
77
- */
78
- replayfile: string;
79
- /**
80
- * Droid modifications that are used in the replay.
81
- */
82
- mod: string;
83
- /**
84
- * The amount of total score achieved.
85
- */
86
- score: number;
87
- /**
88
- * The maximum combo achieved.
89
- */
90
- combo: number;
91
- /**
92
- * The rank achieved in the replay.
93
- */
94
- mark: string;
95
- /**
96
- * The amount of geki hits in the replay.
97
- */
98
- h300k: number;
99
- /**
100
- * The amount of great hits in the replay.
101
- */
102
- h300: number;
103
- /**
104
- * The amount of katu hits in the replay.
105
- */
106
- h100k: number;
107
- /**
108
- * The amount of good hits in the replay.
109
- */
110
- h100: number;
111
- /**
112
- * The amount of meh hits in the replay.
113
- */
114
- h50: number;
115
- /**
116
- * The amount of misses in the replay.
117
- */
118
- misses: number;
119
- /**
120
- * Accuracy gained in the replay.
121
- */
122
- accuracy: number;
123
- /**
124
- * The epoch date at which the score was set, in milliseconds.
125
- */
126
- time: number;
127
- /**
128
- * Whether the score is a full combo (1 is `true`, 0 is `false`).
129
- */
130
- perfect: number;
131
- };
55
+ /**
56
+ * Represents an exported replay's JSON structure.
57
+ */
58
+ interface ExportedReplayJSON {
59
+ /**
60
+ * The version of the exported replay.
61
+ */
62
+ version: number;
63
+ /**
64
+ * Data of the exported replay.
65
+ */
66
+ replaydata: {
67
+ /**
68
+ * The path towards the beatmap's `.osu` file from the song directory of the game.
69
+ */
70
+ filename: string;
71
+ /**
72
+ * The name of the player.
73
+ */
74
+ playername: string;
75
+ /**
76
+ * The name of the replay file.
77
+ */
78
+ replayfile: string;
79
+ /**
80
+ * Droid modifications that are used in the replay.
81
+ */
82
+ mod: string;
83
+ /**
84
+ * The amount of total score achieved.
85
+ */
86
+ score: number;
87
+ /**
88
+ * The maximum combo achieved.
89
+ */
90
+ combo: number;
91
+ /**
92
+ * The rank achieved in the replay.
93
+ */
94
+ mark: string;
95
+ /**
96
+ * The amount of geki hits in the replay.
97
+ */
98
+ h300k: number;
99
+ /**
100
+ * The amount of great hits in the replay.
101
+ */
102
+ h300: number;
103
+ /**
104
+ * The amount of katu hits in the replay.
105
+ */
106
+ h100k: number;
107
+ /**
108
+ * The amount of good hits in the replay.
109
+ */
110
+ h100: number;
111
+ /**
112
+ * The amount of meh hits in the replay.
113
+ */
114
+ h50: number;
115
+ /**
116
+ * The amount of misses in the replay.
117
+ */
118
+ misses: number;
119
+ /**
120
+ * Accuracy gained in the replay.
121
+ */
122
+ accuracy: number;
123
+ /**
124
+ * The epoch date at which the score was set, in milliseconds.
125
+ */
126
+ time: number;
127
+ /**
128
+ * Whether the score is a full combo (1 is `true`, 0 is `false`).
129
+ */
130
+ perfect: number;
131
+ };
132
132
  }
133
133
 
134
- /**
135
- * The result of a hit in an osu!droid replay.
136
- */
137
- declare enum hitResult {
138
- /**
139
- * Miss (0).
140
- */
141
- RESULT_0 = 1,
142
- /**
143
- * Meh (50).
144
- */
145
- RESULT_50 = 2,
146
- /**
147
- * Great (100).
148
- */
149
- RESULT_100 = 3,
150
- /**
151
- * Good (300).
152
- */
153
- RESULT_300 = 4
134
+ /**
135
+ * The result of a hit in an osu!droid replay.
136
+ */
137
+ declare enum hitResult {
138
+ /**
139
+ * Miss (0).
140
+ */
141
+ RESULT_0 = 1,
142
+ /**
143
+ * Meh (50).
144
+ */
145
+ RESULT_50 = 2,
146
+ /**
147
+ * Great (100).
148
+ */
149
+ RESULT_100 = 3,
150
+ /**
151
+ * Good (300).
152
+ */
153
+ RESULT_300 = 4,
154
154
  }
155
155
 
156
- /**
157
- * Represents a hitobject in an osu!droid replay.
158
- *
159
- * Stores information about hitobjects in an osu!droid replay such as hit offset, tickset, and hit result.
160
- *
161
- * This is used when analyzing replays using replay analyzer.
162
- */
163
- declare class ReplayObjectData {
164
- /**
165
- * The offset of which the hitobject was hit in milliseconds.
166
- */
167
- accuracy: number;
168
- /**
169
- * The tickset of the hitobject.
170
- *
171
- * This is used to determine whether or not a slider event (tick/repeat/end) is hit based on the order they appear.
172
- */
173
- tickset: boolean[];
174
- /**
175
- * The bitwise hit result of the hitobject.
176
- */
177
- result: hitResult;
178
- constructor(values: {
179
- /**
180
- * The offset of which the hitobject was hit in milliseconds.
181
- */
182
- accuracy: number;
183
- /**
184
- * The tickset of the hitobject.
185
- *
186
- * This is used to determine whether or not a slider event (tick/repeat/end) is hit based on the order they appear.
187
- */
188
- tickset: boolean[];
189
- /**
190
- * The bitwise hit result of the hitobject.
191
- */
192
- result: hitResult;
193
- });
156
+ /**
157
+ * Represents a hitobject in an osu!droid replay.
158
+ *
159
+ * Stores information about hitobjects in an osu!droid replay such as hit offset, tickset, and hit result.
160
+ *
161
+ * This is used when analyzing replays using replay analyzer.
162
+ */
163
+ declare class ReplayObjectData {
164
+ /**
165
+ * The offset of which the hitobject was hit in milliseconds.
166
+ */
167
+ accuracy: number;
168
+ /**
169
+ * The tickset of the hitobject.
170
+ *
171
+ * This is used to determine whether or not a slider event (tick/repeat/end) is hit based on the order they appear.
172
+ */
173
+ tickset: boolean[];
174
+ /**
175
+ * The bitwise hit result of the hitobject.
176
+ */
177
+ result: hitResult;
178
+ constructor(values: {
179
+ /**
180
+ * The offset of which the hitobject was hit in milliseconds.
181
+ */
182
+ accuracy: number;
183
+ /**
184
+ * The tickset of the hitobject.
185
+ *
186
+ * This is used to determine whether or not a slider event (tick/repeat/end) is hit based on the order they appear.
187
+ */
188
+ tickset: boolean[];
189
+ /**
190
+ * The bitwise hit result of the hitobject.
191
+ */
192
+ result: hitResult;
193
+ });
194
194
  }
195
195
 
196
- /**
197
- * Contains information about a replay.
198
- */
199
- interface ReplayInformation {
200
- /**
201
- * The version of the replay.
202
- */
203
- replayVersion: number;
204
- /**
205
- * The folder name containing the beatmap played.
206
- */
207
- folderName: string;
208
- /**
209
- * The file name of the beatmap played.
210
- */
211
- fileName: string;
212
- /**
213
- * The MD5 hash of the beatmap played.
214
- */
215
- hash: string;
216
- /**
217
- * The date of which the play was set.
218
- *
219
- * Only available in replay v3 or later.
220
- */
221
- time?: Date;
222
- /**
223
- * The amount of geki and 300 katu achieved in the play. See {@link https://osu.ppy.sh/help/wiki/Score this} osu! wiki page for more information.
224
- *
225
- * Only available in replay v3 or later.
226
- *
227
- * If `map` is defined in analyzer (either in `Beatmap` or `StarRating` instance), this will be analyzed using beatmap hitobject information and replay hitobject data for replay v1 and v2.
228
- */
229
- hit300k?: number;
230
- /**
231
- * The amount of 100 katu achieved in the play. See {@link https://osu.ppy.sh/help/wiki/Score this} osu! wiki page for more information.
232
- *
233
- * Only available in replay v3 or later.
234
- *
235
- * If `map` is defined in analyzer (either in `Beatmap` or `StarRating` instance), this will be analyzed using beatmap hitobject information and replay hitobject data for replay v1 and v2.
236
- */
237
- hit100k?: number;
238
- /**
239
- * The total score achieved in the play.
240
- *
241
- * Only available in replay v3 or later.
242
- */
243
- score?: number;
244
- /**
245
- * The maximum combo achieved in the play.
246
- *
247
- * Only available in replay v3 or later.
248
- */
249
- maxCombo?: number;
250
- /**
251
- * The accuracy achieved in the play.
252
- *
253
- * Only available in replay v3 or later.
254
- *
255
- * If `map` is defined in analyzer (either in `Beatmap` or `StarRating` instance), this will be analyzed using beatmap hitobject information and replay hitobject data for replay v1 and v2.
256
- */
257
- accuracy?: Accuracy;
258
- /**
259
- * Whether or not the play achieved the beatmap's maximum combo.
260
- *
261
- * Only available in replay v3 or later.
262
- */
263
- isFullCombo?: boolean;
264
- /**
265
- * The name of the player in the replay.
266
- *
267
- * Only available in replay v3 or later.
268
- */
269
- playerName?: string;
270
- /**
271
- * Enabled modifications during the play in raw Java object format.
272
- *
273
- * Only available in replay v3 or later.
274
- */
275
- rawMods?: string;
276
- /**
277
- * The achieved rank in the play.
278
- *
279
- * Only available in replay v3 or later.
280
- *
281
- * If `map` is defined in analyzer (either in `Beatmap` or `StarRating` instance), this will be analyzed using beatmap hitobject information and replay hitobject data for replay v1 and v2.
282
- */
283
- rank?: string;
284
- /**
285
- * Enabled modifications during the play in osu!standard format.
286
- *
287
- * Only available in replay v3 or later.
288
- */
289
- convertedMods?: Mod[];
290
- /**
291
- * The speed modification of the replay.
292
- *
293
- * Only available in replay v4 or later. By default this is 1.
294
- */
295
- speedModification?: number;
296
- /**
297
- * The forced AR of the replay.
298
- *
299
- * Only available in replay v4 or later.
300
- */
301
- forcedAR?: number;
302
- /**
303
- * The cursor movement data of the replay.
304
- */
305
- cursorMovement: CursorData[];
306
- /**
307
- * The hit object data of the replay.
308
- */
309
- hitObjectData: ReplayObjectData[];
310
- }
311
- /**
312
- * Represents a replay data in an osu!droid replay.
313
- *
314
- * Stores generic information about an osu!droid replay such as player name, MD5 hash, time set, etc.
315
- *
316
- * This is used when analyzing replays using replay analyzer.
317
- */
318
- declare class ReplayData implements ReplayInformation {
319
- readonly replayVersion: number;
320
- readonly folderName: string;
321
- readonly fileName: string;
322
- readonly hash: string;
323
- readonly time: Date;
324
- readonly hit300k: number;
325
- readonly hit100k: number;
326
- readonly score: number;
327
- readonly maxCombo: number;
328
- readonly accuracy: Accuracy;
329
- readonly isFullCombo: boolean;
330
- readonly playerName: string;
331
- readonly rawMods: string;
332
- readonly rank: string;
333
- readonly convertedMods: Mod[];
334
- readonly cursorMovement: CursorData[];
335
- readonly hitObjectData: ReplayObjectData[];
336
- readonly speedModification: number;
337
- readonly forcedAR?: number;
338
- constructor(values: ReplayInformation);
196
+ /**
197
+ * Contains information about a replay.
198
+ */
199
+ interface ReplayInformation {
200
+ /**
201
+ * The version of the replay.
202
+ */
203
+ replayVersion: number;
204
+ /**
205
+ * The folder name containing the beatmap played.
206
+ */
207
+ folderName: string;
208
+ /**
209
+ * The file name of the beatmap played.
210
+ */
211
+ fileName: string;
212
+ /**
213
+ * The MD5 hash of the beatmap played.
214
+ */
215
+ hash: string;
216
+ /**
217
+ * The date of which the play was set.
218
+ *
219
+ * Only available in replay v3 or later.
220
+ */
221
+ time?: Date;
222
+ /**
223
+ * The amount of geki and 300 katu achieved in the play. See {@link https://osu.ppy.sh/help/wiki/Score this} osu! wiki page for more information.
224
+ *
225
+ * Only available in replay v3 or later.
226
+ *
227
+ * If `map` is defined in analyzer (either in `Beatmap` or `StarRating` instance), this will be analyzed using beatmap hitobject information and replay hitobject data for replay v1 and v2.
228
+ */
229
+ hit300k?: number;
230
+ /**
231
+ * The amount of 100 katu achieved in the play. See {@link https://osu.ppy.sh/help/wiki/Score this} osu! wiki page for more information.
232
+ *
233
+ * Only available in replay v3 or later.
234
+ *
235
+ * If `map` is defined in analyzer (either in `Beatmap` or `StarRating` instance), this will be analyzed using beatmap hitobject information and replay hitobject data for replay v1 and v2.
236
+ */
237
+ hit100k?: number;
238
+ /**
239
+ * The total score achieved in the play.
240
+ *
241
+ * Only available in replay v3 or later.
242
+ */
243
+ score?: number;
244
+ /**
245
+ * The maximum combo achieved in the play.
246
+ *
247
+ * Only available in replay v3 or later.
248
+ */
249
+ maxCombo?: number;
250
+ /**
251
+ * The accuracy achieved in the play.
252
+ *
253
+ * Only available in replay v3 or later.
254
+ *
255
+ * If `map` is defined in analyzer (either in `Beatmap` or `StarRating` instance), this will be analyzed using beatmap hitobject information and replay hitobject data for replay v1 and v2.
256
+ */
257
+ accuracy?: Accuracy;
258
+ /**
259
+ * Whether or not the play achieved the beatmap's maximum combo.
260
+ *
261
+ * Only available in replay v3 or later.
262
+ */
263
+ isFullCombo?: boolean;
264
+ /**
265
+ * The name of the player in the replay.
266
+ *
267
+ * Only available in replay v3 or later.
268
+ */
269
+ playerName?: string;
270
+ /**
271
+ * Enabled modifications during the play in raw Java object format.
272
+ *
273
+ * Only available in replay v3 or later.
274
+ */
275
+ rawMods?: string;
276
+ /**
277
+ * The achieved rank in the play.
278
+ *
279
+ * Only available in replay v3 or later.
280
+ *
281
+ * If `map` is defined in analyzer (either in `Beatmap` or `StarRating` instance), this will be analyzed using beatmap hitobject information and replay hitobject data for replay v1 and v2.
282
+ */
283
+ rank?: string;
284
+ /**
285
+ * Enabled modifications during the play in osu!standard format.
286
+ *
287
+ * Only available in replay v3 or later.
288
+ */
289
+ convertedMods?: Mod[];
290
+ /**
291
+ * The speed modification of the replay.
292
+ *
293
+ * Only available in replay v4 or later. By default this is 1.
294
+ */
295
+ speedModification?: number;
296
+ /**
297
+ * The forced AR of the replay.
298
+ *
299
+ * Only available in replay v4 or later.
300
+ */
301
+ forcedAR?: number;
302
+ /**
303
+ * The cursor movement data of the replay.
304
+ */
305
+ cursorMovement: CursorData[];
306
+ /**
307
+ * The hit object data of the replay.
308
+ */
309
+ hitObjectData: ReplayObjectData[];
310
+ }
311
+ /**
312
+ * Represents a replay data in an osu!droid replay.
313
+ *
314
+ * Stores generic information about an osu!droid replay such as player name, MD5 hash, time set, etc.
315
+ *
316
+ * This is used when analyzing replays using replay analyzer.
317
+ */
318
+ declare class ReplayData implements ReplayInformation {
319
+ readonly replayVersion: number;
320
+ readonly folderName: string;
321
+ readonly fileName: string;
322
+ readonly hash: string;
323
+ readonly time: Date;
324
+ readonly hit300k: number;
325
+ readonly hit100k: number;
326
+ readonly score: number;
327
+ readonly maxCombo: number;
328
+ readonly accuracy: Accuracy;
329
+ readonly isFullCombo: boolean;
330
+ readonly playerName: string;
331
+ readonly rawMods: string;
332
+ readonly rank: string;
333
+ readonly convertedMods: Mod[];
334
+ readonly cursorMovement: CursorData[];
335
+ readonly hitObjectData: ReplayObjectData[];
336
+ readonly speedModification: number;
337
+ readonly forcedAR?: number;
338
+ constructor(values: ReplayInformation);
339
339
  }
340
340
 
341
- interface HitErrorInformation {
342
- negativeAvg: number;
343
- positiveAvg: number;
344
- unstableRate: number;
345
- }
346
- /**
347
- * A replay analyzer that analyzes a replay from osu!droid.
348
- *
349
- * Created by reverse engineering the replay parser from the game itself, which can be found {@link https://github.com/osudroid/osu-droid/blob/master/src/ru/nsu/ccfit/zuev/osu/scoring/Replay.java here}.
350
- *
351
- * Once analyzed, the result can be accessed via the `data` property.
352
- */
353
- declare class ReplayAnalyzer {
354
- /**
355
- * The score ID of the replay.
356
- */
357
- scoreID: number;
358
- /**
359
- * The original odr file of the replay.
360
- */
361
- originalODR: Buffer | null;
362
- /**
363
- * The fixed odr file of the replay.
364
- */
365
- fixedODR: Buffer | null;
366
- /**
367
- * Whether or not the play is considered using >=3 finger abuse.
368
- */
369
- is3Finger?: boolean;
370
- /**
371
- * Whether or not the play is considered 2-handed.
372
- */
373
- is2Hand?: boolean;
374
- /**
375
- * The beatmap that is being analyzed. `DroidStarRating` or `RebalanceDroidStarRating` is required for three finger or two hand analyzing.
376
- */
377
- map?: Beatmap | DroidStarRating | DroidStarRating$1;
378
- /**
379
- * The results of the analyzer. `null` when initialized.
380
- */
381
- data: ReplayData | null;
382
- /**
383
- * Penalty value used to penalize dpp for 2-hand.
384
- */
385
- aimPenalty: number;
386
- /**
387
- * Penalty value used to penalize dpp for 3 finger abuse.
388
- */
389
- tapPenalty: number;
390
- /**
391
- * Whether this replay has been checked against 3 finger usage.
392
- */
393
- hasBeenCheckedFor3Finger: boolean;
394
- /**
395
- * Whether this replay has been checked against 2 hand usage.
396
- */
397
- hasBeenCheckedFor2Hand: boolean;
398
- private readonly BYTE_LENGTH;
399
- private readonly SHORT_LENGTH;
400
- private readonly INT_LENGTH;
401
- private readonly FLOAT_LENGTH;
402
- private readonly LONG_LENGTH;
403
- constructor(values: {
404
- /**
405
- * The ID of the score.
406
- */
407
- scoreID: number;
408
- /**
409
- * The beatmap to analyze.
410
- *
411
- * `DroidStarRating` or `RebalanceDroidStarRating` is required for three finger or two hand analyzing.
412
- */
413
- map?: Beatmap | DroidStarRating | DroidStarRating$1;
414
- });
415
- /**
416
- * Analyzes a replay.
417
- */
418
- analyze(): Promise<ReplayAnalyzer>;
419
- /**
420
- * Downloads the given score ID's replay.
421
- */
422
- private downloadReplay;
423
- /**
424
- * Decompresses a replay.
425
- *
426
- * The decompressed replay is in a form of Java object. This will be converted to a buffer and deserialized to read data from the replay.
427
- */
428
- private decompress;
429
- /**
430
- * Parses a replay after being downloaded and converted to a buffer.
431
- */
432
- private parseReplay;
433
- /**
434
- * Gets hit error information of the replay.
435
- *
436
- * `analyze()` must be called before calling this.
437
- */
438
- calculateHitError(): HitErrorInformation | null;
439
- /**
440
- * Converts replay mods to droid mod string.
441
- */
442
- private convertDroidMods;
443
- /**
444
- * Converts replay mods to regular mod string.
445
- */
446
- private convertMods;
447
- /**
448
- * Checks if a play is using 3 fingers.
449
- *
450
- * Requires `analyze()` to be called first and `map` to be defined as `DroidStarRating` or `RebalanceDroidStarRating`.
451
- */
452
- checkFor3Finger(): void;
453
- /**
454
- * Checks if a play is using 2 hands.
455
- *
456
- * Requires `analyze()` to be called first and `map` to be defined as `DroidStarRating` or `RebalanceDroidStarRating`.
457
- */
458
- checkFor2Hand(): void;
341
+ interface HitErrorInformation {
342
+ negativeAvg: number;
343
+ positiveAvg: number;
344
+ unstableRate: number;
345
+ }
346
+ /**
347
+ * A replay analyzer that analyzes a replay from osu!droid.
348
+ *
349
+ * Created by reverse engineering the replay parser from the game itself, which can be found {@link https://github.com/osudroid/osu-droid/blob/master/src/ru/nsu/ccfit/zuev/osu/scoring/Replay.java here}.
350
+ *
351
+ * Once analyzed, the result can be accessed via the `data` property.
352
+ */
353
+ declare class ReplayAnalyzer {
354
+ /**
355
+ * The score ID of the replay.
356
+ */
357
+ scoreID: number;
358
+ /**
359
+ * The original odr file of the replay.
360
+ */
361
+ originalODR: Buffer | null;
362
+ /**
363
+ * The fixed odr file of the replay.
364
+ */
365
+ fixedODR: Buffer | null;
366
+ /**
367
+ * Whether or not the play is considered using >=3 finger abuse.
368
+ */
369
+ is3Finger?: boolean;
370
+ /**
371
+ * Whether or not the play is considered 2-handed.
372
+ */
373
+ is2Hand?: boolean;
374
+ /**
375
+ * The beatmap that is being analyzed. `DroidStarRating` or `RebalanceDroidStarRating` is required for three finger or two hand analyzing.
376
+ */
377
+ map?: Beatmap | DroidStarRating | DroidStarRating$1;
378
+ /**
379
+ * The results of the analyzer. `null` when initialized.
380
+ */
381
+ data: ReplayData | null;
382
+ /**
383
+ * Penalty value used to penalize dpp for 2-hand.
384
+ */
385
+ aimPenalty: number;
386
+ /**
387
+ * Penalty value used to penalize dpp for 3 finger abuse.
388
+ */
389
+ tapPenalty: number;
390
+ /**
391
+ * Whether this replay has been checked against 3 finger usage.
392
+ */
393
+ hasBeenCheckedFor3Finger: boolean;
394
+ /**
395
+ * Whether this replay has been checked against 2 hand usage.
396
+ */
397
+ hasBeenCheckedFor2Hand: boolean;
398
+ private readonly BYTE_LENGTH;
399
+ private readonly SHORT_LENGTH;
400
+ private readonly INT_LENGTH;
401
+ private readonly FLOAT_LENGTH;
402
+ private readonly LONG_LENGTH;
403
+ constructor(values: {
404
+ /**
405
+ * The ID of the score.
406
+ */
407
+ scoreID: number;
408
+ /**
409
+ * The beatmap to analyze.
410
+ *
411
+ * `DroidStarRating` or `RebalanceDroidStarRating` is required for three finger or two hand analyzing.
412
+ */
413
+ map?: Beatmap | DroidStarRating | DroidStarRating$1;
414
+ });
415
+ /**
416
+ * Analyzes a replay.
417
+ */
418
+ analyze(): Promise<ReplayAnalyzer>;
419
+ /**
420
+ * Downloads the given score ID's replay.
421
+ */
422
+ private downloadReplay;
423
+ /**
424
+ * Decompresses a replay.
425
+ *
426
+ * The decompressed replay is in a form of Java object. This will be converted to a buffer and deserialized to read data from the replay.
427
+ */
428
+ private decompress;
429
+ /**
430
+ * Parses a replay after being downloaded and converted to a buffer.
431
+ */
432
+ private parseReplay;
433
+ /**
434
+ * Gets hit error information of the replay.
435
+ *
436
+ * `analyze()` must be called before calling this.
437
+ */
438
+ calculateHitError(): HitErrorInformation | null;
439
+ /**
440
+ * Converts replay mods to droid mod string.
441
+ */
442
+ private convertDroidMods;
443
+ /**
444
+ * Converts replay mods to regular mod string.
445
+ */
446
+ private convertMods;
447
+ /**
448
+ * Checks if a play is using 3 fingers.
449
+ *
450
+ * Requires `analyze()` to be called first and `map` to be defined as `DroidStarRating` or `RebalanceDroidStarRating`.
451
+ */
452
+ checkFor3Finger(): void;
453
+ /**
454
+ * Checks if a play is using 2 hands.
455
+ *
456
+ * Requires `analyze()` to be called first and `map` to be defined as `DroidStarRating` or `RebalanceDroidStarRating`.
457
+ */
458
+ checkFor2Hand(): void;
459
459
  }
460
460
 
461
- /**
462
- * Information about the result of a check.
463
- */
464
- interface ThreeFingerInformation {
465
- /**
466
- * Whether or not the beatmap is 3-fingered.
467
- */
468
- readonly is3Finger: boolean;
469
- /**
470
- * The final penalty. By default this is 1.
471
- */
472
- readonly penalty: number;
473
- }
474
- /**
475
- * Utility to check whether or not a beatmap is three-fingered.
476
- */
477
- declare class ThreeFingerChecker {
478
- /**
479
- * The beatmap to analyze.
480
- */
481
- readonly map: DroidStarRating | DroidStarRating$1;
482
- /**
483
- * The data of the replay.
484
- */
485
- readonly data: ReplayData;
486
- /**
487
- * The strain threshold to start detecting for 3-fingered section.
488
- *
489
- * Increasing this number will result in less sections being flagged.
490
- */
491
- private static readonly strainThreshold;
492
- /**
493
- * The distance threshold between cursors to assume that two cursors are
494
- * actually pressed with 1 finger in osu!pixels.
495
- *
496
- * This is used to prevent cases where a player would lift their finger
497
- * too fast to the point where the 4th cursor instance or beyond is recorded
498
- * as 1st, 2nd, or 3rd cursor instance.
499
- */
500
- private readonly cursorDistancingDistanceThreshold;
501
- /**
502
- * The threshold for the amount of cursors that are assumed to be pressed
503
- * by a single finger.
504
- */
505
- private readonly cursorDistancingCountThreshold;
506
- /**
507
- * The threshold for the time difference of cursors that are assumed to be pressed
508
- * by a single finger, in milliseconds.
509
- */
510
- private readonly cursorDistancingTimeThreshold;
511
- /**
512
- * The amount of notes that has a tap strain exceeding `strainThreshold`.
513
- */
514
- private readonly strainNoteCount;
515
- /**
516
- * The ratio threshold between non-3 finger cursors and 3-finger cursors.
517
- *
518
- * Increasing this number will increase detection accuracy, however
519
- * it also increases the chance of falsely flagged plays.
520
- */
521
- private readonly threeFingerRatioThreshold;
522
- /**
523
- * The maximum delta time allowed between two beatmap sections.
524
- *
525
- * Increasing this number decreases the amount of beatmap sections in general.
526
- *
527
- * Note that this value does not account for the speed multiplier of
528
- * the play, similar to the way replay object data is stored.
529
- */
530
- private readonly maxSectionDeltaTime;
531
- /**
532
- * The minimum object count required to make a beatmap section.
533
- *
534
- * Increasing this number decreases the amount of beatmap sections.
535
- */
536
- private readonly minSectionObjectCount;
537
- /**
538
- * The sections of the beatmap that was cut based on `maxSectionDeltaTime` and `minSectionObjectCount`.
539
- */
540
- private readonly beatmapSections;
541
- /**
542
- * This threshold is used to filter out accidental taps.
543
- *
544
- * Increasing this number makes the filtration more sensitive, however it
545
- * will also increase the chance of 3-fingered plays getting out from
546
- * being flagged.
547
- */
548
- private readonly accidentalTapThreshold;
549
- /**
550
- * The hit window of this beatmap. Keep in mind that speed-changing mods do not change hit window length in game logic.
551
- */
552
- private readonly hitWindow;
553
- /**
554
- * A reprocessed break points to match right on object time.
555
- *
556
- * This is used to increase detection accuracy since break points do not start right at the
557
- * start of the hitobject before it and do not end right at the first hitobject after it.
558
- */
559
- private readonly breakPointAccurateTimes;
560
- /**
561
- * A cursor data array that only contains `movementType.DOWN` movement ID occurrences.
562
- */
563
- private readonly downCursorInstances;
564
- /**
565
- * Nerf factors from all sections that were three-fingered.
566
- */
567
- private readonly nerfFactors;
568
- /**
569
- * @param map The beatmap to analyze.
570
- * @param data The data of the replay.
571
- */
572
- constructor(map: DroidStarRating | DroidStarRating$1, data: ReplayData);
573
- /**
574
- * Checks whether a beatmap is eligible to be detected for 3-finger.
575
- */
576
- static isEligibleToDetect(map: DroidStarRating | DroidStarRating$1): boolean;
577
- /**
578
- * Checks if the given beatmap is 3-fingered and also returns the final penalty.
579
- *
580
- * The beatmap will be separated into sections and each section will be determined
581
- * whether or not it is dragged.
582
- *
583
- * After that, each section will be assigned a nerf factor based on whether or not
584
- * the section is 3-fingered. These nerf factors will be summed up into a final
585
- * nerf factor, taking beatmap difficulty into account.
586
- */
587
- check(): ThreeFingerInformation;
588
- /**
589
- * Generates a new set of "accurate break points".
590
- *
591
- * This is done to increase detection accuracy since break points do not start right at the
592
- * start of the hitobject before it and do not end right at the first hitobject after it.
593
- */
594
- private getAccurateBreakPoints;
595
- /**
596
- * Filters the original cursor instances, returning only those with `movementType.DOWN` movement ID.
597
- *
598
- * This also filters cursors that are in break period or happen before start/after end of the beatmap.
599
- */
600
- private filterCursorInstances;
601
- /**
602
- * Divides the beatmap into sections, which will be used to
603
- * detect dragged sections and improve detection speed.
604
- */
605
- private getBeatmapSections;
606
- /**
607
- * Checks whether or not each beatmap sections is dragged.
608
- */
609
- private detectDragPlay;
610
- /**
611
- * Checks if a section is dragged and returns the index of the drag finger.
612
- *
613
- * If the section is not dragged, -1 will be returned.
614
- *
615
- * @param section The section to check.
616
- */
617
- private checkDrag;
618
- /**
619
- * Finds the drag index of the section.
620
- *
621
- * @param sectionObjects The objects in the section.
622
- * @param sectionReplayObjectData The hitobject data of all objects in the section.
623
- * @param cursorIndexes The indexes of the cursor instance that has at least an occurrence in the section.
624
- */
625
- private findDragIndex;
626
- /**
627
- * Redivides the beatmap into sections.
628
- *
629
- * The result will be used to detect for three-fingered
630
- * sections.
631
- */
632
- private getDetailedBeatmapSections;
633
- /**
634
- * Attempts to prevent accidental taps from being flagged.
635
- *
636
- * This detection will filter cursors that don't hit
637
- * any object in beatmap sections, thus eliminating any
638
- * unnecessary taps.
639
- */
640
- private preventAccidentalTaps;
641
- /**
642
- * Creates nerf factors by scanning through objects.
643
- *
644
- * This check will ignore all objects with speed strain below `strainThreshold`.
645
- */
646
- private calculateNerfFactors;
647
- /**
648
- * Calculates the final penalty.
649
- */
650
- private calculateFinalPenalty;
461
+ /**
462
+ * Information about the result of a check.
463
+ */
464
+ interface ThreeFingerInformation {
465
+ /**
466
+ * Whether or not the beatmap is 3-fingered.
467
+ */
468
+ readonly is3Finger: boolean;
469
+ /**
470
+ * The final penalty. By default this is 1.
471
+ */
472
+ readonly penalty: number;
473
+ }
474
+ /**
475
+ * Utility to check whether or not a beatmap is three-fingered.
476
+ */
477
+ declare class ThreeFingerChecker {
478
+ /**
479
+ * The beatmap to analyze.
480
+ */
481
+ readonly map: DroidStarRating | DroidStarRating$1;
482
+ /**
483
+ * The data of the replay.
484
+ */
485
+ readonly data: ReplayData;
486
+ /**
487
+ * The strain threshold to start detecting for 3-fingered section.
488
+ *
489
+ * Increasing this number will result in less sections being flagged.
490
+ */
491
+ private static readonly strainThreshold;
492
+ /**
493
+ * The distance threshold between cursors to assume that two cursors are
494
+ * actually pressed with 1 finger in osu!pixels.
495
+ *
496
+ * This is used to prevent cases where a player would lift their finger
497
+ * too fast to the point where the 4th cursor instance or beyond is recorded
498
+ * as 1st, 2nd, or 3rd cursor instance.
499
+ */
500
+ private readonly cursorDistancingDistanceThreshold;
501
+ /**
502
+ * The threshold for the amount of cursors that are assumed to be pressed
503
+ * by a single finger.
504
+ */
505
+ private readonly cursorDistancingCountThreshold;
506
+ /**
507
+ * The threshold for the time difference of cursors that are assumed to be pressed
508
+ * by a single finger, in milliseconds.
509
+ */
510
+ private readonly cursorDistancingTimeThreshold;
511
+ /**
512
+ * The amount of notes that has a tap strain exceeding `strainThreshold`.
513
+ */
514
+ private readonly strainNoteCount;
515
+ /**
516
+ * The ratio threshold between non-3 finger cursors and 3-finger cursors.
517
+ *
518
+ * Increasing this number will increase detection accuracy, however
519
+ * it also increases the chance of falsely flagged plays.
520
+ */
521
+ private readonly threeFingerRatioThreshold;
522
+ /**
523
+ * The maximum delta time allowed between two beatmap sections.
524
+ *
525
+ * Increasing this number decreases the amount of beatmap sections in general.
526
+ *
527
+ * Note that this value does not account for the speed multiplier of
528
+ * the play, similar to the way replay object data is stored.
529
+ */
530
+ private readonly maxSectionDeltaTime;
531
+ /**
532
+ * The minimum object count required to make a beatmap section.
533
+ *
534
+ * Increasing this number decreases the amount of beatmap sections.
535
+ */
536
+ private readonly minSectionObjectCount;
537
+ /**
538
+ * The sections of the beatmap that was cut based on `maxSectionDeltaTime` and `minSectionObjectCount`.
539
+ */
540
+ private readonly beatmapSections;
541
+ /**
542
+ * This threshold is used to filter out accidental taps.
543
+ *
544
+ * Increasing this number makes the filtration more sensitive, however it
545
+ * will also increase the chance of 3-fingered plays getting out from
546
+ * being flagged.
547
+ */
548
+ private readonly accidentalTapThreshold;
549
+ /**
550
+ * The hit window of this beatmap. Keep in mind that speed-changing mods do not change hit window length in game logic.
551
+ */
552
+ private readonly hitWindow;
553
+ /**
554
+ * A reprocessed break points to match right on object time.
555
+ *
556
+ * This is used to increase detection accuracy since break points do not start right at the
557
+ * start of the hitobject before it and do not end right at the first hitobject after it.
558
+ */
559
+ private readonly breakPointAccurateTimes;
560
+ /**
561
+ * A cursor data array that only contains `movementType.DOWN` movement ID occurrences.
562
+ */
563
+ private readonly downCursorInstances;
564
+ /**
565
+ * Nerf factors from all sections that were three-fingered.
566
+ */
567
+ private readonly nerfFactors;
568
+ /**
569
+ * @param map The beatmap to analyze.
570
+ * @param data The data of the replay.
571
+ */
572
+ constructor(map: DroidStarRating | DroidStarRating$1, data: ReplayData);
573
+ /**
574
+ * Checks whether a beatmap is eligible to be detected for 3-finger.
575
+ */
576
+ static isEligibleToDetect(
577
+ map: DroidStarRating | DroidStarRating$1
578
+ ): boolean;
579
+ /**
580
+ * Checks if the given beatmap is 3-fingered and also returns the final penalty.
581
+ *
582
+ * The beatmap will be separated into sections and each section will be determined
583
+ * whether or not it is dragged.
584
+ *
585
+ * After that, each section will be assigned a nerf factor based on whether or not
586
+ * the section is 3-fingered. These nerf factors will be summed up into a final
587
+ * nerf factor, taking beatmap difficulty into account.
588
+ */
589
+ check(): ThreeFingerInformation;
590
+ /**
591
+ * Generates a new set of "accurate break points".
592
+ *
593
+ * This is done to increase detection accuracy since break points do not start right at the
594
+ * start of the hitobject before it and do not end right at the first hitobject after it.
595
+ */
596
+ private getAccurateBreakPoints;
597
+ /**
598
+ * Filters the original cursor instances, returning only those with `movementType.DOWN` movement ID.
599
+ *
600
+ * This also filters cursors that are in break period or happen before start/after end of the beatmap.
601
+ */
602
+ private filterCursorInstances;
603
+ /**
604
+ * Divides the beatmap into sections, which will be used to
605
+ * detect dragged sections and improve detection speed.
606
+ */
607
+ private getBeatmapSections;
608
+ /**
609
+ * Checks whether or not each beatmap sections is dragged.
610
+ */
611
+ private detectDragPlay;
612
+ /**
613
+ * Checks if a section is dragged and returns the index of the drag finger.
614
+ *
615
+ * If the section is not dragged, -1 will be returned.
616
+ *
617
+ * @param section The section to check.
618
+ */
619
+ private checkDrag;
620
+ /**
621
+ * Finds the drag index of the section.
622
+ *
623
+ * @param sectionObjects The objects in the section.
624
+ * @param sectionReplayObjectData The hitobject data of all objects in the section.
625
+ * @param cursorIndexes The indexes of the cursor instance that has at least an occurrence in the section.
626
+ */
627
+ private findDragIndex;
628
+ /**
629
+ * Redivides the beatmap into sections.
630
+ *
631
+ * The result will be used to detect for three-fingered
632
+ * sections.
633
+ */
634
+ private getDetailedBeatmapSections;
635
+ /**
636
+ * Attempts to prevent accidental taps from being flagged.
637
+ *
638
+ * This detection will filter cursors that don't hit
639
+ * any object in beatmap sections, thus eliminating any
640
+ * unnecessary taps.
641
+ */
642
+ private preventAccidentalTaps;
643
+ /**
644
+ * Creates nerf factors by scanning through objects.
645
+ *
646
+ * This check will ignore all objects with speed strain below `strainThreshold`.
647
+ */
648
+ private calculateNerfFactors;
649
+ /**
650
+ * Calculates the final penalty.
651
+ */
652
+ private calculateFinalPenalty;
651
653
  }
652
654
 
653
- export { CursorData, CursorInformation, ExportedReplayJSON, HitErrorInformation, ReplayAnalyzer, ReplayData, ReplayInformation, ReplayObjectData, ThreeFingerChecker, ThreeFingerInformation, hitResult, movementType };
655
+ export {
656
+ CursorData,
657
+ CursorInformation,
658
+ ExportedReplayJSON,
659
+ HitErrorInformation,
660
+ ReplayAnalyzer,
661
+ ReplayData,
662
+ ReplayInformation,
663
+ ReplayObjectData,
664
+ ThreeFingerChecker,
665
+ ThreeFingerInformation,
666
+ hitResult,
667
+ movementType,
668
+ };