Introduce UiManager/MainHUD prefab flow, strengthen GameNet/WsClient, and add AIServer maintenance endpoint support. Co-authored-by: Cursor <cursoragent@cursor.com>
38 lines
1.4 KiB
C#
38 lines
1.4 KiB
C#
using YooAsset;
|
|
|
|
namespace AOT.Boot
|
|
{
|
|
/// <summary>
|
|
/// 壳层传给热更入口的运行时上下文。
|
|
/// </summary>
|
|
public sealed class BootContext
|
|
{
|
|
public string AppVersion;
|
|
public string ResVersion;
|
|
public string CdnRoot;
|
|
public string PackageName;
|
|
public ResourcePackage Package;
|
|
public string HttpBase;
|
|
public string WsUrlTemplate;
|
|
/// <summary>CDN version.json 下发的维护/公告文案(可空)。</summary>
|
|
public string Notice;
|
|
|
|
public string BuildWsUrl(string pid, string token = null)
|
|
{
|
|
if (string.IsNullOrEmpty(WsUrlTemplate))
|
|
{
|
|
if (string.IsNullOrEmpty(token))
|
|
return $"wss://game.xworld.ren/ws?pid={pid}";
|
|
return $"wss://game.xworld.ren/ws?pid={pid}&token={UnityEngine.Networking.UnityWebRequest.EscapeURL(token)}";
|
|
}
|
|
|
|
var url = WsUrlTemplate.Replace("{pid}", pid ?? string.Empty);
|
|
if (url.Contains("{token}"))
|
|
url = url.Replace("{token}", UnityEngine.Networking.UnityWebRequest.EscapeURL(token ?? string.Empty));
|
|
else if (!string.IsNullOrEmpty(token))
|
|
url += (url.Contains("?") ? "&" : "?") + "token=" + UnityEngine.Networking.UnityWebRequest.EscapeURL(token);
|
|
return url;
|
|
}
|
|
}
|
|
}
|