From a5a6a713977a40c162d2bf1bb41fb11a04259f20 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Tue, 4 Dec 2018 08:03:58 -0800 Subject: [PATCH] Fix logging bad packet IDs in multiprotocol packet translation macro https://github.com/iceiix/steven/pull/57#issuecomment-443962662 --- src/protocol/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/protocol/mod.rs b/src/protocol/mod.rs index 5c337fb..c247dba 100644 --- a/src/protocol/mod.rs +++ b/src/protocol/mod.rs @@ -174,14 +174,14 @@ macro_rules! protocol_packet_ids { $( $id => crate::protocol::packet::$state::$dir::internal_ids::$name, )* - _ => panic!("bad packet id $id in $dir $state"), + _ => panic!("bad packet id 0x{:x} in {:?} {:?}", id, dir, state), } } else { match id { $( crate::protocol::packet::$state::$dir::internal_ids::$name => $id, )* - _ => panic!("bad packet internal id $id in $dir $state"), + _ => panic!("bad packet internal id 0x{:x} in {:?} {:?}", id, dir, state), } } } @@ -718,7 +718,7 @@ impl Serializable for Position { /// Direction is used to define whether packets are going to the /// server or the client. -#[derive(Clone, Copy)] +#[derive(Clone, Copy, Debug)] pub enum Direction { Serverbound, Clientbound, @@ -726,7 +726,7 @@ pub enum Direction { /// The protocol has multiple 'sub-protocols' or states which control which /// packet an id points to. -#[derive(Clone, Copy)] +#[derive(Clone, Copy, Debug)] pub enum State { Handshaking, Play,