Browse Source

be ready for commands that are more than 1 byte

pbs
Jake Probst 5 years ago
parent
commit
dcd47fa384
  1. 2
      src/login/character.rs

2
src/login/character.rs

@ -36,7 +36,7 @@ pub enum RecvCharacterPacket {
impl RecvServerPacket for RecvCharacterPacket { impl RecvServerPacket for RecvCharacterPacket {
fn from_bytes(data: &Vec<u8>) -> Result<RecvCharacterPacket, PacketParseError> { fn from_bytes(data: &Vec<u8>) -> Result<RecvCharacterPacket, PacketParseError> {
match data[2] {
match u16::from_le_bytes([data[2], data[3]]) {
0x93 => Ok(RecvCharacterPacket::Login(Login::from_bytes(data)?)), 0x93 => Ok(RecvCharacterPacket::Login(Login::from_bytes(data)?)),
0xE0 => Ok(RecvCharacterPacket::RequestSettings(RequestSettings::from_bytes(data)?)), 0xE0 => Ok(RecvCharacterPacket::RequestSettings(RequestSettings::from_bytes(data)?)),
0xE3 => Ok(RecvCharacterPacket::CharSelect(CharSelect::from_bytes(data)?)), 0xE3 => Ok(RecvCharacterPacket::CharSelect(CharSelect::from_bytes(data)?)),

Loading…
Cancel
Save