mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-24 00:41: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();
|
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_see_close_mobs_timer(1000),
|
||||||
m_mob_check_moving_timer(1000),
|
m_mob_check_moving_timer(1000),
|
||||||
bot_attack_flag_timer(10000),
|
bot_attack_flag_timer(10000),
|
||||||
|
m_clear_wearchange_cache_timer(60 * 10 * 1000), // 10 minutes
|
||||||
m_destroying(false)
|
m_destroying(false)
|
||||||
{
|
{
|
||||||
mMovementManager = &MobMovementManager::Get();
|
mMovementManager = &MobMovementManager::Get();
|
||||||
|
|||||||
@ -211,6 +211,7 @@ public:
|
|||||||
uint16 m_last_wearchange_race_id = 0;
|
uint16 m_last_wearchange_race_id = 0;
|
||||||
// client_id -> slot_id -> key
|
// client_id -> slot_id -> key
|
||||||
std::unordered_map<uint32_t, std::unordered_map<uint8_t, uint64_t>> m_last_seen_wearchange;
|
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
|
// Bot attack flag
|
||||||
Timer bot_attack_flag_timer;
|
Timer bot_attack_flag_timer;
|
||||||
|
|||||||
@ -632,6 +632,10 @@ bool NPC::Process()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (tic_timer.Check()) {
|
if (tic_timer.Check()) {
|
||||||
|
if (m_clear_wearchange_cache_timer.Check()) {
|
||||||
|
m_last_seen_wearchange.clear();
|
||||||
|
}
|
||||||
|
|
||||||
if (parse->HasQuestSub(GetNPCTypeID(), EVENT_TICK)) {
|
if (parse->HasQuestSub(GetNPCTypeID(), EVENT_TICK)) {
|
||||||
parse->EventNPC(EVENT_TICK, this, nullptr, "", 0);
|
parse->EventNPC(EVENT_TICK, this, nullptr, "", 0);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user