1
0
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:
Salman Alshamrani 2024-11-23 23:58:17 -05:00 committed by GitHub
commit 354bc424a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 1 additions and 21 deletions

View File

@ -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
{

View File

@ -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);

View File

@ -36,7 +36,6 @@ namespace osu.Game.Screens.OnlinePlay.Components
req.Success += result =>
{
result.RemoveExpiredPlaylistItems();
RoomManager.AddOrUpdateRoom(result);
tcs.SetResult(true);
};