From 1ca1f1d9e27aeea3adaf359570f2e211e0a9af74 Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Thu, 1 Jan 2026 22:28:53 -0600 Subject: Extensible Account (#301) * refactor Account * clean up implementation and docs * add AccountTrait::join * update changelog * update example --- azalea-client/src/plugins/chat_signing.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'azalea-client/src/plugins/chat_signing.rs') diff --git a/azalea-client/src/plugins/chat_signing.rs b/azalea-client/src/plugins/chat_signing.rs index 8e612f5b..2de9c6b0 100644 --- a/azalea-client/src/plugins/chat_signing.rs +++ b/azalea-client/src/plugins/chat_signing.rs @@ -13,7 +13,7 @@ use tracing::{debug, error}; use uuid::Uuid; use super::{chat, login::IsAuthenticated, packet::game::SendGamePacketEvent}; -use crate::{Account, InGameState}; +use crate::{InGameState, account::Account}; pub struct ChatSigningPlugin; impl Plugin for ChatSigningPlugin { @@ -70,7 +70,7 @@ pub fn poll_request_certs_task( commands.entity(entity).insert(QueuedCertsToSend { certs: certs.clone(), }); - *account.certs.lock() = Some(certs); + account.set_certs(certs); } Err(err) => { error!("Error requesting certs: {err:?}. Retrying in an hour."); @@ -108,8 +108,8 @@ pub fn request_certs_if_needed( continue; } - let certs = account.certs.lock(); - let should_refresh = if let Some(certs) = &*certs { + let certs = account.certs(); + let should_refresh = if let Some(certs) = certs { // certs were already requested and we're waiting for them to refresh // but maybe they weren't sent yet, in which case we still want to send the @@ -122,12 +122,10 @@ pub fn request_certs_if_needed( } else { true }; - drop(certs); - if should_refresh && let Some(access_token) = &account.access_token { + if should_refresh && let Some(access_token) = account.access_token() { let task_pool = IoTaskPool::get(); - let access_token = access_token.lock().clone(); debug!("Started task to fetch certs"); let task = task_pool.spawn(async_compat::Compat::new(async move { azalea_auth::certs::fetch_certificates(&access_token).await -- cgit v1.2.3