feat: add official resource sync pipeline

Add the production-facing official update service and bat-official-sync watch CLI for unattended resource synchronization.

Support launcher-resource discovery without installing the launcher, remote marker snapshots, local manifest audit and repair, official seed hash validation, bootstrap caching, richer Addressables coverage, SQLite resource persistence, and FFI JSON helpers.
This commit is contained in:
2026-07-05 23:49:56 +08:00
parent 99e66a48d7
commit 789402c887
35 changed files with 6262 additions and 177 deletions
+8 -8
View File
@@ -8,7 +8,7 @@
//! naked `.bundle` names present in `catalog_Remote.json`
//! - Android uses its own patch-pack directory
use serde::Deserialize;
use serde::{Deserialize, Serialize};
/// Official JP server-info host.
pub const SERVER_INFO_HOST: &str = "yostar-serverinfo.bluearchiveyostar.com";
@@ -230,7 +230,7 @@ impl YostarJpConnectionGroup {
}
/// Patch platform selected by the game client.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize)]
pub enum PatchPlatform {
/// Standalone Windows client.
Windows,
@@ -275,7 +275,7 @@ pub fn verified_official_platforms() -> Vec<PatchPlatform> {
}
/// Kind of official JP resource endpoint discovered from a resource root.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum YostarJpResourceEndpointKind {
/// `TableBundles/TableCatalog.bytes`.
TableCatalog,
@@ -296,7 +296,7 @@ pub enum YostarJpResourceEndpointKind {
}
/// One official JP resource URL seed.
#[derive(Debug, Clone, PartialEq, Eq)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct YostarJpResourceEndpoint {
/// Endpoint kind.
pub kind: YostarJpResourceEndpointKind,
@@ -307,7 +307,7 @@ pub struct YostarJpResourceEndpoint {
}
/// Official JP resource discovery seed plan.
#[derive(Debug, Clone, PartialEq, Eq)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct YostarJpResourceDiscoveryPlan {
/// Selected server-info connection group name.
pub connection_group_name: String,
@@ -322,7 +322,7 @@ pub struct YostarJpResourceDiscoveryPlan {
}
/// Snapshot of the official JP resource state observed at a point in time.
#[derive(Debug, Clone, PartialEq, Eq)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct YostarJpSyncSnapshot {
/// Selected server-info connection group name.
pub connection_group_name: String,
@@ -368,7 +368,7 @@ impl YostarJpSyncSnapshot {
}
/// Delta between an official snapshot and a previously stored snapshot.
#[derive(Debug, Clone, PartialEq, Eq, Default)]
#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize)]
pub struct YostarJpSyncDelta {
/// Whether this is the first observation.
pub is_initial: bool,
@@ -410,7 +410,7 @@ impl YostarJpSyncDelta {
}
/// Individual endpoint difference.
#[derive(Debug, Clone, PartialEq, Eq)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub enum YostarJpResourceEndpointChange {
/// Endpoint newly observed.
Added(YostarJpResourceEndpoint),