Compare commits

...

10 commits

Author SHA1 Message Date
Nikita Podvirnyi
1797ac466d
1.17.3 2024-08-02 16:03:40 +02:00
Nikita Podvirnyi
97e34f7bb5
feat(honkai): removed apply_patch config 2024-08-02 15:32:29 +02:00
Nikita Podvirnyi
b173dd0202
refactor: removed excess imports 2024-08-02 15:31:08 +02:00
Nikita Podvirnyi
7911abbdf9
1.17.2 2024-08-02 14:41:53 +02:00
Nikita Podvirnyi
017d0d164f
1.17.1 2024-08-02 11:52:20 +02:00
Nikita Podvirnyi
365e907a4d
fixed: fixed imports in game.rs files 2024-08-02 11:51:54 +02:00
Nikita Podvirnyi
a17a082434
1.17.0 2024-08-02 10:41:49 +02:00
Nikita Podvirnyi
fde7b26347
style: changed PR style 2024-07-21 16:44:52 +02:00
Observer KRypt0n_
0044bf02fe
Merge pull request #14 from dimasafonis/main
Added hash check for fpsunlocker
2024-07-21 16:42:18 +02:00
Dmitry Safronov
2d26bec891 Added hash check for fpsunlocker 2024-07-21 21:26:49 +07:00
14 changed files with 43 additions and 27 deletions

View file

@ -1,6 +1,6 @@
[package] [package]
name = "anime-launcher-sdk" name = "anime-launcher-sdk"
version = "1.16.10" version = "1.17.3"
authors = ["Nikita Podvirnyi <krypt0nn@vk.com>"] authors = ["Nikita Podvirnyi <krypt0nn@vk.com>"]
license = "GPL-3.0" license = "GPL-3.0"
readme = "README.md" readme = "README.md"
@ -9,7 +9,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.21.3" tag = "1.22.2"
features = ["all"] features = ["all"]
# path = "../anime-game-core" # ! for dev purposes only # path = "../anime-game-core" # ! for dev purposes only
@ -21,7 +21,7 @@ tracing = "0.1"
serde = { version = "1.0", features = ["derive"], optional = true } serde = { version = "1.0", features = ["derive"], optional = true }
serde_json = { version = "1.0", optional = true } serde_json = { version = "1.0", optional = true }
cached = { version = "0.52", features = ["proc_macro"] } cached = { version = "0.53", features = ["proc_macro"] }
enum-ordinalize = { version = "4.3", optional = true } enum-ordinalize = { version = "4.3", optional = true }
wincompatlib = { version = "0.7.4", features = ["all"], optional = true } wincompatlib = { version = "0.7.4", features = ["all"], optional = true }

View file

