mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 21:56:22 +00:00
feat(Core/Optimization): Optimize build of units update object by leveraging cache (#18637)
* feat(Core/Optimization): Optimize build of units update object by leveraging cache. * Remove whitespaces. * Add alternative hooks to handle transmog and other similar things. * Fix build on some compilers. * Fix codestyle * Fix build again. * Take into account updateType.
This commit is contained in:
committed by
GitHub
parent
94df67b1c2
commit
1f640c9872
@@ -186,7 +186,7 @@ void Object::BuildMovementUpdateBlock(UpdateData* data, uint32 flags) const
|
||||
data->AddUpdateBlock(buf);
|
||||
}
|
||||
|
||||
void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const
|
||||
void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target)
|
||||
{
|
||||
if (!target)
|
||||
return;
|
||||
@@ -254,7 +254,7 @@ void Object::SendUpdateToPlayer(Player* player)
|
||||
player->GetSession()->SendPacket(&packet);
|
||||
}
|
||||
|
||||
void Object::BuildValuesUpdateBlockForPlayer(UpdateData* data, Player* target) const
|
||||
void Object::BuildValuesUpdateBlockForPlayer(UpdateData* data, Player* target)
|
||||
{
|
||||
ByteBuffer buf(500);
|
||||
|
||||
@@ -494,7 +494,7 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
|
||||
}
|
||||
}
|
||||
|
||||
void Object::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target) const
|
||||
void Object::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target)
|
||||
{
|
||||
if (!target)
|
||||
return;
|
||||
@@ -542,7 +542,7 @@ void Object::ClearUpdateMask(bool remove)
|
||||
}
|
||||
}
|
||||
|
||||
void Object::BuildFieldsUpdate(Player* player, UpdateDataMapType& data_map) const
|
||||
void Object::BuildFieldsUpdate(Player* player, UpdateDataMapType& data_map)
|
||||
{
|
||||
UpdateDataMapType::iterator iter = data_map.find(player);
|
||||
|
||||
|
||||
@@ -121,10 +121,10 @@ public:
|
||||
[[nodiscard]] TypeID GetTypeId() const { return m_objectTypeId; }
|
||||
[[nodiscard]] bool isType(uint16 mask) const { return (mask & m_objectType); }
|
||||
|
||||
virtual void BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const;
|
||||
virtual void BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target);
|
||||
void SendUpdateToPlayer(Player* player);
|
||||
|
||||
void BuildValuesUpdateBlockForPlayer(UpdateData* data, Player* target) const;
|
||||
void BuildValuesUpdateBlockForPlayer(UpdateData* data, Player* target);
|
||||
void BuildOutOfRangeUpdateBlock(UpdateData* data) const;
|
||||
void BuildMovementUpdateBlock(UpdateData* data, uint32 flags = 0) const;
|
||||
|
||||
@@ -183,7 +183,7 @@ public:
|
||||
[[nodiscard]] virtual bool hasQuest(uint32 /* quest_id */) const { return false; }
|
||||
[[nodiscard]] virtual bool hasInvolvedQuest(uint32 /* quest_id */) const { return false; }
|
||||
virtual void BuildUpdate(UpdateDataMapType&, UpdatePlayerSet&) {}
|
||||
void BuildFieldsUpdate(Player*, UpdateDataMapType&) const;
|
||||
void BuildFieldsUpdate(Player*, UpdateDataMapType&);
|
||||
|
||||
void SetFieldNotifyFlag(uint16 flag) { _fieldNotifyFlags |= flag; }
|
||||
void RemoveFieldNotifyFlag(uint16 flag) { _fieldNotifyFlags &= ~flag; }
|
||||
@@ -223,7 +223,7 @@ protected:
|
||||
uint32 GetUpdateFieldData(Player const* target, uint32*& flags) const;
|
||||
|
||||
void BuildMovementUpdate(ByteBuffer* data, uint16 flags) const;
|
||||
virtual void BuildValuesUpdate(uint8 updatetype, ByteBuffer* data, Player* target) const;
|
||||
virtual void BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target);
|
||||
|
||||
uint16 m_objectType;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user