Example #1
0
        public void TestButtonEnableStateChanges()
        {
            IDisposable joiningRoomOperation = null;

            assertButtonEnableState(true);

            AddStep("begin joining room", () => joiningRoomOperation = OngoingOperationTracker.BeginOperation());
            assertButtonEnableState(false);

            AddStep("end joining room", () => joiningRoomOperation.Dispose());
            assertButtonEnableState(true);

            AddStep("disconnect client", () => MultiplayerClient.Disconnect());
            assertButtonEnableState(false);

            AddStep("re-connect client", () => MultiplayerClient.Connect());
            assertButtonEnableState(true);
        }
Example #2
0
 public void JoinServer(string serverAddress, string roomId)
 {
     Logging.Info($"Attempting to join server '{serverAddress}' in room '{roomId}'");
     _client?.Disconnect();
     _client = new MultiplayerClient(serverAddress, roomId);
 }