/// <summary> /// 重连服务器 /// </summary> public void ReconnectServer() { if (ReconnectMsgList.Count == 0) { return; } if (_reconnectMsg != null || GameObject.Find("CommonMag") != null) { return; } _reconnectMsg = ReconnectMsgList[0]; ReconnectMsgList.RemoveAt(0); if (!_reconnectMsg.sc.IsConnecting && !_reconnectMsg.sc.IsConnected) { if (_reconnectMsg.sc.mReconnectType == ReconnectType.Reauto) { _reconnectMsg.sc.IsInitSuccess = false; _reconnectMsg.sc.Reconnect(); _reconnectMsg = null; } else if (_reconnectMsg.sc.mReconnectType == ReconnectType.Reexteral || _reconnectMsg.sc.mReconnectType == ReconnectType.Renull) { GameApp.Instance.CommonMsgDlg.OpenMsgBox(_reconnectMsg.content, ConfirmReconnectServer); } } }
void ConfirmReconnectServer(bool isConnect) { if (_reconnectMsg == null || _reconnectMsg.sc == null) { _reconnectMsg = null; return; } if (isConnect) { _reconnectMsg.sc.IsInitSuccess = false; _reconnectMsg.sc.Reconnect(); } else { Application.Quit(); } _reconnectMsg = null; }