From e685418740a610794e35a48d1d1f500ef0bd2a93 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sun, 29 May 2022 17:07:36 +0800 Subject: [PATCH] 1 --- server/gameserver/human.cc | 2 ++ server/gameserver/types.cc | 4 ++++ server/tools/protobuild/cs_proto.proto | 2 ++ server/tools/protobuild/out/cs_proto.proto | 2 ++ 4 files changed, 10 insertions(+) diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index e4d4c327..4eb5a4af 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -2126,6 +2126,7 @@ void Human::GenBattleReportData(a8::MutableXObject* params) params->SetVal("hero_stats_name", stats.pb_hero_stats.hero_name()); params->SetVal("hero_stats_hero_id", stats.pb_hero_stats.hero_id()); params->SetVal("hero_stats_reward_ceg", stats.pb_hero_stats.reward_ceg()); + params->SetVal("hero_stats_today_get_ceg", stats.pb_hero_stats.today_get_ceg()); params->SetVal("hero_stats_ceg_uplimit", stats.pb_hero_stats.ceg_uplimit()); for (int i = 0; i < stats.pb_weapons_stats.size(); ++i) { @@ -2135,6 +2136,7 @@ void Human::GenBattleReportData(a8::MutableXObject* params) params->SetVal("weapon_stats_name" + i_str, p.weapon_name()); params->SetVal("weapon_stats_weapon_id" + i_str, p.weapon_id()); params->SetVal("weapon_stats_reward_ceg" + i_str, p.reward_ceg()); + params->SetVal("weapon_stats_today_get_ceg" + i_str, p.today_get_ceg()); params->SetVal("weapon_stats_ceg_uplimit" + i_str, p.ceg_uplimit()); } } diff --git a/server/gameserver/types.cc b/server/gameserver/types.cc index cfb2d2e4..f2d652f9 100644 --- a/server/gameserver/types.cc +++ b/server/gameserver/types.cc @@ -223,6 +223,8 @@ void BattleDataContext::CalcBattleStat(struct PlayerStats* stats) int new_ceg = std::min(up_limit, today_get_gold + ceg); int finaly_ceg = std::max(0, new_ceg - today_get_gold); stats->pb_hero_stats.set_ceg_uplimit(up_limit); + stats->pb_hero_stats.set_today_get_ceg + (std::min(up_limit, today_get_gold + finaly_ceg)); stats->pb_hero_stats.set_reward_ceg(finaly_ceg); } } @@ -252,6 +254,8 @@ void BattleDataContext::CalcBattleStat(struct PlayerStats* stats) int new_ceg = std::min(up_limit, today_get_gold + ceg); int finaly_ceg = std::max(0, new_ceg - today_get_gold); p->set_ceg_uplimit(up_limit); + p->set_today_get_ceg + (std::min(up_limit, today_get_gold + finaly_ceg)); p->set_reward_ceg(finaly_ceg); } } diff --git a/server/tools/protobuild/cs_proto.proto b/server/tools/protobuild/cs_proto.proto index 58cafdd8..2da02ac0 100755 --- a/server/tools/protobuild/cs_proto.proto +++ b/server/tools/protobuild/cs_proto.proto @@ -716,6 +716,7 @@ message MFHeroStats optional int32 hero_id = 3 [default = 0]; //英雄唯id optional int32 reward_ceg = 4 [default = 0]; //英雄获得的ceg数量 optional int32 ceg_uplimit = 5 [default = 0]; //英雄获得的ceg数量上限 + optional int32 today_get_ceg = 6 [default = 0]; //英雄今天获得的ceg数量 } //武器结算信息 @@ -726,6 +727,7 @@ message MFWeaponStats optional int32 weapon_id = 3 [default = 0]; //武器唯id optional int32 reward_ceg = 4 [default = 0]; //武器获得的ceg数量 optional int32 ceg_uplimit = 5 [default = 0]; //武器获得的ceg数量上限 + optional int32 today_get_ceg = 6 [default = 0]; //武器今天获得的ceg数量 } //游戏结束时玩家统计信息 diff --git a/server/tools/protobuild/out/cs_proto.proto b/server/tools/protobuild/out/cs_proto.proto index 98935f6c..2b3829da 100644 --- a/server/tools/protobuild/out/cs_proto.proto +++ b/server/tools/protobuild/out/cs_proto.proto @@ -539,6 +539,7 @@ message MFHeroStats optional int32 hero_id = 3 [default = 0]; optional int32 reward_ceg = 4 [default = 0]; optional int32 ceg_uplimit = 5 [default = 0]; + optional int32 today_get_ceg = 6 [default = 0]; } message MFWeaponStats @@ -548,6 +549,7 @@ message MFWeaponStats optional int32 weapon_id = 3 [default = 0]; optional int32 reward_ceg = 4 [default = 0]; optional int32 ceg_uplimit = 5 [default = 0]; + optional int32 today_get_ceg = 6 [default = 0]; } message MFPlayerStats