Exemplo n.º 1
0
        private void OnVerificationKey(MobaMessage msg)
        {
            OperationResponse operationResponse = msg.Param as OperationResponse;
            int num  = (int)operationResponse.Parameters[6];
            int num2 = num;

            if (num2 != 1)
            {
                if (num != 2)
                {
                    ClientLogger.Assert(false, null);
                }
                NetWorkHelper.Instance.DisconnectFromGateServer(true);
                this._connectState = GateReconnection.ConnectState.ConnectLogin;
                if (NetWorkHelper.Instance.MasterServerFlag)
                {
                    this.OnLoginConnected();
                }
                else
                {
                    NetWorkHelper.Instance.ConnectToMasterServer();
                }
            }
            else
            {
                this.End(true);
            }
        }
Exemplo n.º 2
0
        private void OnLoginConnected()
        {
            AccountData tempAccData = LoginStateManager.Instance.TempAccData;

            SendMsgManager.SendMsgParam param = new SendMsgManager.SendMsgParam(true, "正在登录服务器...", true, 15f);
            SendMsgManager.Instance.SendMsg(MobaMasterCode.Login, param, new object[]
            {
                tempAccData
            });
            this._connectState = GateReconnection.ConnectState.ValidLogin;
        }
Exemplo n.º 3
0
 private void ConnectGateAgain()
 {
     NetWorkHelper.Instance.DisconnectFromMasterServer();
     if (NetWorkHelper.Instance.IsGateConnected)
     {
         this.SelectServer();
     }
     else
     {
         NetWorkHelper.Instance.ConnectToGateServer();
     }
     this._connectState = GateReconnection.ConnectState.ConnectGateAgain;
 }
Exemplo n.º 4
0
        private void OnGateConnected()
        {
            AccountData         accountData         = ModelManager.Instance.Get_accountData_X();
            ServerListModelData serverListModelData = ModelManager.Instance.Get_serverInfo();
            string accountId = accountData.AccountId;
            string tokenKey  = serverListModelData.m_TokenKey;

            SendMsgManager.Instance.SendGateSelfChannelMessage(21, new SendMsgManager.SendMsgParam(true, string.Empty, true, 15f), new object[]
            {
                accountId,
                tokenKey
            });
            this._connectState = GateReconnection.ConnectState.ValidateToken;
        }
Exemplo n.º 5
0
 public override void Begin()
 {
     if (base.IsBegan)
     {
         return;
     }
     base.Begin();
     if (NetWorkHelper.Instance.IsGateConnected)
     {
         this.OnGateConnected();
     }
     else
     {
         NetWorkHelper.Instance.ConnectToGateServer();
     }
     this._connectState = GateReconnection.ConnectState.Begin;
     this._timeout      = Time.realtimeSinceStartup + 5f;
 }
Exemplo n.º 6
0
 public override void End(bool success)
 {
     if (!base.IsBegan)
     {
         return;
     }
     base.End(success);
     if (!success)
     {
         NetWorkHelper.Instance.DisconnectFromMasterServer();
         NetWorkHelper.Instance.DisconnectFromGateServer(true);
     }
     else
     {
         MobaMessageManager.ExecuteMsg(ClientC2C.GateConnected, null, 0f);
     }
     this._connectState = GateReconnection.ConnectState.End;
     this.OnReconnectEnd(success);
 }
Exemplo n.º 7
0
        private void OnValidateLogin(MobaMessage msg)
        {
            OperationResponse operationResponse = msg.Param as OperationResponse;

            if (operationResponse == null)
            {
                ClientLogger.Error("OnValidateLogin failed, it's terrible and I cannot handle it");
                return;
            }
            int    num          = (int)operationResponse.Parameters[1];
            string debugMessage = operationResponse.DebugMessage;

            if (num == 0)
            {
                AccountData accountData = ModelManager.Instance.Get_accountData_X();
                if (accountData != null)
                {
                    AnalyticsToolManager.SetAccountId(accountData.AccountId);
                }
                this.ConnectGateAgain();
                this._connectState = GateReconnection.ConnectState.SelectServer;
            }
        }