mirror of
https://codeberg.org/demostf/parser.git
synced 2026-06-04 02:24:12 +02:00
entity write fixes
This commit is contained in:
parent
6f80468b6d
commit
577a998baa
17 changed files with 129 additions and 35 deletions
|
|
@ -2,37 +2,37 @@ use crate::Stream;
|
|||
/// Messages that consists only of primitives and string and can be derived
|
||||
use bitbuffer::{BitRead, BitWrite, LittleEndian};
|
||||
|
||||
#[derive(BitRead, BitWrite, Debug)]
|
||||
#[derive(BitRead, BitWrite, Debug, PartialEq)]
|
||||
pub struct FileMessage {
|
||||
pub transfer_id: u32,
|
||||
pub file_name: String,
|
||||
pub requested: bool,
|
||||
}
|
||||
|
||||
#[derive(BitRead, BitWrite, Debug)]
|
||||
#[derive(BitRead, BitWrite, Debug, PartialEq)]
|
||||
pub struct NetTickMessage {
|
||||
pub tick: u32,
|
||||
pub frame_time: u16,
|
||||
pub std_dev: u16,
|
||||
}
|
||||
|
||||
#[derive(BitRead, BitWrite, Debug)]
|
||||
#[derive(BitRead, BitWrite, Debug, PartialEq)]
|
||||
pub struct StringCmdMessage {
|
||||
pub command: String,
|
||||
}
|
||||
|
||||
#[derive(BitRead, BitWrite, Debug)]
|
||||
#[derive(BitRead, BitWrite, Debug, PartialEq)]
|
||||
pub struct SigOnStateMessage {
|
||||
pub state: u8,
|
||||
pub count: u32,
|
||||
}
|
||||
|
||||
#[derive(BitRead, BitWrite, Debug)]
|
||||
#[derive(BitRead, BitWrite, Debug, PartialEq)]
|
||||
pub struct PrintMessage {
|
||||
pub value: String,
|
||||
}
|
||||
|
||||
#[derive(BitRead, BitWrite, Debug)]
|
||||
#[derive(BitRead, BitWrite, Debug, PartialEq)]
|
||||
pub struct ServerInfoMessage {
|
||||
pub version: u16,
|
||||
pub server_count: u32,
|
||||
|
|
@ -53,18 +53,18 @@ pub struct ServerInfoMessage {
|
|||
pub replay: bool,
|
||||
}
|
||||
|
||||
#[derive(BitRead, BitWrite, Debug)]
|
||||
#[derive(BitRead, BitWrite, Debug, PartialEq)]
|
||||
pub struct SetPauseMessage {
|
||||
pub pause: bool,
|
||||
}
|
||||
|
||||
#[derive(BitRead, BitWrite, Debug)]
|
||||
#[derive(BitRead, BitWrite, Debug, PartialEq)]
|
||||
pub struct SetViewMessage {
|
||||
#[size = 11]
|
||||
pub index: u16,
|
||||
}
|
||||
|
||||
#[derive(BitRead, BitWrite, Debug)]
|
||||
#[derive(BitRead, BitWrite, Debug, PartialEq)]
|
||||
pub struct FixAngleMessage {
|
||||
pub relative: bool,
|
||||
pub x: u16,
|
||||
|
|
@ -72,7 +72,7 @@ pub struct FixAngleMessage {
|
|||
pub z: u16,
|
||||
}
|
||||
|
||||
#[derive(BitRead, BitWrite, Debug)]
|
||||
#[derive(BitRead, BitWrite, Debug, PartialEq)]
|
||||
#[endianness = "LittleEndian"]
|
||||
pub struct EntityMessage<'a> {
|
||||
#[size = 11]
|
||||
|
|
@ -85,13 +85,13 @@ pub struct EntityMessage<'a> {
|
|||
pub data: Stream<'a>,
|
||||
}
|
||||
|
||||
#[derive(BitRead, BitWrite, Debug)]
|
||||
#[derive(BitRead, BitWrite, Debug, PartialEq)]
|
||||
pub struct PreFetchMessage {
|
||||
#[size = 14]
|
||||
pub index: u16,
|
||||
}
|
||||
|
||||
#[derive(BitRead, BitWrite, Debug)]
|
||||
#[derive(BitRead, BitWrite, Debug, PartialEq)]
|
||||
#[endianness = "LittleEndian"]
|
||||
pub struct MenuMessage<'a> {
|
||||
pub kind: u16,
|
||||
|
|
@ -100,13 +100,13 @@ pub struct MenuMessage<'a> {
|
|||
pub index: Stream<'a>,
|
||||
}
|
||||
|
||||
#[derive(BitRead, BitWrite, Debug)]
|
||||
#[derive(BitRead, BitWrite, Debug, PartialEq)]
|
||||
pub struct GetCvarValueMessage {
|
||||
pub cookie: u32,
|
||||
pub value: String,
|
||||
}
|
||||
|
||||
#[derive(BitRead, BitWrite, Debug)]
|
||||
#[derive(BitRead, BitWrite, Debug, PartialEq)]
|
||||
#[endianness = "LittleEndian"]
|
||||
pub struct CmdKeyValuesMessage<'a> {
|
||||
pub length: u32,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue