mirror of
https://codeberg.org/demostf/parser.git
synced 2026-10-01 08:44:05 +02:00
fix packet parsers
This commit is contained in:
parent
b41bb56822
commit
5f4af8333b
13 changed files with 132 additions and 48 deletions
|
|
@ -19,6 +19,7 @@ pub mod usercmd;
|
|||
pub mod datatable;
|
||||
pub mod message;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum Packet<'a> {
|
||||
Sigon(MessagePacket),
|
||||
Message(MessagePacket),
|
||||
|
|
@ -30,7 +31,7 @@ pub enum Packet<'a> {
|
|||
StringTables(StringTablePacket<'a>),
|
||||
}
|
||||
|
||||
#[derive(Primitive)]
|
||||
#[derive(Primitive, Debug)]
|
||||
pub enum PacketType {
|
||||
Sigon = 1,
|
||||
Message = 2,
|
||||
|
|
@ -71,6 +72,7 @@ impl<'a> Parse<'a> for Packet<'a> {
|
|||
|
||||
fn skip(stream: &mut Stream) -> Result<()> {
|
||||
let packet_type = PacketType::parse(stream, &ParserState::new(&stream))?;
|
||||
dbg!(&packet_type);
|
||||
match packet_type {
|
||||
PacketType::Sigon => MessagePacket::skip(stream),
|
||||
PacketType::Message => MessagePacket::skip(stream),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue