New: add n_enemies_damaged, n_enemies_destroyed, and credits

This commit is contained in:
Pavel Perestoronin committed 2022-12-03 20:28:18 +01:00
1 parent bc3b39e764
commit 7376cfc97e
2 files changed
+21

No files matched your search

+12
View File
@@ -82,6 +82,10 @@ pub struct PlayerResults {
/// Extended player's results information.
#[derive(Message)]
pub struct PlayerResultsInfo {
/// Credits earned – without special awards and medals and premium account excluded.
#[prost(uint32, tag = "2")]
pub credits: u32,
/// Base XP (the total without multipliers).
#[prost(uint32, tag = "3")]
pub base_xp: u32,
@@ -98,9 +102,11 @@ pub struct PlayerResultsInfo {
#[prost(uint32, tag = "8")]
pub damage_dealt: u32,
/// TODO: distinguish the kinds of assisted damage.
#[prost(uint32, tag = "9")]
pub damage_assisted_1: u32,
/// TODO: distinguish the kinds of assisted damage.
#[prost(uint32, tag = "10")]
pub damage_assisted_2: u32,
@@ -113,6 +119,12 @@ pub struct PlayerResultsInfo {
#[prost(uint32, tag = "15")]
pub n_penetrations_received: u32,
#[prost(uint32, tag = "17")]
pub n_enemies_damaged: u32,
#[prost(uint32, tag = "18")]
pub n_enemies_destroyed: u32,
/// TODO: distinguish earned vs seized.
#[prost(uint32, tag = "32")]
pub victory_points_1: u32,
+9
View File
@@ -39,6 +39,8 @@ fn player_results_ok() -> Result<()> {
assert_eq!(snak_the_ripper_info.n_hits_dealt, 5);
assert_eq!(snak_the_ripper_info.n_penetrations_dealt, 5);
assert_eq!(snak_the_ripper_info.tank_id, 5233);
assert_eq!(snak_the_ripper_info.n_enemies_damaged, 3);
assert_eq!(snak_the_ripper_info.n_enemies_destroyed, 2);
let zeekrab_info = &battle_results.player_results[10].info;
assert_eq!(zeekrab_info.base_xp, 701);
@@ -56,6 +58,9 @@ fn player_results_ok() -> Result<()> {
assert_eq!(zeekrab_info.victory_points_1, 40);
assert_eq!(zeekrab_info.victory_points_2, 40);
assert_eq!(zeekrab_info.tank_id, 26657);
assert_eq!(zeekrab_info.credits, 37679);
assert_eq!(zeekrab_info.n_enemies_damaged, 2);
assert_eq!(zeekrab_info.n_enemies_destroyed, 1);
let balls_soup_info = &battle_results.player_results[8].info;
assert_eq!(balls_soup_info.damage_dealt, 2064);
@@ -67,6 +72,8 @@ fn player_results_ok() -> Result<()> {
assert_eq!(balls_soup_info.n_penetrations_received, 4);
assert_eq!(balls_soup_info.n_non_penetrating_hits_received, 2);
assert_eq!(balls_soup_info.tank_id, 4737);
assert_eq!(balls_soup_info.n_enemies_damaged, 4);
assert_eq!(balls_soup_info.n_enemies_destroyed, 1);
let ceaser_info = &battle_results.player_results[0].info;
assert_eq!(ceaser_info.damage_dealt, 919);
@@ -74,6 +81,8 @@ fn player_results_ok() -> Result<()> {
assert_eq!(ceaser_info.n_shots, 9);
assert_eq!(ceaser_info.n_hits_dealt, 6);
assert_eq!(ceaser_info.n_penetrations_dealt, 5);
assert_eq!(ceaser_info.n_enemies_damaged, 3);
assert_eq!(ceaser_info.n_enemies_destroyed, 0);
Ok(())
}