https://github.com/eigenein/wotbreplay-parser
World of Tanks Blitz replay parser
https://github.com/eigenein/wotbreplay-parser
parser rust rust-crate rust-library world-of-tanks-blitz
Last synced: 16 days ago
JSON representation
World of Tanks Blitz replay parser
- Host: GitHub
- URL: https://github.com/eigenein/wotbreplay-parser
- Owner: eigenein
- License: mit
- Created: 2022-12-02T21:43:26.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-29T19:07:11.000Z (over 1 year ago)
- Last Synced: 2024-12-29T01:02:39.335Z (9 months ago)
- Topics: parser, rust, rust-crate, rust-library, world-of-tanks-blitz
- Language: Rust
- Homepage: https://lib.rs/crates/wotbreplay-parser
- Size: 8.04 MB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# `wotbreplay-parser`
World of Tanks Blitz replay parser in Rust.
[](https://crates.io/crates/wotbreplay-parser)
[](https://github.com/eigenein/wotbreplay-parser/commits/main)
[](https://github.com/eigenein/wotbreplay-parser/actions)

[](https://docs.rs/wotbreplay-parser)## Quickstart
```rust
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(())
}
```