summaryrefslogtreecommitdiffstats
path: root/ozone-cli/src/main.rs
diff options
context:
space:
mode:
authorLibravatar bigfoot547 <[email protected]>2025-02-18 18:02:51 -0600
committerLibravatar bigfoot547 <[email protected]>2025-02-18 18:02:51 -0600
commit7f7e6d7a7028536dbe3d9d6d6cc818d61307b12c (patch)
tree60b7f40e59b10309b70c25ff6c4083efb8dafa08 /ozone-cli/src/main.rs
parentrandom changes (diff)
launch the game with an account
Diffstat (limited to 'ozone-cli/src/main.rs')
-rw-r--r--ozone-cli/src/main.rs20
1 files changed, 13 insertions, 7 deletions
diff --git a/ozone-cli/src/main.rs b/ozone-cli/src/main.rs
index 81a44f9..03f249a 100644
--- a/ozone-cli/src/main.rs
+++ b/ozone-cli/src/main.rs
@@ -429,12 +429,13 @@ async fn main_inner(cli: Cli) -> Result<ExitCode, Box<dyn Error>> {
let accounts_path = home.join(ACCOUNT_DB_PATH);
let mut accounts = AccountStorage::load(&accounts_path).await?;
- let Some(account) = accounts.get_selected_account_mut() else {
- eprintln!("No account selected.");
- return Ok(ExitCode::FAILURE);
- };
if !cli.offline {
+ let Some(account) = accounts.get_selected_account_mut() else {
+ eprintln!("No account selected.");
+ return Ok(ExitCode::FAILURE);
+ };
+
if let Account::MSA(msa_acct) = account {
let client = MsaAccount::create_client();
@@ -451,15 +452,20 @@ async fn main_inner(cli: Cli) -> Result<ExitCode, Box<dyn Error>> {
return Ok(ExitCode::FAILURE);
}
}
-
- accounts.save(&accounts_path).await?;
}
+
+ accounts.save(&accounts_path).await?;
}
+
+ let Some((_, account)) = accounts.get_selected_account() else {
+ eprintln!("No account selected.");
+ return Ok(ExitCode::FAILURE);
+ };
println!("Preparing the game files...");
let launcher = Launcher::new(&home, !cli.offline).await?;
- let launch = launcher.prepare_launch(inst, Settings::get_instance_path(selection), settings.client_id).await.map_err(|e| {
+ let launch = launcher.prepare_launch(inst, Settings::get_instance_path(selection), settings.client_id, account, false).await.map_err(|e| {
error!("error launching: {e}");
e
})?;