From e640dd9c60320f155fd39dd65dea972dfcef25ad Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Sun, 23 Apr 2023 11:05:47 +0200 Subject: [PATCH] feat(star-rail): implemented multi-regional patch support --- src/star_rail/config/schema/patch.rs | 3 ++- src/star_rail/states.rs | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/star_rail/config/schema/patch.rs b/src/star_rail/config/schema/patch.rs index ac86cbe..690ebe4 100644 --- a/src/star_rail/config/schema/patch.rs +++ b/src/star_rail/config/schema/patch.rs @@ -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 diff --git a/src/star_rail/states.rs b/src/star_rail/states.rs index 6b7174b..c780591 100644 --- a/src/star_rail/states.rs +++ b/src/star_rail/states.rs @@ -42,6 +42,7 @@ pub enum StateUpdating { pub struct LauncherStateParams { pub wine_prefix: PathBuf, pub game_path: PathBuf, + pub game_edition: GameEdition, pub patch_servers: Vec, 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(¶ms.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,