Exemple #1
0
 //=================================
 void OnCloseClick()
 {
     // 未选择角色(直接退出创建流程)
     //if (m_ChooseIndex == 0)
     {
         if (LoginData.loginRoleList.Count > 0)
         {
             LoginUILogic.Instance().EnterChooseRole();
             //HideProfeesion();
         }
         else
         {
             //NetManager.SendUserLogout();
             NetWorkLogic.GetMe().DisconnectServer();
             LoginUILogic.Instance().EnterServerChoose();
         }
     }
     // 已选择角色,退到展示界面(未做)
     //else
     //{
     //ReturnChooseChar();
     //ShowProfessionDelay(m_delaySelectBack);
     //HideProDetail();
     //}
 }
    void OnChoose(int nIndex)
    {
        setRoleWeaponId(-1);
        setRoleProfess(-1);
        if (nIndex > 0 && nIndex <= MAX_CHAR_NUM)
        {
            if (nIndex > LoginData.loginRoleList.Count)
            {
                GotoCreateRole();
            }
            else
            {
                LoginUILogic.Instance().OnClickChangeShader();
                LoginUILogic.Instance().OnClickChangeEffect();
                m_chooseIndex = nIndex - 1;
                //ShowRoleMode(m_chooseIndex);
                //hideLastLoginBac();

//              if(  m_chooseIndex >=0 && m_chooseIndex < m_lastLoginBac.Length )
//              {
//                  m_lastLoginBac[m_chooseIndex].SetActive(true) ;
//              }
            }
        }
    }
 void OnEnterServerMain()
 {
     if (null != LoginUILogic.Instance())
     {
         LoginUILogic.Instance().EnterServerChoose();
     }
 }
 public void backToServer()
 {
     m_chooseIndex = 0;
     NetWorkLogic.GetMe().DisconnectServer();
     LoginUILogic.Instance().EnterServerChoose();
     //DestroyPartnerFakeObj ();
     LoginUILogic.Instance().DestroyRoleModeObj();
 }
Exemple #5
0
    public void ConnectLost()
    {
        if (!GameManager.gameManager.OnLineState)
        {
            return;
        }
        if (LoginUILogic.Instance() != null)
        {
            LoginUILogic.Instance().EnterServerChoose();
            // 连接丢失,请重新登录
#if !UNITY_WP8
            MessageBoxLogic.OpenOKBox(1292, 1000);
#else
            if (!m_DeviceLost)
            {
                MessageBoxLogic.OpenOKBox(1292, 1000);
            }
#endif

            return;
        }
        else if (MainUILogic.Instance() != null)
        {
            if (!m_bAskConnecting || null != MessageBoxLogic.Instance())
            {
                LogModule.DebugLog("reconnecting....");
                // 连接丢失,正在重新连接。。。
#if UNITY_WP8
                if (!m_DeviceLost)
                {
                    MessageBoxLogic.OpenOKBox(1293, 1000, OnReconnect);
                }
                else
                {
                    WP8ConnectingLostLogic();
                }
#else
                MessageBoxLogic.OpenOKBox(1293, 1000, OnReconnect);
#endif

                m_bAskConnecting  = true;
                m_IsAskConnecting = true;
                if (BackCamerControll.Instance() != null && BackCamerControll.Instance().gameObject.activeInHierarchy)
                {
                    BackCamerControll.Instance().gameObject.SetActive(false);
                }
                WorldMapWindow.OnDisConnect();
                HuaShanPVPData.OnDisconnect();
            }
        }
        else
        {
            // 有可能在loading不处理,等UI起来后检测
        }
    }
Exemple #6
0
 void OnSelectRoleFail()
 {
     if (null != LoginUILogic.Instance())
     {
         LoginUILogic.Instance().EnterServerChoose();
     }
     else
     {
         LoadingWindow.LoadScene(Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_LOGIN);
     }
 }
    IEnumerator LoadAllPlayerNew()
    {
        yield return(new WaitForSeconds(0.1f));

        int Type            = -1;
        int ModelVisualID   = -1;
        int WeaponID        = -1;
        int WeaponEffectGem = -1;
        int index           = 0;

        firtPlaceIndex = 0;

        ulong lastRoleGuid = PlayerPreferenceData.LastRoleGUID;

        for (int j = 0; j < MAX_CHAR_NUM; j++)
        {
            if (j < LoginData.loginRoleList.Count)
            {
                if (LoginData.loginRoleList[j].guid == lastRoleGuid)
                {
                    firtPlaceIndex = j;
                }
            }
        }
        for (int i = 0; i < MAX_CHAR_NUM; i++)
        {
            if (i < LoginData.loginRoleList.Count)
            {
                //LoginUILogic.Instance().SetLoadModelMark(false); //在这里设置还没有加载完模型

                Type            = LoginData.loginRoleList[i].type;
                ModelVisualID   = LoginData.loginRoleList[i].ModelVisualID;
                WeaponID        = LoginData.loginRoleList[i].WeaponID;
                WeaponEffectGem = LoginData.loginRoleList[i].WeaponEffectGem;
                if (i == firtPlaceIndex)
                {
                    LoginUILogic.Instance().ShowModel(Type, ModelVisualID, WeaponID, WeaponEffectGem, 0);
                }
                else
                {
                    otherPlaceIndexList.Add(i);
                    index++;
                    LoginUILogic.Instance().ShowModel(Type, ModelVisualID, WeaponID, WeaponEffectGem, index);
                }

                //yield return LoginUILogic.Instance().GetLoadModelMark(); //等待,一直到加载模型结束
                yield return(new WaitForSeconds(0.5f));
            }
        }

        InitRoleInfo();
    }
