mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Fix playlist deserialisation for creating rooms
This commit is contained in:
@ -63,11 +63,7 @@ namespace osu.Game.Screens.Multi
|
||||
{
|
||||
foreach (var r in result)
|
||||
{
|
||||
foreach (var pi in r.Playlist)
|
||||
{
|
||||
pi.Ruleset = rulesets.GetRuleset(pi.RulesetID);
|
||||
pi.SetRulesets(rulesets);
|
||||
}
|
||||
processPlaylist(r);
|
||||
|
||||
var existing = rooms.FirstOrDefault(e => e.RoomID.Value == r.RoomID.Value);
|
||||
if (existing == null)
|
||||
@ -88,6 +84,8 @@ namespace osu.Game.Screens.Multi
|
||||
|
||||
private void addRoom(Room local, Room remote)
|
||||
{
|
||||
processPlaylist(remote);
|
||||
|
||||
local.CopyFrom(remote);
|
||||
|
||||
var existing = rooms.FirstOrDefault(e => e.RoomID.Value == local.RoomID.Value);
|
||||
@ -96,6 +94,12 @@ namespace osu.Game.Screens.Multi
|
||||
rooms.Add(local);
|
||||
}
|
||||
|
||||
private void processPlaylist(Room room)
|
||||
{
|
||||
foreach (var pi in room.Playlist)
|
||||
pi.MapObjects(beatmaps, rulesets);
|
||||
}
|
||||
|
||||
private class CreateRoomRequest : APIRequest<Room>
|
||||
{
|
||||
private readonly Room room;
|
||||
|
Reference in New Issue
Block a user