From 67b56be4f6ecab07631af4a20b97487331eb71e0 Mon Sep 17 00:00:00 2001 From: Jake Probst Date: Sun, 23 Jun 2019 15:52:54 -0700 Subject: [PATCH] PSOPacket is Debug, more parse errors --- src/lib.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index f6a4483..e4a9ee9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,14 +1,17 @@ -mod crypto; -mod patch; +pub mod crypto; +pub mod patch; #[derive(Debug, PartialEq)] pub enum PacketParseError { NotEnoughBytes, WrongPacketCommand, + WrongPacketForServerType, + WrongPacketSize(u16, usize), + DataStructNotLargeEnough(u64, usize), } -pub trait PSOPacket { +pub trait PSOPacket: std::fmt::Debug { fn from_bytes(data: &Vec) -> Result where Self: Sized; fn as_bytes(&self) -> Vec; }