protected void EnterAwakeState(fsm.State _from, fsm.State _to, fsm.Event _event) { GameCenter.instance.IsReConnecteding = false; GameCenter.uIMng.ReleaseGUI(GUIType.MERRYGOROUND); GameCenter.uIMng.ReleaseGUI(GUIType.LOADING); GameCenter.uIMng.ReleaseGUI(GUIType.MAINFIGHT); GameCenter.uIMng.ReleaseGUI(GUIType.LITTLEMAP); GameCenter.uIMng.ReleaseGUI(GUIType.TASK); GameCenter.uIMng.ReleaseGUI(GUIType.GUILDACTIVITYCOPPY); GameCenter.uIMng.ReleaseGUI(GUIType.TASK_FINDING); if (GameCenter.curMainPlayer != null) { Destroy(GameCenter.curMainPlayer.gameObject); } if (GameCenter.curMainEntourage != null) { Destroy(GameCenter.curMainEntourage.gameObject); } //GameCenter.uIMng.GenGUI(GUIType.LOGIN,true); GameCenter.cameraMng.BlackCoverAll(false); SceneManager.LoadScene("LoginStage"); YvVoiceSdk.YvVoiceLogOut(); CurLoginState = EventType.AWAKE; NetMsgMng.ConectClose(); }
void Awake() { mutualExclusion = true; Layer = GUIZLayer.TIP + 200; //Debug.Log("Awake"); if (GameCenter.instance.IsConnected) { NetMsgMng.ConectClose(); } }
void Awake() { openTime = Time.time; mutualExclusion = false; Layer = GUIZLayer.TIP + 200; showTime.StartTimer(); if (GameCenter.instance.IsConnected) { NetMsgMng.ConectClose(); } UIEventListener.Get(goBackBtn).onClick += OnBtnPassWord; showTime.StartIntervalTimer((int)limitTime); }
public void S2C_OnGetQueueEnd(Pt _info) { pt_net_info_a105 pt = _info as pt_net_info_a105; if (pt != null) { Login_IP = pt.ip; Login_port = (int)pt.port; CurQueueKey = pt.key; isActiveDisconnection = true; NetMsgMng.ConectClose(); LoginInSerlizeID = NetMsgMng.CreateNewSerializeID(); } }
protected void EnterPassWordState(fsm.State _from, fsm.State _to, fsm.Event _event) { GameCenter.cameraMng.BlackCoverAll(false); GameCenter.curGameStage = this; Regist(); CurLoginState = EventType.PASS_WORD; if (GameCenter.instance.IsConnected) { NetMsgMng.ConectClose(); } if (GameCenter.instance.isPlatform && !GameCenter.instance.isSwitchAccount)//此方法从GameCenter放到此处,解决SDK登陆框导致UI放大问题 By邓成 { LynSdkManager.Instance.UsrLogin(GameCenter.instance.gameObject.name, "OnLoginResult"); GameCenter.instance.platformLoginSeralizeID = (int)NetMsgMng.CreateNewSerializeID(); GameCenter.msgLoackingMng.UpdateSerializeList(GameCenter.instance.platformLoginSeralizeID, true); } }
protected virtual void EnterReconnectState(fsm.State _from, fsm.State _to, fsm.Event _event) { LynSdkManager.Instance.ReportConnectionLose(SceneID.ToString(), "游戏过程中,Socket的连接装备变为false,可能是服务端主动断开或者其他网络异常!"); hasConnectedQueueServer = false; lastConnectState = false; failCount = 0; hasNetClosed = false; if (GameCenter.sceneMng != null) { GameCenter.sceneMng.CleanAll(); } GameCenter.instance.IsReConnecteding = true; NetMsgMng.ConectClose(); startConnectTime = Time.time; startConnectTimeForConetWnd = Time.time; GameCenter.uIMng.SwitchToUI(GUIType.AUTO_RECONNECT); GameCenter.uIMng.ReleaseGUI(GUIType.PANELLOADING); }
void Awake() { mutualExclusion = false; Layer = GUIZLayer.TIP + 200; if (GameCenter.msgLoackingMng != null) { GameCenter.msgLoackingMng.CleanSerializeList(); } if (GameCenter.instance.IsConnected) { NetMsgMng.ConectClose(); } if (goBackBtn != null) { UIEventListener.Get(goBackBtn).onClick += OnBtnPassWord; } if (reconnectBtn != null) { UIEventListener.Get(reconnectBtn).onClick += OnBtnConnected; } }
protected virtual void UpdateReconnectState(fsm.State _curState) { if (!hasNetClosed) { if (Time.time - startConnectTime >= 1.0f) { GameCenter.loginMng.C2S_ConectQueueServer(GameCenter.loginMng.Quaue_IP, GameCenter.loginMng.Quaue_port); GameCenter.instance.IsReConnecteding = true; if (GameCenter.mainPlayerMng != null && GameCenter.mainPlayerMng.MainPlayerInfo != null) { GameCenter.mainPlayerMng.MainPlayerInfo.CleanBuff(); } hasNetClosed = true; } } else { if (lastConnectState != NetCenter.Connected) { lastConnectState = NetCenter.Connected; if (lastConnectState && GameCenter.loginMng.CurConnectServerType == LoginMng.ConnectServerType.Queue)//连接排队服务器成功,登陆排队服务器,取得角色列表,在loginmng中如果判断是重新连接中,那么自动选择上一次选择的角色登陆 { hasConnectedQueueServer = true; GameCenter.instance.PingTime = 10; GameCenter.loginMng.C2S_Login(); } else if (!lastConnectState && GameCenter.loginMng.CurConnectServerType == LoginMng.ConnectServerType.Queue)//自动选择角色登陆后,会断开排队服务器,此时连接游戏服务器 { if (hasConnectedQueueServer && GameCenter.loginMng.IsActiveDisconnection) { GameCenter.loginMng.C2S_ConectGameServer(); } else { GameCenter.loginMng.C2S_ConectQueueServer(GameCenter.loginMng.Quaue_IP, GameCenter.loginMng.Quaue_port); } } else if (lastConnectState && GameCenter.loginMng.CurConnectServerType == LoginMng.ConnectServerType.Game)//如果游戏服务器连接成功,则进入游戏 { PlayGameStage ps = GameCenter.curGameStage as PlayGameStage; if (ps != null) { GameCenter.instance.PingTime = 10; //链接成功,申请进入游戏 GameCenter.loginMng.C2S_EnterGame(); } } } if (NetCenter.IsConnectedFaild && !GameCenter.loginMng.IsActiveDisconnection) { if (failCount == 0) { failCount++; GameCenter.loginMng.C2S_ConectQueueServer(GameCenter.loginMng.Quaue_IP, GameCenter.loginMng.Quaue_port); } else if (failCount >= 10) { if (failCount == 5) { GameCenter.uIMng.SwitchToUI(GUIType.RECONNECT); GameCenter.uIMng.ReleaseGUI(GUIType.AUTO_RECONNECT); } failCount++; } else { if (closeTime == 0) { NetMsgMng.ConectClose(); closeTime = Time.time; } else if (Time.time - closeTime >= 2) { failCount++; GameCenter.loginMng.C2S_ConectQueueServer(GameCenter.loginMng.Quaue_IP, GameCenter.loginMng.Quaue_port); closeTime = Time.time; } } } } //超过10秒弹出重新连接窗口 ljq if (Time.time - startConnectTimeForConetWnd >= 30) { if (GameCenter.uIMng.CurOpenType != GUIType.RECONNECT) { startConnectTimeForConetWnd = Time.time; GameCenter.uIMng.SwitchToUI(GUIType.RECONNECT); GameCenter.uIMng.ReleaseGUI(GUIType.AUTO_RECONNECT); } } }