diff options
| author | mat <git@matdoes.dev> | 2025-12-16 05:41:25 -0500 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-12-16 05:41:25 -0500 |
| commit | 188428950722ccaa9b163c12fca92133f18316ba (patch) | |
| tree | 05143223204ef026ee672092f2ebbb3c17cea0d1 /azalea-client/src/plugins/packet/login | |
| parent | 281a810c860a67e8e7957aaec876ea608602831c (diff) | |
| download | azalea-drasl-188428950722ccaa9b163c12fca92133f18316ba.tar.xz | |
implement cookie packets to fix betteranticheat support
Diffstat (limited to 'azalea-client/src/plugins/packet/login')
| -rw-r--r-- | azalea-client/src/plugins/packet/login/mod.rs | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/azalea-client/src/plugins/packet/login/mod.rs b/azalea-client/src/plugins/packet/login/mod.rs index 8fe1e22a..de44309c 100644 --- a/azalea-client/src/plugins/packet/login/mod.rs +++ b/azalea-client/src/plugins/packet/login/mod.rs @@ -8,7 +8,7 @@ use azalea_protocol::packets::{ login::{ ClientboundCookieRequest, ClientboundCustomQuery, ClientboundHello, ClientboundLoginCompression, ClientboundLoginDisconnect, ClientboundLoginFinished, - ClientboundLoginPacket, ServerboundCookieResponse, ServerboundLoginAcknowledged, + ClientboundLoginPacket, ServerboundLoginAcknowledged, }, }; use bevy_ecs::prelude::*; @@ -17,8 +17,8 @@ use tracing::{debug, error}; use super::as_system; use crate::{ - Account, InConfigState, connection::RawConnection, disconnect::DisconnectEvent, - packet::declare_packet_handlers, player::GameProfileComponent, + Account, InConfigState, connection::RawConnection, cookies::RequestCookieEvent, + disconnect::DisconnectEvent, packet::declare_packet_handlers, player::GameProfileComponent, }; pub fn process_packet(ecs: &mut World, player: Entity, packet: &ClientboundLoginPacket) { @@ -127,17 +127,12 @@ impl LoginPacketHandler<'_> { }); } pub fn cookie_request(&mut self, p: &ClientboundCookieRequest) { - debug!("Got cookie request {p:?}"); - + debug!("Got cookie request packet {p:?}"); as_system::<Commands>(self.ecs, |mut commands| { - commands.trigger(SendLoginPacketEvent::new( - self.player, - ServerboundCookieResponse { - key: p.key.clone(), - // cookies aren't implemented - payload: None, - }, - )); + commands.trigger(RequestCookieEvent { + entity: self.player, + key: p.key.clone(), + }); }); } } |
