diff --git a/osu.Game/Online/Multiplayer/MultiplayerRoomSettings.cs b/osu.Game/Online/Multiplayer/MultiplayerRoomSettings.cs index 596f50d54b..d244e69a6b 100644 --- a/osu.Game/Online/Multiplayer/MultiplayerRoomSettings.cs +++ b/osu.Game/Online/Multiplayer/MultiplayerRoomSettings.cs @@ -44,7 +44,7 @@ namespace osu.Game.Online.Multiplayer public MatchType MatchType { get; set; } = MatchType.HeadToHead; [Key(9)] - public QueueingModes QueueingMode { get; set; } = QueueingModes.Host; + public QueueModes QueueMode { get; set; } = QueueModes.HostPick; public bool Equals(MultiplayerRoomSettings other) => BeatmapID == other.BeatmapID @@ -56,7 +56,7 @@ namespace osu.Game.Online.Multiplayer && Name.Equals(other.Name, StringComparison.Ordinal) && PlaylistItemId == other.PlaylistItemId && MatchType == other.MatchType - && QueueingMode == other.QueueingMode; + && QueueMode == other.QueueMode; public override string ToString() => $"Name:{Name}" + $" Beatmap:{BeatmapID} ({BeatmapChecksum})" @@ -66,6 +66,6 @@ namespace osu.Game.Online.Multiplayer + $" Ruleset:{RulesetID}" + $" Type:{MatchType}" + $" Item:{PlaylistItemId}" - + $" Queue:{QueueingMode}"; + + $" Queue:{QueueMode}"; } } diff --git a/osu.Game/Online/Multiplayer/QueueingModes.cs b/osu.Game/Online/Multiplayer/QueueModes.cs similarity index 64% rename from osu.Game/Online/Multiplayer/QueueingModes.cs rename to osu.Game/Online/Multiplayer/QueueModes.cs index 684768fa57..501c87c1cf 100644 --- a/osu.Game/Online/Multiplayer/QueueingModes.cs +++ b/osu.Game/Online/Multiplayer/QueueModes.cs @@ -3,9 +3,11 @@ namespace osu.Game.Online.Multiplayer { - public enum QueueingModes + public enum QueueModes { - Host, + // used for osu-web deserialization so names shouldn't be changed. + + HostPick, Karaoke, } } diff --git a/osu.Game/Online/Rooms/Room.cs b/osu.Game/Online/Rooms/Room.cs index 39fc7f1da8..fe410208cc 100644 --- a/osu.Game/Online/Rooms/Room.cs +++ b/osu.Game/Online/Rooms/Room.cs @@ -7,6 +7,7 @@ using Newtonsoft.Json; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Game.IO.Serialization.Converters; +using osu.Game.Online.Multiplayer; using osu.Game.Online.Rooms.RoomStatuses; using osu.Game.Users; using osu.Game.Utils; @@ -73,6 +74,18 @@ namespace osu.Game.Online.Rooms set => Type.Value = value; } + [Cached] + [JsonIgnore] + public readonly Bindable QueueMode = new Bindable(); + + [JsonConverter(typeof(SnakeCaseStringEnumConverter))] + [JsonProperty("queue_mode")] + private QueueModes queueMode + { + get => QueueMode.Value; + set => QueueMode.Value = value; + } + [Cached] [JsonIgnore] public readonly Bindable MaxParticipants = new Bindable(); diff --git a/osu.Game/Screens/OnlinePlay/Multiplayer/Match/MultiplayerMatchSettingsOverlay.cs b/osu.Game/Screens/OnlinePlay/Multiplayer/Match/MultiplayerMatchSettingsOverlay.cs index 0edf5dde6d..9049d315fb 100644 --- a/osu.Game/Screens/OnlinePlay/Multiplayer/Match/MultiplayerMatchSettingsOverlay.cs +++ b/osu.Game/Screens/OnlinePlay/Multiplayer/Match/MultiplayerMatchSettingsOverlay.cs @@ -59,6 +59,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match public OsuTextBox NameField, MaxParticipantsField; public RoomAvailabilityPicker AvailabilityPicker; public MatchTypePicker TypePicker; + public OsuEnumDropdown QueueModeDropdown; public OsuTextBox PasswordTextBox; public TriangleButton ApplyButton; @@ -190,6 +191,13 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match }, }, }, + new Section("Beatmap queueing mode") + { + Child = QueueModeDropdown = new OsuEnumDropdown + { + RelativeSizeAxes = Axes.X + } + } }, }, new SectionContainer