Files
BlueArchiveToolkit/docs/guides/official-resource-test-pull.md
T

133 lines
3.1 KiB
Markdown
Raw 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.
# 官方资源拉取用户指南
本文档描述当前可用的官方日服资源拉取流程。
默认平台:
- `Windows`
- `Android`
不包含:
- `iOS`
- `macOS`
- `bluearchive.cafe` 或其他镜像域名
- 任何本地客户端目录
## 1. 当前流程
运行时链路只走官方日服:
1. 请求官方 launcher API。
2. 从官方 launcher manifest 链路得到最新游戏包 ZIP。
3. 解包 `resources.assets`
4. 解密 `GameMainConfig`
5.`GameMainConfig` 自动读取 `server-info` URL 和默认 `connection-group`
6. 请求官方 `server-info`
7. 生成 Windows + Android 的官方资源 discovery 端点。
8. 拉取 seed catalog,生成完整官方 pull plan。
9. dry-run 只输出 URL;非 dry-run 下载全部官方 URL。
`--server-info-file``--server-info-path` 都不是硬依赖。
## 2. 先做 launcher bootstrap
先确认 launcher API 和官方 ZIP 链路正常:
```bash
cargo run -p bat-infrastructure --example official_launcher_bootstrap -- \
--launcher-version 1.7.2 \
--manifest
```
这一步会输出:
- `game_latest_version`
- `game_latest_file_path`
- `primary_cdn`
- `backup_cdn`
- `manifest_url`
- `manifest_source`
- `manifest_file_count`
所有 URL 都应来自官方域名。
## 3. 先做 dry-run
推荐默认流程是不提供本地 `server-info` 文件,也不提供本地客户端目录:
```bash
cargo run -p bat-infrastructure --example official_pull_plan -- \
--launcher-bootstrap \
--platforms Windows,Android \
--output /tmp/ba-official-pull \
--dry-run
```
如果你已经有官方 `server-info` 文件,也可以显式传入:
```bash
cargo run -p bat-infrastructure --example official_pull_plan -- \
--server-info-file r93_70_xxxxxxxxxxxxxxxxxxxx.json \
--connection-group Prod-Audit \
--app-version 1.70.0 \
--platforms Windows,Android \
--output /tmp/ba-official-pull \
--dry-run
```
检查输出时,重点看:
- `platforms=[Windows, Android]`
- `discovery_url_count` 大于 0
- `content_url_count` 大于 0
- 不出现 `bluearchive.cafe`
## 4. 执行真实拉取
确认 dry-run 正常后,去掉 `--dry-run`
```bash
cargo run -p bat-infrastructure --example official_pull_plan -- \
--launcher-bootstrap \
--platforms Windows,Android \
--output /tmp/ba-official-pull
```
程序会:
- 只接受官方 URL
- 下载完整官方资源集合
- 把结果写入 `--output`
## 5. 例外输入
如果必须使用本地 `server-info`,只接受:
- `--server-info-file <官方文件名>`
- `--server-info-path <本地官方 JSON>`
但这两项不再是主流程依赖。
## 6. 代码入口
当前可用的用户入口:
- `infrastructure/examples/official_launcher_bootstrap.rs`
- `infrastructure/examples/official_pull_plan.rs`
- `adapters/examples/yostar_jp_client_bootstrap.rs`
- `adapters/examples/yostar_jp_discovery.rs`
- `adapters/examples/yostar_jp_inventory.rs`
## 7. 验证
推荐验证命令:
```bash
cargo test -p bat-adapters
cargo test -p bat-infrastructure
cargo test -p bat-infrastructure --example official_launcher_bootstrap -- --nocapture
cargo test -p bat-infrastructure --example official_pull_plan -- --nocapture
```