Exemplo n.º 1
0
        public Task Login()
        {
            if (State != ClientState.Disconnected)
            {
                throw new InvalidOperationException("Client not in disconnected state");
            }

            var tcs = new VirtualTCS <object>();

            ActiveTask = tcs;
            State      = ClientState.LobbyServerConnectInProgress;
            LobbyClient.Connect(Constants.LOBBY_HOST_IP, Constants.LOBBY_HOST_PORT);

            return(tcs.Task);
        }
Exemplo n.º 2
0
        public Task Login()
        {
            if (_state != ClientState.Disconnected)
            {
                throw new InvalidOperationException("Client not in disconnected state");
            }

            var tcs = new VirtualTCS <object>();

            _activeTask = tcs;
            _state      = ClientState.LobbyServerConnectInProgress;
            _lobbyClient.Connect(LobbyHost, LobbyPort);

            return(tcs.Task);
        }