1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:17:23 +08:00

Remove gameplay_order, use existing playlist_order

This commit is contained in:
Dan Balasescu 2021-12-03 15:45:13 +09:00
parent b75a5b778e
commit 0a1304b92a
6 changed files with 10 additions and 10 deletions

View File

@ -742,7 +742,7 @@ namespace osu.Game.Online.Multiplayer
Beatmap = { Value = apiBeatmap },
Ruleset = { Value = ruleset },
Expired = item.Expired,
GameplayOrder = item.GameplayOrder
PlaylistOrder = item.PlaylistOrder
};
playlistItem.RequiredMods.AddRange(item.RequiredMods.Select(m => m.ToMod(rulesetInstance)));

View File

@ -43,7 +43,7 @@ namespace osu.Game.Online.Rooms
/// The order in which this <see cref="MultiplayerPlaylistItem"/> will be played, starting from 0 and increasing for items which will be played later.
/// </summary>
[Key(8)]
public int GameplayOrder { get; set; }
public ushort PlaylistOrder { get; set; }
/// <summary>
/// The date when this <see cref="MultiplayerPlaylistItem"/> was last updated.
@ -65,7 +65,7 @@ namespace osu.Game.Online.Rooms
RequiredMods = item.RequiredMods.Select(m => new APIMod(m)).ToArray();
AllowedMods = item.AllowedMods.Select(m => new APIMod(m)).ToArray();
Expired = item.Expired;
GameplayOrder = item.GameplayOrder;
PlaylistOrder = item.PlaylistOrder ?? 0;
}
}
}

View File

@ -33,8 +33,8 @@ namespace osu.Game.Online.Rooms
[JsonProperty("expired")]
public bool Expired { get; set; }
[JsonProperty("gameplay_order")]
public int GameplayOrder { get; set; }
[JsonProperty("playlist_order")]
public ushort? PlaylistOrder { get; set; }
[JsonIgnore]
public IBindable<bool> Valid => valid;

View File

@ -27,7 +27,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match.Playlist
private class HistoryFillFlowContainer : FillFlowContainer<RearrangeableListItem<PlaylistItem>>
{
public override IEnumerable<Drawable> FlowingChildren => base.FlowingChildren.OfType<RearrangeableListItem<PlaylistItem>>().OrderByDescending(item => item.Model.GameplayOrder);
public override IEnumerable<Drawable> FlowingChildren => base.FlowingChildren.OfType<RearrangeableListItem<PlaylistItem>>().OrderByDescending(item => item.Model.PlaylistOrder);
}
}
}

View File

@ -38,7 +38,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match.Playlist
roomPlaylist.BindCollectionChanged((_, __) => InvalidateLayout());
}
public override IEnumerable<Drawable> FlowingChildren => base.FlowingChildren.OfType<RearrangeableListItem<PlaylistItem>>().OrderBy(item => item.Model.GameplayOrder);
public override IEnumerable<Drawable> FlowingChildren => base.FlowingChildren.OfType<RearrangeableListItem<PlaylistItem>>().OrderBy(item => item.Model.PlaylistOrder);
}
}
}

View File

@ -316,7 +316,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
case QueueMode.HostOnly:
// In host-only mode, the current item is re-used.
item.ID = currentItem.ID;
item.GameplayOrder = currentItem.GameplayOrder;
item.PlaylistOrder = currentItem.PlaylistOrder;
serverSidePlaylist[currentIndex] = item;
await ((IMultiplayerClient)this).PlaylistItemChanged(item).ConfigureAwait(false);
@ -488,10 +488,10 @@ namespace osu.Game.Tests.Visual.Multiplayer
for (int i = 0; i < orderedItems.Count; i++)
{
// Items which are already ordered correct don't need to be updated.
if (orderedItems[i].GameplayOrder == i)
if (orderedItems[i].PlaylistOrder == i)
continue;
orderedItems[i].GameplayOrder = i;
orderedItems[i].PlaylistOrder = (ushort)i;
// Items which have an ID of 0 are not in the database, so avoid propagating database/hub events for them.
if (orderedItems[i].ID <= 0)