More hardening of `TestMultiplayerClient` to attempt to fix test failures

This commit is contained in:
Dean Herbert 2024-08-19 04:04:24 +09:00
parent 07929b440a
commit e75ae4a37b
No known key found for this signature in database
1 changed files with 5 additions and 0 deletions

View File

@ -208,6 +208,9 @@ public void ChangeUserBeatmapAvailability(int userId, BeatmapAvailability newBea
protected override async Task<MultiplayerRoom> JoinRoom(long roomId, string? password = null)
{
if (RoomJoined || ServerAPIRoom != null)
throw new InvalidOperationException("Already joined a room");
roomId = clone(roomId);
password = clone(password);
@ -260,6 +263,8 @@ protected override void OnRoomJoined()
protected override Task LeaveRoomInternal()
{
RoomJoined = false;
ServerAPIRoom = null;
ServerRoom = null;
return Task.CompletedTask;
}