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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user