|
@ -71,12 +71,10 @@ impl RecvServerPacket for RecvShipPacket { |
|
|
fn from_bytes(data: &[u8]) -> Result<RecvShipPacket, PacketParseError> {
|
|
|
fn from_bytes(data: &[u8]) -> Result<RecvShipPacket, PacketParseError> {
|
|
|
match u16::from_le_bytes([data[2], data[3]]) {
|
|
|
match u16::from_le_bytes([data[2], data[3]]) {
|
|
|
0x93 => Ok(RecvShipPacket::Login(Login::from_bytes(data)?)),
|
|
|
0x93 => Ok(RecvShipPacket::Login(Login::from_bytes(data)?)),
|
|
|
0x10 => {
|
|
|
|
|
|
match data[0] {
|
|
|
|
|
|
|
|
|
0x10 => match data[0] {
|
|
|
16 => Ok(RecvShipPacket::MenuSelect(MenuSelect::from_bytes(data)?)),
|
|
|
16 => Ok(RecvShipPacket::MenuSelect(MenuSelect::from_bytes(data)?)),
|
|
|
48 => Ok(RecvShipPacket::RoomPasswordReq(RoomPasswordReq::from_bytes(data)?)),
|
|
|
48 => Ok(RecvShipPacket::RoomPasswordReq(RoomPasswordReq::from_bytes(data)?)),
|
|
|
_ => Err(PacketParseError::WrongPacketForServerType(u16::from_le_bytes([data[2], data[3]]), data.to_vec())),
|
|
|
_ => Err(PacketParseError::WrongPacketForServerType(u16::from_le_bytes([data[2], data[3]]), data.to_vec())),
|
|
|
}
|
|
|
|
|
|
},
|
|
|
},
|
|
|
0x61 => Ok(RecvShipPacket::CharData(CharData::from_bytes(data)?)),
|
|
|
0x61 => Ok(RecvShipPacket::CharData(CharData::from_bytes(data)?)),
|
|
|
0x60 => Ok(RecvShipPacket::Message(Message::from_bytes(data)?)),
|
|
|
0x60 => Ok(RecvShipPacket::Message(Message::from_bytes(data)?)),
|
|
|