1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-08 21:24:41 +08:00

Make sure you can't request non-local scores with a sort mode other than score.

This commit is contained in:
Dani211e
2025-06-27 04:46:49 +02:00
Unverified
parent 6e73a9299e
commit abfd4f6338
2 changed files with 5 additions and 1 deletions
@@ -106,6 +106,9 @@ namespace osu.Game.Online.Leaderboards
return;
}
if (newCriteria.Sorting != LeaderboardSortMode.Score)
throw new InvalidOperationException("Should not attempt to request online scores with a sort mode other than score");
IReadOnlyList<Mod>? requestMods = null;
if (newCriteria.ExactMods != null)
@@ -219,11 +219,12 @@ namespace osu.Game.Screens.SelectV2
{
var fetchBeatmapInfo = beatmap.Value.BeatmapInfo;
var fetchRuleset = ruleset.Value ?? fetchBeatmapInfo.Ruleset;
var fetchSorting = Scope.Value == BeatmapLeaderboardScope.Local ? Sorting.Value : LeaderboardSortMode.Score;
// For now, we forcefully refresh to keep things simple.
// In the future, removing this requirement may be deemed useful, but will need ample testing of edge case scenarios
// (like returning from gameplay after setting a new score, returning to song select after main menu).
leaderboardManager.FetchWithCriteria(new LeaderboardCriteria(fetchBeatmapInfo, fetchRuleset, Scope.Value, FilterBySelectedMods.Value ? mods.Value.ToArray() : null, Sorting.Value), forceRefresh: true);
leaderboardManager.FetchWithCriteria(new LeaderboardCriteria(fetchBeatmapInfo, fetchRuleset, Scope.Value, FilterBySelectedMods.Value ? mods.Value.ToArray() : null, fetchSorting), forceRefresh: true);
if (!initialFetchComplete)
{