mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 01:02:55 +08:00
Tidy up event flow of change settings call
This commit is contained in:
parent
c5692a5d6a
commit
4296f61d6c
@ -369,7 +369,6 @@ namespace osu.Game.Online.RealtimeMultiplayer
|
|||||||
if (Room == null)
|
if (Room == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Update a few properties of the room instantaneously.
|
|
||||||
Schedule(() =>
|
Schedule(() =>
|
||||||
{
|
{
|
||||||
if (Room == null)
|
if (Room == null)
|
||||||
@ -377,6 +376,7 @@ namespace osu.Game.Online.RealtimeMultiplayer
|
|||||||
|
|
||||||
Debug.Assert(apiRoom != null);
|
Debug.Assert(apiRoom != null);
|
||||||
|
|
||||||
|
// Update a few properties of the room instantaneously.
|
||||||
Room.Settings = settings;
|
Room.Settings = settings;
|
||||||
apiRoom.Name.Value = Room.Settings.Name;
|
apiRoom.Name.Value = Room.Settings.Name;
|
||||||
|
|
||||||
@ -385,12 +385,12 @@ namespace osu.Game.Online.RealtimeMultiplayer
|
|||||||
apiRoom.Playlist.Clear();
|
apiRoom.Playlist.Clear();
|
||||||
|
|
||||||
RoomChanged?.Invoke();
|
RoomChanged?.Invoke();
|
||||||
|
|
||||||
|
var req = new GetBeatmapSetRequest(settings.BeatmapID, BeatmapSetLookupType.BeatmapId);
|
||||||
|
req.Success += res => updatePlaylist(settings, res);
|
||||||
|
|
||||||
|
api.Queue(req);
|
||||||
});
|
});
|
||||||
|
|
||||||
var req = new GetBeatmapSetRequest(settings.BeatmapID, BeatmapSetLookupType.BeatmapId);
|
|
||||||
req.Success += res => updatePlaylist(settings, res);
|
|
||||||
|
|
||||||
api.Queue(req);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updatePlaylist(MultiplayerRoomSettings settings, APIBeatmapSet onlineSet)
|
private void updatePlaylist(MultiplayerRoomSettings settings, APIBeatmapSet onlineSet)
|
||||||
|
Loading…
Reference in New Issue
Block a user