1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 06:16:04 +00:00

Ignore unknown packets

This commit is contained in:
mat 2022-05-01 14:03:15 -05:00
parent 9dacd90abc
commit 766b290065
2 changed files with 8 additions and 2 deletions

View file

@ -147,7 +147,10 @@ impl Client {
match r {
Ok(packet) => Self::handle(&packet, &tx, &state, &conn).await,
Err(e) => {
panic!("Error: {:?}", e);
println!("Error: {:?}", e);
if e == "length wider than 21-bit" {
panic!();
}
}
};
}
@ -233,6 +236,9 @@ impl Client {
GamePacket::ClientboundAddEntityPacket(p) => {
println!("Got add entity packet {:?}", p);
}
GamePacket::ClientboundSetEntityDataPacket(p) => {
println!("Got set entity data packet {:?}", p);
}
_ => panic!("Unexpected packet {:?}", packet),
}
println!();

View file

@ -392,7 +392,7 @@ pub fn declare_state_packets(input: TokenStream) -> TokenStream {
Ok(match flow {
crate::connect::PacketFlow::ServerToClient => match id {
#clientbound_read_match_contents
_ => panic!("Unknown ServerToClient {} packet id: {}", #state_name_litstr, id),
_ => return Err(format!("Unknown ServerToClient {} packet id: {}", #state_name_litstr, id)),
},
crate::connect::PacketFlow::ClientToServer => match id {
#serverbound_read_match_contents