mirror of
https://github.com/Yuyi-Oak/BlueArchiveToolkit.git
synced 2026-07-22 03:56:44 +08:00
142 lines
5.2 KiB
Markdown
142 lines
5.2 KiB
Markdown
# BlueArchive Toolkit
|
||
|
||
**BlueArchiveToolkit** 是一个面向长期维护的 Blue Archive 资源管理、解析、翻译和补丁工具套件。
|
||
|
||
当前仓库仍不是完整产品,但 Rust 侧已经具备一条可运行的官方日服资源同步链路:可以在 Linux 上通过官方 HTTP metadata 自动发现资源入口,拉取 Windows + Android 官方资源,保存同步 snapshot,校验本地下载清单,并用 `--watch` 常驻定期检查更新。Go CLI、API Server、Web、完整 AssetBundle 解析、翻译系统和 Patch 系统仍在后续阶段。
|
||
|
||
---
|
||
|
||
## 当前可用
|
||
|
||
- Rust workspace 和 monorepo 结构。
|
||
- `bat-core` 领域对象和仓储接口骨架。
|
||
- `bat-adapters` Unity、Manifest、Client 集成框架,以及当前真实形态 Addressables catalog 解析覆盖。
|
||
- `bat-cas-engine` CAS V1:原子写入、BLAKE3 校验、引用计数、GC、并发写入测试、损坏检测。
|
||
- `bat-infrastructure` CAS 适配层、SQLite Resource Repository、官方资源 pull/update 服务。
|
||
- `bat-official-sync`:官方资源自动发现、全量拉取、本地 manifest audit/repair、`.part` 断点续传、官方 seed `.hash` 校验、snapshot/cache、`--watch` 常驻更新。
|
||
- `bat-ffi` 粗粒度 JSON 接口:Manifest inspect 和官方 sync plan。
|
||
- 文档路线图、当前状态、缺口清单、官方资源运行指南。
|
||
|
||
仍未完成:
|
||
|
||
- Go CLI 最小可用入口。
|
||
- 完整 UnityFS / AssetBundle 解析。
|
||
- 真实 Patch apply/diff。
|
||
- Translation Memory、Glossary、AI Provider。
|
||
- API Server、SDK、Web 管理后台。
|
||
- 真实官方网络全量下载 smoke test 尚未在本仓库记录。
|
||
|
||
详细状态见:
|
||
|
||
- [当前状态](CURRENT_STATUS.md)
|
||
- [完整开发计划](PROJECT_PLAN.md)
|
||
- [文档索引](DOCS_INDEX.md)
|
||
- [当前缺口清单](docs/reports/CURRENT_GAPS.md)
|
||
- [官方资源拉取与自动更新指南](docs/guides/official-resource-test-pull.md)
|
||
- [官方资源后端说明](docs/architecture/official-resource-backend.md)
|
||
|
||
---
|
||
|
||
## 快速验证
|
||
|
||
前置要求:
|
||
|
||
- Rust 1.75+
|
||
- Go 1.22+
|
||
- `curl`
|
||
- `unzip`,仅旧版 launcher manifest 指向整包 ZIP 且 `--auto-discover` 需要从 ZIP 解析 `GameMainConfig` 时使用;当前目录型 manifest 会直接下载 `resources.assets`
|
||
|
||
运行当前主要测试:
|
||
|
||
```bash
|
||
cargo test -p bat-adapters -- --nocapture
|
||
cargo test -p bat-ffi -- --nocapture
|
||
cargo test -p bat-infrastructure -- --nocapture
|
||
cargo test -p bat-infrastructure --bin bat-official-sync -- --nocapture
|
||
```
|
||
|
||
查看官方同步命令:
|
||
|
||
```bash
|
||
cargo run -p bat-infrastructure --bin bat-official-sync -- --help
|
||
```
|
||
|
||
只做官方资源更新判断,不写同步状态:
|
||
|
||
```bash
|
||
cargo run -p bat-infrastructure --bin bat-official-sync -- \
|
||
--auto-discover \
|
||
--platforms Windows,Android \
|
||
--output /tmp/ba-official-update \
|
||
--dry-run
|
||
```
|
||
|
||
常驻自动更新,默认每 1 小时检查一次;远端和本地一致时静默:
|
||
|
||
```bash
|
||
cargo run -p bat-infrastructure --bin bat-official-sync -- \
|
||
--auto-discover \
|
||
--platforms Windows,Android \
|
||
--output /tmp/ba-official-update \
|
||
--watch
|
||
```
|
||
|
||
生产输出目录必须使用独立状态目录,不要指向已有客户端目录,也不要指向 `/home/wanye/D/BlueArchive` 这类人工维护或开发资源目录。
|
||
|
||
---
|
||
|
||
## 技术栈
|
||
|
||
- Rust:CAS、官方资源同步核心、AssetBundle/Patch 引擎、FFI。
|
||
- Go:计划中的最小 CLI、服务编排、API Server、SDK;当前仅有 FFI 包骨架。
|
||
- PostgreSQL:计划中的服务端主数据库。
|
||
- Redis:计划中的缓存、队列状态、限流和短期锁。
|
||
- Vue 3 + TypeScript:计划中的 Web 管理后台。
|
||
- Docker / Docker Compose:数据库和后续服务部署配置。
|
||
|
||
---
|
||
|
||
## 项目结构
|
||
|
||
```text
|
||
BlueArchiveToolkit/
|
||
├── core/ # Rust 领域模型和仓储接口
|
||
├── adapters/ # Rust 适配器框架与官方资源规则
|
||
├── infrastructure/ # Rust 基础设施、官方同步、CAS/ResourceRepository 适配
|
||
├── crates/ # Rust 引擎 crate
|
||
│ ├── bat-cas-engine/
|
||
│ ├── bat-assetbundle/
|
||
│ ├── bat-patch/
|
||
│ └── bat-ffi/
|
||
├── internal/ffi/ # Go 调用 Rust FFI 的早期包装
|
||
├── cmd/ # Go CLI 入口,尚未实现
|
||
├── pkg/ # Go SDK 包,尚未实现
|
||
├── api/ # API 定义,尚未实现
|
||
├── web/ # Web 管理后台,尚未实现
|
||
├── deployments/ # Docker 和部署配置
|
||
├── docs/ # 文档、历史报告和分析资料
|
||
├── Cargo.toml
|
||
├── go.mod
|
||
└── Makefile
|
||
```
|
||
|
||
---
|
||
|
||
## 开发优先级
|
||
|
||
近期优先级:
|
||
|
||
1. 落地 Go CLI 最小可用入口:`bat doctor`、`bat sync --help`、Rust 同步命令包装。
|
||
2. 补齐 AssetBundle UnityFS header/block/directory 解析。
|
||
3. 扩展 Addressables catalog 解析覆盖,继续用真实形态 fixture/golden 锁定行为。
|
||
4. 将官方同步结果接入 CAS + ResourceRepository 的用户级工作流。
|
||
5. 执行并记录一次真实官方网络全量下载 smoke test。
|
||
|
||
不建议在 Go CLI、资源解析和文本提取基础能力完成前优先开发 Web UI。
|
||
|
||
---
|
||
|
||
## 许可证
|
||
|
||
本项目采用 MIT 许可证,见 [LICENSE](LICENSE)。
|