Skip to content

Simplify game resolver code and add support for platform specifiers #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 26, 2025

Conversation

ethangreen-dev
Copy link
Member

No description provided.

@ethangreen-dev ethangreen-dev merged commit fdf985e into develop May 26, 2025
1 of 3 checks passed
@ethangreen-dev ethangreen-dev deleted the eco-game-import branch May 26, 2025 09:04
fn construct(self: Box<Self>, base: ImportBase) -> Result<GameData, Error> {
let subkey = format!("Software\\{}\\", self.ident.replace('.', "\\"));
let value = reg::get_value_at(HKey::LocalMachine, &subkey, "Install Dir")?;
pub fn get_gamedist(ident: &str, game_def: &GameDef, overrides: &ImportOverrides) -> Result<Option<ActiveDistribution>, Error> {

Check failure

Code scanning / clippy

? couldn't convert the error to error::Error Error

? couldn't convert the error to error::Error
let value = reg::get_value_at(HKey::LocalMachine, &subkey, "Install Dir")?;
pub fn get_gamedist(ident: &str, game_def: &GameDef, overrides: &ImportOverrides) -> Result<Option<ActiveDistribution>, Error> {
let subkey = format!("Software\\{}\\", ident.replace('.', "\\"));
let value = reg::get_value_at(HKey::LocalMachine, &subkey, "Install Dir")?;

Check failure

Code scanning / clippy

? couldn't convert the error to error::Error Error

? couldn't convert the error to error::Error
let value = reg::get_value_at(HKey::LocalMachine, &subkey, "Install Dir")?;
pub fn get_gamedist(ident: &str, game_def: &GameDef, overrides: &ImportOverrides) -> Result<Option<ActiveDistribution>, Error> {
let subkey = format!("Software\\{}\\", ident.replace('.', "\\"));
let value = reg::get_value_at(HKey::LocalMachine, &subkey, "Install Dir")?;

Check failure

Code scanning / clippy

? couldn't convert the error to error::Error Error

? couldn't convert the error to error::Error
}
}
}
pub fn get_gamedist(ident: &str, game_def: &GameDef, overrides: &ImportOverrides) -> Result<Option<ActiveDistribution>, Error> {

Check failure

Code scanning / clippy

? couldn't convert the error to error::Error Error

? couldn't convert the error to error::Error
// I'm going to go for the second option.
// Attempt to get the path of the EGS /Data directory from the registry.
let subkey = r#"Software\WOW64Node\Epic Games\EpicGamesLauncher"#;
let value = reg::get_value_at(HKey::LocalMachine, subkey, "AppDataPath")?;

Check failure

Code scanning / clippy

? couldn't convert the error to error::Error Error

? couldn't convert the error to error::Error
.ok_or_else(|| {
GameError::NotFound(ident.into(), "Gamepass".to_string())
})?;
let game_dir = PathBuf::from(reg::get_value_at(HKey::LocalMachine, &game_root, "Root")?);

Check failure

Code scanning / clippy

? couldn't convert the error to error::Error Error

? couldn't convert the error to error::Error
use once_cell::sync::Lazy;
use project::error::ProjectError;
use project::ProjectKind;
use ts::error::ApiError;
use ts::v1::models::ecosystem::GamePlatform;

Check warning

Code scanning / clippy

unused import: ts::v1::models::ecosystem::GamePlatform Warning

unused import: ts::v1::models::ecosystem::GamePlatform
@@ -2,7 +2,11 @@

use serde::{Deserialize, Serialize};

use crate::error::Error;

Check warning

Code scanning / clippy

unused import: crate::error::Error Warning

unused import: crate::error::Error
use crate::ts::version::Version;
use crate::game::ecosystem;

Check warning

Code scanning / clippy

unused import: crate::game::ecosystem Warning

unused import: crate::game::ecosystem
use crate::ts::version::Version;
use crate::game::ecosystem;
use crate::game::error::GameError;

Check warning

Code scanning / clippy

unused import: crate::game::error::GameError Warning

unused import: crate::game::error::GameError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant