feat: implement production cas v1

This commit is contained in:
2026-06-28 12:39:17 +08:00
parent dd53e3054e
commit b202d7b231
33 changed files with 1082 additions and 447 deletions
+8 -11
View File
@@ -79,7 +79,7 @@ impl GameClient {
/// 此功能将在 Phase 3 实现
pub fn discover() -> crate::Result<Vec<GameClient>> {
Err(crate::Error::NotImplemented(
"客户端发现功能将在 Phase 3 实现".to_string()
"客户端发现功能将在 Phase 3 实现".to_string(),
))
}
@@ -93,7 +93,7 @@ impl GameClient {
/// 此功能将在 Phase 3 实现
pub fn verify_integrity(&self) -> crate::Result<bool> {
Err(crate::Error::NotImplemented(
"完整性验证将在 Phase 3 实现".to_string()
"完整性验证将在 Phase 3 实现".to_string(),
))
}
@@ -134,10 +134,7 @@ mod tests {
#[test]
fn test_streaming_assets_path() {
let client = GameClient::new(
PathBuf::from("/game/BlueArchive_JP"),
GameRegion::Japan
);
let client = GameClient::new(PathBuf::from("/game/BlueArchive_JP"), GameRegion::Japan);
assert_eq!(
client.streaming_assets_path(),
@@ -147,10 +144,7 @@ mod tests {
#[test]
fn test_asset_bundles_path() {
let client = GameClient::new(
PathBuf::from("/game/BlueArchive_JP"),
GameRegion::Japan
);
let client = GameClient::new(PathBuf::from("/game/BlueArchive_JP"), GameRegion::Japan);
assert_eq!(
client.asset_bundles_path(),
@@ -162,6 +156,9 @@ mod tests {
fn test_discover_not_implemented() {
let result = GameClient::discover();
assert!(result.is_err());
assert!(matches!(result.unwrap_err(), crate::Error::NotImplemented(_)));
assert!(matches!(
result.unwrap_err(),
crate::Error::NotImplemented(_)
));
}
}
+17 -3
View File
@@ -18,13 +18,22 @@ pub struct UnityVersion {
impl UnityVersion {
/// 创建新的 Unity 版本
pub fn new(year: u32, stream: u32, patch: u32, revision: String) -> Self {
Self { year, stream, patch, revision }
Self {
year,
stream,
patch,
revision,
}
}
}
impl fmt::Display for UnityVersion {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}.{}.{}{}", self.year, self.stream, self.patch, self.revision)
write!(
f,
"{}.{}.{}{}",
self.year, self.stream, self.patch, self.revision
)
}
}
@@ -44,7 +53,12 @@ pub struct GameVersion {
impl GameVersion {
/// 创建新的游戏版本
pub fn new(major: u32, minor: u32, patch: u32, unity_version: UnityVersion) -> Self {
Self { major, minor, patch, unity_version }
Self {
major,
minor,
patch,
unity_version,
}
}
}
+4 -1
View File
@@ -8,4 +8,7 @@ pub mod translation;
pub use game_client::{ClientStatus, GameClient, GameRegion};
pub use game_version::{GameVersion, UnityVersion};
pub use resource::{Resource, ResourceEntry, ResourceType};
pub use translation::{ExtractedText, SourceText, TextContext, TextMetadata, TextSource, TranslatedText, TranslationStatus};
pub use translation::{
ExtractedText, SourceText, TextContext, TextMetadata, TextSource, TranslatedText,
TranslationStatus,
};