From 2bf97f341f4a80b6de807fd55b12c4b3808f46d4 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 5 Aug 2021 09:43:47 +0000 Subject: [PATCH] 1 --- server/gameserver/creature.cc | 12 ++++++++++++ server/gameserver/creature.h | 1 + server/gameserver/player.cc | 2 ++ 3 files changed, 15 insertions(+) diff --git a/server/gameserver/creature.cc b/server/gameserver/creature.cc index 8a184eb..9e4c9a3 100644 --- a/server/gameserver/creature.cc +++ b/server/gameserver/creature.cc @@ -2565,3 +2565,15 @@ Hero* Creature::InternalSummonHero(MetaData::Player* hero_meta, a8::Vec2 dir, a8 } return nullptr; } + +std::string Creature::DebugOutBuffList() +{ + std::string data; + for (auto& itr : buff_list_) { + data += a8::Format("buffid:%d effect:%d\n", + { + + }); + } + return data; +} diff --git a/server/gameserver/creature.h b/server/gameserver/creature.h index c732417..643c739 100644 --- a/server/gameserver/creature.h +++ b/server/gameserver/creature.h @@ -211,6 +211,7 @@ class Creature : public MoveableEntity void RefreshHP(); void TraverseBuff(std::function func); long long GetCollisionTimes() { return collision_times_; }; + std::string DebugOutBuffList(); protected: diff --git a/server/gameserver/player.cc b/server/gameserver/player.cc index e81afbc..dc0852e 100644 --- a/server/gameserver/player.cc +++ b/server/gameserver/player.cc @@ -1241,6 +1241,8 @@ void Player::_CMExecCommand(f8::MsgHdr& hdr, const cs::CMExecCommand& msg) float abs_val = GetAbility()->GetAttrAbs(attr_id); float rate_val = GetAbility()->GetAttrRate(attr_id); SendDebugMsg(a8::Format("attr_id:%d abs_val:%f rate_val:%f", {attr_id, abs_val, rate_val})); + } else if (cmd == "bufflist") { + SendDebugMsg(DebugOutBuffList()); } }