From e9b3128103d203ad4902a40124e4d22a012c196a Mon Sep 17 00:00:00 2001 From: mat Date: Fri, 9 May 2025 14:12:51 -1030 Subject: don't send chat signing certs on offline-mode servers --- azalea-client/src/plugins/login.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'azalea-client/src/plugins/login.rs') diff --git a/azalea-client/src/plugins/login.rs b/azalea-client/src/plugins/login.rs index 357769e9..ebba5905 100644 --- a/azalea-client/src/plugins/login.rs +++ b/azalea-client/src/plugins/login.rs @@ -33,6 +33,11 @@ fn handle_receive_hello_event(trigger: Trigger, mut commands: commands.entity(player).insert(AuthTask(task)); } +/// A marker component on our clients that indicates that the server is +/// online-mode and the client has authenticated their join with Mojang. +#[derive(Component)] +pub struct IsAuthenticated; + pub fn poll_auth_task( mut commands: Commands, mut query: Query<(Entity, &mut AuthTask, &mut RawConnection)>, @@ -40,7 +45,10 @@ pub fn poll_auth_task( for (entity, mut auth_task, mut raw_conn) in query.iter_mut() { if let Some(poll_res) = future::block_on(future::poll_once(&mut auth_task.0)) { debug!("Finished auth"); - commands.entity(entity).remove::(); + commands + .entity(entity) + .remove::() + .insert(IsAuthenticated); match poll_res { Ok((packet, private_key)) => { // we use this instead of SendLoginPacketEvent to ensure that it's sent right -- cgit v1.2.3