feat(star-rail): implemented multi-regional patch support

This commit is contained in:
Observer KRypt0n_ 2023-04-23 11:05:47 +02:00
parent 4de34eaa98
commit e640dd9c60
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2
2 changed files with 5 additions and 2 deletions

View file

@ -21,7 +21,8 @@ impl Default for Patch {
path: launcher_dir.join("patch"),
servers: vec![
String::from("https://notabug.org/Krock/dawn")
// Temp solution
format!("file://{}/patch", launcher_dir.to_string_lossy())
],
// Disable root requirement for patching if we're running launcher in flatpak

View file

@ -42,6 +42,7 @@ pub enum StateUpdating {
pub struct LauncherStateParams<F: Fn(StateUpdating)> {
pub wine_prefix: PathBuf,
pub game_path: PathBuf,
pub game_edition: GameEdition,
pub patch_servers: Vec<String>,
pub patch_folder: PathBuf,
@ -82,7 +83,7 @@ impl LauncherState {
}
// Check the main patch
let main_patch = patch.main_patch()?;
let main_patch = patch.main_patch(params.game_edition)?;
if !main_patch.is_applied(&params.game_path)? {
return Ok(Self::MainPatchAvailable(main_patch));
@ -124,6 +125,7 @@ impl LauncherState {
Self::get(LauncherStateParams {
wine_prefix: config.get_wine_prefix_path(),
game_path: config.game.path.for_edition(config.launcher.edition).to_path_buf(),
game_edition: config.launcher.edition,
patch_servers: config.patch.servers,
patch_folder: config.patch.path,