mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-16 01:01:30 +00:00
[Performance] Clear Wearchange Deduplication Cache (#4960)
* [Performance] Clear Wearchange Deduplication Cache * Move timers to process loops
This commit is contained in:
parent
07d484597d
commit
659a960401
@ -561,6 +561,10 @@ bool Client::Process() {
|
||||
{
|
||||
ItemTimerCheck();
|
||||
}
|
||||
|
||||
if (m_clear_wearchange_cache_timer.Check()) {
|
||||
m_last_seen_wearchange.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -133,6 +133,7 @@ Mob::Mob(
|
||||
m_see_close_mobs_timer(1000),
|
||||
m_mob_check_moving_timer(1000),
|
||||
bot_attack_flag_timer(10000),
|
||||
m_clear_wearchange_cache_timer(60 * 10 * 1000), // 10 minutes
|
||||
m_destroying(false)
|
||||
{
|
||||
mMovementManager = &MobMovementManager::Get();
|
||||
|
||||
@ -211,6 +211,7 @@ public:
|
||||
uint16 m_last_wearchange_race_id = 0;
|
||||
// client_id -> slot_id -> key
|
||||
std::unordered_map<uint32_t, std::unordered_map<uint8_t, uint64_t>> m_last_seen_wearchange;
|
||||
Timer m_clear_wearchange_cache_timer;
|
||||
|
||||
// Bot attack flag
|
||||
Timer bot_attack_flag_timer;
|
||||
|
||||
@ -632,6 +632,10 @@ bool NPC::Process()
|
||||
}
|
||||
|
||||
if (tic_timer.Check()) {
|
||||
if (m_clear_wearchange_cache_timer.Check()) {
|
||||
m_last_seen_wearchange.clear();
|
||||
}
|
||||
|
||||
if (parse->HasQuestSub(GetNPCTypeID(), EVENT_TICK)) {
|
||||
parse->EventNPC(EVENT_TICK, this, nullptr, "", 0);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user