You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
442 B

6 years ago
  1. pub mod crypto;
  2. pub mod packet;
  3. pub mod character;
  4. #[derive(Debug, PartialEq)]
  5. pub enum PacketParseError {
  6. NotEnoughBytes,
  7. WrongPacketCommand,
  8. WrongPacketForServerType,
  9. WrongPacketSize(u16, usize),
  10. DataStructNotLargeEnough(u64, usize),
  11. InvalidValue,
  12. }
  13. pub trait PSOPacket: std::fmt::Debug {
  14. fn from_bytes(data: &[u8]) -> Result<Self, PacketParseError> where Self: Sized;
  15. fn as_bytes(&self) -> Vec<u8>;
  16. }