コード例 #1
0
        void OnLoginReceived(OperationResponse response)
        {
            Debug.Log("[OnLoginReceived]");
            switch ((NextAction)response.ReturnCode)
            {
            case NextAction.LoginSuccess:
                byte[]             bytes = (byte[])DictionaryTool.GetValue <byte, object> (response.Parameters, 1);
                ProtoData.UserData data  = BinSerializer.Deserialize <ProtoData.UserData> (bytes);
                GameManager.Instance.Join(data.nickname, (Race)data.race);
                TransitionManager.Instance.OnSceneTransition(SceneName.GetMainLobby((Race)data.race), TransitionType.Loading01_Slide, null);
                break;

            case NextAction.LoginFailed:
                BasePage.OnMessageBox("로그인에 실패하셨습니다.", true, null, "확인");
                break;

            case NextAction.UserCreateFail:
                BasePage.OnMessageBox("ID길이가 잘못 되었습니다.\n(2글자 ~ 10글자)", true, null, "확인");
                break;

            case NextAction.UserInfoCreate:
                Action action = () =>
                {
                    LoginGameMode gameMode = GameManager.Instance.GameMode as LoginGameMode;
                    GameManager.Instance.GameMode.CurrentPage = gameMode.cutScenePage;
                };
                TransitionManager.Instance.OnTransition(TransitionType.Blank, TransitionType.Slide, action, null);
                break;
            }
        }
コード例 #2
0
        void OnUserResistrationReceived(OperationResponse response)
        {
            Debug.Log("[OnUserResistrationReceived]");
            ReturnCode rc = (ReturnCode)response.ReturnCode;

            if (rc == ReturnCode.Success)
            {
                byte[]             bytes = (byte[])DictionaryTool.GetValue <byte, object> (response.Parameters, 1);
                ProtoData.UserData data  = BinSerializer.Deserialize <ProtoData.UserData> (bytes);
                GameManager.Instance.Join(data.nickname, (Race)data.race);
                TransitionManager.Instance.OnSceneTransition(SceneName.GetMainLobby(GameManager.Instance.LocalPlayer.playerInfo.Race), TransitionType.Loading01_Slide, null);
            }
            else
            {
                BasePage.OnMessageBox("닉네임의 길이가 잘못 되었습니다.\n(3글자 ~ 6글자)", true, null, "확인");
            }
        }