Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/production-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- le-testing

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
127 changes: 121 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,5 @@ aim-accuracy-fix = { package = "akatsuki-pp", git = "https://github.com/osuAkats
improved-miss-penalty-and-acc-rework = { package = "akatsuki-pp", git = "https://github.com/osuAkatsuki/akatsuki-pp-rs", rev = "c5cb35b62309c2159a466a6d26addde7acf0c231" }
everything-at-once = { package = "akatsuki-pp", git = "https://github.com/osuAkatsuki/akatsuki-pp-rs", rev = "6d22dcdcafb70399a5c0380fcad96e3bdd5c4009" }
kippy-attempt = { package = "akatsuki-pp", git = "https://github.com/kippysevenstars/akatsuki-pp-rs", rev = "001cc6eb920c4945e14b66ca682bfbf8ecedce4b" }
merge-test = { package = "rosu-pp", git = "https://github.com/infernalfire72/rosu-pp", rev = "ab89d750d62a42e47157e4810d576aa5ee915b1b" }
md5 = "0.7.0"
26 changes: 26 additions & 0 deletions src/processor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,31 @@ async fn calculate_kippy_attempt_pp(
Ok(pp)
}

async fn calculate_merge_test_pp(
score: &RippleScore,
context: Arc<Context>,
) -> anyhow::Result<f32> {
let beatmap_bytes =
usecases::beatmaps::fetch_beatmap_osu_file(score.beatmap_id, context).await?;
let beatmap = merge_test::Beatmap::from_bytes(&beatmap_bytes)?;

let result = merge_test::any::Performance::from(&beatmap)
.mods(score.mods as u32)
.combo(score.max_combo as u32)
.n300(score.count_300 as u32)
.n100(score.count_100 as u32)
.n50(score.count_50 as u32)
.misses(score.count_misses as u32)
.calculate();

let mut pp = round(result.pp() as f32, 2);
if pp.is_infinite() || pp.is_nan() {
pp = 0.0;
}

Ok(pp)
}

async fn process_scores(
rework: &Rework,
scores: Vec<RippleScore>,
Expand All @@ -301,6 +326,7 @@ async fn process_scores(
27 => calculate_improved_miss_penalty_and_acc_rework_pp(score, context.clone()).await?,
28 => calculate_everything_at_once_pp(score, context.clone()).await?,
29 => calculate_kippy_attempt_pp(score, context.clone()).await?,
30 => calculate_merge_test_pp(score, context.clone()).await?,
_ => unreachable!(),
};

Expand Down
Loading