Exemplo n.º 1
0
    private void DoAskForDownload()
    {
        long downloadSize = this.UpdateInfo.DownloadAmmount - this.UpdateInfo.GetCurrentFilesSize();
        NetworkReachability internetReachability = Application.get_internetReachability();

        if (internetReachability != 1)
        {
            if (internetReachability != 2)
            {
                DialogBoxUIViewModel.Instance.ShowAsConfirm("错误", "更新失败,请检查网络后重试", delegate
                {
                    this.DoAskForDownload();
                }, "确 定", "button_orange_1", UINodesManager.T4RootOfSpecial);
                DialogBoxUIView.Instance.isClick = false;
            }
            else
            {
                this.DoDownload();
            }
        }
        else
        {
            DialogBoxUIViewModel.Instance.ShowAsOKCancel("更新", this.GetUpdateSizeMsg(downloadSize), delegate
            {
                ClientApp.QuitApp();
            }, delegate
            {
                this.DoDownload();
            }, "取 消", "确 定", "button_orange_1", "button_yellow_1", UINodesManager.T4RootOfSpecial, true, true);
            DialogBoxUIView.Instance.isClick = false;
        }
    }
Exemplo n.º 2
0
 private void ShowVersionError()
 {
     DialogBoxUIViewModel.Instance.ShowAsConfirm("错误", "未找到对应版本资源,请重新下载客户端", delegate
     {
         ClientApp.QuitApp();
     }, "确 定", "button_orange_1", UINodesManager.T4RootOfSpecial);
     DialogBoxUIView.Instance.isClick = false;
 }
 private void RestartConfirm(string content)
 {
     UIManagerControl.Instance.OpenUI("DialogBoxUI", UINodesManager.T3RootOfSpecial, false, UIType.NonPush);
     DialogBoxUIViewModel.Instance.ShowAsConfirm(GameDataUtils.GetChineseContent(513156, false), content, delegate
     {
         ClientApp.QuitApp();
     }, GameDataUtils.GetChineseContent(513154, false), "button_orange_1", null);
     DialogBoxUIView.Instance.isClick = false;
 }
Exemplo n.º 4
0
 private void OnAskForDownloadAgainEnter(int eventID, FSMState preState, FSMState currentState)
 {
     DialogBoxUIViewModel.Instance.ShowAsOKCancel("更新", "更新出错,是否重新下载", delegate
     {
         ClientApp.QuitApp();
     }, delegate
     {
         base.React(UpdateEvent.Next);
     }, "取 消", "确 定", "button_orange_1", "button_yellow_1", UINodesManager.T4RootOfSpecial, true, true);
     DialogBoxUIView.Instance.isClick = false;
 }
Exemplo n.º 5
0
        private void DoDownloadPackage(string url, string localPath, FileBaseInfo fileInfo)
        {
            PreloadingUIView.SetProgressName("正在计算下载量...");
            long fileDownloadAmmount = Downloader.GetFileDownloadAmmount(localPath, (long)fileInfo.FileSize, fileInfo.Md5);

            if (fileDownloadAmmount == 0L)
            {
                base.React(UpdateEvent2.Next);
            }
            else
            {
                switch (Application.get_internetReachability())
                {
                case 0:
                    DialogBoxUIViewModel.Instance.ShowAsConfirm("错误", "更新失败,请检查网络后重试", delegate
                    {
                        this.DoDownloadPackage(url, localPath, fileInfo);
                    }, "确 定", "button_orange_1", UINodesManager.T4RootOfSpecial);
                    DialogBoxUIView.Instance.isClick = false;
                    break;

                case 1:
                    DialogBoxUIViewModel.Instance.ShowAsOKCancel("更新", this.GetUpdateSizeMsg(fileDownloadAmmount), delegate
                    {
                        ClientApp.QuitApp();
                    }, delegate
                    {
                        this.BeginDownloadPackage(url, localPath, fileInfo);
                    }, "取 消", "确 定", "button_orange_1", "button_yellow_1", UINodesManager.T4RootOfSpecial, true, true);
                    DialogBoxUIView.Instance.isClick = false;
                    break;

                case 2:
                    this.BeginDownloadPackage(url, localPath, fileInfo);
                    break;
                }
            }
        }
Exemplo n.º 6
0
 public void OnApplicationQuitResp(SDKStatusCode code, string data)
 {
     ClientApp.QuitApp();
 }