[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
+4 -4
View File
@@ -824,8 +824,8 @@ void MobMovementManager::SendCommandToClients(
return;
}
EQApplicationPacket outapp(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));
auto *spu = (PlayerPositionUpdateServer_Struct *) outapp.pBuffer;
static EQApplicationPacket p(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));
auto *spu = (PlayerPositionUpdateServer_Struct *) p.pBuffer;
FillCommandStruct(spu, mob, delta_x, delta_y, delta_z, delta_heading, anim);
@@ -862,7 +862,7 @@ void MobMovementManager::SendCommandToClients(
}
}
c->QueuePacket(&outapp, false);
c->QueuePacket(&p, false);
c->m_last_seen_mob_position[mob->GetID()] = mob->GetPosition();
}
}
@@ -924,7 +924,7 @@ void MobMovementManager::SendCommandToClients(
}
}
c->QueuePacket(&outapp, false);
c->QueuePacket(&p, false);
c->m_last_seen_mob_position[mob->GetID()] = mob->GetPosition();
}
}