Crates.io | dem |
lib.rs | dem |
version | 0.2.0 |
source | src |
created_at | 2024-12-08 01:38:13.84052 |
updated_at | 2024-12-08 01:38:13.84052 |
description | GoldSrc demo parser and writer library |
homepage | |
repository | https://github.com/khanghugo/dem |
max_upload_size | |
id | 1476016 |
size | 227,107 |
A complete GoldSrc demo parser and writer library
let mut demo = open_demo("./src/tests/demotest.dem").unwrap();
for entry in &mut demo.directory.entries {
for frame in &mut entry.frames {
if let FrameData::NetworkMessage(ref mut box_type) = &mut frame.frame_data {
let data = &mut box_type.as_mut().1;
if let MessageData::Parsed(messages) = &mut data.messages {
messages.push(NetMessage::EngineMessage(Box::new(EngineMessage::SvcBad)));
};
}
}
}
demo.write_to_file("./src/tests/demo2test.dem").unwrap();