[Performance] Re-use ClientUpdate packet memory (#4619)

This commit is contained in:
Chris Miles
2025-01-27 15:32:14 -06:00
committed by GitHub
parent 6525051d2d
commit 07c762068f
4 changed files with 24 additions and 28 deletions
+3 -4
View File
@@ -3824,13 +3824,12 @@ int NPC::GetRolledItemCount(uint32 item_id)
void NPC::SendPositionToClients()
{
auto p = new EQApplicationPacket(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));
auto *s = (PlayerPositionUpdateServer_Struct *) p->pBuffer;
static EQApplicationPacket p(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));
auto *s = (PlayerPositionUpdateServer_Struct *) p.pBuffer;
for (auto &c: entity_list.GetClientList()) {
MakeSpawnUpdate(s);
c.second->QueuePacket(p, false);
c.second->QueuePacket(&p, false);
}
safe_delete(p);
}
void NPC::HandleRoambox()