wotbreplay-parser

Crates.iowotbreplay-parser
lib.rswotbreplay-parser
version0.4.2
sourcesrc
created_at2022-12-02 23:08:25.195089
updated_at2024-01-29 19:07:41.245607
descriptionWorld of Tanks Blitz replay parser
homepage
repositoryhttps://github.com/eigenein/wotbreplay-parser
max_upload_size
id728679
size6,773,189
Pavel Perestoronin (eigenein)

documentation

README

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(())
}
Commit count: 74

cargo fmt