Esempio n. 1
0
        private void searchAccountResponse(Packet rowPacket)
        {
            messageBoxHandler.close();

            var packet    = rowPacket as SearchAccountResponsePacket;
            var errorCode = (StatusCode)packet.errorCode;

            switch (errorCode)
            {
            case StatusCode.Success:
                AccountData.Instance.FamilyName          = packet.familyName;
                characterListUI.CreatableCharactersCount = packet.creatableCharactersCount;
                this.getCharacterListRequest();
                break;

            case StatusCode.Fail:
                familyNameDialog.SetActive(true);
                break;

            default:
                messageBoxHandler.alert("알 수 없는 에러 발생");
                this.searchAccountRequest();
                break;
            }
        }
Esempio n. 2
0
        private IEnumerator RequestLogin()
        {
            messageBoxHandler.notice("처리 중입니다.");

            WWWForm form = new WWWForm();

            form.AddField("username", userIdField.text);
            form.AddField("password", passwordField.text);

            UnityWebRequest webRequest = UnityWebRequest.Post(authServerIP + "/account/signin", form);

            yield return(webRequest.SendWebRequest());

            if (webRequest.isNetworkError || webRequest.isHttpError)
            {
                messageBoxHandler.alert("네트워크 상태가 원활하지 않습니다.");
                yield break;
            }

            messageBoxHandler.close();
            string  response     = webRequest.downloadHandler.text;
            JObject responseData = JObject.Parse(response);

            if (responseData.ContainsKey("error"))
            {
                messageBoxHandler.alert(responseData["error"].ToString());
                yield break;
            }

            AccountData.Instance.accessKey = responseData["accessKey"].ToString();
            SceneManager.LoadScene("Channel");
        }
Esempio n. 3
0
        private void createCharacterResponse(Packet rowPacket)
        {
            messageBoxHandler.close();

            var packet    = rowPacket as CreateCharacterResponsePacket;
            var errorCode = (StatusCode)packet.errorCode;

            switch (errorCode)
            {
            case StatusCode.Success:
                SceneManager.LoadScene("Select");
                break;

            case StatusCode.BadRequest:
                messageBoxHandler.alert("올바르지 않은 이름입니다.");
                break;

            case StatusCode.Conflict:
                messageBoxHandler.alert("이미 존재하는 이름입니다.");
                break;

            default:
                messageBoxHandler.alert("알 수 없는 에러 발생");
                break;
            }
        }
Esempio n. 4
0
        private void getChannelListResponse(Packet rowPacket)
        {
            messageBoxHandler.close();

            var packet = rowPacket as GetChannelListResponsePacket;

            channelListUI.createChannelBoxes(packet.channelList);
        }
Esempio n. 5
0
        private void revivePlayerResponse(Packet rowPacket)
        {
            messageBoxHandler.close();

            var stateManager = this.getPlayerState(AccountData.Instance.PlayerId);

            stateManager.info.currentHp = stateManager.info.maxHp;
            stateManager.executeAction(ActionType.Revive);
        }