Files

43 lines
2.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# CDN 根目录
内网 / 线上资源分发根。由独立静态文件服务 `Server/Cdn.Runner` 提供:
```bash
dotnet run --project Server/Cdn.Runner -- --root <仓库>/CDN --port 15081 --lan
```
客户端通过 DevDiscovery 拿到 **CDN 根地址**`http://<lanip>:15081/`,存入 `GlobalData.CurCDN`),
再从根派生下面两套子树。两套都是根下的兄弟目录。
```
CDN/
├─ XWorld/ # ① 旧全量热更链路(大厅 / 基础客户端资源)
│ ├─ pc/ # 按平台分目录(pc / android / ios
│ │ ├─ updatever.txt # 版本号:dllmd5,filelistmd5
│ │ ├─ files_<md5>.txt # 资源清单(md5 命名)
│ │ └─ <资源>_<md5>.unity3d # ABmd5 命名,含 StreamingAssets_<md5>.unity3d
│ ├─ android/
│ └─ ios/
└─ minigame/ # ② 小游戏资源
└─ <id>/<ver>/<platform>/ # 每个小游戏每个版本每个平台一目录(platform=pc/android/ios/webgl
├─ game.json
├─ files.txt
├─ files.txt.sig
├─ code_<md5>.unity3d
└─ res_<md5>.unity3d
```
## 各链路取值
| 链路 | 消费方 | 取值 |
|---|---|---|
| ① 旧全量热更(大厅) | `UpdateModule.UpdateResAll``Update.cs`);运行时 AB 由 `XResLoader``coLoadXIDAB/coLoadXIDFile("XWorld",…)` | `AppConst.UpdateServer = <CurCDN>XWorld/`,再 `+<platform>/``<根>/XWorld/<platform>/…``XResLoader``m_dicXidCDN["XWorld"]=<CurCDN>` + 路径 `XWorld/<platform>/…` |
| ② 小游戏 | `MiniGameDownloader``CSharpClientApp.ResolvedCdnBase` | `<CurCDN>` 末尾补 `minigame/`,再 `+<id>/<ver>/<platform>/``<根>/minigame/<id>/<ver>/<platform>/…` |
## 来源(怎么把产物放进来)
- **XWorld/**:基础客户端/大厅的打包产物(`updatever.txt` + `files_<md5>.txt` + AB),按平台放进 `XWorld/<platform>/`
- **minigame/**Unity 菜单「XWorld/生成小游戏更新」直接产出到 `minigame/<id>/<ver>/<platform>/`(客户端 AB + game.json/files.txt/files.txt.sig)。
> 说明:本目录下除 `.gitkeep` 占位外为发布产物,通常不纳入版本库(按需)。