mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 15:03:10 +08:00
Merge pull request #14741 from smoogipoo/fix-lounge-beatmaps-counter
Fix incorrect beatmap count and SR range in multi lounge
This commit is contained in:
commit
8acfefed1b
@ -179,11 +179,7 @@ namespace osu.Game.Online.Rooms
|
|||||||
if (EndDate.Value != null && DateTimeOffset.Now >= EndDate.Value)
|
if (EndDate.Value != null && DateTimeOffset.Now >= EndDate.Value)
|
||||||
Status.Value = new RoomStatusEnded();
|
Status.Value = new RoomStatusEnded();
|
||||||
|
|
||||||
// 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,
|
other.RemoveExpiredPlaylistItems();
|
||||||
// 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.Value is RoomStatusEnded))
|
|
||||||
other.Playlist.RemoveAll(i => i.Expired);
|
|
||||||
|
|
||||||
if (!Playlist.SequenceEqual(other.Playlist))
|
if (!Playlist.SequenceEqual(other.Playlist))
|
||||||
{
|
{
|
||||||
@ -200,6 +196,15 @@ namespace osu.Game.Online.Rooms
|
|||||||
Position.Value = other.Position.Value;
|
Position.Value = other.Position.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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.Value is RoomStatusEnded))
|
||||||
|
Playlist.RemoveAll(i => i.Expired);
|
||||||
|
}
|
||||||
|
|
||||||
public bool ShouldSerializeRoomID() => false;
|
public bool ShouldSerializeRoomID() => false;
|
||||||
public bool ShouldSerializeHost() => false;
|
public bool ShouldSerializeHost() => false;
|
||||||
public bool ShouldSerializeEndDate() => false;
|
public bool ShouldSerializeEndDate() => false;
|
||||||
|
@ -57,7 +57,10 @@ 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);
|
||||||
|
@ -39,6 +39,7 @@ namespace osu.Game.Screens.OnlinePlay.Components
|
|||||||
|
|
||||||
pollReq.Success += result =>
|
pollReq.Success += result =>
|
||||||
{
|
{
|
||||||
|
result.RemoveExpiredPlaylistItems();
|
||||||
RoomManager.AddOrUpdateRoom(result);
|
RoomManager.AddOrUpdateRoom(result);
|
||||||
tcs.SetResult(true);
|
tcs.SetResult(true);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user