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; //复活倒计时