文档同步:远程配置格式按线上真实格式纠正(契约§4.3/4.4 + 框架指南 + WBS)
代码已对齐线上真实远程配置格式,同步修订设计文档(此前 §4 误录为废弃的 Bean1/GameupdateUtil 格式,会误导后续开发): - 契约§4.3 配置 JSON 改为真实格式:顶层仅 agentlist、层级 agent→game→channel→market、 资源字段 game_zip、marketid/版本为数字、无二级 url 二次请求;附旧格式纠正说明。 - §4.4 分层匹配改为真实遍历与累积规则 + gameid 回退 version.xml。 - §4.2 gameconfig 改生产端点;§5.4/启动流程图 game_download→game_zip;验收清单同步。 - 框架设计指南 §8.2/§8.3/落地映射表、Plan WBS T-M2-05/06 描述同步。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
799e78d8af
commit
0fcee6de1e
@@ -620,7 +620,7 @@ INIT → LOAD_LOCAL_CONFIG → REQUEST_PERMISSIONS → FETCH_REMOTE_CONFIG
|
||||
|
||||
- **本地配置**:弃用"目录名编码",改为随包内置 `resources/rawfile/app_config.json`(KV),提供《契约规范》§4.2 全部键:`agent/channel/gamedir/gamestart/appversion/market/gameid/weburl/gameconfig/other/tuiguang`。对 H5 无感知。
|
||||
- **远程配置**:`HttpClient.get("http://"+gameconfig.replace(/-/g,'/')+".txt?a="+ts)`,禁缓存。
|
||||
- **分层覆盖**:`VersionResolver` 实现 agent→channel→market→game 后层覆盖(§4.4),含 `agentlist`/`gamelist` 两棵树与二级 `url` 二次请求。用纯函数实现,便于单测。
|
||||
- **分层覆盖**:`VersionResolver` 按线上真实格式实现 **agent→game→channel→market** 后层覆盖(§4.4)——单 `agentlist` 树、资源字段 `game_zip`、数字 id/版本归一、gameid 为空回退 `version.xml` 的 `<game id>`,无二级 `url` 二次请求。纯函数实现,便于单测。
|
||||
|
||||
### 8.3 ResourceManager(资源)
|
||||
|
||||
@@ -633,7 +633,7 @@ INIT → LOAD_LOCAL_CONFIG → REQUEST_PERMISSIONS → FETCH_REMOTE_CONFIG
|
||||
流程:
|
||||
首启 → 拷贝内置包(rawfile) → @ohos.zlib.decompressFile 解压
|
||||
非首启 → 比较 version.xml<version value> 与远程 game_version
|
||||
需更新 → Downloader 下载 game_download(?a=ts) → 删旧 → decompressFile → 收尾
|
||||
需更新 → Downloader 下载 game_zip(?a=ts) → 删旧 → decompressFile → 收尾
|
||||
```
|
||||
|
||||
- 下载、解压在 **TaskPool/Worker** 执行(§9),UI 线程只收进度回调。
|
||||
@@ -710,7 +710,7 @@ function downloadTask(url: string, savePath: string, eventId: number): void {
|
||||
| §11.1 路径 A `SwitchOverGameData` | `BridgeGameContainer` + `NavProvider` | 同容器 loadUrl 切换 |
|
||||
| §11.2/§11.3 通用网页容器 | `GenericWebContainer + SettingsProxy` | `settings` 6 方法 + 3 直调函数 + 101 回传 |
|
||||
| §3 启动时序 | `StartupOrchestrator` | 状态机逐步 |
|
||||
| §4 配置/分层覆盖 | `ConfigManager + VersionResolver` | 两棵树 + 二级 url + 后层覆盖 |
|
||||
| §4 配置/分层覆盖 | `ConfigManager + VersionResolver` | 单 agentlist 树 · agent→game→channel→market 后层覆盖 · game_zip |
|
||||
| §5 资源管理 | `ResourceManager + Unzipper + Downloader` | 路径/版本比较/下载解压 |
|
||||
| §6 app_data.js | `AppDataInjector` | 全局变量同名同义、加载前注入 |
|
||||
| §7 WebView 能力 | `BridgeGameContainer` 属性 | JS/DOM/file/mixed/cache/geo |
|
||||
|
||||
Reference in New Issue
Block a user