mirror of
https://github.com/ppy/osu.git
synced 2025-01-23 18:22:56 +08:00
Populate rooms as soon as they're joined
This commit is contained in:
parent
23ef8fd909
commit
f738fb2a89
@ -7,7 +7,7 @@ using osu.Game.Online.API;
|
|||||||
|
|
||||||
namespace osu.Game.Online.Rooms
|
namespace osu.Game.Online.Rooms
|
||||||
{
|
{
|
||||||
public class JoinRoomRequest : APIRequest
|
public class JoinRoomRequest : APIRequest<Room>
|
||||||
{
|
{
|
||||||
public readonly Room Room;
|
public readonly Room Room;
|
||||||
public readonly string? Password;
|
public readonly string? Password;
|
||||||
|
@ -72,9 +72,13 @@ namespace osu.Game.Screens.OnlinePlay.Components
|
|||||||
currentJoinRoomRequest?.Cancel();
|
currentJoinRoomRequest?.Cancel();
|
||||||
currentJoinRoomRequest = new JoinRoomRequest(room, password);
|
currentJoinRoomRequest = new JoinRoomRequest(room, password);
|
||||||
|
|
||||||
currentJoinRoomRequest.Success += () =>
|
currentJoinRoomRequest.Success += result =>
|
||||||
{
|
{
|
||||||
joinedRoom.Value = room;
|
joinedRoom.Value = room;
|
||||||
|
|
||||||
|
AddOrUpdateRoom(result);
|
||||||
|
room.CopyFrom(result); // Also copy back to the source model, since this is likely to have been stored elsewhere.
|
||||||
|
|
||||||
onSuccess?.Invoke(room);
|
onSuccess?.Invoke(room);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user