1
0
Fork 0
mirror of https://codeberg.org/demostf/parser.git synced 2026-06-03 18:24:05 +02:00
This commit is contained in:
Robin Appelman 2021-07-21 23:44:04 +02:00
commit 0162eea68e
3 changed files with 91 additions and 11 deletions

View file

@ -11,13 +11,13 @@ struct RawPlayerInfo {
pub steam_id: String,
pub extra: u32, // all my sources say these 4 bytes don't exist
pub friends_id: u32,
#[size = 32]
pub friends_name_bytes: [u8; 32], // seem to all be 0 now
pub is_fake_player: u8,
pub is_hl_tv: u8,
pub is_replay: u8,
pub custom_file: [u32; 4],
pub files_downloaded: u32,
pub more_extra: u8,
}
#[derive(BitWrite, Debug, Clone)]
@ -29,13 +29,13 @@ pub struct PlayerInfo {
pub steam_id: String,
pub extra: u32, // all my sources say these 4 bytes don't exist
pub friends_id: u32,
#[size = 32]
pub friends_name_bytes: [u8; 32], // seem to all be 0 now
pub is_fake_player: u8,
pub is_hl_tv: u8,
pub is_replay: u8,
pub custom_file: [u32; 4],
pub files_downloaded: u32,
pub more_extra: u8,
}
impl From<RawPlayerInfo> for PlayerInfo {
@ -52,6 +52,7 @@ impl From<RawPlayerInfo> for PlayerInfo {
is_replay: raw.is_replay,
custom_file: raw.custom_file,
files_downloaded: raw.files_downloaded,
more_extra: raw.more_extra,
}
}
}
@ -88,7 +89,7 @@ impl UserInfo {
pub fn encode_to_string_table(&self) -> ReadResult<StringTableEntry<'static>> {
let text = format!("{}", self.entity_id);
let mut extra_data = Vec::with_capacity(128);
let mut extra_data = Vec::with_capacity(132);
{
let mut stream = BitWriteStream::new(&mut extra_data, LittleEndian);
self.player_info.write(&mut stream)?;

View file

@ -1,4 +1,4 @@
use bitbuffer::{BitRead, BitWrite, BitWriteSized, LittleEndian};
use bitbuffer::{BitRead, BitWrite, LittleEndian};
use crate::{ReadResult, Stream};