From e1d9c27bdacf3ca5073e4aede785925a7b305854 Mon Sep 17 00:00:00 2001 From: Pavel Perestoronin Date: Wed, 7 Dec 2022 14:17:23 +0100 Subject: [PATCH] Break: rename `author_results` into `author` and add `author.account_id` --- src/models/battle_results.rs | 7 +++++-- tests/battle_results.rs | 7 ++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/models/battle_results.rs b/src/models/battle_results.rs index 7f454b6..66b6df8 100644 --- a/src/models/battle_results.rs +++ b/src/models/battle_results.rs @@ -26,7 +26,7 @@ pub struct BattleResults { /// Replay's author results. #[prost(message, required, tag = "8")] - pub author_results: AuthorResults, + pub author: Author, /// Author's free XP, including premium. #[prost(uint32, tag = "137")] @@ -176,7 +176,7 @@ impl PlayerResultsInfo { } #[derive(Message, Serialize)] -pub struct AuthorResults { +pub struct Author { /// Earned credits, including premium and special awards and medals. #[prost(uint32, tag = "2")] pub credits_earned: u32, @@ -187,4 +187,7 @@ pub struct AuthorResults { #[prost(uint32, tag = "8")] pub damage_dealt: u32, + + #[prost(uint32, tag = "101")] + pub account_id: u32, } diff --git a/tests/battle_results.rs b/tests/battle_results.rs index 902c097..62d00b4 100644 --- a/tests/battle_results.rs +++ b/tests/battle_results.rs @@ -111,9 +111,10 @@ fn author_results_ok() -> Result<()> { let battle_results = Replay::open(File::open("tests/replays/author_results.wotbreplay")?)? .read_battle_results()?; - assert_eq!(battle_results.author_results.credits_earned, 53623); - assert_eq!(battle_results.author_results.combat_xp, 2370); - assert_eq!(battle_results.author_results.damage_dealt, 1738); + assert_eq!(battle_results.author.credits_earned, 53623); + assert_eq!(battle_results.author.combat_xp, 2370); + assert_eq!(battle_results.author.damage_dealt, 1738); + assert_eq!(battle_results.author.account_id, 594778041); assert_eq!(battle_results.free_xp, 116); Ok(())