This commit is contained in:
Observer KRypt0n_ 2023-05-20 15:58:22 +02:00
parent c26fe8a3d5
commit 673decfbd3
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2
4 changed files with 7 additions and 19 deletions

View file

@ -1,6 +1,6 @@
[package]
name = "anime-launcher-sdk"
version = "1.2.5"
version = "1.3.0"
authors = ["Nikita Podvirnyy <suimin.tu.mu.ga.mi@gmail.com>"]
license = "GPL-3.0"
readme = "README.md"
@ -8,7 +8,7 @@ edition = "2021"
[dependencies.anime-game-core]
git = "https://github.com/an-anime-team/anime-game-core"
tag = "1.8.2"
tag = "1.9.0"
features = ["all"]
# path = "../anime-game-core" # ! for dev purposes only

View file

@ -25,4 +25,5 @@ SDK based on [anime-game-core](https://github.com/an-anime-team/anime-game-core)
| Name | Feature |
| - | - |
| [An Anime Game](https://github.com/an-anime-team/an-anime-game-launcher) | `gen-shin` (without dash) |
| [Honkers Railway](https://github.com/an-anime-team/the-honkers-railway-launcher) | `star-rail` |
| [Honkers](https://github.com/an-anime-team/honkers-launcher) | `hon-kai` (without dash) |

View file

@ -11,9 +11,6 @@ use crate::config::ConfigExt;
pub enum LauncherState {
Launch,
/// Always contains `VersionDiff::Predownload`
PredownloadAvailable(VersionDiff),
MfplatPatchAvailable,
MainPatchAvailable(MainPatch),
@ -25,9 +22,6 @@ pub enum LauncherState {
// Always contains `VersionDiff::Diff`
GameUpdateAvailable(VersionDiff),
/// Always contains `VersionDiff::Outdated`
GameOutdated(VersionDiff),
/// Always contains `VersionDiff::NotInstalled`
GameNotInstalled(VersionDiff)
}
@ -67,7 +61,7 @@ impl LauncherState {
let diff = game.try_get_diff()?;
match diff {
VersionDiff::Latest(_) | VersionDiff::Predownload { .. } => {
VersionDiff::Latest(_) => {
// Check game patch status
(params.status_updater)(StateUpdating::Patch);
@ -95,19 +89,10 @@ impl LauncherState {
return Ok(Self::MainPatchAvailable(player_patch));
}
// Check if update predownload available
if let VersionDiff::Predownload { .. } = diff {
Ok(Self::PredownloadAvailable(diff))
}
// Otherwise we can launch the game
else {
Ok(Self::Launch)
}
Ok(Self::Launch)
}
VersionDiff::Diff { .. } => Ok(Self::GameUpdateAvailable(diff)),
VersionDiff::Outdated { .. } => Ok(Self::GameOutdated(diff)),
VersionDiff::NotInstalled { .. } => Ok(Self::GameNotInstalled(diff))
}
}

View file

@ -28,6 +28,8 @@ pub mod sessions;
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
// TODO: rewrite it to find this binary in PATH instead
/// Check if specified binary is available
///
/// ```