From a7f27a721ddcd0d3fc9c148f22cd5cb567b71d1a Mon Sep 17 00:00:00 2001 From: bigfoot547 Date: Mon, 17 Feb 2025 01:25:49 -0600 Subject: random changes --- ozone-cli/src/main.rs | 15 ++++++++++++--- ozone/src/launcher/runner.rs | 5 ++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ozone-cli/src/main.rs b/ozone-cli/src/main.rs index d383cb7..81a44f9 100644 --- a/ozone-cli/src/main.rs +++ b/ozone-cli/src/main.rs @@ -300,6 +300,11 @@ async fn main_inner(cli: Cli) -> Result> { accounts.save(&accounts_path).await?; }, AccountCommand::SignIn(args) => { + if cli.offline { + eprintln!("This command cannot be used while offline."); + return Ok(ExitCode::FAILURE); + } + let (client_id, azure) = if args.use_alt_client_id { (ALT_CLIENT_ID, false) } else { @@ -386,6 +391,11 @@ async fn main_inner(cli: Cli) -> Result> { display_account(account, false, true); }, AccountCommand::Refresh => { + if cli.offline { + eprintln!("This command cannot be used while offline."); + return Ok(ExitCode::FAILURE); + } + let Some(account) = accounts.get_selected_account_mut() else { eprintln!("No account selected."); return Ok(ExitCode::FAILURE); @@ -424,8 +434,8 @@ async fn main_inner(cli: Cli) -> Result> { return Ok(ExitCode::FAILURE); }; - match account { - Account::MSA(msa_acct) => { + if !cli.offline { + if let Account::MSA(msa_acct) = account { let client = MsaAccount::create_client(); println!("Looking up account information..."); @@ -444,7 +454,6 @@ async fn main_inner(cli: Cli) -> Result> { accounts.save(&accounts_path).await?; } - _ => () // nothing to be done } println!("Preparing the game files..."); diff --git a/ozone/src/launcher/runner.rs b/ozone/src/launcher/runner.rs index 4e1f353..9e7c05e 100644 --- a/ozone/src/launcher/runner.rs +++ b/ozone/src/launcher/runner.rs @@ -1,7 +1,6 @@ use std::borrow::Cow; use std::ffi::{OsStr, OsString}; use std::iter; -use std::marker::PhantomData; use std::path::{Path, PathBuf}; use std::process::Command; use log::{debug, warn}; @@ -48,8 +47,8 @@ impl<'key, 'rep> SubFunc<'key, 'rep> for LaunchArgSub<'rep, '_> { "quickPlayPath" => None, // TODO "quickPlayRealms" => None, // TODO "quickPlaySingleplayer" => None, // TODO - "resolution_height" => self.0.resolution.map(|r| Cow::Owned(r.height.to_string())), - "resolution_width" => self.0.resolution.map(|r| Cow::Owned(r.width.to_string())), + "resolution_height" => Some(self.0.resolution.map(|r| Cow::Owned(r.height.to_string())).unwrap_or(Cow::Borrowed(""))), + "resolution_width" => Some(self.0.resolution.map(|r| Cow::Owned(r.width.to_string())).unwrap_or(Cow::Borrowed(""))), "user_properties" => Some(Cow::Borrowed("{}")), // TODO "user_property_map" => Some(Cow::Borrowed("[]")), // TODO "user_type" => Some(Cow::Borrowed("legacy")), // TODO -- cgit v1.2.3-70-g09d2