1
0
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:
smoogipoo 2019-10-30 14:41:54 +09:00
parent 95ff48c123
commit b6457f0ce9

View File

@ -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;