mirror of
https://github.com/ppy/osu.git
synced 2025-01-08 22:02:56 +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;
|
RoomID = other.RoomID;
|
||||||
Name = other.Name;
|
Name = other.Name;
|
||||||
|
|
||||||
Category = other.Category;
|
Category = other.Category;
|
||||||
|
Host = other.Host;
|
||||||
if (other.Host != null && Host?.Id != other.Host.Id)
|
|
||||||
Host = other.Host;
|
|
||||||
|
|
||||||
ChannelId = other.ChannelId;
|
ChannelId = other.ChannelId;
|
||||||
Status = other.Status;
|
Status = other.Status;
|
||||||
Availability = other.Availability;
|
Availability = other.Availability;
|
||||||
@ -387,22 +383,10 @@ namespace osu.Game.Online.Rooms
|
|||||||
PlaylistItemStats = other.PlaylistItemStats;
|
PlaylistItemStats = other.PlaylistItemStats;
|
||||||
CurrentPlaylistItem = other.CurrentPlaylistItem;
|
CurrentPlaylistItem = other.CurrentPlaylistItem;
|
||||||
AutoSkip = other.AutoSkip;
|
AutoSkip = other.AutoSkip;
|
||||||
|
|
||||||
other.RemoveExpiredPlaylistItems();
|
|
||||||
|
|
||||||
Playlist = other.Playlist;
|
Playlist = other.Playlist;
|
||||||
RecentParticipants = other.RecentParticipants;
|
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)]
|
[JsonObject(MemberSerialization.OptIn)]
|
||||||
public class RoomPlaylistItemStats
|
public class RoomPlaylistItemStats
|
||||||
{
|
{
|
||||||
|
@ -60,10 +60,7 @@ namespace osu.Game.Screens.OnlinePlay.Components
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach (var incoming in result)
|
foreach (var incoming in result)
|
||||||
{
|
|
||||||
incoming.RemoveExpiredPlaylistItems();
|
|
||||||
RoomManager.AddOrUpdateRoom(incoming);
|
RoomManager.AddOrUpdateRoom(incoming);
|
||||||
}
|
|
||||||
|
|
||||||
initialRoomsReceived.Value = true;
|
initialRoomsReceived.Value = true;
|
||||||
tcs.SetResult(true);
|
tcs.SetResult(true);
|
||||||
|
@ -36,7 +36,6 @@ namespace osu.Game.Screens.OnlinePlay.Components
|
|||||||
|
|
||||||
req.Success += result =>
|
req.Success += result =>
|
||||||
{
|
{
|
||||||
result.RemoveExpiredPlaylistItems();
|
|
||||||
RoomManager.AddOrUpdateRoom(result);
|
RoomManager.AddOrUpdateRoom(result);
|
||||||
tcs.SetResult(true);
|
tcs.SetResult(true);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user