mirror of
https://github.com/ppy/osu.git
synced 2025-02-08 18:12:54 +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:
parent
f88102610d
commit
459847cb80
@ -89,6 +89,7 @@ namespace osu.Game.Screens.OnlinePlay
|
|||||||
|
|
||||||
// Must be from the same set as the playlist item.
|
// Must be from the same set as the playlist item.
|
||||||
criteria.BeatmapSetId = beatmapSetId;
|
criteria.BeatmapSetId = beatmapSetId;
|
||||||
|
criteria.HasOnlineID = true;
|
||||||
|
|
||||||
// Must be within 30s of the playlist item.
|
// Must be within 30s of the playlist item.
|
||||||
criteria.Length.Min = itemLength - 30000;
|
criteria.Length.Min = itemLength - 30000;
|
||||||
|
@ -21,6 +21,13 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
|
|||||||
|
|
||||||
protected override bool OnStart()
|
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;
|
Beatmap.Value = base.Beatmap.Value.BeatmapInfo;
|
||||||
Ruleset.Value = base.Ruleset.Value;
|
Ruleset.Value = base.Ruleset.Value;
|
||||||
this.Exit();
|
this.Exit();
|
||||||
|
@ -90,6 +90,9 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
if (match && criteria.RulesetCriteria != null)
|
if (match && criteria.RulesetCriteria != null)
|
||||||
match &= criteria.RulesetCriteria.Matches(BeatmapInfo, criteria);
|
match &= criteria.RulesetCriteria.Matches(BeatmapInfo, criteria);
|
||||||
|
|
||||||
|
if (match && criteria.HasOnlineID == true)
|
||||||
|
match &= BeatmapInfo.OnlineID >= 0;
|
||||||
|
|
||||||
if (match && criteria.BeatmapSetId != null)
|
if (match && criteria.BeatmapSetId != null)
|
||||||
match &= criteria.BeatmapSetId == BeatmapInfo.BeatmapSet?.OnlineID;
|
match &= criteria.BeatmapSetId == BeatmapInfo.BeatmapSet?.OnlineID;
|
||||||
|
|
||||||
|
@ -58,6 +58,8 @@ namespace osu.Game.Screens.Select
|
|||||||
public bool AllowConvertedBeatmaps;
|
public bool AllowConvertedBeatmaps;
|
||||||
public int? BeatmapSetId;
|
public int? BeatmapSetId;
|
||||||
|
|
||||||
|
public bool? HasOnlineID;
|
||||||
|
|
||||||
private string searchText = string.Empty;
|
private string searchText = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user