Exemplo n.º 1
0
        public Task <CharacterInfo.Detailed> GetDetailedCharacterInfo(int characterSlot)
        {
            if (State != ClientState.LobbyServerCharacterListReceived)
            {
                throw new InvalidOperationException("Client has not received characters");
            }

            var tcs = new VirtualTCS <CharacterInfo.Detailed>();

            ActiveTask = tcs;
            LobbyClient.GetDetailedCharacterInfo(characterSlot);
            return(tcs.Task);
        }
Exemplo n.º 2
0
        public Task <DistrictEnterInfo> JoinInstance(InstanceInfo instance)
        {
            if (State != ClientState.WorldServerWorldEnterComplete)
            {
                throw new InvalidOperationException("Client has not entered world");
            }

            var tcs = new VirtualTCS <DistrictEnterInfo>();

            ActiveTask = tcs;
            State      = ClientState.WorldServerDistrictReserveInProgress;
            WorldClient.AskDistrictReserve(instance.DistrictUid, instance.InstanceNum, -1, false);
            return(tcs.Task);
        }
Exemplo n.º 3
0
        public Task <List <InstanceInfo> > GetInstances()
        {
            if (State != ClientState.WorldServerWorldEnterComplete)
            {
                throw new InvalidOperationException("Client has not entered world");
            }

            var tcs = new VirtualTCS <List <InstanceInfo> >();

            ActiveTask = tcs;
            State      = ClientState.WorldServerInstanceListInProgress;
            WorldClient.GetInstanceList();
            return(tcs.Task);
        }
Exemplo n.º 4
0
        public Task <FinalWorldEnterData> EnterWorld(int characterSlotNumber)
        {
            if (State != ClientState.LobbyServerCharacterListReceived)
            {
                throw new InvalidOperationException("Client has not received characters or busy");
            }

            var tcs = new VirtualTCS <FinalWorldEnterData>();

            ActiveTask = tcs;
            State      = ClientState.LobbyServerWorldEnterInProgress;
            LobbyClient.EnterWorld(characterSlotNumber);
            return(tcs.Task);
        }
Exemplo n.º 5
0
        public Task <List <WorldInfo> > GetWorlds()
        {
            if (State != ClientState.LobbyServerCharacterListReceived)
            {
                throw new InvalidOperationException("Client has not received characters");
            }

            var tcs = new VirtualTCS <List <WorldInfo> >();

            ActiveTask = tcs;
            State      = ClientState.LobbyServerWorldListInProgress;
            LobbyClient.GetWorldList();
            return(tcs.Task);
        }
Exemplo n.º 6
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.º 7
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);
        }