Exemple #1
0
        // Token: 0x060158C0 RID: 88256 RVA: 0x0057CC54 File Offset: 0x0057AE54
        public static IEnumerator GetUpdateClientURL(GameObject parentObj = null)
        {
            if (PDSDK.IsIosReview)
            {
                yield break;
            }
            string url = null;

            string[] urls = null;
            yield return(Util.DownloadHttpFile(DefaultServerAddress.URLToSaveUpdateClientServerURL, delegate(bool ret, WWW www)
            {
                if (!ret)
                {
                    return;
                }
                urls = www.text.Trim().Split(new char[]
                {
                    ','
                });
            }, null));

            int idx = -1;

            if (urls != null && urls.Length > 0)
            {
                for (int i = 0; i < urls.Length; i++)
                {
                    url = string.Format("{0}/{1}/{2}", urls[i].Trim(new char[]
                    {
                        '/'
                    }), Util.GetCurrentTargetPlatform(), PathHelper.BundleDataVersionFileName);
                    bool isSuccess = false;
                    yield return(Util.DownloadHttpFile(url, delegate(bool ret, WWW www)
                    {
                        isSuccess = ret;
                    }, null));

                    if (isSuccess)
                    {
                        idx = i;
                        break;
                    }
                }
            }
            if (idx < 0)
            {
                global::Debug.LogError(string.Format("Utility.GetUpdateClientURL Failed to get update client server url from {0}", DefaultServerAddress.URLToSaveUpdateClientServerURL));
                if (parentObj != null)
                {
                    yield return(DialogBox.Show(parentObj, "Assets/GameProject/Resources/UI/DialogBox.prefab", StringTable.Get("MsgGetUpdateClinetUrlFailed"), StringTable.Get("ButtonOK"), string.Empty, delegate(DialogBoxResult result)
                    {
                        global::Debug.Log("ProjectLGameEntryUITask.GetUpdateClientURL call Quit().");
                        Application.Quit();
                    }));
                }
                yield break;
            }
            ResourceManager.Instance.SetDownloadUrlRoot(urls[idx]);
            AudioManager4CRI.DownloadUrlRoot = string.Format("{0}/{1}", urls[idx], GameManager.Instance.GameClientSetting.AudioSetting.CRIAudioManagerAsset);
            yield break;
        }