1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 00:42:55 +08:00

Add connection/disconnection capability

This commit is contained in:
smoogipoo 2020-12-19 01:16:00 +09:00
parent 1e2163f55e
commit 50a35c0f63

View File

@ -16,11 +16,16 @@ namespace osu.Game.Tests.Visual.RealtimeMultiplayer
{
public class TestRealtimeMultiplayerClient : StatefulMultiplayerClient
{
public override IBindable<bool> IsConnected { get; } = new Bindable<bool>(true);
public override IBindable<bool> IsConnected => isConnected;
private readonly Bindable<bool> isConnected = new Bindable<bool>(true);
[Resolved]
private IAPIProvider api { get; set; } = null!;
public void Connect() => isConnected.Value = true;
public void Disconnect() => isConnected.Value = false;
public void AddUser(User user) => ((IMultiplayerClient)this).UserJoined(new MultiplayerRoomUser(user.Id) { User = user });
public void RemoveUser(User user)