Files
AIGame/AIClient/Assets/AOT/Scripts/Patch/CdnRemoteService.cs
T
udxandCursor b7a0bbcb89 Add hot-update boot pipeline, UI bundles/atlas assets, and design docs.
Ignore AIClient/Library and AIClient/HybridCLRData permanently; include HybridCLR/YooAsset project setup and UI tooling.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 16:02:58 +08:00

36 lines
941 B
C#

using System.Collections.Generic;
using YooAsset;
namespace AOT.Patch
{
/// <summary>
/// YooAsset 远端地址查询(CDN)。
/// </summary>
public sealed class CdnRemoteService : IRemoteService
{
readonly string _primary;
readonly string _fallback;
public CdnRemoteService(string primaryRoot, string fallbackRoot = null)
{
_primary = TrimSlash(primaryRoot);
_fallback = string.IsNullOrEmpty(fallbackRoot) ? _primary : TrimSlash(fallbackRoot);
}
public IReadOnlyList<string> GetRemoteUrls(string fileName)
{
return new[]
{
$"{_primary}/{fileName}",
$"{_fallback}/{fileName}",
};
}
static string TrimSlash(string root)
{
if (string.IsNullOrEmpty(root)) return string.Empty;
return root.TrimEnd('/');
}
}
}