Skip to content

Commit

Permalink
Revert changes to LoungeSubScreen.Join()
Browse files Browse the repository at this point in the history
- `virtual` modifier was used in mocking.
- The spacing change revert is just mostly to keep it out of the final
  diff.
  • Loading branch information
bdach committed Oct 12, 2023
1 parent 1ce268b commit 6c8490b
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions osu.Game/Screens/OnlinePlay/Lounge/LoungeSubScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,29 +297,26 @@ private void onLeaving()
popoverContainer.HidePopover();
}

public void Join(Room room, string password, Action<Room> onSuccess = null, Action<string> onFailure = null)
public virtual void Join(Room room, string password, Action<Room> onSuccess = null, Action<string> onFailure = null) => Schedule(() =>
{
Schedule(() =>
{
if (joiningRoomOperation != null)
return;
if (joiningRoomOperation != null)
return;

joiningRoomOperation = ongoingOperationTracker?.BeginOperation();
joiningRoomOperation = ongoingOperationTracker?.BeginOperation();

RoomManager?.JoinRoom(room, password, _ =>
{
Open(room);
joiningRoomOperation?.Dispose();
joiningRoomOperation = null;
onSuccess?.Invoke(room);
}, error =>
{
joiningRoomOperation?.Dispose();
joiningRoomOperation = null;
onFailure?.Invoke(error);
});
RoomManager?.JoinRoom(room, password, _ =>
{
Open(room);
joiningRoomOperation?.Dispose();
joiningRoomOperation = null;
onSuccess?.Invoke(room);
}, error =>
{
joiningRoomOperation?.Dispose();
joiningRoomOperation = null;
onFailure?.Invoke(error);
});
}
});

/// <summary>
/// Copies a room and opens it as a fresh (not-yet-created) one.
Expand Down

0 comments on commit 6c8490b

Please sign in to comment.