Skip to content

Commit fe44968

Browse files
committed
feat(data): use game version as version key
1 parent 20be3a3 commit fe44968

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

crates/bm_data_fs/src/data.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,14 @@ impl Data {
2727
channel: sender,
2828
version: Arc::new(RwLock::new(None)),
2929
// Use a constant version key
30-
version_key: VersionKey::from_str("0000000000000001").unwrap(),
30+
version_key: {
31+
// Convert RelativePathBuf to Path and append ffxivgame.ver
32+
let ver_path = game_dir.relative().join("ffxivgame.ver");
33+
let ver_str = std::fs::read_to_string(&ver_path)
34+
.expect(&format!("Failed to read {:?}", ver_path));
35+
let key_str: String = ver_str.chars().filter(|c| c.is_ascii_digit()).collect();
36+
VersionKey::from_str(&key_str).expect("Invalid version key in ffxivgame.ver")
37+
},
3138
game_dir,
3239
}
3340
}

0 commit comments

Comments
 (0)