From 50f15b9ae9ae330eec3193b3ab1e86855f8e4dc8 Mon Sep 17 00:00:00 2001 From: Pavel Perestoronin Date: Tue, 16 May 2023 21:37:07 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=A5=20Add=20more=20maps=20and=20result?= =?UTF-8?q?=20fields?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/models/battle_results.rs | 22 ++++++++++++++++++++-- src/models/map_id.rs | 3 +++ tests/battle_results.rs | 4 ++-- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/models/battle_results.rs b/src/models/battle_results.rs index c881fb3..1cb3c8b 100644 --- a/src/models/battle_results.rs +++ b/src/models/battle_results.rs @@ -197,13 +197,31 @@ impl PlayerResultsInfo { #[derive(Message, Serialize)] pub struct Author { + /// # Note + /// + /// The field is `-2` if the player is auto-destroyed by inactivity. + #[prost(int32, tag = "2")] + pub hitpoints_left: i32, + /// Earned credits, including premium and special awards and medals. #[prost(uint32, tag = "2")] - pub credits_earned: u32, + pub total_credits: u32, /// Combat XP, including premium. #[prost(uint32, tag = "3")] - pub combat_xp: u32, + pub total_xp: u32, + + #[prost(uint32, tag = "4")] + pub n_shots: u32, + + #[prost(uint32, tag = "5")] + pub n_hits: u32, + + #[prost(uint32, tag = "6")] + pub n_splashes: u32, + + #[prost(uint32, tag = "7")] + pub n_penetrations: u32, #[prost(uint32, tag = "8")] pub damage_dealt: u32, diff --git a/src/models/map_id.rs b/src/models/map_id.rs index 1478e60..02ef286 100644 --- a/src/models/map_id.rs +++ b/src/models/map_id.rs @@ -12,12 +12,15 @@ pub enum MapId { DeadRail = 7, FortDespair = 8, Himmelsdorf = 9, + BlackGoldville = 10, OasisPalms = 11, GhostFactory = 12, Molendijk = 14, PortBay = 15, + WinterMalinovka = 19, Castilla = 20, Canal = 21, + Vineyards = 23, YamatoHarbor = 25, Canyon = 27, MayanRuins = 30, diff --git a/tests/battle_results.rs b/tests/battle_results.rs index 496856a..e304813 100644 --- a/tests/battle_results.rs +++ b/tests/battle_results.rs @@ -17,8 +17,8 @@ fn player_results_ok() -> Result<()> { assert_eq!(battle_results.room_type(), RoomType::Regular); assert_eq!(battle_results.author.team_number, 2); - assert_eq!(battle_results.author.credits_earned, 59518); - assert_eq!(battle_results.author.combat_xp, 5255); + assert_eq!(battle_results.author.total_credits, 59518); + assert_eq!(battle_results.author.total_xp, 5255); assert_eq!(battle_results.author.damage_dealt, 1438); assert_eq!(battle_results.author.account_id, 594778041); assert_eq!(battle_results.free_xp, 260);