1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 06:47:24 +08:00

Remove local APIRoom from test multiplayer client

This commit is contained in:
smoogipoo 2021-07-19 20:19:23 +09:00
parent 1b9d297911
commit d6aa15e5d7

View File

@ -28,7 +28,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
public override IBindable<bool> IsConnected => isConnected;
private readonly Bindable<bool> isConnected = new Bindable<bool>(true);
public Room? APIRoom { get; private set; }
public new Room? APIRoom => base.APIRoom;
public Action<MultiplayerRoom>? RoomSetupAction;
@ -138,6 +138,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
RequiredMods = apiRoom.Playlist.Last().RequiredMods.Select(m => new APIMod(m)).ToArray(),
AllowedMods = apiRoom.Playlist.Last().AllowedMods.Select(m => new APIMod(m)).ToArray(),
PlaylistItemId = apiRoom.Playlist.Last().ID,
// ReSharper disable once ConstantNullCoalescingCondition Incorrect inspection due to lack of nullable in Room.cs.
Password = password ?? string.Empty,
},
Users = { localUser },
@ -147,16 +148,10 @@ namespace osu.Game.Tests.Visual.Multiplayer
RoomSetupAction?.Invoke(room);
RoomSetupAction = null;
APIRoom = apiRoom;
return Task.FromResult(room);
}
protected override Task LeaveRoomInternal()
{
APIRoom = null;
return Task.CompletedTask;
}
protected override Task LeaveRoomInternal() => Task.CompletedTask;
public override Task TransferHost(int userId) => ((IMultiplayerClient)this).HostChanged(userId);