Ejemplo n.º 1
0
        private void searchAccountRequest()
        {
            var packet = new SearchAccountRequestPacket();

            packet.accessKey = AccountData.Instance.accessKey;
            networkManager.sendPacket(packet);
            messageBoxHandler.notice("계정 정보를 불러오고 있습니다.");
        }
Ejemplo 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");
        }
Ejemplo n.º 3
0
        private void getChannelListRequest()
        {
            var packet = new GetChannelListRequestPacket();

            networkManager.sendPacket(packet);
            messageBoxHandler.notice("채널 목록을 불러오고 있습니다.");
        }
Ejemplo n.º 4
0
        public void createCharacterRequest(GameObject characterNameField)
        {
            Text   characterNameText = characterNameField.GetComponent <Text>();
            string characterName     = characterNameText.text;

            if (string.IsNullOrWhiteSpace(characterName))
            {
                messageBoxHandler.alert("이름을 입력해주세요.");
                return;
            }
            else if (characterName.Length < 1 || characterName.Length > 10)
            {
                messageBoxHandler.alert("올바르지 않은 이름입니다.");
                return;
            }

            string warningStr = string.Format("[{0}]로 캐릭터 이름을 정하시겠습니까?", characterName);

            messageBoxHandler.confirm(warningStr, () => {
                var packet           = new CreateCharacterRequestPacket();
                packet.accessKey     = AccountData.Instance.accessKey;
                packet.classType     = this.selectedType;
                packet.characterName = characterName;
                networkManager.sendPacket(packet);
                messageBoxHandler.notice("캐릭터를 생성하고 있습니다.");
            });
        }
Ejemplo n.º 5
0
        public void activeRequestReviveWindow()
        {
            if (messageBoxHandler.IsOpened)
            {
                return;
            }

            messageBoxHandler.confirm("부활하시겠습니까?", () => {
                var packet      = new RevivePlayerRequestPacket();
                packet.playerId = AccountData.Instance.PlayerId;
                networkManager.sendPacket(packet);

                messageBoxHandler.notice("요청하고 있습니다.");
            });
        }