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/config | |
| parent | 281a810c860a67e8e7957aaec876ea608602831c (diff) | |
| download | azalea-drasl-188428950722ccaa9b163c12fca92133f18316ba.tar.xz | |
implement cookie packets to fix betteranticheat support
Diffstat (limited to 'azalea-client/src/plugins/packet/config')
| -rw-r--r-- | azalea-client/src/plugins/packet/config/mod.rs | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/azalea-client/src/plugins/packet/config/mod.rs b/azalea-client/src/plugins/packet/config/mod.rs index 629f9f71..27dae837 100644 --- a/azalea-client/src/plugins/packet/config/mod.rs +++ b/azalea-client/src/plugins/packet/config/mod.rs @@ -15,6 +15,7 @@ use super::{as_system, declare_packet_handlers}; use crate::{ client::InConfigState, connection::RawConnection, + cookies::{RequestCookieEvent, StoreCookieEvent}, disconnect::DisconnectEvent, local_player::InstanceHolder, packet::game::{KeepAliveEvent, ResourcePackEvent}, @@ -179,16 +180,21 @@ impl ConfigPacketHandler<'_> { pub fn cookie_request(&mut self, p: &ClientboundCookieRequest) { debug!("Got cookie request packet {p:?}"); - as_system::<Commands>(self.ecs, |mut commands| { - commands.trigger(SendConfigPacketEvent::new( - self.player, - ServerboundCookieResponse { - key: p.key.clone(), - // cookies aren't implemented - payload: None, - }, - )); + commands.trigger(RequestCookieEvent { + entity: self.player, + key: p.key.clone(), + }); + }); + } + pub fn store_cookie(&mut self, p: &ClientboundStoreCookie) { + debug!("Got store cookie packet {p:?}"); + as_system::<Commands>(self.ecs, |mut commands| { + commands.trigger(StoreCookieEvent { + entity: self.player, + key: p.key.clone(), + payload: p.payload.clone(), + }); }); } @@ -196,10 +202,6 @@ impl ConfigPacketHandler<'_> { debug!("Got reset chat packet {p:?}"); } - pub fn store_cookie(&mut self, p: &ClientboundStoreCookie) { - debug!("Got store cookie packet {p:?}"); - } - pub fn transfer(&mut self, p: &ClientboundTransfer) { debug!("Got transfer packet {p:?}"); } |
