s2protocol 3.5.3

A parser for Starcraft II - Replay format, exports to different target formats
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use nom_mpq::parser;

#[test_log::test]
fn s2_protocol_87702_version() {
    let file_path = concat!(
        env!("CARGO_MANIFEST_DIR"),
        "/assets/SC2-Patch_4.12-2v2AI.SC2Replay"
    );
    let file_contents = parser::read_file(file_path);
    let (_input, mpq) = parser::parse(&file_contents).unwrap();
    let (_tail, proto_header) = s2protocol::read_protocol_header(&mpq).unwrap();
    assert_eq!(proto_header.m_signature, b"StarCraft II replay\x1b11"[..]);
    assert_eq!(proto_header.m_version.m_base_build, 87702);
}