dem

Crates.iodem
lib.rsdem
version0.2.0
sourcesrc
created_at2024-12-08 01:38:13.84052
updated_at2024-12-08 01:38:13.84052
descriptionGoldSrc demo parser and writer library
homepage
repositoryhttps://github.com/khanghugo/dem
max_upload_size
id1476016
size227,107
Lê Hàn Minh Khang (khanghugo)

documentation

README

dem

A complete GoldSrc demo parser and writer library

Example

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();

Acknowledgement

hlviewer.js

talent

coldemoplayer

hldemojs

Commit count: 40

cargo fmt