feat(star-rail): implemented multi-regional patch support
This commit is contained in:
parent
4de34eaa98
commit
e640dd9c60
2 changed files with 5 additions and 2 deletions
|
@ -21,7 +21,8 @@ impl Default for Patch {
|
||||||
path: launcher_dir.join("patch"),
|
path: launcher_dir.join("patch"),
|
||||||
|
|
||||||
servers: vec![
|
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
|
// Disable root requirement for patching if we're running launcher in flatpak
|
||||||
|
|
|
@ -42,6 +42,7 @@ pub enum StateUpdating {
|
||||||
pub struct LauncherStateParams<F: Fn(StateUpdating)> {
|
pub struct LauncherStateParams<F: Fn(StateUpdating)> {
|
||||||
pub wine_prefix: PathBuf,
|
pub wine_prefix: PathBuf,
|
||||||
pub game_path: PathBuf,
|
pub game_path: PathBuf,
|
||||||
|
pub game_edition: GameEdition,
|
||||||
|
|
||||||
pub patch_servers: Vec<String>,
|
pub patch_servers: Vec<String>,
|
||||||
pub patch_folder: PathBuf,
|
pub patch_folder: PathBuf,
|
||||||
|
@ -82,7 +83,7 @@ impl LauncherState {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check the main patch
|
// 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)? {
|
if !main_patch.is_applied(¶ms.game_path)? {
|
||||||
return Ok(Self::MainPatchAvailable(main_patch));
|
return Ok(Self::MainPatchAvailable(main_patch));
|
||||||
|
@ -124,6 +125,7 @@ impl LauncherState {
|
||||||
Self::get(LauncherStateParams {
|
Self::get(LauncherStateParams {
|
||||||
wine_prefix: config.get_wine_prefix_path(),
|
wine_prefix: config.get_wine_prefix_path(),
|
||||||
game_path: config.game.path.for_edition(config.launcher.edition).to_path_buf(),
|
game_path: config.game.path.for_edition(config.launcher.edition).to_path_buf(),
|
||||||
|
game_edition: config.launcher.edition,
|
||||||
|
|
||||||
patch_servers: config.patch.servers,
|
patch_servers: config.patch.servers,
|
||||||
patch_folder: config.patch.path,
|
patch_folder: config.patch.path,
|
||||||
|
|
Loading…
Reference in a new issue