mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 08:52:55 +08:00
Cancel room joins on part
This commit is contained in:
parent
95ff48c123
commit
b6457f0ce9
@ -87,9 +87,8 @@ namespace osu.Game.Screens.Multi
|
|||||||
public void JoinRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null)
|
public void JoinRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null)
|
||||||
{
|
{
|
||||||
currentJoinRoomRequest?.Cancel();
|
currentJoinRoomRequest?.Cancel();
|
||||||
currentJoinRoomRequest = null;
|
|
||||||
|
|
||||||
currentJoinRoomRequest = new JoinRoomRequest(room, api.LocalUser.Value);
|
currentJoinRoomRequest = new JoinRoomRequest(room, api.LocalUser.Value);
|
||||||
|
|
||||||
currentJoinRoomRequest.Success += () =>
|
currentJoinRoomRequest.Success += () =>
|
||||||
{
|
{
|
||||||
joinedRoom = room;
|
joinedRoom = room;
|
||||||
@ -108,6 +107,8 @@ namespace osu.Game.Screens.Multi
|
|||||||
|
|
||||||
public void PartRoom()
|
public void PartRoom()
|
||||||
{
|
{
|
||||||
|
currentJoinRoomRequest?.Cancel();
|
||||||
|
|
||||||
if (joinedRoom == null)
|
if (joinedRoom == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user