Exemplo n.º 1
0
 private void ConfirmReconnect()
 {
     if (GlobalSettings.NoReConnnect || this._isConfirmCd || this._peer == null)
     {
         return;
     }
     if (this.ConnectFlag)
     {
         this.ReconnectFinish();
         return;
     }
     if (this._isConfirmingReconnect)
     {
         return;
     }
     if (PvpServer._autoRetryNum < 5)
     {
         PvpServer._autoRetryNum++;
         PvpServer.LockScreen(true);
         this.Connect();
     }
     else
     {
         CtrlManager.CloseWindow(WindowID.ProgressView);
         PvpServer._autoRetryNum     = 0;
         this._isConfirmingReconnect = true;
         CtrlManager.ShowMsgBox(LanguageManager.Instance.GetStringById("ServerResponse_Title_GameServerDisconnect", "游戏服务器断开"), LanguageManager.Instance.GetStringById("ServerResponse_Content_GameServerDisconnect", "网络出故障了,请重试"), new Action <bool>(this.ConnectOrRestart), PopViewType.PopTwoButton, "确定", "重启游戏", null);
     }
 }
Exemplo n.º 2
0
 private void ConnectOrRestart(bool yes)
 {
     this._isConfirmingReconnect = false;
     if (yes)
     {
         this.Connect();
     }
     else
     {
         PvpServer._autoRetryNum = 0;
         PvpServer.LockScreen(false);
         GlobalObject.ReStartGame();
     }
 }
Exemplo n.º 3
0
        public override void OnDisconnected(MobaDisconnectedType dType)
        {
            bool flag = this._peer == null;

            if (flag)
            {
                PvpServer.LockScreen(false);
            }
            if (this.ConnectFlag)
            {
                this.ConnectFlag = false;
                MobaMessageManager.ExecuteMsg(MobaMessageManager.GetMessage((ClientMsg)20008, dType, 0f));
            }
            this.ConfirmReconnect();
            MobaMessageManager.ExecuteMsg(MobaMessageManager.GetMessage((ClientMsg)20002, new PeerDisconnectedMessage(MobaPeerType.C2PvpServer, dType), 0f));
        }
Exemplo n.º 4
0
 public override void OnConnected(MobaConnectedType cType)
 {
     if (!base.HasBegun)
     {
         ClientLogger.Error("OnConnected received when end");
         return;
     }
     if (cType == MobaConnectedType.ExceptionOnConnect)
     {
         PvpServer.LockScreen(true);
         this.ConfirmReconnect();
     }
     else
     {
         this.ConnectFlag = true;
         MobaMessageManager.ExecuteMsg(MobaMessageManager.GetMessage((ClientMsg)20007, cType, 0f));
     }
     MobaMessageManager.ExecuteMsg(MobaMessageManager.GetMessage((ClientMsg)20001, new PeerConnectedMessage(MobaPeerType.C2PvpServer, cType), 0f));
 }
Exemplo n.º 5
0
 private void ReconnectFinish()
 {
     PvpServer._autoRetryNum = 0;
     PvpServer.LockScreen(false);
 }