Fixed an issue where Mercenaries were causing several DB queries per second while suspended.

This commit is contained in:
Trevius 2015-01-25 11:28:34 -06:00
parent 5266d7b25c
commit 966acb25b3
3 changed files with 7 additions and 8 deletions

View File

@ -1,5 +1,8 @@
EQEMu Changelog (Started on Sept 24, 2003 15:50) EQEMu Changelog (Started on Sept 24, 2003 15:50)
------------------------------------------------------- -------------------------------------------------------
== 01/25/2015 ==
Trevius: Fixed an issue where Mercenaries were causing several DB queries per second while suspended.
== 01/24/2015 == == 01/24/2015 ==
Uleat: Added equipment light source functionality to all mob derived classes (may still need tweaking...) Uleat: Added equipment light source functionality to all mob derived classes (may still need tweaking...)
Notes: Notes:

View File

@ -233,10 +233,7 @@ bool Client::Process() {
if(GetMercInfo().MercTemplateID != 0 && GetMercInfo().IsSuspended) if(GetMercInfo().MercTemplateID != 0 && GetMercInfo().IsSuspended)
{ {
if(p_timers.Expired(&database, pTimerMercSuspend, false)) CheckMercSuspendTimer();
{
CheckMercSuspendTimer();
}
} }
if(IsAIControlled()) if(IsAIControlled())

View File

@ -5299,7 +5299,8 @@ void Client::CheckMercSuspendTimer() {
if(GetMercInfo().SuspendedTime != 0) if(GetMercInfo().SuspendedTime != 0)
{ {
if(time(nullptr) >= GetMercInfo().SuspendedTime) //if(time(nullptr) >= GetMercInfo().SuspendedTime)
if (p_timers.Expired(&database, pTimerMercSuspend, false))
{ {
GetMercInfo().SuspendedTime = 0; GetMercInfo().SuspendedTime = 0;
SendMercResponsePackets(0); SendMercResponsePackets(0);
@ -5399,11 +5400,9 @@ void Client::SpawnMercOnZone() {
} }
// Send Mercenary Status/Timer packet // Send Mercenary Status/Timer packet
SendMercTimer(GetMerc()); SendMercTimer(GetMerc());
//SendMercPersonalInfo();
CheckMercSuspendTimer();
if (MERC_DEBUG > 0) if (MERC_DEBUG > 0)
Message(7, "Mercenary Debug: SpawnMercOnZone Suspended Merc."); Message(7, "Mercenary Debug: SpawnMercOnZone Suspended Merc.");
} }
} }
else else