@ -26,8 +26,6 @@ pub mod components;
pub mod prelude { pub mod prelude {
pub use super::launcher::prelude::*; pub use super::launcher::prelude::*;
pub use super::game::prelude::*; pub use super::game::prelude::*;
pub use super::launcher::prelude::*;
pub use super::game::*; pub use super::game::*;
#[cfg(feature = "components")] #[cfg(feature = "components")]

View file

@ -48,7 +48,24 @@ impl FpsUnlocker {
} }
match downloader.download(dir.join("fpsunlock.exe"), |_, _| {}) { match downloader.download(dir.join("fpsunlock.exe"), |_, _| {}) {
Ok(_) => Ok(Self { dir }), Ok(_) => {
match Self::from_dir(dir) {
Ok(Some(me)) => Ok(me),
Ok(None) => {
tracing::error!("Invalid hash");
anyhow::bail!("Downloading failed: invalid fps unlocker hash");
}
Err(err) => {
tracing::error!("Downloading failed: {err}");
Err(err.into())
}
}
}
Err(err) => { Err(err) => {
tracing::error!("Downloading failed: {err}"); tracing::error!("Downloading failed: {err}");

View file

@ -42,7 +42,7 @@ impl ConfigExt for Config {
#[inline] #[inline]
fn get() -> anyhow::Result<Self::Schema> { fn get() -> anyhow::Result<Self::Schema> {
unsafe { unsafe {
match &CONFIG { match CONFIG.as_ref() {
Some(config) => Ok(config.clone()), Some(config) => Ok(config.clone()),
None => Self::get_raw() None => Self::get_raw()
} }

View file

@ -27,8 +27,6 @@ pub mod components;
pub mod prelude { pub mod prelude {
pub use super::launcher::prelude::*; pub use super::launcher::prelude::*;
pub use super::game::prelude::*; pub use super::game::prelude::*;
pub use super::launcher::prelude::*;
pub use super::game::*; pub use super::game::*;
pub use super::patch::*; pub use super::patch::*;

View file

@ -7,8 +7,7 @@ use crate::honkai::consts::launcher_dir;
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct Patch { pub struct Patch {
pub path: PathBuf, pub path: PathBuf
pub apply_mfplat: bool
} }
impl Default for Patch { impl Default for Patch {
@ -17,12 +16,7 @@ impl Default for Patch {
let launcher_dir = launcher_dir().expect("Failed to get launcher dir"); let launcher_dir = launcher_dir().expect("Failed to get launcher dir");
Self { Self {
path: launcher_dir.join("patch"), path: launcher_dir.join("patch")
// Seems to not be needed with wine 8+
// which is recommended by default, so will work
// for most of users
apply_mfplat: false
} }
} }
} }
@ -35,11 +29,6 @@ impl From<&JsonValue> for Patch {
path: match value.get("path").and_then(|path| path.as_str()).map(PathBuf::from) { path: match value.get("path").and_then(|path| path.as_str()).map(PathBuf::from) {
Some(path) => path, Some(path) => path,
None => default.path None => default.path
},
apply_mfplat: match value.get("apply_mfplat") {
Some(value) => value.as_bool().unwrap_or(default.apply_mfplat),
None => default.apply_mfplat
} }
} }
} }

View file

@ -1,6 +1,9 @@
use std::io::{Read, Write}; use std::io::{Read, Write};
use std::process::{Command, Stdio}; use std::process::{Command, Stdio};
use std::path::PathBuf; use std::path::PathBuf;
use std::fs::File;
use std::sync::{Arc, Mutex};
use std::sync::atomic::{AtomicUsize, Ordering};
use anime_game_core::honkai::telemetry; use anime_game_core::honkai::telemetry;

View file

@ -26,8 +26,6 @@ pub mod components;
pub mod prelude { pub mod prelude {
pub use super::launcher::prelude::*; pub use super::launcher::prelude::*;
pub use super::game::prelude::*; pub use super::game::prelude::*;
pub use super::launcher::prelude::*;
pub use super::game::*; pub use super::game::*;
#[cfg(feature = "components")] #[cfg(feature = "components")]

View file

@ -1,5 +1,9 @@
use std::io::{Read, Write};
use std::process::{Command, Stdio}; use std::process::{Command, Stdio};
use std::path::PathBuf; use std::path::PathBuf;
use std::fs::File;
use std::sync::{Arc, Mutex};
use std::sync::atomic::{AtomicUsize, Ordering};
use anime_game_core::pgr::telemetry; use anime_game_core::pgr::telemetry;

View file

@ -27,8 +27,6 @@ pub mod components;
pub mod prelude { pub mod prelude {
pub use super::launcher::prelude::*; pub use super::launcher::prelude::*;
pub use super::game::prelude::*; pub use super::game::prelude::*;
pub use super::launcher::prelude::*;
pub use super::game::*; pub use super::game::*;
pub use super::patch::*; pub use super::patch::*;

View file

@ -1,5 +1,9 @@
use std::io::{Read, Write};
use std::process::{Command, Stdio}; use std::process::{Command, Stdio};
use std::path::PathBuf; use std::path::PathBuf;
use std::fs::File;
use std::sync::{Arc, Mutex};
use std::sync::atomic::{AtomicUsize, Ordering};
use anime_game_core::star_rail::telemetry; use anime_game_core::star_rail::telemetry;

View file

@ -1,5 +1,9 @@
use std::io::{Read, Write};
use std::process::{Command, Stdio}; use std::process::{Command, Stdio};
use std::path::PathBuf; use std::path::PathBuf;
use std::fs::File;
use std::sync::{Arc, Mutex};
use std::sync::atomic::{AtomicUsize, Ordering};
use anime_game_core::wuwa::telemetry; use anime_game_core::wuwa::telemetry;

View file

@ -26,7 +26,6 @@ pub mod components;
pub mod prelude { pub mod prelude {
pub use super::launcher::prelude::*; pub use super::launcher::prelude::*;
pub use super::game::prelude::*; pub use super::game::prelude::*;
pub use super::game::*; pub use super::game::*;
#[cfg(feature = "components")] #[cfg(feature = "components")]

View file

@ -1,5 +1,9 @@
use std::io::{Read, Write};
use std::process::{Command, Stdio}; use std::process::{Command, Stdio};
use std::path::PathBuf; use std::path::PathBuf;
use std::fs::File;
use std::sync::{Arc, Mutex};
use std::sync::atomic::{AtomicUsize, Ordering};
use anime_game_core::prelude::*; use anime_game_core::prelude::*;
use anime_game_core::zzz::telemetry; use anime_game_core::zzz::telemetry;