|
@ -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)?)),
|
|
|