26 releases

0.4.2 Jan 29, 2024
0.4.1 Jun 29, 2023
0.4.0 May 8, 2023
0.3.0-beta.3 May 8, 2023
0.1.0 Dec 2, 2022

#862 in Parser implementations

27 downloads per month
Used in wotbreplay-inspector

MIT license

6.5MB
612 lines

Contains (Zip file, 1.5MB) 20230503_0027__helaas_pindakaas.wotbreplay, (Zip file, 1MB) 20221203_victory_points.wotbreplay, (Zip file, 1.5MB) 20230429_1682194799_malinovka.wotbreplay, (Zip file, 715KB) 20221203_player_results.wotbreplay, (Zip file, 1MB) 20230429_0126__helaas_pindakaas.wotbreplay, (Zip file, 1MB) 20230512_2150__helaas_pindakaas_R159_SU_130PM_15146680594634860.wotbreplay and 3 more.

wotbreplay-parser

World of Tanks Blitz replay parser in Rust.

Crates.io Last commit GitHub Workflow Status License: MIT docs.rs

Quickstart

use std::fs::File;

use anyhow::Result;
use wotbreplay_parser::models::battle_results::TeamNumber;
use wotbreplay_parser::replay::Replay;

fn main() -> Result<()> {
    let battle_results = Replay::open(File::open("replays/20221203_player_results.wotbreplay")?)?.read_battle_results()?;

    assert_eq!(battle_results.timestamp_secs, 1670083956);
    assert_eq!(battle_results.players.len(), 14);

    assert_eq!(battle_results.players[0].account_id, 595693744);
    assert_eq!(battle_results.players[0].info.nickname, "yuranhik_hustriy26");
    assert_eq!(battle_results.players[0].info.team(), TeamNumber::One);
    assert_eq!(battle_results.players[0].info.platoon_id, Some(545104609));

    assert_eq!(battle_results.players[1].info.nickname, "SNAK_THE_RIPPER");
    assert_eq!(battle_results.players[1].info.team(), TeamNumber::Two);
    assert_eq!(battle_results.players[1].info.platoon_id, Some(273692628));

    Ok(())
}

Dependencies

~3–4MB
~79K SLoC