diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index f8049e7..6b3c453 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -1983,6 +1983,22 @@ void Human::InternalSendGameOver() hum->stats.history_kills = data.Get("kill_his"); hum->stats.history_damage_amount = data.Get("harm_his"); hum->stats.history_heal_amount = data.Get("add_HP_his"); + { + std::string extra_drop = data.Get("extra_drop"); + std::vector strings1; + a8::Split(extra_drop, strings1, '|'); + for (std::string& str1 : strings1) { + std::vector strings2; + a8::Split(str1, strings2, ':'); + if (strings2.size() == 2) { + hum->stats.extra_drop.push_back(std::make_pair( + a8::XValue(strings2[0]).GetInt(), + a8::XValue(strings2[1]).GetInt() + ) + ); + } + } + } cs::SMGameOver msg; hum->FillSMGameOver(msg); hum->SendNotifyMsg(msg); diff --git a/server/gameserver/types.h b/server/gameserver/types.h index d95fe21..273b7dc 100755 --- a/server/gameserver/types.h +++ b/server/gameserver/types.h @@ -83,6 +83,8 @@ struct PlayerStats int gold = 0; int score = 0; + std::vector> extra_drop; + int killer_id = 0; std::string killer_name; int weapon_id = 0; diff --git a/server/tools/protobuild/cs_proto.proto b/server/tools/protobuild/cs_proto.proto index a66b2f6..facaf89 100755 --- a/server/tools/protobuild/cs_proto.proto +++ b/server/tools/protobuild/cs_proto.proto @@ -532,6 +532,8 @@ message MFPlayerStats optional int32 gold = 10; //金币 optional int32 score = 11; //积分 + repeated MFPair extra_drop = 12; //额外掉落,key:item_id value:数量(看广告) + optional bool dead = 5; //是否已死亡 optional int32 killer_id = 7; //杀手id(自杀时为自己) 特殊id: -1:倒在安全区 optional string killer_name = 40; //杀手名称