aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-05-07 20:41:33 -0500
committermat <github@matdoes.dev>2022-05-07 20:41:33 -0500
commit98eee6d908a5651c55131b80dc3c153a6708052e (patch)
tree72c70b5af9e113f16fb54871be2bb34e94cac20a /azalea-client/src
parent49454781cf02c85e065cf1cf4de22701175f3f13 (diff)
downloadazalea-drasl-98eee6d908a5651c55131b80dc3c153a6708052e.tar.xz
add keepalive packets
Diffstat (limited to 'azalea-client/src')
-rwxr-xr-xazalea-client/src/connect.rs12
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!();