mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-15 00:22:27 +00:00
(Performance) Rate limit the rate in which signals are processed for NPC's
This commit is contained in:
parent
e5ad5e13db
commit
2a69ae42ee
@ -159,6 +159,7 @@ enum { //timer settings, all in milliseconds
|
||||
AItarget_check_duration = 500,
|
||||
AIClientScanarea_delay = 750, //used in REVERSE_AGGRO
|
||||
AIassistcheck_delay = 3000, //now often a fighting NPC will yell for help
|
||||
AI_check_signal_timer_delay = 500, // How often EVENT_SIGNAL checks are processed
|
||||
ClientProximity_interval = 150,
|
||||
CombatEventTimer_expire = 12000,
|
||||
Tribute_duration = 600000,
|
||||
|
||||
@ -1262,6 +1262,7 @@ protected:
|
||||
std::unique_ptr<Timer> AIscanarea_timer;
|
||||
std::unique_ptr<Timer> AIwalking_timer;
|
||||
std::unique_ptr<Timer> AIfeignremember_timer;
|
||||
std::unique_ptr<Timer> AI_check_signal_timer;
|
||||
uint32 pLastFightingDelayMoving;
|
||||
HateList hate_list;
|
||||
std::set<uint32> feign_memory_list;
|
||||
|
||||
@ -429,6 +429,8 @@ void Mob::AI_Init()
|
||||
AItarget_check_timer.reset(nullptr);
|
||||
AIfeignremember_timer.reset(nullptr);
|
||||
AIscanarea_timer.reset(nullptr);
|
||||
AI_check_signal_timer.reset(nullptr);
|
||||
|
||||
minLastFightingDelayMoving = RuleI(NPC, LastFightingDelayMovingMin);
|
||||
maxLastFightingDelayMoving = RuleI(NPC, LastFightingDelayMovingMax);
|
||||
|
||||
@ -479,6 +481,8 @@ void Mob::AI_Start(uint32 iMoveDelay) {
|
||||
AItarget_check_timer = std::unique_ptr<Timer>(new Timer(AItarget_check_duration));
|
||||
AIfeignremember_timer = std::unique_ptr<Timer>(new Timer(AIfeignremember_delay));
|
||||
AIscanarea_timer = std::unique_ptr<Timer>(new Timer(AIscanarea_delay));
|
||||
AI_check_signal_timer = std::unique_ptr<Timer>(new Timer(AI_check_signal_timer_delay));
|
||||
|
||||
#ifdef REVERSE_AGGRO
|
||||
if(IsNPC() && !CastToNPC()->WillAggroNPCs())
|
||||
AIscanarea_timer->Disable();
|
||||
@ -544,6 +548,7 @@ void Mob::AI_Stop() {
|
||||
AItarget_check_timer.reset(nullptr);
|
||||
AIscanarea_timer.reset(nullptr);
|
||||
AIfeignremember_timer.reset(nullptr);
|
||||
AI_check_signal_timer.reset(nullptr);
|
||||
|
||||
hate_list.WipeHateList();
|
||||
}
|
||||
@ -998,7 +1003,7 @@ void Mob::AI_Process() {
|
||||
}
|
||||
|
||||
// trigger EVENT_SIGNAL if required
|
||||
if(IsNPC()) {
|
||||
if (AI_check_signal_timer->Check() && IsNPC()) {
|
||||
CastToNPC()->CheckSignal();
|
||||
}
|
||||
|
||||
|
||||
@ -393,10 +393,10 @@ int main(int argc, char** argv) {
|
||||
|
||||
worldserver.Process();
|
||||
|
||||
if (!eqsf.IsOpen() && Config->ZonePort!=0) {
|
||||
Log.Out(Logs::General, Logs::Zone_Server, "Starting EQ Network server on port %d",Config->ZonePort);
|
||||
if (!eqsf.IsOpen() && Config->ZonePort != 0) {
|
||||
Log.Out(Logs::General, Logs::Zone_Server, "Starting EQ Network server on port %d", Config->ZonePort);
|
||||
if (!eqsf.Open(Config->ZonePort)) {
|
||||
Log.Out(Logs::General, Logs::Error, "Failed to open port %d",Config->ZonePort);
|
||||
Log.Out(Logs::General, Logs::Error, "Failed to open port %d", Config->ZonePort);
|
||||
ZoneConfig::SetZonePort(0);
|
||||
worldserver.Disconnect();
|
||||
worldwasconnected = false;
|
||||
@ -410,7 +410,7 @@ int main(int argc, char** argv) {
|
||||
//structures and opcodes for that patch.
|
||||
struct in_addr in;
|
||||
in.s_addr = eqss->GetRemoteIP();
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "New connection from %s:%d", inet_ntoa(in),ntohs(eqss->GetRemotePort()));
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "New connection from %s:%d", inet_ntoa(in), ntohs(eqss->GetRemotePort()));
|
||||
stream_identifier.AddStream(eqss); //takes the stream
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user