diff options
| author | mat <github@matdoes.dev> | 2022-05-07 20:41:33 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-05-07 20:41:33 -0500 |
| commit | 98eee6d908a5651c55131b80dc3c153a6708052e (patch) | |
| tree | 72c70b5af9e113f16fb54871be2bb34e94cac20a /azalea-client/src | |
| parent | 49454781cf02c85e065cf1cf4de22701175f3f13 (diff) | |
| download | azalea-drasl-98eee6d908a5651c55131b80dc3c153a6708052e.tar.xz | |
add keepalive packets
Diffstat (limited to 'azalea-client/src')
| -rwxr-xr-x | azalea-client/src/connect.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/azalea-client/src/connect.rs b/azalea-client/src/connect.rs index f04eb25d..8713ccda 100755 --- a/azalea-client/src/connect.rs +++ b/azalea-client/src/connect.rs @@ -3,7 +3,10 @@ use azalea_core::resource_location::ResourceLocation; use azalea_protocol::{ connect::{GameConnection, HandshakeConnection}, packets::{ - game::{serverbound_custom_payload_packet::ServerboundCustomPayloadPacket, GamePacket}, + game::{ + serverbound_custom_payload_packet::ServerboundCustomPayloadPacket, + serverbound_keep_alive_packet::ServerboundKeepAlivePacket, GamePacket, + }, handshake::client_intention_packet::ClientIntentionPacket, login::{ serverbound_hello_packet::ServerboundHelloPacket, @@ -294,6 +297,13 @@ impl Client { GamePacket::ClientboundMoveEntityRotPacket(p) => { println!("Got move entity rot packet {:?}", p); } + GamePacket::ClientboundKeepAlivePacket(p) => { + println!("Got keep alive packet {:?}", p); + conn.lock() + .await + .write(ServerboundKeepAlivePacket { id: p.id }.get()) + .await; + } _ => panic!("Unexpected packet {:?}", packet), } println!(); |
