mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 05:36:23 +00:00
feat(Core/Debug): GetDebugInfo implementation (#12705)
Cherry-pick: 9a924fb9d5
Co-authored-by: jackpoz <giacomopoz@gmail.com>
Co-authored-by: jackpoz <giacomopoz@gmail.com>
This commit is contained in:
@@ -1010,6 +1010,13 @@ bool Object::PrintIndexError(uint32 index, bool set) const
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string Object::GetDebugInfo() const
|
||||
{
|
||||
std::stringstream sstr;
|
||||
sstr << GetGUID().ToString() + " Entry " << GetEntry();
|
||||
return sstr.str();
|
||||
}
|
||||
|
||||
void MovementInfo::OutDebug()
|
||||
{
|
||||
LOG_INFO("movement", "MOVEMENT INFO");
|
||||
@@ -2419,6 +2426,15 @@ Player* WorldObject::SelectNearestPlayer(float distance) const
|
||||
return target;
|
||||
}
|
||||
|
||||
std::string WorldObject::GetDebugInfo() const
|
||||
{
|
||||
std::stringstream sstr;
|
||||
sstr << WorldLocation::GetDebugInfo() << "\n"
|
||||
<< Object::GetDebugInfo() << "\n"
|
||||
<< "Name: " << GetName();
|
||||
return sstr.str();
|
||||
}
|
||||
|
||||
void WorldObject::GetGameObjectListWithEntryInGrid(std::list<GameObject*>& gameobjectList, uint32 entry, float maxSearchRange) const
|
||||
{
|
||||
Acore::AllGameObjectsWithEntryInRange check(this, entry, maxSearchRange);
|
||||
|
||||
@@ -208,6 +208,8 @@ public:
|
||||
DynamicObject* ToDynObject() { if (GetTypeId() == TYPEID_DYNAMICOBJECT) return reinterpret_cast<DynamicObject*>(this); else return nullptr; }
|
||||
[[nodiscard]] DynamicObject const* ToDynObject() const { if (GetTypeId() == TYPEID_DYNAMICOBJECT) return reinterpret_cast<DynamicObject const*>(this); else return nullptr; }
|
||||
|
||||
virtual std::string GetDebugInfo() const;
|
||||
|
||||
DataMap CustomData;
|
||||
|
||||
protected:
|
||||
@@ -613,6 +615,8 @@ public:
|
||||
[[nodiscard]] bool HasAllowedLooter(ObjectGuid guid) const;
|
||||
[[nodiscard]] GuidUnorderedSet const& GetAllowedLooters() const;
|
||||
|
||||
std::string GetDebugInfo() const override;
|
||||
|
||||
ElunaEventProcessor* elunaEvents;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -208,3 +208,10 @@ ByteBuffer& operator<<(ByteBuffer& buf, Position::PositionXYZOStreamer const& st
|
||||
buf << x << y << z << o;
|
||||
return buf;
|
||||
}
|
||||
|
||||
std::string WorldLocation::GetDebugInfo() const
|
||||
{
|
||||
std::stringstream sstr;
|
||||
sstr << "MapID: " << m_mapId << " " << Position::ToString();
|
||||
return sstr.str();
|
||||
}
|
||||
|
||||
@@ -317,6 +317,8 @@ public:
|
||||
}
|
||||
|
||||
uint32 m_mapId;
|
||||
|
||||
std::string GetDebugInfo() const;
|
||||
};
|
||||
|
||||
ByteBuffer& operator<<(ByteBuffer& buf, Position::PositionXYStreamer const& streamer);
|
||||
|
||||
Reference in New Issue
Block a user