1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-25 03:15:37 +08:00
osu-lazer/osu.Game/Screens/OnlinePlay/Playlists/PlaylistsRoomStyleSelect.cs
Dean Herbert 459847cb80
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`.
2025-01-21 19:51:55 +09:00

38 lines
1.2 KiB
C#

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Bindables;
using osu.Framework.Screens;
using osu.Game.Beatmaps;
using osu.Game.Online.Rooms;
using osu.Game.Rulesets;
namespace osu.Game.Screens.OnlinePlay.Playlists
{
public partial class PlaylistsRoomStyleSelect : OnlinePlayStyleSelect
{
public new readonly Bindable<BeatmapInfo?> Beatmap = new Bindable<BeatmapInfo?>();
public new readonly Bindable<RulesetInfo?> Ruleset = new Bindable<RulesetInfo?>();
public PlaylistsRoomStyleSelect(Room room, PlaylistItem item)
: base(room, item)
{
}
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();
return true;
}
}
}