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); } }
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; }
private void ConnectGateAgain() { NetWorkHelper.Instance.DisconnectFromMasterServer(); if (NetWorkHelper.Instance.IsGateConnected) { this.SelectServer(); } else { NetWorkHelper.Instance.ConnectToGateServer(); } this._connectState = GateReconnection.ConnectState.ConnectGateAgain; }
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; }
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; }
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); }
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; } }