1.4.5
- added option to disable main genshin patch - updated core library
This commit is contained in:
parent
2490641aae
commit
af03ab65d4
3 changed files with 16 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "anime-launcher-sdk"
|
name = "anime-launcher-sdk"
|
||||||
version = "1.4.4"
|
version = "1.4.5"
|
||||||
authors = ["Nikita Podvirnyy <suimin.tu.mu.ga.mi@gmail.com>"]
|
authors = ["Nikita Podvirnyy <suimin.tu.mu.ga.mi@gmail.com>"]
|
||||||
license = "GPL-3.0"
|
license = "GPL-3.0"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
@ -8,7 +8,7 @@ edition = "2021"
|
||||||
|
|
||||||
[dependencies.anime-game-core]
|
[dependencies.anime-game-core]
|
||||||
git = "https://github.com/an-anime-team/anime-game-core"
|
git = "https://github.com/an-anime-team/anime-game-core"
|
||||||
tag = "1.10.2"
|
tag = "1.10.3"
|
||||||
features = ["all"]
|
features = ["all"]
|
||||||
|
|
||||||
# path = "../anime-game-core" # ! for dev purposes only
|
# path = "../anime-game-core" # ! for dev purposes only
|
||||||
|
|
|
@ -9,6 +9,7 @@ use crate::genshin::consts::launcher_dir;
|
||||||
pub struct Patch {
|
pub struct Patch {
|
||||||
pub path: PathBuf,
|
pub path: PathBuf,
|
||||||
pub servers: Vec<String>,
|
pub servers: Vec<String>,
|
||||||
|
pub apply_main: bool,
|
||||||
pub apply_xlua: bool,
|
pub apply_xlua: bool,
|
||||||
pub root: bool
|
pub root: bool
|
||||||
}
|
}
|
||||||
|
@ -26,6 +27,7 @@ impl Default for Patch {
|
||||||
String::from("https://notabug.org/Krock/dawn")
|
String::from("https://notabug.org/Krock/dawn")
|
||||||
],
|
],
|
||||||
|
|
||||||
|
apply_main: true,
|
||||||
apply_xlua: false,
|
apply_xlua: false,
|
||||||
|
|
||||||
// Disable root requirement for patching if we're running launcher in flatpak
|
// Disable root requirement for patching if we're running launcher in flatpak
|
||||||
|
@ -70,6 +72,11 @@ impl From<&JsonValue> for Patch {
|
||||||
None => default.servers
|
None => default.servers
|
||||||
},
|
},
|
||||||
|
|
||||||
|
apply_main: match value.get("apply_main") {
|
||||||
|
Some(value) => value.as_bool().unwrap_or(default.apply_main),
|
||||||
|
None => default.apply_main
|
||||||
|
},
|
||||||
|
|
||||||
apply_xlua: match value.get("apply_xlua") {
|
apply_xlua: match value.get("apply_xlua") {
|
||||||
Some(value) => value.as_bool().unwrap_or(default.apply_xlua),
|
Some(value) => value.as_bool().unwrap_or(default.apply_xlua),
|
||||||
None => default.apply_xlua
|
None => default.apply_xlua
|
||||||
|
|
|
@ -68,6 +68,7 @@ pub struct LauncherStateParams<F: Fn(StateUpdating)> {
|
||||||
|
|
||||||
pub patch_servers: Vec<String>,
|
pub patch_servers: Vec<String>,
|
||||||
pub patch_folder: PathBuf,
|
pub patch_folder: PathBuf,
|
||||||
|
pub use_main_patch: bool,
|
||||||
pub use_xlua_patch: bool,
|
pub use_xlua_patch: bool,
|
||||||
|
|
||||||
pub status_updater: F
|
pub status_updater: F
|
||||||
|
@ -152,11 +153,13 @@ impl LauncherState {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check UnityPlayer patch
|
// Check UnityPlayer patch
|
||||||
|
if params.use_main_patch {
|
||||||
let player_patch = patch.unity_player_patch()?;
|
let player_patch = patch.unity_player_patch()?;
|
||||||
|
|
||||||
if !player_patch.is_applied(¶ms.game_path)? {
|
if !player_patch.is_applied(¶ms.game_path)? {
|
||||||
return Ok(Self::UnityPlayerPatchAvailable(player_patch));
|
return Ok(Self::UnityPlayerPatchAvailable(player_patch));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check xlua patch
|
// Check xlua patch
|
||||||
if params.use_xlua_patch {
|
if params.use_xlua_patch {
|
||||||
|
@ -221,6 +224,7 @@ impl LauncherState {
|
||||||
|
|
||||||
patch_servers: config.patch.servers,
|
patch_servers: config.patch.servers,
|
||||||
patch_folder: config.patch.path,
|
patch_folder: config.patch.path,
|
||||||
|
use_main_patch: config.patch.apply_main,
|
||||||
use_xlua_patch: config.patch.apply_xlua,
|
use_xlua_patch: config.patch.apply_xlua,
|
||||||
|
|
||||||
status_updater
|
status_updater
|
||||||
|
|
Loading…
Reference in a new issue