From 5c1a366af9c0ff1a223579cd29f2c3b474b8793d Mon Sep 17 00:00:00 2001 From: jake Date: Mon, 4 Nov 2019 20:23:41 -0800 Subject: [PATCH] WrongPacketForServerType now wants the packet command --- src/login/character.rs | 2 +- src/login/login.rs | 2 +- src/patch/patch.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/login/character.rs b/src/login/character.rs index 3001265..cbd234b 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) + _ => Err(PacketParseError::WrongPacketForServerType(u16::from_le_bytes([data[2], data[3]]))) } } } diff --git a/src/login/login.rs b/src/login/login.rs index 6cda53b..226e62d 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) + _ => Err(PacketParseError::WrongPacketForServerType(u16::from_le_bytes([data[2], data[3]]))) } } } diff --git a/src/patch/patch.rs b/src/patch/patch.rs index c1d9bbc..2ae36d1 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) + _ => Err(PacketParseError::WrongPacketForServerType(u16::from_le_bytes([data[2], data[3]]))) } } }