diff options
| author | mat <git@matdoes.dev> | 2025-05-09 14:12:51 -1030 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-05-09 14:12:51 -1030 |
| commit | e9b3128103d203ad4902a40124e4d22a012c196a (patch) | |
| tree | 3f8211f88a72ff63c4349efc694d90def3a6d8da /azalea-client/src/plugins/login.rs | |
| parent | 1493c06de597fc320b79212d133f08c678763a6b (diff) | |
| download | azalea-drasl-e9b3128103d203ad4902a40124e4d22a012c196a.tar.xz | |
don't send chat signing certs on offline-mode servers
Diffstat (limited to 'azalea-client/src/plugins/login.rs')
| -rw-r--r-- | azalea-client/src/plugins/login.rs | 10 |
1 files changed, 9 insertions, 1 deletions
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<ReceiveHelloEvent>, 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::<AuthTask>(); + commands + .entity(entity) + .remove::<AuthTask>() + .insert(IsAuthenticated); match poll_res { Ok((packet, private_key)) => { // we use this instead of SendLoginPacketEvent to ensure that it's sent right |
