mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-08 05:52:26 +00:00
Amazing
This commit is contained in:
parent
8606ccffc9
commit
6424e6a3f3
@ -12968,6 +12968,18 @@ void Client::CheckSendBulkClientPositionUpdate()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if we have seen this mob before and it hasn't moved, skip it
|
||||||
|
if (m_last_seen_mob_position.contains(mob->GetID())) {
|
||||||
|
if (m_last_seen_mob_position[mob->GetID()] == mob->GetPosition()) {
|
||||||
|
LogVisibilityDetail(
|
||||||
|
"Mob [{}] has already been sent to client [{}] at this position, skipping",
|
||||||
|
mob->GetCleanName(),
|
||||||
|
GetCleanName()
|
||||||
|
);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mob_movement_manager.SendCommandToClients(
|
mob_movement_manager.SendCommandToClients(
|
||||||
mob,
|
mob,
|
||||||
0.0,
|
0.0,
|
||||||
|
|||||||
@ -971,6 +971,8 @@ void Client::CompleteConnect()
|
|||||||
RecordStats();
|
RecordStats();
|
||||||
AutoGrantAAPoints();
|
AutoGrantAAPoints();
|
||||||
|
|
||||||
|
m_last_seen_mob_position.reserve(entity_list.GetMobList().size());
|
||||||
|
|
||||||
// enforce some rules..
|
// enforce some rules..
|
||||||
if (!CanEnterZone()) {
|
if (!CanEnterZone()) {
|
||||||
LogInfo("Kicking character [{}] from zone, not allowed here (missing requirements)", GetCleanName());
|
LogInfo("Kicking character [{}] from zone, not allowed here (missing requirements)", GetCleanName());
|
||||||
|
|||||||
@ -2870,6 +2870,7 @@ bool EntityList::RemoveMobFromCloseLists(Mob *mob)
|
|||||||
|
|
||||||
it->second->m_close_mobs.erase(entity_id);
|
it->second->m_close_mobs.erase(entity_id);
|
||||||
it->second->m_can_see_mob.erase(entity_id);
|
it->second->m_can_see_mob.erase(entity_id);
|
||||||
|
it->second->m_last_seen_mob_position.erase(entity_id);
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2975,7 +2976,7 @@ void EntityList::ScanCloseMobs(Mob *scanning_mob)
|
|||||||
}
|
}
|
||||||
|
|
||||||
BenchTimer g_vis_bench_timer;
|
BenchTimer g_vis_bench_timer;
|
||||||
#define STATE_HIDDEN -1
|
#define STATE_HIDDEN (-1)
|
||||||
#define STATE_VISIBLE 1
|
#define STATE_VISIBLE 1
|
||||||
|
|
||||||
void EntityList::UpdateVisibility(Mob *scanning_mob) {
|
void EntityList::UpdateVisibility(Mob *scanning_mob) {
|
||||||
|
|||||||
@ -571,6 +571,7 @@ public:
|
|||||||
void SendAlternateAdvancementStats();
|
void SendAlternateAdvancementStats();
|
||||||
void ScanCloseMobs(Mob *scanning_mob);
|
void ScanCloseMobs(Mob *scanning_mob);
|
||||||
void UpdateVisibility(Mob *scanning_mob);
|
void UpdateVisibility(Mob *scanning_mob);
|
||||||
|
void UpdateKnownPositions(Mob *scanning_mob);
|
||||||
|
|
||||||
void GetTrapInfo(Client* c);
|
void GetTrapInfo(Client* c);
|
||||||
bool IsTrapGroupSpawned(uint32 trap_id, uint8 group);
|
bool IsTrapGroupSpawned(uint32 trap_id, uint8 group);
|
||||||
|
|||||||
11
zone/mob.h
11
zone/mob.h
@ -201,11 +201,12 @@ public:
|
|||||||
|
|
||||||
void DisplayInfo(Mob *mob);
|
void DisplayInfo(Mob *mob);
|
||||||
|
|
||||||
std::unordered_map<uint16, Mob *> m_close_mobs;
|
std::unordered_map<uint16, Mob *> m_close_mobs;
|
||||||
std::unordered_map<int, int8> m_can_see_mob;
|
std::unordered_map<int, int8> m_can_see_mob;
|
||||||
Timer m_scan_close_mobs_timer;
|
std::unordered_map<int, glm::vec4> m_last_seen_mob_position;
|
||||||
Timer m_see_close_mobs_timer;
|
Timer m_scan_close_mobs_timer;
|
||||||
Timer m_mob_check_moving_timer;
|
Timer m_see_close_mobs_timer;
|
||||||
|
Timer m_mob_check_moving_timer;
|
||||||
|
|
||||||
// Bot attack flag
|
// Bot attack flag
|
||||||
Timer bot_attack_flag_timer;
|
Timer bot_attack_flag_timer;
|
||||||
|
|||||||
@ -852,6 +852,7 @@ void MobMovementManager::SendCommandToClients(
|
|||||||
}
|
}
|
||||||
|
|
||||||
c->QueuePacket(&outapp, false);
|
c->QueuePacket(&outapp, false);
|
||||||
|
c->m_last_seen_mob_position[mob->GetID()] = mob->GetPosition();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -902,6 +903,7 @@ void MobMovementManager::SendCommandToClients(
|
|||||||
}
|
}
|
||||||
|
|
||||||
c->QueuePacket(&outapp, false);
|
c->QueuePacket(&outapp, false);
|
||||||
|
c->m_last_seen_mob_position[mob->GetID()] = mob->GetPosition();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user