1
0
Fork 0
mirror of https://codeberg.org/demostf/parser.git synced 2026-06-04 02:24:12 +02:00

update to bitstream_reader 0.7

This commit is contained in:
Robin Appelman 2020-01-07 23:19:48 +01:00
commit b7c3baee17
12 changed files with 32 additions and 66 deletions

View file

@ -1,6 +1,6 @@
use crate::Stream;
/// Messages that consists only of primitives and string and can be derived
use bitstream_reader::{BitRead, BitSize, BitSkip, LittleEndian};
use bitstream_reader::{BitRead, LittleEndian};
use std::collections::HashMap;
#[derive(BitRead, Debug)]
@ -10,9 +10,7 @@ pub struct FileMessage {
pub requested: bool,
}
impl BitSkip<LittleEndian> for FileMessage {}
#[derive(BitRead, BitSize, Debug)]
#[derive(BitRead, Debug)]
pub struct NetTickMessage {
pub tick: u32,
pub frame_time: u16,
@ -24,9 +22,7 @@ pub struct StringCmdMessage {
pub command: String,
}
impl BitSkip<LittleEndian> for StringCmdMessage {}
#[derive(BitRead, BitSize, Debug)]
#[derive(BitRead, Debug)]
pub struct SigOnStateMessage {
pub state: u8,
pub count: u32,
@ -37,8 +33,6 @@ pub struct PrintMessage {
pub value: String,
}
impl BitSkip<LittleEndian> for PrintMessage {}
#[derive(BitRead, Debug)]
pub struct ServerInfoMessage {
pub version: u16,
@ -60,20 +54,18 @@ pub struct ServerInfoMessage {
pub replay: bool,
}
impl BitSkip<LittleEndian> for ServerInfoMessage {}
#[derive(BitRead, BitSize, Debug)]
#[derive(BitRead, Debug)]
pub struct SetPauseMessage {
pub pause: bool,
}
#[derive(BitRead, BitSize, Debug)]
#[derive(BitRead, Debug)]
pub struct SetViewMessage {
#[size = 11]
pub index: u16,
}
#[derive(BitRead, BitSize, Debug)]
#[derive(BitRead, Debug)]
pub struct FixAngleMessage {
pub relative: bool,
pub x: u16,
@ -94,9 +86,7 @@ pub struct EntityMessage {
pub data: Stream,
}
impl BitSkip<LittleEndian> for EntityMessage {}
#[derive(BitRead, BitSize, Debug)]
#[derive(BitRead, Debug)]
pub struct PreFetchMessage {
#[size = 14]
pub index: u16,
@ -111,16 +101,12 @@ pub struct MenuMessage {
pub index: Stream,
}
impl BitSkip<LittleEndian> for MenuMessage {}
#[derive(BitRead, Debug)]
pub struct GetCvarValueMessage {
pub cookie: u32,
pub value: String,
}
impl BitSkip<LittleEndian> for GetCvarValueMessage {}
#[derive(BitRead, Debug)]
#[endianness = "LittleEndian"]
pub struct CmdKeyValuesMessage {
@ -128,5 +114,3 @@ pub struct CmdKeyValuesMessage {
#[size = "length * 8"]
pub data: Stream,
}
impl BitSkip<LittleEndian> for CmdKeyValuesMessage {}