1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-08 12:23:21 +08:00

Perform client side validation that the selected beatmap and ruleset have valid online IDs

This is local to playlists, since in multiplayer the validation is
already provided by `osu-server-spectator`.
This commit is contained in:
Dean Herbert 2025-01-21 19:51:13 +09:00
parent f88102610d
commit 459847cb80
No known key found for this signature in database
4 changed files with 13 additions and 0 deletions

View File

@ -89,6 +89,7 @@ namespace osu.Game.Screens.OnlinePlay
// Must be from the same set as the playlist item.
criteria.BeatmapSetId = beatmapSetId;
criteria.HasOnlineID = true;
// Must be within 30s of the playlist item.
criteria.Length.Min = itemLength - 30000;

View File

@ -21,6 +21,13 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
protected override bool OnStart()
{
// Beatmaps without a valid online ID are filtered away; this is just a final safety.
if (base.Beatmap.Value.BeatmapInfo.OnlineID < 0)
return false;
if (base.Ruleset.Value.OnlineID < 0)
return false;
Beatmap.Value = base.Beatmap.Value.BeatmapInfo;
Ruleset.Value = base.Ruleset.Value;
this.Exit();

View File

@ -90,6 +90,9 @@ namespace osu.Game.Screens.Select.Carousel
if (match && criteria.RulesetCriteria != null)
match &= criteria.RulesetCriteria.Matches(BeatmapInfo, criteria);
if (match && criteria.HasOnlineID == true)
match &= BeatmapInfo.OnlineID >= 0;
if (match && criteria.BeatmapSetId != null)
match &= criteria.BeatmapSetId == BeatmapInfo.BeatmapSet?.OnlineID;

View File

@ -58,6 +58,8 @@ namespace osu.Game.Screens.Select
public bool AllowConvertedBeatmaps;
public int? BeatmapSetId;
public bool? HasOnlineID;
private string searchText = string.Empty;
/// <summary>