diff --git a/src/login/character.rs b/src/login/character.rs index 5f36870..033aa95 100644 --- a/src/login/character.rs +++ b/src/login/character.rs @@ -56,7 +56,7 @@ impl RecvServerPacket for RecvCharacterPacket { 0xE5 => Ok(RecvCharacterPacket::CharacterPreview(CharacterPreview::from_bytes(data)?)), 0xEC => Ok(RecvCharacterPacket::SetFlag(SetFlag::from_bytes(data)?)), 0x10 => Ok(RecvCharacterPacket::MenuSelect(MenuSelect::from_bytes(data)?)), - _ => Err(PacketParseError::WrongPacketForServerType(u16::from_le_bytes([data[2], data[3]]))) + _ => Err(PacketParseError::WrongPacketForServerType(u16::from_le_bytes([data[2], data[3]]), data.to_vec())) } } } diff --git a/src/login/login.rs b/src/login/login.rs index a2c1c85..7cb71f4 100644 --- a/src/login/login.rs +++ b/src/login/login.rs @@ -32,7 +32,7 @@ impl RecvServerPacket for RecvLoginPacket { fn from_bytes(data: &[u8]) -> Result { match data[2] { 0x93 => Ok(RecvLoginPacket::Login(Login::from_bytes(data)?)), - _ => Err(PacketParseError::WrongPacketForServerType(u16::from_le_bytes([data[2], data[3]]))) + _ => Err(PacketParseError::WrongPacketForServerType(u16::from_le_bytes([data[2], data[3]]), data.to_vec())) } } } diff --git a/src/patch/patch.rs b/src/patch/patch.rs index 2ae36d1..427880e 100644 --- a/src/patch/patch.rs +++ b/src/patch/patch.rs @@ -93,7 +93,7 @@ impl RecvServerPacket for RecvPatchPacket { 0x04 => Ok(RecvPatchPacket::LoginReply(LoginReply::from_bytes(data)?)), 0x0F => Ok(RecvPatchPacket::FileInfoReply(FileInfoReply::from_bytes(data)?)), 0x10 => Ok(RecvPatchPacket::FileInfoListEnd(FileInfoListEnd::from_bytes(data)?)), - _ => Err(PacketParseError::WrongPacketForServerType(u16::from_le_bytes([data[2], data[3]]))) + _ => Err(PacketParseError::WrongPacketForServerType(u16::from_le_bytes([data[2], data[3]]), data.to_vec())) } } } diff --git a/src/ship/ship.rs b/src/ship/ship.rs index e9045b0..de11ef2 100644 --- a/src/ship/ship.rs +++ b/src/ship/ship.rs @@ -31,7 +31,7 @@ impl RecvServerPacket for RecvShipPacket { fn from_bytes(data: &[u8]) -> Result { match u16::from_le_bytes([data[2], data[3]]) { 0x93 => Ok(RecvShipPacket::Login(Login::from_bytes(data)?)), - _ => Err(PacketParseError::WrongPacketForServerType(u16::from_le_bytes([data[2], data[3]]))) + _ => Err(PacketParseError::WrongPacketForServerType(u16::from_le_bytes([data[2], data[3]]), data.to_vec())) } } }