From e4c767e9209073039480e01bf0a61bf9dc39e48c Mon Sep 17 00:00:00 2001 From: Max Ohn Date: Thu, 12 Mar 2026 13:11:25 +0100 Subject: [PATCH 1/2] dep: use local rosu-pp --- Cargo.lock | 106 ++++++++++++++++--- Cargo.toml | 6 +- bathbot-cards/src/skills/mod.rs | 24 ++--- bathbot/Cargo.toml | 4 +- bathbot/src/active/impls/bookmarks.rs | 9 +- bathbot/src/active/impls/map.rs | 7 +- bathbot/src/active/impls/simulate/data.rs | 3 +- bathbot/src/active/impls/simulate/state.rs | 80 +++++++------- bathbot/src/active/impls/simulate/top_old.rs | 21 ++-- bathbot/src/manager/pp.rs | 2 + 10 files changed, 174 insertions(+), 88 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4096b894..dddd1236 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -44,6 +44,12 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" +[[package]] +name = "anstyle" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" + [[package]] name = "anyhow" version = "1.0.99" @@ -624,6 +630,32 @@ dependencies = [ "libloading", ] +[[package]] +name = "clap" +version = "4.5.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2797f34da339ce31042b27d23607e051786132987f595b02ba4f6a6dffb7030a" +dependencies = [ + "clap_builder", +] + +[[package]] +name = "clap_builder" +version = "4.5.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24a241312cea5059b13574bb9b3861cabf758b879c15190b37b6d6fd63ab6876" +dependencies = [ + "anstyle", + "clap_lex", + "terminal_size", +] + +[[package]] +name = "clap_lex" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a822ea5bc7590f9d40f1ba12c0dc3c2760f3482c6984db1573ad11031420831" + [[package]] name = "color_quant" version = "1.1.0" @@ -653,6 +685,12 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "condtype" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf0a07a401f374238ab8e2f11a104d2851bf9ce711ec69804834de8af45c7af" + [[package]] name = "console-api" version = "0.8.1" @@ -973,7 +1011,7 @@ dependencies = [ "libc", "option-ext", "redox_users", - "windows-sys 0.61.0", + "windows-sys 0.60.2", ] [[package]] @@ -987,6 +1025,31 @@ dependencies = [ "syn", ] +[[package]] +name = "divan" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a405457ec78b8fe08b0e32b4a3570ab5dff6dd16eb9e76a5ee0a9d9cbd898933" +dependencies = [ + "cfg-if", + "clap", + "condtype", + "divan-macros", + "libc", + "regex-lite", +] + +[[package]] +name = "divan-macros" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9556bc800956545d6420a640173e5ba7dfa82f38d3ea5a167eb555bc69ac3323" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "dlib" version = "0.5.2" @@ -1066,7 +1129,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.0", + "windows-sys 0.60.2", ] [[package]] @@ -1659,7 +1722,7 @@ dependencies = [ "hyper", "libc", "pin-project-lite", - "socket2 0.6.0", + "socket2 0.5.10", "tokio", "tower-service", "tracing", @@ -2328,10 +2391,10 @@ dependencies = [ ] [[package]] -name = "paste" -version = "1.0.15" +name = "pastey" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +checksum = "b867cad97c0791bbd3aaa6472142568c6c9e8f71937e98379f584cfb0cf35bec" [[package]] name = "pathfinder_geometry" @@ -2805,6 +2868,12 @@ dependencies = [ "regex-syntax", ] +[[package]] +name = "regex-lite" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab834c73d247e67f4fae452806d17d3c7501756d98c8808d7c9c7aa7d18f973" + [[package]] name = "regex-syntax" version = "0.8.6" @@ -2872,11 +2941,11 @@ checksum = "6b92ea634d8b3eaa4d7fba7bd12045dda1a50ce81401c96af0d9c851b0737544" [[package]] name = "rosu-mods" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdc002dd5c7baef181e98980615ef27df55f35ff291c088cb37e6a339f2777e1" +checksum = "3dd5db7193071b635e7d95fc71a38ab59042bd2496e7ecc3088bdad07e6b4ff0" dependencies = [ - "paste", + "pastey", "rkyv", "serde", ] @@ -2884,8 +2953,8 @@ dependencies = [ [[package]] name = "rosu-pp" version = "3.1.0" -source = "git+https://github.com/MaxOhn/rosu-pp?branch=next#1bdb39fde4dc6f649daf5f9226422a48b01a4b9d" dependencies = [ + "divan", "rosu-map", "rosu-mods", ] @@ -2893,7 +2962,6 @@ dependencies = [ [[package]] name = "rosu-pp-older" version = "0.2.0" -source = "git+https://github.com/MaxOhn/rosu-pp-older.git?branch=main#b3880e406d8d0661c88bb63a1e9ce4e3c267be67" dependencies = [ "rosu-map", "rosu-pp", @@ -2933,7 +3001,7 @@ dependencies = [ [[package]] name = "rosu-v2" version = "0.11.0" -source = "git+https://github.com/MaxOhn/rosu-v2?branch=lazer#b3208c817afcd914bfd669e8c89504c86a29d3ee" +source = "git+https://github.com/MaxOhn/rosu-v2?branch=lazer#520b2a5592bace5db4b6c4b1efeb1a61330f4e1d" dependencies = [ "bytes", "futures", @@ -3008,7 +3076,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.61.0", + "windows-sys 0.60.2", ] [[package]] @@ -3650,6 +3718,16 @@ dependencies = [ "xattr", ] +[[package]] +name = "terminal_size" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b8cb979cb11c32ce1603f8137b22262a9d131aaa5c37b5678025f22b8becd0" +dependencies = [ + "rustix", + "windows-sys 0.60.2", +] + [[package]] name = "thiserror" version = "1.0.69" @@ -4512,7 +4590,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.0", + "windows-sys 0.48.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 44a27fc5..36780ae1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,9 +30,9 @@ metrics = { version = "0.24.1" } metrics-exporter-prometheus = { version = "0.16.2", default-features = false } metrics-util = { version = "0.19.0" } rkyv = { version = "0.8" } -rosu-mods = { version = "0.3.0", features = ["rkyv"] } -rosu-pp = { git = "https://github.com/MaxOhn/rosu-pp", branch = "next" } -# rosu-pp = { path = "../rosu-pp" } +rosu-mods = { version = "0.4.0", features = ["rkyv"] } +# rosu-pp = { git = "https://github.com/MaxOhn/rosu-pp", branch = "next" } +rosu-pp = { path = "../rosu-pp" } rosu-v2 = { git = "https://github.com/MaxOhn/rosu-v2", branch = "lazer", default-features = false, features = ["deny_unknown_fields", "macros", "metrics"] } # rosu-v2 = { path = "../rosu-v2", default-features = false, features = ["deny_unknown_fields", "macros", "metrics"] } rustls = { version = "0.23.20", default-features = false, features = ["std", "tls12"] } diff --git a/bathbot-cards/src/skills/mod.rs b/bathbot-cards/src/skills/mod.rs index 0cffdf43..fd72ce0e 100644 --- a/bathbot-cards/src/skills/mod.rs +++ b/bathbot-cards/src/skills/mod.rs @@ -6,10 +6,10 @@ mod title; use std::hash::BuildHasher; use rosu_pp::{ - catch::{CatchPerformance, CatchPerformanceAttributes, CatchScoreState}, + catch::{CatchHitResults, CatchPerformance, CatchPerformanceAttributes}, mania::{ManiaPerformance, ManiaScoreState}, - osu::{OsuPerformance, OsuScoreState}, - taiko::{TaikoPerformance, TaikoScoreState}, + osu::{OsuHitResults, OsuPerformance}, + taiko::{TaikoHitResults, TaikoPerformance}, }; use rosu_v2::model::{GameMode, score::Score}; @@ -53,8 +53,7 @@ impl Skills { continue; }; - let state = OsuScoreState { - max_combo: score.max_combo, + let hitresults = OsuHitResults { n300: score.statistics.great, n100: score.statistics.ok, n50: score.statistics.meh, @@ -67,7 +66,8 @@ impl Skills { let attrs = OsuPerformance::try_new(attrs.difficulty) .unwrap() .mods(score.mods.clone()) - .state(state) + .combo(score.max_combo) + .hitresults(hitresults) .lazer(score.set_on_lazer) .calculate() .unwrap(); @@ -102,8 +102,7 @@ impl Skills { continue; }; - let state = TaikoScoreState { - max_combo: score.max_combo, + let hitresults = TaikoHitResults { n300: score.statistics.great, n100: score.statistics.ok, misses: score.statistics.miss, @@ -112,7 +111,8 @@ impl Skills { let attrs = TaikoPerformance::try_new(attrs.difficulty) .unwrap() .mods(score.mods.clone()) - .state(state) + .combo(score.max_combo) + .hitresults(hitresults) .calculate() .unwrap(); @@ -143,8 +143,7 @@ impl Skills { continue; }; - let state = CatchScoreState { - max_combo: score.max_combo, + let hitresults = CatchHitResults { fruits: score.statistics.great, droplets: score.statistics.large_tick_hit, tiny_droplets: score.statistics.small_tick_hit, @@ -157,7 +156,8 @@ impl Skills { let attrs = CatchPerformance::try_new(attrs.difficulty) .unwrap() .mods(score.mods.clone()) - .state(state) + .combo(score.max_combo) + .hitresults(hitresults) .calculate() .unwrap(); diff --git a/bathbot/Cargo.toml b/bathbot/Cargo.toml index b59e08e3..d31210e8 100644 --- a/bathbot/Cargo.toml +++ b/bathbot/Cargo.toml @@ -45,8 +45,8 @@ rand = { version = "0.8" } rkyv = { workspace = true } rosu-pp = { workspace = true } rosu-v2 = { workspace = true } -rosu-pp-older = { git = "https://github.com/MaxOhn/rosu-pp-older.git", branch = "main" } -# rosu-pp-older = { path = "../../rosu-pp-older" } +# rosu-pp-older = { git = "https://github.com/MaxOhn/rosu-pp-older.git", branch = "main" } +rosu-pp-older = { path = "../../rosu-pp-older" } # rosu-render = { git = "https://github.com/MaxOhn/rosu-render", branch = "main", default-features = false, features = ["rustls-webpki-roots"] } rosu-render = { version = "0.5.1", default-features = false, features = ["rustls-webpki-roots"] } serde = { version = "1.0", features = ["derive"] } diff --git a/bathbot/src/active/impls/bookmarks.rs b/bathbot/src/active/impls/bookmarks.rs index 4adb8966..3fafdc8b 100644 --- a/bathbot/src/active/impls/bookmarks.rs +++ b/bathbot/src/active/impls/bookmarks.rs @@ -15,7 +15,10 @@ use bathbot_util::{ numbers::round, }; use eyre::{Report, Result}; -use rosu_pp::{Beatmap, Difficulty, Performance, any::HitResultPriority}; +use rosu_pp::{ + Beatmap, Difficulty, Performance, + any::hitresult_generator::{Closest, Composable, Fast}, +}; use rosu_v2::prelude::{GameMode, Username}; use twilight_model::{ channel::message::{ @@ -271,7 +274,7 @@ impl BookmarksPagination { pp_97 = Performance::new(attrs.difficulty_attributes()) .accuracy(97.0) - .hitresult_priority(HitResultPriority::Fastest) + .hitresult_generator::>() .lazer(true) .calculate() .pp() as f32; @@ -351,7 +354,7 @@ impl BookmarksPagination { for &acc in ACCS.iter() { let pp_result = Performance::from(attrs.clone()) .accuracy(acc as f64) - .hitresult_priority(HitResultPriority::Fastest) + .hitresult_generator::>() .calculate(); let pp = pp_result.pp(); diff --git a/bathbot/src/active/impls/map.rs b/bathbot/src/active/impls/map.rs index c0a85274..7111755e 100644 --- a/bathbot/src/active/impls/map.rs +++ b/bathbot/src/active/impls/map.rs @@ -10,7 +10,10 @@ use bathbot_util::{ numbers::{WithComma, round}, }; use eyre::{ContextCompat, Result, WrapErr}; -use rosu_pp::{Difficulty, any::HitResultPriority}; +use rosu_pp::{ + Difficulty, + any::hitresult_generator::{Closest, Composable, Fast}, +}; use rosu_v2::prelude::{ BeatmapExtended, BeatmapsetExtended, GameMode, GameModsIntermode, Username, }; @@ -144,7 +147,7 @@ impl IActiveMessage for MapPagination { .mods(&self.mods) .accuracy(acc as f64) .clock_rate(clock_rate) - .hitresult_priority(HitResultPriority::Fastest) + .hitresult_generator::>() .calculate(); let pp = pp_result.pp(); diff --git a/bathbot/src/active/impls/simulate/data.rs b/bathbot/src/active/impls/simulate/data.rs index cc588845..1ee360c7 100644 --- a/bathbot/src/active/impls/simulate/data.rs +++ b/bathbot/src/active/impls/simulate/data.rs @@ -1,4 +1,3 @@ -use rosu_pp::any::HitResultPriority; use rosu_v2::{ mods, prelude::{GameMod, GameMods}, @@ -117,7 +116,7 @@ impl SimulateData { }; ( @PRIO $calc:ident A $( $rest:tt )* ) => { if self.acc.is_some() { - $calc = $calc.hitresult_priority(HitResultPriority::Fastest); + $calc = $calc.hitresult_generator::(); } }; ( @PRIO $calc:ident ) => { }; diff --git a/bathbot/src/active/impls/simulate/state.rs b/bathbot/src/active/impls/simulate/state.rs index 8affcf3f..dc9e7c8b 100644 --- a/bathbot/src/active/impls/simulate/state.rs +++ b/bathbot/src/active/impls/simulate/state.rs @@ -1,14 +1,14 @@ use rosu_pp::{ - Beatmap, Difficulty, catch::CatchScoreState, mania::ManiaScoreState, osu::OsuScoreState, - taiko::TaikoScoreState, + Beatmap, Difficulty, catch::CatchHitResults, mania::ManiaHitResults, osu::OsuHitResults, + taiko::TaikoHitResults, }; use rosu_v2::prelude::{GameMode, ScoreStatistics}; pub(super) enum ScoreState { - Osu(OsuScoreState), - Taiko(TaikoScoreState), - Catch(CatchScoreState), - Mania(ManiaScoreState), + Osu(OsuHitResults), + Taiko(TaikoHitResults), + Catch(CatchHitResults), + Mania(ManiaHitResults), } impl ScoreState { @@ -17,14 +17,14 @@ impl ScoreState { map: Option<&Beatmap>, ) -> (GameMode, ScoreStatistics, ScoreStatistics) { match self { - Self::Osu(state) => { + Self::Osu(hitresults) => { let stats = ScoreStatistics { - great: state.n300, - ok: state.n100, - meh: state.n50, - miss: state.misses, - large_tick_hit: state.large_tick_hits, - slider_tail_hit: state.slider_end_hits, + great: hitresults.n300, + ok: hitresults.n100, + meh: hitresults.n50, + miss: hitresults.misses, + large_tick_hit: hitresults.large_tick_hits, + slider_tail_hit: hitresults.slider_end_hits, ..Default::default() }; @@ -42,7 +42,7 @@ impl ScoreState { .unwrap_or((0, 0)); let max_stats = ScoreStatistics { - great: state.n300 + state.n100 + state.n50 + state.misses, + great: hitresults.n300 + hitresults.n100 + hitresults.n50 + hitresults.misses, large_tick_hit, slider_tail_hit, ..Default::default() @@ -50,57 +50,57 @@ impl ScoreState { (GameMode::Osu, stats, max_stats) } - Self::Taiko(state) => { + Self::Taiko(hitresults) => { let stats = ScoreStatistics { - great: state.n300, - ok: state.n100, - miss: state.misses, + great: hitresults.n300, + ok: hitresults.n100, + miss: hitresults.misses, ..Default::default() }; let max_stats = ScoreStatistics { - great: state.n300 + state.n100 + state.misses, + great: hitresults.n300 + hitresults.n100 + hitresults.misses, ..Default::default() }; (GameMode::Taiko, stats, max_stats) } - Self::Catch(state) => { + Self::Catch(hitresults) => { let stats = ScoreStatistics { - great: state.fruits, - good: state.tiny_droplet_misses, - ok: state.droplets, - meh: state.tiny_droplets, - miss: state.misses, + great: hitresults.fruits, + good: hitresults.tiny_droplet_misses, + ok: hitresults.droplets, + meh: hitresults.tiny_droplets, + miss: hitresults.misses, ..Default::default() }; let max_stats = ScoreStatistics { - great: state.fruits + state.droplets + state.misses, - meh: state.tiny_droplets + state.tiny_droplet_misses, + great: hitresults.fruits + hitresults.droplets + hitresults.misses, + meh: hitresults.tiny_droplets + hitresults.tiny_droplet_misses, ..Default::default() }; (GameMode::Catch, stats, max_stats) } - Self::Mania(state) => { + Self::Mania(hitresults) => { let stats = ScoreStatistics { - perfect: state.n320, - great: state.n300, - good: state.n200, - ok: state.n100, - meh: state.n50, - miss: state.misses, + perfect: hitresults.n320, + great: hitresults.n300, + good: hitresults.n200, + ok: hitresults.n100, + meh: hitresults.n50, + miss: hitresults.misses, ..Default::default() }; let max_stats = ScoreStatistics { - perfect: state.n320 - + state.n300 - + state.n200 - + state.n100 - + state.n50 - + state.misses, + perfect: hitresults.n320 + + hitresults.n300 + + hitresults.n200 + + hitresults.n100 + + hitresults.n50 + + hitresults.misses, ..Default::default() }; diff --git a/bathbot/src/active/impls/simulate/top_old.rs b/bathbot/src/active/impls/simulate/top_old.rs index 3a79813e..4bfa490b 100644 --- a/bathbot/src/active/impls/simulate/top_old.rs +++ b/bathbot/src/active/impls/simulate/top_old.rs @@ -1,8 +1,12 @@ use std::fmt::{Display, Formatter, Result as FmtResult}; use rosu_pp::{ - Beatmap, Performance, any::HitResultPriority, catch::CatchScoreState, mania::ManiaScoreState, - osu::OsuScoreState, taiko::TaikoScoreState, + Beatmap, Performance, + any::hitresult_generator::{Closest, Composable, Fast}, + catch::CatchHitResults, + mania::ManiaHitResults, + osu::OsuHitResults, + taiko::TaikoHitResults, }; use twilight_model::channel::message::{ Component, @@ -422,7 +426,7 @@ impl TopOldVersion { if let Some(acc) = data.acc { calc = calc .accuracy(acc as f64) - .hitresult_priority(HitResultPriority::Fastest); + .hitresult_generator::>(); } if let Some(n_geki) = data.n_geki { @@ -462,8 +466,7 @@ impl TopOldVersion { let state = calc.generate_state(); let state = match self { - Self::Osu(_) => ScoreState::Osu(OsuScoreState { - max_combo: state.max_combo, + Self::Osu(_) => ScoreState::Osu(OsuHitResults { n300: state.n300, n100: state.n100, n50: state.n50, @@ -472,21 +475,19 @@ impl TopOldVersion { small_tick_hits: state.osu_small_tick_hits, slider_end_hits: state.slider_end_hits, }), - Self::Taiko(_) => ScoreState::Taiko(TaikoScoreState { - max_combo: state.max_combo, + Self::Taiko(_) => ScoreState::Taiko(TaikoHitResults { n300: state.n300, n100: state.n100, misses: state.misses, }), - Self::Catch(_) => ScoreState::Catch(CatchScoreState { - max_combo: state.max_combo, + Self::Catch(_) => ScoreState::Catch(CatchHitResults { fruits: state.n300, droplets: state.n100, tiny_droplets: state.n50, tiny_droplet_misses: state.n_katu, misses: state.misses, }), - Self::Mania(_) => ScoreState::Mania(ManiaScoreState { + Self::Mania(_) => ScoreState::Mania(ManiaHitResults { n320: state.n_geki, n300: state.n300, n200: state.n_katu, diff --git a/bathbot/src/manager/pp.rs b/bathbot/src/manager/pp.rs index 3dec64d0..4dafdda9 100644 --- a/bathbot/src/manager/pp.rs +++ b/bathbot/src/manager/pp.rs @@ -219,6 +219,7 @@ impl<'s> From<&'s OsuStatsScore> for ScoreData { osu_large_tick_hits: 0, osu_small_tick_hits: 0, slider_end_hits: 0, + legacy_total_score: None, }, mods: Mods::new(score.mods.clone()), mode: None, @@ -302,6 +303,7 @@ fn stats_to_state(max_combo: u32, mode: GameMode, stats: &ScoreStatistics) -> Sc n100, n50, misses: stats.miss, + legacy_total_score: None, } } From 93c2aa668ae5a66545a72e95562ea6df83e8f0fa Mon Sep 17 00:00:00 2001 From: Max Ohn Date: Fri, 13 Mar 2026 22:28:31 +0100 Subject: [PATCH 2/2] feat: pp update --- Cargo.lock | 10 +- Cargo.toml | 4 +- bathbot/Cargo.toml | 4 +- bathbot/src/active/impls/simulate/data.rs | 78 +++++++++-- bathbot/src/active/impls/simulate/top_old.rs | 31 +++-- bathbot/src/commands/osu/simulate/mod.rs | 6 +- bathbot/src/commands/osu/top/old.rs | 139 ++++++++++++++----- bathbot/src/core/context/mod.rs | 7 +- 8 files changed, 209 insertions(+), 70 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dddd1236..e131776e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1011,7 +1011,7 @@ dependencies = [ "libc", "option-ext", "redox_users", - "windows-sys 0.60.2", + "windows-sys 0.59.0", ] [[package]] @@ -1129,7 +1129,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.52.0", ] [[package]] @@ -1976,7 +1976,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" dependencies = [ "cfg-if", - "windows-targets 0.53.3", + "windows-targets 0.48.5", ] [[package]] @@ -2953,6 +2953,7 @@ dependencies = [ [[package]] name = "rosu-pp" version = "3.1.0" +source = "git+https://github.com/MaxOhn/rosu-pp?branch=pp-update#5ed185abf7ad7f4d3ad924d99807fdfd6e7d89c1" dependencies = [ "divan", "rosu-map", @@ -2962,6 +2963,7 @@ dependencies = [ [[package]] name = "rosu-pp-older" version = "0.2.0" +source = "git+https://github.com/MaxOhn/rosu-pp-older.git?branch=main#ae01e30d7e80e8e3ea6cf84bad79b6172a8407f3" dependencies = [ "rosu-map", "rosu-pp", @@ -3076,7 +3078,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.60.2", + "windows-sys 0.52.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 36780ae1..34796345 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,8 +31,8 @@ metrics-exporter-prometheus = { version = "0.16.2", default-features = false } metrics-util = { version = "0.19.0" } rkyv = { version = "0.8" } rosu-mods = { version = "0.4.0", features = ["rkyv"] } -# rosu-pp = { git = "https://github.com/MaxOhn/rosu-pp", branch = "next" } -rosu-pp = { path = "../rosu-pp" } +rosu-pp = { git = "https://github.com/MaxOhn/rosu-pp", branch = "pp-update" } +# rosu-pp = { path = "../rosu-pp" } rosu-v2 = { git = "https://github.com/MaxOhn/rosu-v2", branch = "lazer", default-features = false, features = ["deny_unknown_fields", "macros", "metrics"] } # rosu-v2 = { path = "../rosu-v2", default-features = false, features = ["deny_unknown_fields", "macros", "metrics"] } rustls = { version = "0.23.20", default-features = false, features = ["std", "tls12"] } diff --git a/bathbot/Cargo.toml b/bathbot/Cargo.toml index d31210e8..b59e08e3 100644 --- a/bathbot/Cargo.toml +++ b/bathbot/Cargo.toml @@ -45,8 +45,8 @@ rand = { version = "0.8" } rkyv = { workspace = true } rosu-pp = { workspace = true } rosu-v2 = { workspace = true } -# rosu-pp-older = { git = "https://github.com/MaxOhn/rosu-pp-older.git", branch = "main" } -rosu-pp-older = { path = "../../rosu-pp-older" } +rosu-pp-older = { git = "https://github.com/MaxOhn/rosu-pp-older.git", branch = "main" } +# rosu-pp-older = { path = "../../rosu-pp-older" } # rosu-render = { git = "https://github.com/MaxOhn/rosu-render", branch = "main", default-features = false, features = ["rustls-webpki-roots"] } rosu-render = { version = "0.5.1", default-features = false, features = ["rustls-webpki-roots"] } serde = { version = "1.0", features = ["derive"] } diff --git a/bathbot/src/active/impls/simulate/data.rs b/bathbot/src/active/impls/simulate/data.rs index 1ee360c7..1123f653 100644 --- a/bathbot/src/active/impls/simulate/data.rs +++ b/bathbot/src/active/impls/simulate/data.rs @@ -289,7 +289,27 @@ impl SimulateData { fallible: false, } }, - TopOldVersion::Osu(TopOldOsuVersion::March25Now) => simulate! { + TopOldVersion::Osu(TopOldOsuVersion::March25October25) => simulate! { + rosu_pp_older::osu_2025::OsuPP { + combo: combo, + n300: n300, + n100: n100, + n50: n50, + misses: n_miss, + slider_end_hits: n_slider_ends, + small_tick_hits: n_slider_ends, + large_tick_hits: n_large_ticks, + clock_rate: clock_rate as f64, + @A accuracy: acc as f64, + } => { + mods: mods.clone(), + max_new: map, + with_diff: true, + with_lazer: true, + fallible: true, + } + }, + TopOldVersion::Osu(TopOldOsuVersion::October25Now) => simulate! { rosu_pp::osu::OsuPerformance { combo: combo, n300: n300, @@ -348,8 +368,23 @@ impl SimulateData { with_diff: true, } }, - TopOldVersion::Taiko(TopOldTaikoVersion::March25Now) => simulate! { - rosu_pp::taiko::TaikoPerformance { + TopOldVersion::Taiko(TopOldTaikoVersion::October24March25) => simulate! { + rosu_pp_older::taiko_2024::TaikoPP { + combo: combo, + n300: n300, + n100: n100, + misses: n_miss, + clock_rate: clock_rate as f64, + accuracy: acc as f64, + } => { + mods: mods.clone(), + max_new: map, + with_diff: true, + fallible: false, + } + }, + TopOldVersion::Taiko(TopOldTaikoVersion::March25October25) => simulate! { + rosu_pp_older::taiko_2025::TaikoPP { combo: combo, n300: n300, n100: n100, @@ -358,12 +393,13 @@ impl SimulateData { @A accuracy: acc as f64, } => { mods: mods.clone(), - max_new: attrs, + max_new: map, + with_diff: true, fallible: true, } }, - TopOldVersion::Taiko(TopOldTaikoVersion::October24March25) => simulate! { - rosu_pp_older::taiko_2024::TaikoPP { + TopOldVersion::Taiko(TopOldTaikoVersion::October25Now) => simulate! { + rosu_pp::taiko::TaikoPerformance { combo: combo, n300: n300, n100: n100, @@ -372,9 +408,8 @@ impl SimulateData { accuracy: acc as f64, } => { mods: mods.clone(), - max_new: map, - with_diff: true, - fallible: false, + max_new: attrs, + fallible: true, } }, TopOldVersion::Catch(TopOldCatchVersion::March14May20) => simulate! { @@ -408,7 +443,24 @@ impl SimulateData { with_diff: true, } }, - TopOldVersion::Catch(TopOldCatchVersion::October24Now) => simulate! { + TopOldVersion::Catch(TopOldCatchVersion::October24October25) => simulate! { + rosu_pp_older::fruits_2024::FruitsPP { + combo: combo, + fruits: n300, + droplets: n100, + tiny_droplets: n50, + misses: n_miss, + tiny_droplet_misses: n_katu, + clock_rate: clock_rate as f64, + accuracy: acc as f64, + } => { + mods: mods.clone(), + max_new: map, + with_diff: true, + fallible: true, + } + }, + TopOldVersion::Catch(TopOldCatchVersion::October25Now) => simulate! { rosu_pp::catch::CatchPerformance { combo: combo, fruits: n300, @@ -511,13 +563,13 @@ impl SimulateData { TopOldVersion::Osu( TopOldOsuVersion::September22October24 | TopOldOsuVersion::October24March25 - | TopOldOsuVersion::March25Now + | TopOldOsuVersion::March25October25 ) | TopOldVersion::Taiko( TopOldTaikoVersion::September22October24 | TopOldTaikoVersion::October24March25 - | TopOldTaikoVersion::March25Now + | TopOldTaikoVersion::March25October25 ) | TopOldVersion::Catch( - TopOldCatchVersion::May20October24 | TopOldCatchVersion::October24Now + TopOldCatchVersion::May20October24 | TopOldCatchVersion::October24October25 ) | TopOldVersion::Mania( TopOldManiaVersion::October22October24 | TopOldManiaVersion::October24Now ) diff --git a/bathbot/src/active/impls/simulate/top_old.rs b/bathbot/src/active/impls/simulate/top_old.rs index 4bfa490b..86c2b840 100644 --- a/bathbot/src/active/impls/simulate/top_old.rs +++ b/bathbot/src/active/impls/simulate/top_old.rs @@ -29,7 +29,7 @@ pub enum TopOldVersion { impl TopOldVersion { pub fn from_menu_str(s: &str) -> Option { let version = match s { - "sim_osu_march25_now" => Self::Osu(TopOldOsuVersion::March25Now), + "sim_osu_march25_now" => Self::Osu(TopOldOsuVersion::March25October25), "sim_osu_october24_march25" => Self::Osu(TopOldOsuVersion::October24March25), "sim_osu_september22_october24" => Self::Osu(TopOldOsuVersion::September22October24), "sim_osu_november21_september22" => Self::Osu(TopOldOsuVersion::November21September22), @@ -41,7 +41,7 @@ impl TopOldVersion { "sim_osu_february15_april15" => Self::Osu(TopOldOsuVersion::February15April15), "sim_osu_july14_february15" => Self::Osu(TopOldOsuVersion::July14February15), "sim_osu_may14_july14" => Self::Osu(TopOldOsuVersion::May14July14), - "sim_taiko_march25_now" => Self::Taiko(TopOldTaikoVersion::March25Now), + "sim_taiko_march25_now" => Self::Taiko(TopOldTaikoVersion::March25October25), "sim_taiko_october24_march25" => Self::Taiko(TopOldTaikoVersion::October24March25), "sim_taiko_september22_october24" => { Self::Taiko(TopOldTaikoVersion::September22October24) @@ -50,7 +50,7 @@ impl TopOldVersion { Self::Taiko(TopOldTaikoVersion::September20September22) } "sim_taiko_march14_september20" => Self::Taiko(TopOldTaikoVersion::March14September20), - "sim_catch_october24_now" => Self::Catch(TopOldCatchVersion::October24Now), + "sim_catch_october24_now" => Self::Catch(TopOldCatchVersion::October24October25), "sim_catch_may20_october24" => Self::Catch(TopOldCatchVersion::May20October24), "sim_catch_march14_may20" => Self::Catch(TopOldCatchVersion::March14May20), "sim_mania_october24_now" => Self::Mania(TopOldManiaVersion::October24Now), @@ -109,7 +109,7 @@ impl TopOldVersion { match version { TopOldOsuVersion::September22October24 | TopOldOsuVersion::October24March25 - | TopOldOsuVersion::March25Now => { + | TopOldOsuVersion::March25October25 => { let clock_rate = button!("sim_clock_rate", "Clock rate", Primary); upper.push(Component::Button(clock_rate)); } @@ -159,7 +159,7 @@ impl TopOldVersion { ]; let options = versions![ - "March 2025 - Now", "sim_osu_march25_now", version = TopOldOsuVersion::March25Now; + "March 2025 - Now", "sim_osu_march25_now", version = TopOldOsuVersion::March25October25; "October 2024 - March 2025", "sim_osu_october24_march25", version = TopOldOsuVersion::October24March25; "September 2022 - October 2024", "sim_osu_september22_october24", version = TopOldOsuVersion::September22October24; "November 2021 - September 2022", "sim_osu_november21_september22", version = TopOldOsuVersion::November21September22; @@ -206,7 +206,7 @@ impl TopOldVersion { match version { TopOldTaikoVersion::September22October24 | TopOldTaikoVersion::October24March25 - | TopOldTaikoVersion::March25Now => { + | TopOldTaikoVersion::March25October25 => { let clock_rate = button!("sim_clock_rate", "Clock rate", Primary); upper.push(Component::Button(clock_rate)); } @@ -227,7 +227,7 @@ impl TopOldVersion { ]; let options = versions![ - "March 2025 - Now", "sim_taiko_march25_now", version = TopOldTaikoVersion::March25Now; + "March 2025 - Now", "sim_taiko_march25_now", version = TopOldTaikoVersion::March25October25; "October 2024 - March 2025", "sim_taiko_october24_march25", version = TopOldTaikoVersion::October24March25; "September 2022 - October 2024", "sim_taiko_september22_october24", version = TopOldTaikoVersion::September22October24; "September 2020 - September 2022","sim_taiko_september20_september22", version = TopOldTaikoVersion::September20September22; @@ -260,7 +260,7 @@ impl TopOldVersion { ]; match version { - TopOldCatchVersion::May20October24 | TopOldCatchVersion::October24Now => { + TopOldCatchVersion::May20October24 | TopOldCatchVersion::October24October25 => { let clock_rate = button!("sim_clock_rate", "Clock rate", Primary); upper.push(Component::Button(clock_rate)); } @@ -285,7 +285,7 @@ impl TopOldVersion { ]; let options = versions![ - "October 2024 - Now", "sim_catch_october24_now", version = TopOldCatchVersion::October24Now; + "October 2024 - Now", "sim_catch_october24_now", version = TopOldCatchVersion::October24October25; "May 2020 - October 2024", "sim_catch_may20_october24", version = TopOldCatchVersion::May20October24; "March 2014 - May 2020", "sim_catch_march14_may20", version = TopOldCatchVersion::March14May20; ]; @@ -528,7 +528,8 @@ impl Display for TopOldVersion { f.write_str("september 2022 - october 2024") } TopOldOsuVersion::October24March25 => f.write_str("october 2024 - march 2025"), - TopOldOsuVersion::March25Now => f.write_str("march 2025 - now"), + TopOldOsuVersion::March25October25 => f.write_str("march 2025 - october 2025"), + TopOldOsuVersion::October25Now => f.write_str("october 2025 - now"), } } Self::Taiko(version) => { @@ -547,7 +548,10 @@ impl Display for TopOldVersion { TopOldTaikoVersion::October24March25 => { f.write_str("october 2024 - march 2025") } - TopOldTaikoVersion::March25Now => f.write_str("march 2025 - now"), + TopOldTaikoVersion::March25October25 => { + f.write_str("march 2025 - october 2025") + } + TopOldTaikoVersion::October25Now => f.write_str("october 2025 - now"), } } Self::Catch(version) => { @@ -556,7 +560,10 @@ impl Display for TopOldVersion { match version { TopOldCatchVersion::March14May20 => f.write_str("march 2014 - may 2020"), TopOldCatchVersion::May20October24 => f.write_str("may 2020 - october 2024"), - TopOldCatchVersion::October24Now => f.write_str("october 2024 - now"), + TopOldCatchVersion::October24October25 => { + f.write_str("october 2024 - october 2025") + } + TopOldCatchVersion::October25Now => f.write_str("october 2025 - now"), } } Self::Mania(version) => { diff --git a/bathbot/src/commands/osu/simulate/mod.rs b/bathbot/src/commands/osu/simulate/mod.rs index 4f6dd59b..38c7869e 100644 --- a/bathbot/src/commands/osu/simulate/mod.rs +++ b/bathbot/src/commands/osu/simulate/mod.rs @@ -115,9 +115,9 @@ async fn simulate(orig: CommandOrigin<'_>, mut args: SimulateArgs) -> Result<()> debug!(?map, ?mode, "Processing simulate command..."); let version = match mode { - GameMode::Osu => TopOldVersion::Osu(TopOldOsuVersion::March25Now), - GameMode::Taiko => TopOldVersion::Taiko(TopOldTaikoVersion::March25Now), - GameMode::Catch => TopOldVersion::Catch(TopOldCatchVersion::October24Now), + GameMode::Osu => TopOldVersion::Osu(TopOldOsuVersion::March25October25), + GameMode::Taiko => TopOldVersion::Taiko(TopOldTaikoVersion::March25October25), + GameMode::Catch => TopOldVersion::Catch(TopOldCatchVersion::October24October25), GameMode::Mania => TopOldVersion::Mania(TopOldManiaVersion::October24Now), }; diff --git a/bathbot/src/commands/osu/top/old.rs b/bathbot/src/commands/osu/top/old.rs index f47059f0..57fe5229 100644 --- a/bathbot/src/commands/osu/top/old.rs +++ b/bathbot/src/commands/osu/top/old.rs @@ -71,7 +71,8 @@ pub enum TopOld<'a> { - 2021: [Rhythm buff, slider buff, FL skill](https://osu.ppy.sh/home/news/2021-11-09-performance-points-star-rating-updates)\n\ - 2022: [Aim buff, doubletap detection improvement, low AR nerf, FL adjustments](https://osu.ppy.sh/home/news/2022-09-30-changes-to-osu-sr-and-pp)\n - 2024: [Combo scale removal, improved rhythm complexity, slider pp](https://osu.ppy.sh/home/news/2024-10-28-performance-points-star-rating-updates)\n\ - - 2025: [Aim nerf, n50s adjustment](https://osu.ppy.sh/home/news/2025-03-06-performance-points-star-rating-updates)" + - 2025: [Aim nerf, n50s adjustment](https://osu.ppy.sh/home/news/2025-03-06-performance-points-star-rating-updates)\n\ + - 2025: [Slider break estimation, precision buff, HD rebalance](https://osu.ppy.sh/home/news/2025-10-29-performance-points-star-rating-updates)" )] pub struct TopOldOsu<'a> { #[command(desc = "Choose which version should replace the current pp system")] @@ -139,8 +140,10 @@ pub enum TopOldOsuVersion { September22October24, #[option(name = "October 2024 - March 2025", value = "october24_march25")] October24March25, - #[option(name = "March 2025 - Now", value = "march25_now")] - March25Now, + #[option(name = "March 2025 - October 2025", value = "march25_october25")] + March25October25, + #[option(name = "October 2025 - Now", value = "october25_now")] + October25Now, } impl TryFrom for TopOldOsuVersion { @@ -167,9 +170,10 @@ impl TryFrom for TopOldOsuVersion { 2022 | 22 => Ok(Self::November21September22), 2023 | 23 => Ok(Self::September22October24), 2024 | 24 => Ok(Self::October24March25), + 2025 | 25 => Ok(Self::March25October25), i32::MIN..=2006 => Err("osu! was not a thing until september 2007.\n\ The first available pp system is from 2014."), - _ => Ok(Self::March25Now), + _ => Ok(Self::October25Now), } } } @@ -183,7 +187,8 @@ impl TryFrom for TopOldOsuVersion { - 2020: [Revamp](https://osu.ppy.sh/home/news/2020-09-15-changes-to-osutaiko-star-rating)\n\ - 2022: [Stamina, colour, & peaks rework](https://osu.ppy.sh/home/news/2022-09-28-changes-to-osu-taiko-sr-and-pp)\n - 2024: [TL-tap consideration, acc scale adjust, mod adjusts](https://osu.ppy.sh/home/news/2024-10-28-performance-points-star-rating-updates)\n\ - - 2025: [Rhythm rewrite, new reading skill, convert adjustments](https://osu.ppy.sh/home/news/2025-03-06-performance-points-star-rating-updates)" + - 2025: [Rhythm rewrite, new reading skill, convert adjustments](https://osu.ppy.sh/home/news/2025-03-06-performance-points-star-rating-updates)\n\ + - 2025: [Steeper acc scaling & rhythm penalties, length bonus revamp](https://osu.ppy.sh/home/news/2025-10-29-performance-points-star-rating-updates)" )] pub struct TopOldTaiko<'a> { #[command(desc = "Choose which version should replace the current pp system")] @@ -237,8 +242,10 @@ pub enum TopOldTaikoVersion { September22October24, #[option(name = "October 2024 - March 2025", value = "october24_march25")] October24March25, - #[option(name = "March 2025 - Now", value = "march25_now")] - March25Now, + #[option(name = "March 2025 - October 2025", value = "march25_october25")] + March25October25, + #[option(name = "October 2025 - Now", value = "october25_now")] + October25Now, } impl TryFrom for TopOldTaikoVersion { @@ -250,9 +257,10 @@ impl TryFrom for TopOldTaikoVersion { 2020..=2022 | 20..=22 => Ok(Self::September20September22), 2023 | 23 => Ok(Self::September22October24), 2024 | 24 => Ok(Self::October24March25), + 2025 | 25 => Ok(Self::March25October25), i32::MIN..=2013 => Err("taiko pp were not a thing until march 2014. \ I think? Don't quote me on that :^)"), - _ => Ok(Self::March25Now), + _ => Ok(Self::October25Now), } } } @@ -264,7 +272,8 @@ impl TryFrom for TopOldTaikoVersion { help = "The osu!ctb pp history looks roughly like this:\n\ - 2014: [ppv1](https://osu.ppy.sh/home/news/2014-03-01-performance-ranking-for-all-gamemodes)\n\ - 2020: [Revamp](https://osu.ppy.sh/home/news/2020-05-14-osucatch-scoring-updates)\n - - 2024: [NF buff](https://osu.ppy.sh/home/news/2024-10-28-performance-points-star-rating-updates)" + - 2024: [NF buff](https://osu.ppy.sh/home/news/2024-10-28-performance-points-star-rating-updates)\n\ + - 2025: [Reduced combo scaling](https://osu.ppy.sh/home/news/2025-10-29-performance-points-star-rating-updates)" )] pub struct TopOldCatch<'a> { #[command(desc = "Choose which version should replace the current pp system")] @@ -308,8 +317,10 @@ pub enum TopOldCatchVersion { March14May20, #[option(name = "May 2020 - October 2024", value = "may20_october24")] May20October24, - #[option(name = "October 2024 - Now", value = "october24_now")] - October24Now, + #[option(name = "October 2024 - October 2025", value = "october24_october25")] + October24October25, + #[option(name = "October 2025 - Now", value = "october25_now")] + October25Now, } impl TryFrom for TopOldCatchVersion { @@ -319,9 +330,10 @@ impl TryFrom for TopOldCatchVersion { match year { 2014..=2019 | 14..=19 => Ok(Self::March14May20), 2023 | 23 => Ok(Self::May20October24), + 2024 | 24 => Ok(Self::October24October25), i32::MIN..=2013 => Err("ctb pp were not a thing until march 2014. \ I think? Don't quote me on that :^)"), - _ => Ok(Self::October24Now), + _ => Ok(Self::October25Now), } } } @@ -424,7 +436,8 @@ pub async fn slash_topold(mut command: InteractionCommand) -> Result<()> { - 2021: [Rhythm buff, slider buff, FL skill](https://osu.ppy.sh/home/news/2021-11-09-performance-points-star-rating-updates)\n\ - 2022: [Aim buff, doubletap detection improvement, low AR nerf, FL adjustments](https://osu.ppy.sh/home/news/2022-09-30-changes-to-osu-sr-and-pp)\n - 2024: [Combo scale removal, improved rhythm complexity, slider pp](https://osu.ppy.sh/home/news/2024-10-28-performance-points-star-rating-updates)\n\ - - 2025: [Aim nerf, n50s adjustment](https://osu.ppy.sh/home/news/2025-03-06-performance-points-star-rating-updates)" + - 2025: [Aim nerf, n50s adjustment](https://osu.ppy.sh/home/news/2025-03-06-performance-points-star-rating-updates)\n\ + - 2025: [Slider break estimation, precision buff, HD rebalance](https://osu.ppy.sh/home/news/2025-10-29-performance-points-star-rating-updates)" )] #[usage("[username] [year]")] #[example("\"freddie benson\" 2015")] @@ -479,7 +492,8 @@ async fn prefix_topoldmania(msg: &Message, args: Args<'_>) -> Result<()> { - 2020: [Revamp](https://osu.ppy.sh/home/news/2020-09-15-changes-to-osutaiko-star-rating)\n\ - 2022: [Stamina, colour, & peaks rework](https://osu.ppy.sh/home/news/2022-09-28-changes-to-osu-taiko-sr-and-pp)\n - 2024: [TL-tap consideration, acc scale adjust, mod adjusts](https://osu.ppy.sh/home/news/2024-10-28-performance-points-star-rating-updates)\n\ - - 2025: [Rhythm rewrite, new reading skill, convert adjustments](https://osu.ppy.sh/home/news/2025-03-06-performance-points-star-rating-updates)" + - 2025: [Rhythm rewrite, new reading skill, convert adjustments](https://osu.ppy.sh/home/news/2025-03-06-performance-points-star-rating-updates)\n\ + - 2025: [Steeper acc scaling & rhythm penalties, length bonus revamp](https://osu.ppy.sh/home/news/2025-10-29-performance-points-star-rating-updates)" )] #[usage("[username] [year]")] #[example("\"freddie benson\" 2015")] @@ -505,7 +519,8 @@ async fn prefix_topoldtaiko(msg: &Message, args: Args<'_>) -> Result<()> { The osu!ctb pp history looks roughly like this:\n\ - 2014: [ppv1](https://osu.ppy.sh/home/news/2014-03-01-performance-ranking-for-all-gamemodes)\n\ - 2020: [Revamp](https://osu.ppy.sh/home/news/2020-05-14-osucatch-scoring-updates)\n - - 2024: [NF buff](https://osu.ppy.sh/home/news/2024-10-28-performance-points-star-rating-updates)" + - 2024: [NF buff](https://osu.ppy.sh/home/news/2024-10-28-performance-points-star-rating-updates)\n\ + - 2025: [Reduced combo scaling](https://osu.ppy.sh/home/news/2025-10-29-performance-points-star-rating-updates)" )] #[usage("[username] [year]")] #[example("\"freddie benson\" 2019")] @@ -622,7 +637,8 @@ impl<'m> TopOld<'m> { } TopOldOsuVersion::September22October24 => "between september 2022 and october 2024", TopOldOsuVersion::October24March25 => "between october 2024 and march 2025", - TopOldOsuVersion::March25Now => "since march 2025", + TopOldOsuVersion::March25October25 => "between march 2025 and october 2025", + TopOldOsuVersion::October25Now => "since october 2025", }, TopOld::Taiko(t) => match t.version { TopOldTaikoVersion::March14September20 => "between march 2014 and september 2020", @@ -633,12 +649,14 @@ impl<'m> TopOld<'m> { "between september 2022 and october 2024" } TopOldTaikoVersion::October24March25 => "between october 2024 and march 2025", - TopOldTaikoVersion::March25Now => "since march 2025", + TopOldTaikoVersion::March25October25 => "between march 2025 and october 2025", + TopOldTaikoVersion::October25Now => "since october 2025", }, TopOld::Catch(c) => match c.version { TopOldCatchVersion::March14May20 => "between march 2014 and may 2020", TopOldCatchVersion::May20October24 => "between may 2020 and october 2024", - TopOldCatchVersion::October24Now => "since october 2024", + TopOldCatchVersion::October24October25 => "between october 2024 and october 2025", + TopOldCatchVersion::October25Now => "since october 2025", }, TopOld::Mania(m) => match m.version { TopOldManiaVersion::March14May18 => "between march 2014 and may 2018", @@ -651,7 +669,7 @@ impl<'m> TopOld<'m> { } macro_rules! pp_std { - ($version:ident, $rosu_map:ident, $score:ident ) => { + ( $version:ident, $rosu_map:ident, $score:ident ) => { pp_std!( $version, $rosu_map, @@ -661,7 +679,21 @@ macro_rules! pp_std { ) }; - ($version:ident, $rosu_map:ident, $score:ident, lazer ) => { + ( $version:ident, $rosu_map:ident, $score:ident, lazer ) => { + pp_std!( + $version, + $rosu_map, + $score, + $score.mods.clone(), + $score.mods.clone(), + lazer: $score.set_on_lazer, + large_tick_hit: $score.statistics.large_tick_hit, + small_tick_hit: $score.statistics.small_tick_hit, + slider_end_hit: $score.statistics.slider_tail_hit, + ) + }; + + ( $version:ident, $rosu_map:ident, $score:ident, lazer, unwrap_conversion ) => { pp_std!( $version, $rosu_map, @@ -672,6 +704,7 @@ macro_rules! pp_std { large_tick_hit: $score.statistics.large_tick_hit, small_tick_hit: $score.statistics.small_tick_hit, slider_end_hit: $score.statistics.slider_tail_hit, + unwrap: unwrap, ) }; @@ -686,12 +719,14 @@ macro_rules! pp_std { large_tick_hit: $large_tick_hit:expr, small_tick_hit: $small_tick_hit:expr, slider_end_hit: $slider_end_hit:expr, + $( unwrap: $unwrap:ident, )? )? ) => {{ let max_pp_res = $version::OsuPP::new($rosu_map) .mods($max_mods) $( .lazer($lazer) )? - .calculate(); + .calculate() + $( $( .$unwrap() )? )?; let max_pp = max_pp_res.pp as f32; let stars = max_pp_res.difficulty.stars as f32; @@ -710,7 +745,8 @@ macro_rules! pp_std { .small_tick_hits($small_tick_hit) .slider_end_hits($slider_end_hit) )? - .calculate(); + .calculate() + $( $( .$unwrap() )? )?; let pp = attrs.pp as f32; let max_combo = attrs.max_combo() as u32; @@ -720,7 +756,7 @@ macro_rules! pp_std { } macro_rules! pp_tko { - ($version:ident, $rosu_map:ident, $score:ident ) => { + ( $version:ident, $rosu_map:ident, $score:ident ) => { pp_tko!( $version, $rosu_map, @@ -730,13 +766,24 @@ macro_rules! pp_tko { ) }; - ($version:ident, $rosu_map:ident, $score:ident, lazer) => { + ( $version:ident, $rosu_map:ident, $score:ident, lazer ) => { + pp_tko!( + $version, + $rosu_map, + $score, + $score.mods.clone(), + $score.mods.clone(), + ) + }; + + ( $version:ident, $rosu_map:ident, $score:ident, lazer, unwrap_conversion ) => { pp_tko!( $version, $rosu_map, $score, $score.mods.clone(), $score.mods.clone(), + unwrap: unwrap, ) }; @@ -746,10 +793,12 @@ macro_rules! pp_tko { $score:ident, $max_mods:expr, $curr_mods:expr, + $( unwrap: $unwrap:ident, )? ) => {{ let max_pp_res = $version::TaikoPP::new($rosu_map) .mods($max_mods) - .calculate(); + .calculate() + $( .$unwrap() )?; let max_pp = max_pp_res.pp as f32; let stars = max_pp_res.difficulty.stars as f32; @@ -761,7 +810,8 @@ macro_rules! pp_tko { .n100($score.statistics.ok) .misses($score.statistics.miss) .combo($score.max_combo) - .calculate(); + .calculate() + $( .$unwrap() )?; let pp = attrs.pp as f32; let max_combo = attrs.max_combo(); @@ -771,7 +821,7 @@ macro_rules! pp_tko { } macro_rules! pp_ctb { - ($version:ident, $rosu_map:ident, $score:ident ) => { + ( $version:ident, $rosu_map:ident, $score:ident ) => { pp_ctb!( $version, $rosu_map, @@ -781,13 +831,24 @@ macro_rules! pp_ctb { ) }; - ($version:ident, $rosu_map:ident, $score:ident, lazer) => { + ( $version:ident, $rosu_map:ident, $score:ident, lazer ) => { + pp_ctb!( + $version, + $rosu_map, + $score, + $score.mods.clone(), + $score.mods.clone(), + ) + }; + + ( $version:ident, $rosu_map:ident, $score:ident, lazer, unwrap_conversion ) => { pp_ctb!( $version, $rosu_map, $score, $score.mods.clone(), $score.mods.clone(), + unwrap: unwrap, ) }; @@ -797,10 +858,12 @@ macro_rules! pp_ctb { $score:ident, $max_mods:expr, $curr_mods:expr, + $( unwrap: $unwrap:ident, )? ) => {{ let max_pp_res = $version::FruitsPP::new($rosu_map) .mods($max_mods) - .calculate(); + .calculate() + $( .$unwrap() )?; let max_pp = max_pp_res.pp as f32; let stars = max_pp_res.difficulty.stars as f32; @@ -815,7 +878,8 @@ macro_rules! pp_ctb { .tiny_droplet_misses(stats.count_katu) .misses(stats.count_miss) .combo($score.max_combo) - .calculate(); + .calculate() + $( .$unwrap() )?; let pp = attrs.pp as f32; let max_combo = attrs.max_combo(); @@ -1132,7 +1196,10 @@ async fn process_scores(scores: Vec, args: &TopOld<'_>) -> Result { pp_std!(osu_2024, rosu_map, score, lazer) } - TopOldOsuVersion::March25Now => use_current_system(&score, &map).await, + TopOldOsuVersion::March25October25 => { + pp_std!(osu_2025, rosu_map, score, lazer, unwrap_conversion) + } + TopOldOsuVersion::October25Now => use_current_system(&score, &map).await, }, TopOld::Taiko(t) => match t.version { TopOldTaikoVersion::March14September20 => { @@ -1147,14 +1214,20 @@ async fn process_scores(scores: Vec, args: &TopOld<'_>) -> Result { pp_tko!(taiko_2024, rosu_map, score, lazer) } - TopOldTaikoVersion::March25Now => use_current_system(&score, &map).await, + TopOldTaikoVersion::March25October25 => { + pp_tko!(taiko_2025, rosu_map, score, lazer, unwrap_conversion) + } + TopOldTaikoVersion::October25Now => use_current_system(&score, &map).await, }, TopOld::Catch(c) => match c.version { TopOldCatchVersion::March14May20 => pp_ctb!(fruits_ppv1, rosu_map, score), TopOldCatchVersion::May20October24 => { pp_ctb!(fruits_2022, rosu_map, score) } - TopOldCatchVersion::October24Now => use_current_system(&score, &map).await, + TopOldCatchVersion::October24October25 => { + pp_ctb!(fruits_2024, rosu_map, score, lazer, unwrap_conversion) + } + TopOldCatchVersion::October25Now => use_current_system(&score, &map).await, }, TopOld::Mania(m) => match m.version { TopOldManiaVersion::March14May18 => { diff --git a/bathbot/src/core/context/mod.rs b/bathbot/src/core/context/mod.rs index 076091e7..279ade00 100644 --- a/bathbot/src/core/context/mod.rs +++ b/bathbot/src/core/context/mod.rs @@ -196,7 +196,12 @@ impl Context { // Connect to osu! API let osu_client_id = config.tokens.osu_client_id; let osu_client_secret = &config.tokens.osu_client_secret; - let osu = Osu::new(osu_client_id, osu_client_secret.as_ref()) + + let osu = Osu::builder() + .client_id(osu_client_id) + .client_secret(osu_client_secret.as_ref()) + .ratelimit(10) + .build() .await .wrap_err("Failed to create osu client")?;