Ship the WeChat hot-update catalogs and the camp, TideWhale T2, UI atlas, and animation-lab work.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -9,11 +9,15 @@ namespace AOT.Boot
|
||||
{
|
||||
public string AppVersion;
|
||||
public string ResVersion;
|
||||
public string PackVersion;
|
||||
public string CdnRoot;
|
||||
public string PackageName;
|
||||
public ResourcePackage Package;
|
||||
public string HttpBase;
|
||||
public string WsUrlTemplate;
|
||||
/// <summary>Hot update signals the authored home UI is ready before the boot mask is hidden.</summary>
|
||||
public bool MainUiReady;
|
||||
public string MainUiError;
|
||||
/// <summary>CDN version.json 下发的维护/公告文案(可空)。</summary>
|
||||
public string Notice;
|
||||
/// <summary>业务 UI 当前仅使用 candy;字段保留用于旧启动配置兼容。</summary>
|
||||
@@ -24,8 +28,8 @@ namespace AOT.Boot
|
||||
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)}";
|
||||
return $"wss://BuddyDefense.xworld.ren:15888/ws?pid={pid}";
|
||||
return $"wss://BuddyDefense.xworld.ren:15888/ws?pid={pid}&token={UnityEngine.Networking.UnityWebRequest.EscapeURL(token)}";
|
||||
}
|
||||
|
||||
var url = WsUrlTemplate.Replace("{pid}", pid ?? string.Empty);
|
||||
|
||||
@@ -65,10 +65,20 @@ namespace AOT.Boot
|
||||
|
||||
_view?.SetProgress(1f);
|
||||
_view?.SetStatus("热更已启动");
|
||||
Debug.Log($"[Boot] OK app={ctx.AppVersion} res={ctx.ResVersion} cdn={ctx.CdnRoot}");
|
||||
Debug.Log($"[Boot] OK app={ctx.AppVersion} res={ctx.ResVersion} pack={ctx.PackVersion} cdn={ctx.CdnRoot}");
|
||||
|
||||
// 让热更侧完成首帧生成后再撤掉全屏启动遮罩
|
||||
yield return null;
|
||||
// Prefabs/atlases load asynchronously; two frames are not a readiness guarantee.
|
||||
_view?.SetStatus("加载主界面…");
|
||||
float uiDeadline = Time.realtimeSinceStartup + 120f;
|
||||
while (!ctx.MainUiReady && string.IsNullOrEmpty(ctx.MainUiError) && Time.realtimeSinceStartup < uiDeadline)
|
||||
yield return null;
|
||||
if (!ctx.MainUiReady)
|
||||
{
|
||||
string uiError = ctx.MainUiError ?? "主界面加载超时,请检查 Art 资源包后重试";
|
||||
_view?.SetError(uiError);
|
||||
Debug.LogError("[Boot] " + uiError);
|
||||
yield break;
|
||||
}
|
||||
yield return null;
|
||||
_view?.Hide();
|
||||
}
|
||||
|
||||
@@ -9,14 +9,19 @@ namespace AOT.Boot
|
||||
[System.Serializable]
|
||||
public class BootSettings
|
||||
{
|
||||
public const string ProductionVersionUrl = "https://www.xworld.ren/game/Friends/webgl/cdn/version.json";
|
||||
public const string ProductionCdnRoot = "https://www.xworld.ren/game/Friends/webgl/yoo/DefaultPackage";
|
||||
public const string ProductionHttpBase = "https://BuddyDefense.xworld.ren:15888";
|
||||
public const string ProductionWsTemplate = "wss://BuddyDefense.xworld.ren:15888/ws?pid={pid}&token={token}";
|
||||
|
||||
[Tooltip("壳版本,对应提审包 appVersion")]
|
||||
public string AppVersion = "1.0.0";
|
||||
|
||||
[Tooltip("CDN 总控 version.json")]
|
||||
public string VersionUrl = "https://www.xworld.ren/wechat/version.json";
|
||||
public string VersionUrl = ProductionVersionUrl;
|
||||
|
||||
[Tooltip("CDN 根(version.json 未下发 cdnRoot 时回退;含 Package 名)")]
|
||||
public string DefaultCdnRoot = "https://www.xworld.ren/wechat/1.0.0/DefaultPackage";
|
||||
public string DefaultCdnRoot = ProductionCdnRoot;
|
||||
|
||||
[Tooltip("YooAsset 默认包名")]
|
||||
public string PackageName = "DefaultPackage";
|
||||
@@ -25,10 +30,10 @@ namespace AOT.Boot
|
||||
public string HotUpdateDllLocation = "HotUpdate.Runtime";
|
||||
|
||||
[Tooltip("登录服 HTTP 根(/register /login)")]
|
||||
public string HttpBase = "https://game.xworld.ren";
|
||||
public string HttpBase = ProductionHttpBase;
|
||||
|
||||
[Tooltip("WebSocket 模板,{pid}/{token} 会被替换")]
|
||||
public string WsUrlTemplate = "wss://game.xworld.ren/ws?pid={pid}&token={token}";
|
||||
public string WsUrlTemplate = ProductionWsTemplate;
|
||||
|
||||
[Tooltip("业务 UI 当前仅支持 candy(糖果风);保留该字段兼容旧配置,其他值回退到 Candy。")]
|
||||
public string UiTheme = "candy";
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
namespace AOT.Boot
|
||||
{
|
||||
/// <summary>AOT-owned native imports; hot-update code polls events on Unity's main thread.</summary>
|
||||
[Preserve]
|
||||
public static class WebSocketBridge
|
||||
{
|
||||
#if UNITY_WEBGL && !UNITY_EDITOR
|
||||
[DllImport("__Internal")] public static extern int AIGame_WsCreate(string url);
|
||||
[DllImport("__Internal")] public static extern string AIGame_WsPoll(int id);
|
||||
[DllImport("__Internal")] public static extern void AIGame_WsSend(int id, string text);
|
||||
[DllImport("__Internal")] public static extern void AIGame_WsDispose(int id);
|
||||
#else
|
||||
public static int AIGame_WsCreate(string url) => 0;
|
||||
public static string AIGame_WsPoll(int id) => null;
|
||||
public static void AIGame_WsSend(int id, string text) { }
|
||||
public static void AIGame_WsDispose(int id) { }
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bcb076c623aa72042b59e4236d7ca270
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user