diff --git a/README.md b/README.md index fcaff375..9e4bc96b 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,8 @@ api - `n100` - Amount of 100 - `n50` - Amount of 50 - `sliderEndHits` - Amount of slider ends hits (lazer only) - - `sliderTickHits` - Amount of slider ticks hits (lazer only) + - `smallTickHits` - Amount of slider small ticks hits (lazer only) + - `largeTickHits` - Amount of slider large ticks hits (lazer only) - `nMisses` - Amount of Misses - `combo` - combo - `passedObjects` - Sum of nGeki, nKatu, n300, n100, n50, nMisses diff --git a/packages/server/package.json b/packages/server/package.json index 31f638c8..0c2c6f2f 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -12,7 +12,7 @@ "dependencies": { "@tosu/common": "workspace:*", "@tosu/updater": "workspace:*", - "@kotrikd/rosu-pp": "2.0.0-alpha.10", + "@kotrikd/rosu-pp": "2.0.0", "semver": "^7.5.4", "ws": "^8.16.0" }, diff --git a/packages/server/router/index.ts b/packages/server/router/index.ts index feadfdcf..e5d235a7 100644 --- a/packages/server/router/index.ts +++ b/packages/server/router/index.ts @@ -451,14 +451,10 @@ export default function buildBaseApi(server: Server) { if (query.acc !== undefined) params.accuracy = +query.acc; if (query.sliderEndHits !== undefined) params.sliderEndHits = +query.sliderEndHits; - if (query.sliderTickHits !== undefined) - params.sliderTickHits = +query.sliderTickHits; - - if ( - params.sliderEndHits === undefined && - params.sliderTickHits === undefined - ) - params.lazer = false; + if (query.smallTickHits !== undefined) + params.smallTickHits = +query.smallTickHits; + if (query.largeTickHits !== undefined) + params.largeTickHits = +query.largeTickHits; const calculate = new rosu.Performance(params).calculate(beatmap); sendJson(res, calculate); diff --git a/packages/tosu/package.json b/packages/tosu/package.json index 4105b4e9..b0d9c401 100644 --- a/packages/tosu/package.json +++ b/packages/tosu/package.json @@ -24,7 +24,7 @@ "osu-standard-stable": "^5.0.0", "osu-taiko-stable": "^5.0.0", "resedit": "^2.0.0", - "@kotrikd/rosu-pp": "2.0.0-alpha.10", + "@kotrikd/rosu-pp": "2.0.0", "semver": "^7.5.4", "tsprocess": "workspace:*" }, diff --git a/packages/tosu/src/api/types/v2.ts b/packages/tosu/src/api/types/v2.ts index b71dc6d1..08c06fdc 100644 --- a/packages/tosu/src/api/types/v2.ts +++ b/packages/tosu/src/api/types/v2.ts @@ -221,7 +221,8 @@ export interface Hits { katu: number; sliderBreaks: number; sliderEndHits: number; - sliderTickHits: number; + smallTickHits: number; + largeTickHits: number; } export interface Combo { @@ -364,7 +365,8 @@ export interface Hits3 { geki: number; katu: number; sliderEndHits: number; - sliderTickHits: number; + smallTickHits: number; + largeTickHits: number; } export interface Folders { diff --git a/packages/tosu/src/api/utils/buildResultV2.ts b/packages/tosu/src/api/utils/buildResultV2.ts index 7280c5c8..eea75977 100644 --- a/packages/tosu/src/api/utils/buildResultV2.ts +++ b/packages/tosu/src/api/utils/buildResultV2.ts @@ -125,7 +125,8 @@ export const buildResult = (instanceManager: InstanceManager): ApiAnswer => { 50: resultScreen.hit50, 0: resultScreen.hitMiss, sliderEndHits: resultScreen.sliderEndHits, - sliderTickHits: resultScreen.sliderTickHits + smallTickHits: resultScreen.smallTickHits, + largeTickHits: resultScreen.largeTickHits }; return { @@ -570,7 +571,8 @@ function buildPlay( 0: gameplay.hitMiss, sliderBreaks: gameplay.hitSB, sliderEndHits: gameplay.sliderEndHits, - sliderTickHits: gameplay.sliderTickHits + smallTickHits: gameplay.smallTickHits, + largeTickHits: gameplay.largeTickHits }, hitErrorArray: gameplay.hitErrors, diff --git a/packages/tosu/src/memory/lazer.ts b/packages/tosu/src/memory/lazer.ts index b95243fe..57d1ceea 100644 --- a/packages/tosu/src/memory/lazer.ts +++ b/packages/tosu/src/memory/lazer.ts @@ -803,8 +803,9 @@ export class LazerMemory extends AbstractMemory { hit100: statistics.ok, hit50: statistics.meh, hitMiss: statistics.miss, - sliderEndHits: statistics.sliderTailHit || statistics.smallTickHit, - sliderTickHits: statistics.largeTickHit, + sliderEndHits: statistics.sliderTailHit, + smallTickHits: statistics.largeTickHit, + largeTickHits: statistics.smallTickHit, combo, maxCombo: this.process.readInt(scoreInfo + 0xc4), pp @@ -925,7 +926,8 @@ export class LazerMemory extends AbstractMemory { hitKatu: score.hitKatu, hitMiss: score.hitMiss, sliderEndHits: score.sliderEndHits, - sliderTickHits: score.sliderTickHits, + smallTickHits: score.smallTickHits, + largeTickHits: score.largeTickHits, date }; } diff --git a/packages/tosu/src/memory/stable.ts b/packages/tosu/src/memory/stable.ts index dce4a6c3..cb801885 100644 --- a/packages/tosu/src/memory/stable.ts +++ b/packages/tosu/src/memory/stable.ts @@ -430,7 +430,8 @@ export class StableMemory extends AbstractMemory { hitKatu, hitMiss, sliderEndHits: 0, - sliderTickHits: 0, + smallTickHits: 0, + largeTickHits: 0, date }; } catch (error) { @@ -549,7 +550,8 @@ export class StableMemory extends AbstractMemory { hitKatu, hitMiss, sliderEndHits: 0, - sliderTickHits: 0, + smallTickHits: 0, + largeTickHits: 0, combo, maxCombo }; diff --git a/packages/tosu/src/memory/types.ts b/packages/tosu/src/memory/types.ts index 9820a221..9fdbeadb 100644 --- a/packages/tosu/src/memory/types.ts +++ b/packages/tosu/src/memory/types.ts @@ -63,7 +63,8 @@ export type IResultScreen = hitKatu: number; hitMiss: number; sliderEndHits: number; - sliderTickHits: number; + smallTickHits: number; + largeTickHits: number; date: string; } | string @@ -85,7 +86,8 @@ export type IScore = { hitKatu: number; hitMiss: number; sliderEndHits: number; - sliderTickHits: number; + smallTickHits: number; + largeTickHits: number; combo: number; maxCombo: number; pp?: number; diff --git a/packages/tosu/src/states/beatmap.ts b/packages/tosu/src/states/beatmap.ts index f540d01a..5319762f 100644 --- a/packages/tosu/src/states/beatmap.ts +++ b/packages/tosu/src/states/beatmap.ts @@ -500,7 +500,7 @@ export class BeatmapPP extends AbstractState { rhythm: fcPerformance.difficulty.rhythm, color: fcPerformance.difficulty.color, peak: fcPerformance.difficulty.peak, - hitWindow: fcPerformance.difficulty.hitWindow + hitWindow: fcPerformance.difficulty.greatHitWindow }; attributes.free(); diff --git a/packages/tosu/src/states/gameplay.ts b/packages/tosu/src/states/gameplay.ts index d884c877..518ad9af 100644 --- a/packages/tosu/src/states/gameplay.ts +++ b/packages/tosu/src/states/gameplay.ts @@ -44,7 +44,8 @@ export class Gameplay extends AbstractState { hitKatu: number; hitMiss: number; sliderEndHits: number; - sliderTickHits: number; + smallTickHits: number; + largeTickHits: number; hitMissPrev: number; hitUR: number; hitSB: number; @@ -87,7 +88,8 @@ export class Gameplay extends AbstractState { this.hitKatu = 0; this.hitMiss = 0; this.sliderEndHits = 0; - this.sliderTickHits = 0; + this.smallTickHits = 0; + this.largeTickHits = 0; this.hitMissPrev = 0; this.hitUR = 0.0; this.hitSB = 0; @@ -203,7 +205,8 @@ export class Gameplay extends AbstractState { this.hitKatu = result.hitKatu; this.hitMiss = result.hitMiss; this.sliderEndHits = result.sliderEndHits; - this.sliderTickHits = result.sliderTickHits; + this.smallTickHits = result.smallTickHits; + this.largeTickHits = result.largeTickHits; this.combo = result.combo; this.maxCombo = result.maxCombo; @@ -487,7 +490,8 @@ export class Gameplay extends AbstractState { nKatu: this.hitKatu, nGeki: this.hitGeki, sliderEndHits: this.sliderEndHits, - sliderTickHits: this.sliderTickHits + osuSmallTickHits: this.smallTickHits, + osuLargeTickHits: this.largeTickHits }; const currPerformance = this.gradualPerformance.nth( diff --git a/packages/tosu/src/states/resultScreen.ts b/packages/tosu/src/states/resultScreen.ts index d0d4d0a0..1ddb5591 100644 --- a/packages/tosu/src/states/resultScreen.ts +++ b/packages/tosu/src/states/resultScreen.ts @@ -21,7 +21,8 @@ export class ResultScreen extends AbstractState { hitKatu: number; hitMiss: number; sliderEndHits: number; - sliderTickHits: number; + smallTickHits: number; + largeTickHits: number; grade: string; date: string; accuracy: number; @@ -52,7 +53,8 @@ export class ResultScreen extends AbstractState { this.hitKatu = 0; this.hitMiss = 0; this.sliderEndHits = 0; - this.sliderTickHits = 0; + this.smallTickHits = 0; + this.largeTickHits = 0; this.grade = ''; this.date = ''; this.accuracy = 0; @@ -84,7 +86,8 @@ export class ResultScreen extends AbstractState { this.hitKatu = result.hitKatu; this.hitMiss = result.hitMiss; this.sliderEndHits = result.sliderEndHits; - this.sliderTickHits = result.sliderTickHits; + this.smallTickHits = result.smallTickHits; + this.largeTickHits = result.largeTickHits; this.date = result.date; const hits = { @@ -146,7 +149,8 @@ export class ResultScreen extends AbstractState { nKatu: this.hitKatu, nGeki: this.hitGeki, sliderEndHits: this.sliderEndHits, - sliderTickHits: this.sliderTickHits, + smallTickHits: this.smallTickHits, + largeTickHits: this.largeTickHits, lazer: this.game.client === ClientType.lazer }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f8181172..58ed7c0f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -72,8 +72,8 @@ importers: packages/server: dependencies: '@kotrikd/rosu-pp': - specifier: 2.0.0-alpha.10 - version: 2.0.0-alpha.10 + specifier: 2.0.0 + version: 2.0.0 '@tosu/common': specifier: workspace:* version: link:../common @@ -94,8 +94,8 @@ importers: packages/tosu: dependencies: '@kotrikd/rosu-pp': - specifier: 2.0.0-alpha.10 - version: 2.0.0-alpha.10 + specifier: 2.0.0 + version: 2.0.0 '@tosu/common': specifier: workspace:* version: link:../common @@ -313,8 +313,8 @@ packages: '@jridgewell/trace-mapping@0.3.9': resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} - '@kotrikd/rosu-pp@2.0.0-alpha.10': - resolution: {integrity: sha512-fzqaNXEkImdR1Dq8kvymITZwyQV+OatZCGoXgFMvNd7p4X2AoDCeB5g0CQdaKVsYTmlPLaAYbOZzYGfkDn/Aow==} + '@kotrikd/rosu-pp@2.0.0': + resolution: {integrity: sha512-me0oaYEGTmMTv1arJ0w0vZBOFST3QJEvx+SZKqtFmzi5WzwdU5GFSGQzXRBUOiGMC5id3CH1bXlEPeFSreIEmA==} '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} @@ -2861,7 +2861,7 @@ snapshots: '@jridgewell/resolve-uri': 3.1.1 '@jridgewell/sourcemap-codec': 1.4.15 - '@kotrikd/rosu-pp@2.0.0-alpha.10': {} + '@kotrikd/rosu-pp@2.0.0': {} '@nodelib/fs.scandir@2.1.5': dependencies: