Exemple #1
0
    private void OnUpdateMd5List(UpdateHelper.UpdateResult result, string message)
    {
        if (result == UpdateHelper.UpdateResult.GetMd5ListFail)
        {
            ShowErrorTip(message);
            return;
        }

        if (/*UpdateHelper.CheckWiFi()*/ true)
        {
            WifiTip.SetActive(false);
            UpdatePanel.SetActive(true);
            StartCoroutine(updateHelper.StartUpdateAll(OnUpdateFinish));
        }
        else
        {
            TotalSize.text = message;
            WifiTip.SetActive(true);
            switch (result)
            {
            case UpdateHelper.UpdateResult.GetMd5ListSuccess:
                LateUpdateTip.gameObject.SetActive(false);
                UpdateTip.gameObject.SetActive(true);
                break;

            case UpdateHelper.UpdateResult.GetMd5ListSuccessAndLateUpdate:
                LateUpdateTip.gameObject.SetActive(true);
                UpdateTip.gameObject.SetActive(false);
                break;
            }
        }
    }
Exemple #2
0
    private void OnUpdateMd5List(UpdateHelper.UpdateResult result, string message)
    {
        if (result == UpdateHelper.UpdateResult.GetMd5ListFail)
        {
            ShowErrorTip(message);
            return;
        }



        if (UpdateHelper.CheckWiFi())
        {
            StartupView.WifiTip.SetActive(false);
            StartupView.UpdatePanel.SetActive(true);
            StartCoroutine(updateHelper.StartUpdateAll(OnUpdateFinish));
        }
        else
        {
            StartupView.TotalSize.text = message;
            switch (result)
            {
            case UpdateHelper.UpdateResult.GetMd5ListSuccess:
            {
                cellularUpdate = true;
                if (cellularUpdate)
                {
                    GameUtils.RecordKeyPoint("UpdateTip", 11);
                }

                float downloadSize;
                if (float.TryParse(message, out downloadSize))
                {
                    if (downloadSize < 1.5f)
                    {
                        StartupView.WifiTip.SetActive(false);
                        StartupView.UpdatePanel.SetActive(false);
                        StartCoroutine(updateHelper.StartUpdateAll(OnUpdateFinish));
                        break;
                    }
                }
                StartupView.WifiTip.SetActive(true);
                StartupView.ProgressBar.gameObject.SetActive(false);
                StartupView.LateUpdateTip.gameObject.SetActive(false);
                StartupView.UpdateTip.gameObject.SetActive(true);
            }
            break;

            case UpdateHelper.UpdateResult.GetMd5ListSuccessAndLateUpdate:
                StartupView.WifiTip.SetActive(true);
                StartupView.LateUpdateTip.gameObject.SetActive(true);
                StartupView.UpdateTip.gameObject.SetActive(false);
                cellularLateUpdate = true;
                if (cellularLateUpdate)
                {
                    GameUtils.RecordKeyPoint("LateUpdateTip", 9);
                }
                break;
            }
        }
    }
Exemple #3
0
    public static string GetUpdateErrorTip(UpdateHelper.UpdateResult updateResult)
    {
        switch (updateResult)
        {
        case UpdateHelper.UpdateResult.GetVersionFail:                 // 获取版本号失败
        {
            // 请检查网络是否通畅
            return(GetTipByID(11));
        }

        case UpdateHelper.UpdateResult.GetFileListFail:                // 获取文件列表失败
        {
            // 请检查网络是否通畅
            return(GetTipByID(11));
        }

        case UpdateHelper.UpdateResult.DownloadInComplete:             // 下载文件不完全
        {
            // 文件错误,请重启游戏
            return(GetTipByID(12));
        }

        case UpdateHelper.UpdateResult.DownloadFail:                   // 下载文件失败
        {
            // 下载失败,请检查网络是否通畅
            return(GetTipByID(13));
        }

        case UpdateHelper.UpdateResult.CopyDataFileFail:               // 拷贝文件失败
        {
            // 安装失败,请重启游戏
            return(GetTipByID(14));
        }

        case UpdateHelper.UpdateResult.GenerateVersionFileFail:        // 生成版本号文件失败
        {
            // 版本号错误,请重启游戏
            return(GetTipByID(15));
        }

        case UpdateHelper.UpdateResult.GenerateFileListFail:           // 生成文件列表文件失败
        {
            // 文件信息错误,请重启游戏
            return(GetTipByID(16));
        }

        case UpdateHelper.UpdateResult.CleanCacheFail:                 // 清理缓存失败
        {
            // 清理缓存错误,请重启游戏
            return(GetTipByID(17));
        }

        case UpdateHelper.UpdateResult.LoadRomoteFailListError:        // 读取下载的文件列表失败
        {
            // 请检查网络是否通畅
            return(GetTipByID(11));
        }

        default:
        {
            // 未知错误
            return(GetTipByID(18));
        }
        }
    }