Пример #1
0
        public static void CallBack(CMsgLoginSystemGM2GCAckAccountLogin msg)
        {
            if (CMsgLoginSystemGM2GCAckAccountLogin.cb == null)
            {
                return;
            }

            CMsgLoginSystemGM2GCAckAccountLogin.cb((EErrorPlayerLoginServer)msg.m_state);
        }
Пример #2
0
 private void SetLoginResult(EErrorPlayerLoginServer result)
 {
     if (ConnectCallBackType == EConnectCallBack.CONNECT_CB_RECONNECT_GT)
     {
         return;
     }
     CMsgLoginSystemGM2GCAckAccountLogin loginback = new CMsgLoginSystemGM2GCAckAccountLogin();
     loginback.m_state = (uint)result;
     CMsgLoginSystemGM2GCAckAccountLogin.CallBack(loginback);
 }
Пример #3
0
        /// <summary>
        /// 连接网关回调
        /// </summary>
        /// <param name="msgData"></param>
        private void OnMsgLoginSystemGM2GCAckAccountLogin(UnityFrame.CMsg msgData)
        {
            if ((m_loginState != LoginState.CONNECT_GAMESERVER_WAIT_LOGIN) && (ConnectCallBackType != EConnectCallBack.CONNECT_CB_RECONNECT_GT))
            {
                SetLoginState(LoginState.CONNECT_GAMESERVER_FAIL);
                CGameClient.Singleton.Disconnect();
                return;
            }
            CMsgLoginSystemGM2GCAckAccountLogin accountLogin = (CMsgLoginSystemGM2GCAckAccountLogin)msgData;
            UnityUtility.CTrace.Singleton.debug("[GT][m_state={0}]]", ((EErrorPlayerLoginServer)accountLogin.m_state).ToString());
            if ((EErrorPlayerLoginServer)accountLogin.m_state != EErrorPlayerLoginServer.ELOGINRESULT_SUCCESS)
            {
                if ((EErrorPlayerLoginServer)accountLogin.m_state == EErrorPlayerLoginServer.ELOGINRESULT_SUCCESS_FIRST)
                {
                    if (ConnectCallBackType == EConnectCallBack.CONNECT_CB_RECONNECT_GT)
                    {
                        SendLostMsg();
                        return;
                    }
                    SetLoginState(LoginState.CONNECT_GAMESERVER_SUCCESS);
                    SetLoginResult(EErrorPlayerLoginServer.ELOGINRESULT_SUCCESS_FIRST);
                    return;
                }

                if (ConnectCallBackType == EConnectCallBack.CONNECT_CB_RECONNECT_GT)
                {
                    UnityUtility.CTrace.Singleton.debug("[GT][m_state={0}]][recoennect fail]", ((EErrorPlayerLoginServer)accountLogin.m_state).ToString());
                    NotifyNetState(ENetStatus.ENETSTATUS_RECONNECT_INVALID);
                    return;
                }
                
                SetLoginState(LoginState.CONNECT_GAMESERVER_FAIL);
                CGameClient.Singleton.Disconnect();
                SetLoginResult((EErrorPlayerLoginServer)accountLogin.m_state);
                return;
            }

            SetLoginState(LoginState.CONNECT_GAMESERVER_SUCCESS);
            if (ConnectCallBackType == EConnectCallBack.CONNECT_CB_RECONNECT_GT)
            {
                SendLostMsg();
                return;
            }
            CMsgLoginSystemGM2GCAckAccountLogin.CallBack(accountLogin);
        }