mirror of
https://github.com/Yuyi-Oak/BlueArchiveToolkit.git
synced 2026-07-21 22:11:26 +08:00
5e76ea4ae3fcf1290720fdf437652060af0147da
Update the authoritative docs, guides, architecture notes, gap list, deployment guidance, handoff notes, and changelog to reflect the current Rust official resource sync boundary.
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-adaptersUnity、Manifest、Client 集成框架,以及当前真实形态 Addressables catalog 解析覆盖。bat-cas-engineCAS V1:原子写入、BLAKE3 校验、引用计数、GC、并发写入测试、损坏检测。bat-infrastructureCAS 适配层、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 尚未在本仓库记录。
详细状态见:
快速验证
前置要求:
- Rust 1.75+
- Go 1.22+
curlunzip,仅--auto-discover在 launcher metadata 变化并需要解析GameMainConfig时使用
运行当前主要测试:
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
查看官方同步命令:
cargo run -p bat-infrastructure --bin bat-official-sync -- --help
只做官方资源更新判断,不写同步状态:
cargo run -p bat-infrastructure --bin bat-official-sync -- \
--auto-discover \
--platforms Windows,Android \
--output /tmp/ba-official-update \
--dry-run
常驻自动更新,默认每 1 小时检查一次;远端和本地一致时静默:
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:数据库和后续服务部署配置。
项目结构
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
开发优先级
近期优先级:
- 落地 Go CLI 最小可用入口:
bat doctor、bat sync --help、Rust 同步命令包装。 - 补齐 AssetBundle UnityFS header/block/directory 解析。
- 扩展 Addressables catalog 解析覆盖,继续用真实形态 fixture/golden 锁定行为。
- 将官方同步结果接入 CAS + ResourceRepository 的用户级工作流。
- 执行并记录一次真实官方网络全量下载 smoke test。
不建议在 Go CLI、资源解析和文本提取基础能力完成前优先开发 Web UI。
许可证
本项目采用 MIT 许可证,见 LICENSE。
Languages
Rust
98.8%
Shell
0.5%
Makefile
0.5%
Go
0.2%