Exemple #8
0
    void OnUpdateApp()
    {
        if (PlatformHelper.GetNetworkState() == PlatformHelper.NetworkState.STATE_WIFI)
        {
#if UNITY_ANDROID
            LoginUILogic.DoUpdateApp();
#else
            Application.OpenURL(PlatformHelper.GetUpdateAppUrl());
            ShowForceEnterTip(false);
#endif
        }
        else
        {
            ShowForceEnterTip(false);
            MessageBoxLogic.OpenOKCancelBox(2622, 1000, OnDoUpdateApp);
        }
    }
    void Start()
    {
        LoginUILogic.Instance().ShowChooseRoleCamera();

        NGUITools.SetActive(LoginUILogic.Instance().m_ClickEffect[1], false);
        for (int i = 0; i < LoginUILogic.Instance().m_ClickEffect.Length; i++)
        {
            if (i == m_choosePlace)
            {
                NGUITools.SetActive(LoginUILogic.Instance().m_ClickEffect[i], true);
            }
            else
            {
                NGUITools.SetActive(LoginUILogic.Instance().m_ClickEffect[i], false);
            }
        }
        StartCoroutine(LoadAllPlayerNew());
    }
Exemple #10
0
 public void WPLogOutCallBack()
 {
     if (GameManager.gameManager.RunningScene != (int)Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_LOGIN)
     {
         NetManager.SendUserLogout();
     }
     else
     {
         if (LoginUILogic.Instance() != null)
         {
             LoginUILogic.Instance().EnterServerChoose();
         }
         else
         {
             LoadingWindow.LoadScene(Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_LOGIN);
         }
     }
 }
        public uint Execute(PacketDistributed ipacket)
        {
            GC_RET_QUIT_GAME packet = (GC_RET_QUIT_GAME )ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic
            WorldMapWindow.OnDisConnect();
            HuaShanPVPData.OnDisconnect();
            LoginUILogic.m_LoginSelect = 0;
            if (packet.Type == (int)GC_RET_QUIT_GAME.GameSelectType.GAMESELECTTYPE_ACCOUNT)
            {
                if (GameManager.gameManager.RunningScene != (int)(int)Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_LOGIN)
                {
                    LoginUILogic.m_LoginSelect = 1;
                    LoadingWindow.LoadScene(Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_LOGIN);
                    OnClearAccount();
                }
                else
                {
                    // 如果在登陆场景,直接返回服务器选择界面
                    if (LoginUILogic.Instance() != null)
                    {
                        LoginUILogic.Instance().EnterServerChoose();
                    }
                }
            }
            else if (packet.Type == (int)GC_RET_QUIT_GAME.GameSelectType.GAMESELECTTYPE_ROLE)
            {
                LoginUILogic.m_LoginSelect = 2;
                LoadingWindow.LoadScene(Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_LOGIN);
                OnClearRole();
            }
            else if (packet.Type == (int)GC_RET_QUIT_GAME.GameSelectType.GAMESELECTTYPE_QUIT)
            {
                Application.Quit();
            }

            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
Exemple #12
0
 void OnConnectResult(bool bSuccess, string result)
 {
     if (bSuccess)
     {
         MessageBoxLogic.CloseBox();
         if (LoginUILogic.Instance() != null)
         {
             LoginUILogic.Instance().EnterAccount();
         }
     }
     else
     {
         if (!m_bShowConnectResult)
         {
             StartCoroutine(RequestServerState(PlayerPreferenceData.LastServer));
             m_bShowConnectResult = true;
         }
         LogModule.WarningLog("connect fail");
         m_connnectTimer = 0;
     }
 }
Exemple #13
0
    public void FreshNewName()
    {
        string strRet = "";

        if (m_ChooseSex == ROLE_SEX.ROLE_FEMALE)
        {
            if (LoginData.m_randomFemaleNameList.Count > 0)
            {
                strRet = LoginData.m_randomFemaleNameList[0];
                LoginData.m_randomFemaleNameList.RemoveAt(0);
                if (LoginData.m_randomFemaleNameList.Count == 1)
                {
                    LoginUILogic.RequestRandomName((int)m_ChooseSex);
                }
            }
            else
            {
                strRet = GetRandomNameFromClient();
            }
        }
        else
        {
            if (LoginData.m_randomMaleNameList.Count > 0)
            {
                strRet = LoginData.m_randomMaleNameList[0];
                LoginData.m_randomMaleNameList.RemoveAt(0);
                if (LoginData.m_randomMaleNameList.Count == 1)
                {
                    LoginUILogic.RequestRandomName((int)m_ChooseSex);
                }
            }
            else
            {
                strRet = GetRandomNameFromClient();
            }
        }


        m_InputName.value = strRet;
    }
Exemple #14
0
 void Update()
 {
     if (m_updateTimer > 0)
     {
         m_updateTimer -= Time.deltaTime;
         if (m_updateTimer <= 0)
         {
             if (LoginData.m_curQueueState == GC_LOGIN_QUEUE_STATUS.QUEUESTATUS.QUEUING)
             {
                 if (LoginUILogic.Instance() != null)
                 {
                     objLeaveBtn.SetActive(true);
                 }
                 FirstChild.SetActive(true);
                 PlatformHelper.SendUserAction(UserBehaviorDefine.StartQueue);
             }
             else
             {
                 UIManager.CloseUI(UIInfo.QueueWindow);
             }
         }
     }
 }
Exemple #15
0
 void RequestNewName()
 {
     LoginData.m_randomMaleNameList.Clear();
     LoginData.m_randomFemaleNameList.Clear();
     LoginUILogic.RequestRandomName((int)m_ChooseSex);
 }
 void GotoCreateRole()
 {
     //DestroyPartnerFakeObj ();
     LoginUILogic.Instance().EnterCreateRole();
     LoginUILogic.Instance().DestroyRoleModeObj();
 }
Exemple #17
0
 private static void OnReturnServerChoose()
 {
     NetWorkLogic.GetMe().DisconnectServer();
     LoginUILogic.Instance().EnterServerChoose();
 }
Exemple #18
0
 static void VersionNotMatch()
 {
     LoginUILogic.DoUpdateApp();
 }
Exemple #19
0
 public static void Ret_Login(GC_LOGIN_RET.LOGINRESULT result, int validateResult)
 {
     PlatformHelper.SendUserAction(UserBehaviorDefine.LoginVarifyTokenFinish);
     if (result == GC_LOGIN_RET.LOGINRESULT.ACCOUNTVERIFYFAIL)
     {
         PlatformHelper.SendUserAction(UserBehaviorDefine.VerifyResult + ((int)result).ToString() + validateResult);
     }
     else
     {
         PlatformHelper.SendUserAction(UserBehaviorDefine.VerifyResult + ((int)result).ToString());
     }
     LogModule.DebugLog("connect result: " + result.ToString() + " validateResult: " + validateResult);
     UIManager.CloseUI(UIInfo.QueueWindow);
     MessageBoxLogic.CloseBox();
     if (result == GC_LOGIN_RET.LOGINRESULT.SUCCESS)
     {
         LoginUILogic.Instance().LoginSuccess();
     }
     else if (result == GC_LOGIN_RET.LOGINRESULT.ACCOUNTVERIFYFAIL)
     {
         // 登录失败
         if (validateResult == 6)
         {
             PlatformHelper.UserLogout();
             accountData.CleanData();
             MessageBoxLogic.OpenOKBox(2369, 1000, SDKVarifyFail);
         }
         else
         {
             string strTip   = StrDictionary.GetClientDictionaryString("#{1284}", (int)validateResult);
             string strTitle = StrDictionary.GetClientDictionaryString("#{1000}");
             MessageBoxLogic.OpenOKBox(strTip, strTitle);
         }
     }
     else if (result == GC_LOGIN_RET.LOGINRESULT.ALREADYLOGIN)
     {
         // 该账户已经登录
         MessageBoxLogic.OpenOKBox(1285, 1000);
     }
     else if (result == GC_LOGIN_RET.LOGINRESULT.READROLELISTFAIL)
     {
         // 获取角色列表失败
         MessageBoxLogic.OpenOKBox(1286, 1000);
     }
     else if (result == GC_LOGIN_RET.LOGINRESULT.QUEUEFULL)
     {
         // 队伍已满,请稍后尝试
         MessageBoxLogic.OpenOKBox(1852, 1000);
     }
     else if (result == GC_LOGIN_RET.LOGINRESULT.VERSIONNOTMATCH || result == GC_LOGIN_RET.LOGINRESULT.PACKETNOTMATCH)
     {
         // 客户端版本过低
         MessageBoxLogic.OpenOKBox(2161, 1000, VersionNotMatch);
     }
     else if (result == GC_LOGIN_RET.LOGINRESULT.NEEDFORCEENTER)
     {
         if (null != ServerChooseController.Instance())
         {
             ServerChooseController.Instance().ShowForceEnterTip(true);
         }
         else
         {
             MessageBoxLogic.OpenOKBox(2161, 1000, VersionNotMatch);
         }
     }
     else
     {
         MessageBoxLogic.OpenOKBox(1287, 1000);
     }
 }
Exemple #20
0
 void OnDoUpdateApp()
 {
     LoginUILogic.DoUpdateApp();
 }
Exemple #21
0
 void OnEnterAccount()
 {
     GameManager.gameManager.OnLineState = false;
     LoginUILogic.Instance().EnterAccount();
 }