summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar bigfoot547 <[email protected]>2025-02-17 01:25:49 -0600
committerLibravatar bigfoot547 <[email protected]>2025-02-17 01:25:49 -0600
commita7f27a721ddcd0d3fc9c148f22cd5cb567b71d1a (patch)
tree142441f6b2f6f77e593e8af7443b08bb05f29ee9
parentwip: launch game with auth (diff)
random changes
-rw-r--r--ozone-cli/src/main.rs15
-rw-r--r--ozone/src/launcher/runner.rs5
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<ExitCode, Box<dyn Error>> {
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<ExitCode, Box<dyn Error>> {
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<ExitCode, Box<dyn Error>> {
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<ExitCode, Box<dyn Error>> {
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