mirror of
https://github.com/ppy/osu.git
synced 2025-01-07 23:23:12 +08:00
Merge pull request #30830 from smoogipoo/multiplayer-remove-expired-item-removal
No longer remove expired playlist items from `Room` model
This commit is contained in:
commit
354bc424a3
@ -366,12 +366,8 @@ namespace osu.Game.Online.Rooms
|
||||
{
|
||||
RoomID = other.RoomID;
|
||||
Name = other.Name;
|
||||
|
||||
Category = other.Category;
|
||||
|
||||
if (other.Host != null && Host?.Id != other.Host.Id)
|
||||
Host = other.Host;
|
||||
|
||||
Host = other.Host;
|
||||
ChannelId = other.ChannelId;
|
||||
Status = other.Status;
|
||||
Availability = other.Availability;
|
||||
@ -387,22 +383,10 @@ namespace osu.Game.Online.Rooms
|
||||
PlaylistItemStats = other.PlaylistItemStats;
|
||||
CurrentPlaylistItem = other.CurrentPlaylistItem;
|
||||
AutoSkip = other.AutoSkip;
|
||||
|
||||
other.RemoveExpiredPlaylistItems();
|
||||
|
||||
Playlist = other.Playlist;
|
||||
RecentParticipants = other.RecentParticipants;
|
||||
}
|
||||
|
||||
public void RemoveExpiredPlaylistItems()
|
||||
{
|
||||
// Todo: This is not the best way/place to do this, but the intention is to display all playlist items when the room has ended,
|
||||
// and display only the non-expired playlist items while the room is still active. In order to achieve this, all expired items are removed from the source Room.
|
||||
// More refactoring is required before this can be done locally instead - DrawableRoomPlaylist is currently directly bound to the playlist to display items in the room.
|
||||
if (Status is not RoomStatusEnded)
|
||||
Playlist = Playlist.Where(i => !i.Expired).ToArray();
|
||||
}
|
||||
|
||||
[JsonObject(MemberSerialization.OptIn)]
|
||||
public class RoomPlaylistItemStats
|
||||
{
|
||||
|
@ -60,10 +60,7 @@ namespace osu.Game.Screens.OnlinePlay.Components
|
||||
}
|
||||
|
||||
foreach (var incoming in result)
|
||||
{
|
||||
incoming.RemoveExpiredPlaylistItems();
|
||||
RoomManager.AddOrUpdateRoom(incoming);
|
||||
}
|
||||
|
||||
initialRoomsReceived.Value = true;
|
||||
tcs.SetResult(true);
|
||||
|
@ -36,7 +36,6 @@ namespace osu.Game.Screens.OnlinePlay.Components
|
||||
|
||||
req.Success += result =>
|
||||
{
|
||||
result.RemoveExpiredPlaylistItems();
|
||||
RoomManager.AddOrUpdateRoom(result);
|
||||
tcs.SetResult(true);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user