From a06d5fab89c5685d1baa83f30a90b203b68d99ed Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 28 Mar 2017 15:49:13 -0500 Subject: [PATCH 1/3] [Performance] Adjust HP marquee call checks --- zone/attack.cpp | 2 +- zone/client.cpp | 3 --- zone/mob.cpp | 3 ++- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/zone/attack.cpp b/zone/attack.cpp index 5cd5aebae..3a77e81ab 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -3300,7 +3300,7 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const SetHP(GetHP() - damage); - if (IsClient()) + if (IsClient() && RuleB(Character, MarqueeHPUpdates)) this->CastToClient()->SendHPUpdateMarquee(); if(HasDied()) { diff --git a/zone/client.cpp b/zone/client.cpp index 94dd43878..1c3bf7854 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -8659,9 +8659,6 @@ void Client::QuestReward(Mob* target, uint32 copper, uint32 silver, uint32 gold, } void Client::SendHPUpdateMarquee(){ - if (!RuleB(Character, MarqueeHPUpdates)) - return; - if (!this || !this->IsClient() || !this->cur_hp || !this->max_hp) return; diff --git a/zone/mob.cpp b/zone/mob.cpp index 9bde2cc0e..651f2f97d 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -1381,7 +1381,8 @@ void Mob::SendHPUpdate(bool skip_self) // send to self - we need the actual hps here if(IsClient() && (!skip_self || dospam)) { - this->CastToClient()->SendHPUpdateMarquee(); + if (RuleB(Character, MarqueeHPUpdates)) + this->CastToClient()->SendHPUpdateMarquee(); auto hp_app2 = new EQApplicationPacket(OP_HPUpdate, sizeof(SpawnHPUpdate_Struct)); SpawnHPUpdate_Struct* ds = (SpawnHPUpdate_Struct*)hp_app2->pBuffer; From fe8e907b080c186a8205f303b9ab97a52f8e195e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 28 Mar 2017 15:52:51 -0500 Subject: [PATCH 2/3] [Performance] Remove unecessary log calls from EQStream hot paths (read/write) --- common/eq_stream_factory.cpp | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/common/eq_stream_factory.cpp b/common/eq_stream_factory.cpp index d58995623..429f258f6 100644 --- a/common/eq_stream_factory.cpp +++ b/common/eq_stream_factory.cpp @@ -23,18 +23,10 @@ ThreadReturnType EQStreamFactoryReaderLoop(void *eqfs) { -EQStreamFactory *fs=(EQStreamFactory *)eqfs; - -#ifndef WIN32 - Log.Out(Logs::Detail, Logs::None, "Starting EQStreamFactoryReaderLoop with thread ID %d", pthread_self()); -#endif + EQStreamFactory *fs=(EQStreamFactory *)eqfs; fs->ReaderLoop(); -#ifndef WIN32 - Log.Out(Logs::Detail, Logs::None, "Ending EQStreamFactoryReaderLoop with thread ID %d", pthread_self()); -#endif - THREAD_RETURN(nullptr); } @@ -42,16 +34,8 @@ ThreadReturnType EQStreamFactoryWriterLoop(void *eqfs) { EQStreamFactory *fs=(EQStreamFactory *)eqfs; -#ifndef WIN32 - Log.Out(Logs::Detail, Logs::None, "Starting EQStreamFactoryWriterLoop with thread ID %d", pthread_self()); -#endif - fs->WriterLoop(); -#ifndef WIN32 - Log.Out(Logs::Detail, Logs::None, "Ending EQStreamFactoryWriterLoop with thread ID %d", pthread_self()); -#endif - THREAD_RETURN(nullptr); } From af9a34e4e770351d393152ff64640929238826c9 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 28 Mar 2017 21:10:57 -0500 Subject: [PATCH 3/3] [Performance] Slow dynamic zones down when no clients are in them --- zone/net.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/net.cpp b/zone/net.cpp index 2746595cf..e254ff5b7 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -550,7 +550,7 @@ int main(int argc, char** argv) { #endif #endif } //end extra profiler block - if (is_zone_loaded) { + if (is_zone_loaded && numclients > 0) { Sleep(ZoneTimerResolution); } else {