mirror of
https://codeberg.org/demostf/parser.git
synced 2026-06-04 02:24:12 +02:00
message work
This commit is contained in:
parent
abe9418a3b
commit
8d053296ca
12 changed files with 534 additions and 10 deletions
|
|
@ -1,6 +1,7 @@
|
|||
/// Messages that consists only of primitives and string and can be derived
|
||||
use bitstream_reader::BitRead;
|
||||
use bitstream_reader::{BitRead, BitStream, LittleEndian};
|
||||
use std::collections::HashMap;
|
||||
use crate::Stream;
|
||||
|
||||
#[derive(BitRead, Debug)]
|
||||
pub struct FileMessage {
|
||||
|
|
@ -72,6 +73,19 @@ pub struct FixAngleMessage {
|
|||
pub z: u16,
|
||||
}
|
||||
|
||||
#[derive(BitRead, Debug)]
|
||||
#[endianness = "LittleEndian"]
|
||||
pub struct EntityMessage {
|
||||
#[size = 11]
|
||||
pub index: u16,
|
||||
#[size = 9]
|
||||
pub class_id: u16,
|
||||
#[size = 11]
|
||||
pub length: u16,
|
||||
#[size = "length * 8"]
|
||||
pub data: Stream,
|
||||
}
|
||||
|
||||
#[derive(BitRead, Debug)]
|
||||
pub struct PreFetchMessage {
|
||||
#[size = 14]
|
||||
|
|
@ -79,11 +93,28 @@ pub struct PreFetchMessage {
|
|||
}
|
||||
|
||||
#[derive(BitRead, Debug)]
|
||||
pub struct GetCvarMessage {
|
||||
#[endianness = "LittleEndian"]
|
||||
pub struct MenuMessage {
|
||||
pub kind: u16,
|
||||
pub length: u16,
|
||||
#[size = "length * 8"]
|
||||
pub index: Stream,
|
||||
}
|
||||
|
||||
#[derive(BitRead, Debug)]
|
||||
pub struct GetCvarValueMessage {
|
||||
pub cookie: u32,
|
||||
pub value: String,
|
||||
}
|
||||
|
||||
#[derive(BitRead, Debug)]
|
||||
#[endianness = "LittleEndian"]
|
||||
pub struct CmdKeyValuesMessage {
|
||||
pub length: u32,
|
||||
#[size = "length * 8"]
|
||||
pub data: Stream,
|
||||
}
|
||||
|
||||
#[derive(BitRead, Debug)]
|
||||
pub struct SetConVarMessage {
|
||||
#[size_bits = 8]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue