mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Transfer metadata to ensure present on creating a new match
This commit is contained in:
@ -118,8 +118,20 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
if (DateTimeOffset.Now >= EndDate.Value)
|
if (DateTimeOffset.Now >= EndDate.Value)
|
||||||
Status.Value = new RoomStatusEnded();
|
Status.Value = new RoomStatusEnded();
|
||||||
|
|
||||||
foreach (var removedItem in Playlist.Except(other.Playlist).ToArray())
|
// transfer local beatmaps across to ensure we have Metadata available (CreateRoomRequest does not give us metadata as expected)
|
||||||
Playlist.Remove(removedItem);
|
foreach (var item in other.Playlist)
|
||||||
|
{
|
||||||
|
var localItem = Playlist.FirstOrDefault(i => i.BeatmapID == item.BeatmapID);
|
||||||
|
|
||||||
|
if (localItem != null)
|
||||||
|
{
|
||||||
|
item.Beatmap.Value.Metadata = localItem.Beatmap.Value.Metadata;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var removeableItem in Playlist.Except(other.Playlist).ToArray())
|
||||||
|
Playlist.Remove(removeableItem);
|
||||||
|
|
||||||
Playlist.AddRange(other.Playlist.Except(Playlist).ToArray());
|
Playlist.AddRange(other.Playlist.Except(Playlist).ToArray());
|
||||||
|
|
||||||
foreach (var removedItem in Participants.Except(other.Participants).ToArray())
|
foreach (var removedItem in Participants.Except(other.Participants).ToArray())
|
||||||
|
Reference in New Issue
Block a user