mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
[Performance] Client / NPC Position Update Optimizations (#4602)
* Zone optimizations * More changes * More * Update entity.cpp * Beautiful * Amazing * Feature flag all logic * Broadcast to group * Update mob.cpp * Updates * Update client.cpp * Update client.cpp * Add rule Zone:EnableEntityClipping * Little bit of cleanup * Don't send update to self while in group * Remove visibility work and feature flags * Cleanup * Logging * Improve CheckSendBulkNpcPositions * No need to cast * Field cleanup * Build initial list on zone-in
This commit is contained in:
@@ -851,12 +851,24 @@ void MobMovementManager::SendCommandToClients(
|
||||
_impl->Stats.TotalSentPosition++;
|
||||
}
|
||||
|
||||
if (c->m_last_seen_mob_position.contains(mob->GetID())) {
|
||||
if (c->m_last_seen_mob_position[mob->GetID()] == mob->GetPosition() && anim == 0) {
|
||||
LogPositionUpdate(
|
||||
"Mob [{}] has already been sent to client [{}] at this position, skipping",
|
||||
mob->GetCleanName(),
|
||||
c->GetCleanName()
|
||||
);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
c->QueuePacket(&outapp, false);
|
||||
c->m_last_seen_mob_position[mob->GetID()] = mob->GetPosition();
|
||||
}
|
||||
}
|
||||
else {
|
||||
float short_range = RuleR(Pathing, ShortMovementUpdateRange);
|
||||
float long_range = zone->GetNpcPositionUpdateDistance();
|
||||
float long_range = RuleI(Range, MobCloseScanDistance);
|
||||
|
||||
for (auto &c : _impl->Clients) {
|
||||
if (single_client && c != single_client) {
|
||||
@@ -901,7 +913,19 @@ void MobMovementManager::SendCommandToClients(
|
||||
_impl->Stats.TotalSentPosition++;
|
||||
}
|
||||
|
||||
if (c->m_last_seen_mob_position.contains(mob->GetID())) {
|
||||
if (c->m_last_seen_mob_position[mob->GetID()] == mob->GetPosition() && anim == 0) {
|
||||
LogPositionUpdate(
|
||||
"Mob [{}] has already been sent to client [{}] at this position, skipping",
|
||||
mob->GetCleanName(),
|
||||
c->GetCleanName()
|
||||
);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
c->QueuePacket(&outapp, false);
|
||||
c->m_last_seen_mob_position[mob->GetID()] = mob->GetPosition();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user