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起来后检测 } }
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); }