Browse Source

WrongPacketForServerType now wants the packet command

pbs
jake 5 years ago
parent
commit
5c1a366af9
  1. 2
      src/login/character.rs
  2. 2
      src/login/login.rs
  3. 2
      src/patch/patch.rs

2
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]])))
}
}
}

2
src/login/login.rs

@ -32,7 +32,7 @@ impl RecvServerPacket for RecvLoginPacket {
fn from_bytes(data: &[u8]) -> Result<RecvLoginPacket, PacketParseError> {
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]])))
}
}
}

2
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]])))
}
}
}

Loading…
Cancel
Save