mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
[Performance] Re-use ClientUpdate packet memory (#4619)
This commit is contained in:
+3
-4
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user