三国卡牌客户端基础资源仓库
yyl
7 天以前 03de6fd025876df6afe57c05380ffc29864ee05c
冲突
1个文件已修改
64 ■■■■■ 已修改文件
Assets/Launch/Manager/LocalResManager.cs 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Launch/Manager/LocalResManager.cs
@@ -22,7 +22,13 @@
{
    private static void LogTiming(string phase, float startTime)
    {
        Debug.LogWarning($"[LocalResManager][Timing] {phase} cost={(Time.realtimeSinceStartup - startTime):F3}s");
#if UNITY_WEBGL
        Debug.Log("[LocalResManager][Timing] " + phase + " cost=" +
                  (Time.realtimeSinceStartup - startTime).ToString("F3") + "s");
#else
        Debug.LogWarning("[LocalResManager][Timing] " + phase + " cost=" +
                         (Time.realtimeSinceStartup - startTime).ToString("F3") + "s");
#endif
    }
    //不下载时本地安卓测试路径
@@ -142,31 +148,34 @@
            case "ryzj":
                VERSION_URL = new string[]
                {
                    "http://xssgcenter.secondworld.net.cn:11000/center/appversion_new.php/?",
                    "http://106.55.151.92:11000/center/appversion_new.php/?",
                    "http://xssgcenter.secondworld.net.cn:11000/center/appversion_new.php?",
                    "http://106.55.151.92:11000/center/appversion_new.php?",
                };
                break;
            case "sghy":
                VERSION_URL = new string[]
                {
                    "http://sghycenter.funimpactgames.com:11000/center/appversion_new.php/?",
                    "http://47.250.213.171:11000/center/appversion_new.php/?",
                    "http://sghycenter.funimpactgames.com:11000/center/appversion_new.php?",
                    "http://47.250.213.171:11000/center/appversion_new.php?",
                };
                break;
            default:
                VERSION_URL = new string[]
                {
                    "http://xssgcenter.secondworld.net.cn:11000/center/appversion_new.php/?",
                    "http://106.55.151.92:11000/center/appversion_new.php/?",
                    "http://xssgcenter.secondworld.net.cn:11000/center/appversion_new.php?",
                    "http://106.55.151.92:11000/center/appversion_new.php?",
                };
                break;
        }
#if TEST_URL
        VERSION_URL = new string[]
        // if (VersionConfigEx.config.versionAuthority == VersionConfigEx.VersionAuthority.InterTest)
        {
            "http://gamecenter.secondworld.net.cn:11000/center/appversion_new.php/?",
        };
            VERSION_URL = new string[]
            {
                "http://gamecenter.secondworld.net.cn:11000/center/appversion_new.php?",
            };
        }
#endif
    }
@@ -385,7 +394,12 @@
            urlIndex++;
            versionUrl = url;
            Debug.LogWarning("http地址:versionUrl  " + url);
            HttpRequest.Instance.RequestHttpGet(url, HttpRequest.defaultHttpContentType, 1, OnVersionCheckResult);
            // 改用 await 返回值 + 直接调用,避免 Action<bool,string> 委托
            // 经过 HybridCLR 解释器的 async 状态机桥接时触发 function signature mismatch
            var (ok, result) = await HttpBehaviour.CreateAsync(
                url, "GET", "", HttpRequest.defaultHttpContentType, 1);
            OnVersionCheckResult(ok, result);
        }
        catch (Exception ex)
        {
@@ -519,14 +533,14 @@
#if UNITY_EDITOR
        await TryLoadInitialFunctionFromResourcesAsync();
#else
    bool configReady = await TryLoadInitialFunctionFromCdnAsync(initFuncUrl);
    if (!configReady)
    {
        await InitializeYooAssetAndEnterReadBytesAsync();
    }
        bool configReady = await TryLoadInitialFunctionFromCdnAsync(initFuncUrl);
        if (!configReady)
        {
            await TryLoadInitialFunctionFromResourcesAsync();
        }
#endif
        await InitializeYooAssetAndEnterReadBytesAsync();
    LogTiming("LoadInitialFunctionAndStartAsync", startTime);
        LogTiming("LoadInitialFunctionAndStartAsync", startTime);
    }
    private const int INIT_FUNC_MAX_RETRY = 5;
@@ -894,6 +908,9 @@
                url = "http://xssgcenter.secondworld.net.cn:11000/center/eventreport.php?";
                break;
        }
#if TEST_URL
        url = "http://gamecenter.secondworld.net.cn:11000/center/eventreport.php?";
#endif
    }
    public void RecordLauchEvent(int _step)
@@ -982,7 +999,7 @@
    public class VersionInfo
    {
        [Preserve] public JsonData notice_flag;
        [Preserve] public JsonData resource_url; //这里只用到这个取下载地址
        [Preserve] public Dictionary<string, string> resource_url; //这里只用到这个取下载地址
        [Preserve] public string ResourceAward;
        [Preserve] public int downAsset = 1;
        [Preserve] public string downUrl;
@@ -991,14 +1008,13 @@
        public string GetResourcesURL(int _branch)
        {
            if (resource_url != null)
            string resourceUrl;
            if (resource_url != null && resource_url.TryGetValue(_branch.ToString(), out resourceUrl))
            {
                return resource_url[_branch.ToString()].ToString();
                return resourceUrl ?? string.Empty;
            }
            else
            {
                return string.Empty;
            }
            return string.Empty;
        }
    }