Fix logging bad packet IDs in multiprotocol packet translation macro

https://github.com/iceiix/steven/pull/57#issuecomment-443962662
This commit is contained in:
ice_iix 2018-12-04 08:03:58 -08:00
parent 3f5024d4ec
commit a5a6a71397
1 changed files with 4 additions and 4 deletions

View File

@ -174,14 +174,14 @@ macro_rules! protocol_packet_ids {
$( $(
$id => crate::protocol::packet::$state::$dir::internal_ids::$name, $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 { } else {
match id { match id {
$( $(
crate::protocol::packet::$state::$dir::internal_ids::$name => $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 /// Direction is used to define whether packets are going to the
/// server or the client. /// server or the client.
#[derive(Clone, Copy)] #[derive(Clone, Copy, Debug)]
pub enum Direction { pub enum Direction {
Serverbound, Serverbound,
Clientbound, Clientbound,
@ -726,7 +726,7 @@ pub enum Direction {
/// The protocol has multiple 'sub-protocols' or states which control which /// The protocol has multiple 'sub-protocols' or states which control which
/// packet an id points to. /// packet an id points to.
#[derive(Clone, Copy)] #[derive(Clone, Copy, Debug)]
pub enum State { pub enum State {
Handshaking, Handshaking,
Play, Play,