mirror of
https://github.com/redstrate/Kawari.git
synced 2025-06-12 11:17:46 +00:00
Send a better patchlist
This isn't correct yet, but closer to being usable.
This commit is contained in:
parent
46dec1b0f0
commit
37a9702a29
2 changed files with 33 additions and 21 deletions
|
@ -166,32 +166,44 @@ async fn verify_boot(
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if we need any patching
|
// check if we need any patching
|
||||||
let patches = list_patch_files(&config.patch.patches_location);
|
let mut send_patches = Vec::new();
|
||||||
|
let patches = list_patch_files(&*format!("{}/boot", &config.patch.patches_location));
|
||||||
for patch in patches {
|
for patch in patches {
|
||||||
let patch_str: &str = &patch;
|
let patch_str: &str = &patch;
|
||||||
if actual_boot_version.partial_cmp(patch_str).unwrap() == Ordering::Less {
|
if actual_boot_version.partial_cmp(patch_str).unwrap() == Ordering::Less {
|
||||||
// not up to date!
|
let file = std::fs::File::open(&*format!(
|
||||||
let patch_list = PatchList {
|
"{}/boot/{}.patch",
|
||||||
id: "477D80B1_38BC_41d4_8B48_5273ADB89CAC".to_string(),
|
&config.patch.patches_location, patch_str
|
||||||
requested_version: boot_version.to_string().clone(),
|
))
|
||||||
patch_length: 0,
|
.unwrap();
|
||||||
content_location: String::new(),
|
let metadata = file.metadata().unwrap();
|
||||||
patches: vec![PatchEntry {
|
|
||||||
url: format!("http://{}/{}", config.patch.patch_dl_url, patch).to_string(),
|
send_patches.push(PatchEntry {
|
||||||
version: "2023.09.15.0000.0000".to_string(),
|
url: format!("http://{}/boot/{}.patch", config.patch.patch_dl_url, patch)
|
||||||
hash_block_size: 50000000,
|
.to_string(),
|
||||||
length: 1479062470,
|
version: patch_str.to_string(),
|
||||||
size_on_disk: 0,
|
hash_block_size: 50000000,
|
||||||
hashes: vec![],
|
length: metadata.len() as i64,
|
||||||
unknown_a: 0,
|
size_on_disk: metadata.len() as i64, // NOTE: wrong but it should be fine to lie
|
||||||
unknown_b: 0,
|
hashes: vec![],
|
||||||
}],
|
unknown_a: 0,
|
||||||
};
|
unknown_b: 0,
|
||||||
let patch_list_str = patch_list.to_string(PatchListType::Boot);
|
});
|
||||||
return patch_list_str.into_response();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !send_patches.is_empty() {
|
||||||
|
let patch_list = PatchList {
|
||||||
|
id: "477D80B1_38BC_41d4_8B48_5273ADB89CAC".to_string(),
|
||||||
|
requested_version: boot_version.to_string().clone(),
|
||||||
|
content_location: format!("ffxivpatch/boot/metainfo/{}.http", boot_version.0), // FIXME: i think this is actually supposed to be the target version
|
||||||
|
patch_length: 0,
|
||||||
|
patches: send_patches,
|
||||||
|
};
|
||||||
|
let patch_list_str = patch_list.to_string(PatchListType::Boot);
|
||||||
|
return patch_list_str.into_response();
|
||||||
|
}
|
||||||
|
|
||||||
let headers = HeaderMap::new();
|
let headers = HeaderMap::new();
|
||||||
(headers).into_response()
|
(headers).into_response()
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,7 +142,7 @@ impl Default for PatchConfig {
|
||||||
port: 6900,
|
port: 6900,
|
||||||
listen_address: "127.0.0.1".to_string(),
|
listen_address: "127.0.0.1".to_string(),
|
||||||
patch_dl_url: "patch-dl.ffxiv.localhost".to_string(),
|
patch_dl_url: "patch-dl.ffxiv.localhost".to_string(),
|
||||||
patches_location: String::new(),
|
patches_location: "patches".to_string(),
|
||||||
boot_server_name: "patch-bootver.ffxiv.localhost".to_string(),
|
boot_server_name: "patch-bootver.ffxiv.localhost".to_string(),
|
||||||
game_server_name: "patch-gamever.ffxiv.localhost".to_string(),
|
game_server_name: "patch-gamever.ffxiv.localhost".to_string(),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue