Example #1
0
 public bool SplashScreenHidden = false;//开屏splash图是否隐藏.隐藏后其他界面才能开始更新
 void OnApplicationQuit()
 {
     //主线程阻塞到下载线程结束.
     HttpManager.Instance.Quit();
     //释放日志占用
     Log.Uninit();
     TcpClientProxy.Exit();
     FtpLog.Uninit();
     UpdateHelper.SaveCache();
 }
 static void OnVerifyResult(ProtocolVerifyRsp rsp)
 {
     if (rsp.result == 1)
     {
         TcpClientProxy.UpdateGameServer();//取得房间列表
     }
     else
     {
         U3D.PopupTip(string.Format("客户端版本过低-无法连接到服务器"));
         TcpClientProxy.Exit();
     }
 }
Example #3
0
 void Init()
 {
     Version.text = Main.Ins.AppInfo.MeteorVersion;
     SinglePlayerMode.onClick.AddListener(() =>
     {
         subMenuOpen = !subMenuOpen;
         SubMenu.SetActive(subMenuOpen);
     });
     //单机关卡-官方剧情
     SinglePlayer.onClick.AddListener(() =>
     {
         OnSinglePlayer();
     });
     DlcLevel.onClick.AddListener(() =>
     {
         OnDlcWnd();
     });
     //教学关卡-教导使用招式方式
     TeachingLevel.onClick.AddListener(() =>
     {
         OnTeachingLevel();
     });
     //创建房间-各种单机玩法
     CreateBattle.onClick.AddListener(() =>
     {
         OnCreateRoom();
     });
     //多人游戏-联机
     MultiplePlayer.onClick.AddListener(() =>
     {
         OnlineGame();
     });
     //设置面板
     PlayerSetting.onClick.AddListener(() =>
     {
         OnSetting();
     });
     Replay.onClick.AddListener(() =>
     {
         OnReplay();
     });
     EnterQueue.onClick.AddListener(() =>
     {
         OnEnterQueue();
     });
     if (Main.Ins.GameStateMgr.gameStatus.GodLike)
     {
         UploadLog.gameObject.SetActive(true);
     }
     UploadLog.onClick.AddListener(() => { FtpLog.UploadStart(); });
     TcpClientProxy.Exit();
 }
 static void OnConnect(int result, string message)
 {
     //取得房间信息
     if (result == 1)
     {
         retryNum = 3;
         TcpClientProxy.UpdateGameServer();
         //TcpClientProxy.AutoLogin();//验证客户端的合法性
     }
     else
     {
         //链接失败,重置对战
         U3D.PopupTip(message);
         Main.Ins.NetWorkBattle.OnDisconnect();
         retryNum--;
         if (retryNum <= 0)
         {
             TcpClientProxy.Exit();//重试3次,等待切换服务器再激活链接服务器的定时器.
             retryNum = 3;
         }
     }
 }
    void InsertServerItem(ServerInfo svr, int i)
    {
        GameObject btn = GameObject.Instantiate(ResMng.Load("ButtonNormal")) as GameObject;

        btn.transform.SetParent(serverRoot.transform);
        btn.transform.localScale    = Vector3.one;
        btn.transform.localPosition = Vector3.zero;
        btn.transform.localRotation = Quaternion.identity;
        btn.GetComponent <Button>().onClick.AddListener(() =>
        {
            if (Main.Ins.CombatData.Server == Main.Ins.CombatData.Servers[i])
            {
                TcpClientProxy.CheckNeedReConnect();
                return;
            }
            TcpClientProxy.Exit();
            ClearRooms();
            Main.Ins.CombatData.Server = svr;
            TcpClientProxy.ReStart();
        });
        btn.GetComponentInChildren <Text>().text = svr.ServerName;
    }