From c36ce53e05fc231a201617a3598ab5072f670f61 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 13 Mar 2020 16:46:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0bufflist=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/gameserver/human.cc | 9 +++++++++ server/gameserver/human.h | 1 + server/tools/protobuild/cs_proto.proto | 1 + 3 files changed, 11 insertions(+) diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index d70a177..936e580 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -162,6 +162,7 @@ void Human::FillMFObjectFull(cs::MFObjectFull* full_data) p->set_parachute(parachute); } FillBodyState(p->mutable_states()); + FillBuffList(p->mutable_buff_list()); if (dead) { p->set_killer_name(stats.killer_name); p->set_killer_id(stats.killer_id); @@ -1464,6 +1465,14 @@ void Human::FillBodyState(::google::protobuf::RepeatedPtrField<::cs::MFBodyState } } +void Human::FillBuffList(::google::protobuf::RepeatedPtrField<::cs::MFBuff>* pb_buff_list) +{ + for (auto& itr : buff_list_) { + auto buff = pb_buff_list->Add(); + itr.FillMFBuff(buff); + } +} + void Human::SummonHero() { #if 0 diff --git a/server/gameserver/human.h b/server/gameserver/human.h index 00fa3fc..cdbb046 100644 --- a/server/gameserver/human.h +++ b/server/gameserver/human.h @@ -195,6 +195,7 @@ class Human : public Entity int GetVolume(int slot_id); void RecoverHp(int inc_hp); void FillBodyState(::google::protobuf::RepeatedPtrField<::cs::MFBodyState>* states); + void FillBuffList(::google::protobuf::RepeatedPtrField<::cs::MFBuff>* pb_buff_list); void SummonHero(); void AddObserver(Human* observer); void RemoveObserver(Human* observer); diff --git a/server/tools/protobuild/cs_proto.proto b/server/tools/protobuild/cs_proto.proto index e1aac3b..1d38386 100755 --- a/server/tools/protobuild/cs_proto.proto +++ b/server/tools/protobuild/cs_proto.proto @@ -197,6 +197,7 @@ message MFPlayerFull optional int32 emoji1 = 25; //表情1 optional int32 emoji2 = 26; //表情2 optional int32 parachute = 27; //降落伞 + repeated MFBuff buff_list = 28; //buff列表 optional bool can_revive = 30; //是否可复活 optional int32 revive_countdown = 31; //复活倒计时