diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 208bfeb9..6db732fb 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -40,6 +40,11 @@ const int kReviveTimeAdd = 12; const int kSkinNum = 4; +void PlayerStats::Statement(Human* hum) +{ + statemented = 1; +} + WeaponStats& PlayerStats::MustBeWeapon(int weapon_id) { auto itr = weapon_stats.find(weapon_id); @@ -1849,6 +1854,9 @@ void Human::GenBattleReportData(a8::MutableXObject* params) } } stats.rank = rank; + if (!stats.statemented) { + stats.Statement(this); + } params->SetVal("account_id", account_id); params->SetVal("session_id", session_id); params->SetVal("battle_uuid", battle_uuid); @@ -1957,26 +1965,11 @@ void Human::GenBattleReportData(a8::MutableXObject* params) params->SetVal("pass_score", has_pass ? stats.pass_score * 2 : stats.pass_score); params->SetVal("rank_score", stats.rank_score); { - { - double ranked_topx = rank / 40; - params->SetVal("ranked_topx", ranked_topx); - } - { - double kills_topx = rank / 40; - params->SetVal("kills_topx", kills_topx); - } - { - double hero_topx = rank / 40; - params->SetVal("hero_topx", hero_topx); - } - { - double weapon_topx = rank / 40; - params->SetVal("weapon_topx", weapon_topx); - } - { - double survival_topx = rank / 40; - params->SetVal("survival_topx", survival_topx); - } + params->SetVal("ranked_topx", stats.ranked_topx); + params->SetVal("kills_topx", stats.kills_topx); + params->SetVal("hero_topx", stats.hero_topx); + params->SetVal("weapon_topx", stats.weapon_topx); + params->SetVal("survival_topx", stats.survival_topx); } } diff --git a/server/gameserver/human.h b/server/gameserver/human.h index 50d01c1f..6a11b2a1 100644 --- a/server/gameserver/human.h +++ b/server/gameserver/human.h @@ -101,6 +101,13 @@ struct PlayerStats OverReward over_reward; + int statemented = false; + double ranked_topx = 0; + double kills_topx = 0; + double hero_topx = 0; + double weapon_topx = 0; + double survival_topx = 0; + WeaponStats& MustBeWeapon(int weapon_id); void IncWeaponKills(int weapon_id, int val); void IncWeaponDamageOut(int weapon_id, int val); @@ -110,6 +117,7 @@ struct PlayerStats void SetHeroSkillLv(int hero_id, int skill_lv); void SetHeroWeaponLv(int hero_id, int weapon_lv); void CalcReward(Human* hum, int ranked, int kills); + void Statement(Human* hum); }; struct xtimer_list;