diff options
| author | mat <github@matdoes.dev> | 2023-04-20 17:11:56 +0000 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2023-04-20 17:11:56 +0000 |
| commit | 88b09f7791b51639f8191cc88c98fbd13fa7e3d4 (patch) | |
| tree | de9d1497d51190df26eddf00992658ac7bc47924 /azalea-client | |
| parent | c4c5edf80b364b9e1281e04b26446cdff499a8b5 (diff) | |
| parent | 821533138152748d3b677afd64f505020d6a83b3 (diff) | |
| download | azalea-drasl-88b09f7791b51639f8191cc88c98fbd13fa7e3d4.tar.xz | |
Merge branch 'main' into 1.20
Diffstat (limited to 'azalea-client')
| -rwxr-xr-x | azalea-client/src/account.rs | 14 | ||||
| -rw-r--r-- | azalea-client/src/lib.rs | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/azalea-client/src/account.rs b/azalea-client/src/account.rs index b6073209..dba2d0f1 100755 --- a/azalea-client/src/account.rs +++ b/azalea-client/src/account.rs @@ -41,12 +41,12 @@ pub struct Account { /// [`Account`]. This is used to for automatic reauthentication when we get /// "Invalid Session" errors. If you don't need that feature (like in /// offline mode), then you can set this to `AuthOpts::default()`. - pub auth_opts: AuthOpts, + pub account_opts: AccountOpts, } /// The parameters that were passed for creating the associated [`Account`]. #[derive(Clone, Debug)] -pub enum AuthOpts { +pub enum AccountOpts { Offline { username: String }, // this is an enum so legacy Mojang auth can be added in the future Microsoft { email: String }, @@ -61,7 +61,7 @@ impl Account { username: username.to_string(), access_token: None, uuid: None, - auth_opts: AuthOpts::Offline { + account_opts: AccountOpts::Offline { username: username.to_string(), }, } @@ -90,7 +90,7 @@ impl Account { username: auth_result.profile.name, access_token: Some(Arc::new(Mutex::new(auth_result.access_token))), uuid: Some(auth_result.profile.id), - auth_opts: AuthOpts::Microsoft { + account_opts: AccountOpts::Microsoft { email: email.to_string(), }, }) @@ -102,10 +102,10 @@ impl Account { /// by default if you used the constructor functions). Note that if the /// Account is offline-mode, this function won't do anything. pub async fn refresh(&self) -> Result<(), azalea_auth::AuthError> { - match &self.auth_opts { + match &self.account_opts { // offline mode doesn't need to refresh so just don't do anything lol - AuthOpts::Offline { .. } => Ok(()), - AuthOpts::Microsoft { email } => { + AccountOpts::Offline { .. } => Ok(()), + AccountOpts::Microsoft { email } => { let new_account = Account::microsoft(email).await?; let access_token = self .access_token diff --git a/azalea-client/src/lib.rs b/azalea-client/src/lib.rs index 8c3936cd..04fec604 100644 --- a/azalea-client/src/lib.rs +++ b/azalea-client/src/lib.rs @@ -25,7 +25,7 @@ pub mod ping; mod player; pub mod task_pool; -pub use account::Account; +pub use account::{Account, AccountOpts}; pub use client::{ init_ecs_app, start_ecs, Client, ClientInformation, JoinError, JoinedClientBundle, TabList, }; |
