diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 286b678db..3d0c95f52 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -94,7 +94,6 @@ SET(common_headers bodytypes.h breakdowns.h classes.h - common_profile.h Condition.h crash.h CRC16.h diff --git a/common/Item.cpp b/common/Item.cpp index 0c750c238..1f74b1b85 100644 --- a/common/Item.cpp +++ b/common/Item.cpp @@ -531,7 +531,6 @@ ItemInst* ItemInstQueue::peek_front() const // Retrieve item at specified slot; returns false if item not found ItemInst* Inventory::GetItem(int16 slot_id) const { - _CP(Inventory_GetItem); ItemInst* result = nullptr; // Cursor @@ -862,7 +861,6 @@ bool Inventory::SwapItem(int16 slot_a, int16 slot_b) int16 Inventory::HasItem(uint32 item_id, uint8 quantity, uint8 where) { - _CP(Inventory_HasItem); int16 slot_id = SLOT_INVALID; //Altered by Father Nitwit to support a specification of diff --git a/common/MiscFunctions.cpp b/common/MiscFunctions.cpp index 45da67457..cf371adc1 100644 --- a/common/MiscFunctions.cpp +++ b/common/MiscFunctions.cpp @@ -185,7 +185,6 @@ const char * itoa(int num, char* a,int b) { */ int MakeRandomInt(int low, int high) { - _CP(MakeRandomInt); if(low >= high) return(low); @@ -203,7 +202,6 @@ int MakeRandomInt(int low, int high) double MakeRandomFloat(double low, double high) { - _CP(MakeRandomFloat); if(low >= high) return(low); diff --git a/common/Mutex.cpp b/common/Mutex.cpp index 5235e8483..763f10db4 100644 --- a/common/Mutex.cpp +++ b/common/Mutex.cpp @@ -85,21 +85,13 @@ Mutex::Mutex() { } Mutex::~Mutex() { -#if DEBUG_MUTEX_CLASS >= 7 - std::cout << "Deconstructing Mutex" << std::endl; -#endif #ifdef _WINDOWS DeleteCriticalSection(&CSMutex); #else -// pthread_mutex_destroy(&CSMutex); #endif } void Mutex::lock() { - _CP(Mutex_lock); -#if DEBUG_MUTEX_CLASS >= 9 - std::cout << "Locking Mutex" << std::endl; -#endif #if DEBUG_MUTEX_CLASS >= 5 if (!trylock()) { std::cout << "Locking Mutex: Having to wait" << std::endl; @@ -119,9 +111,6 @@ void Mutex::lock() { } bool Mutex::trylock() { -#if DEBUG_MUTEX_CLASS >= 9 - std::cout << "TryLocking Mutex" << std::endl; -#endif #ifdef _WINDOWS #if(_WIN32_WINNT >= 0x0400) if (TrylockSupported) @@ -140,9 +129,6 @@ bool Mutex::trylock() { } void Mutex::unlock() { -#if DEBUG_MUTEX_CLASS >= 9 - std::cout << "Unlocking Mutex" << std::endl; -#endif #ifdef _WINDOWS LeaveCriticalSection(&CSMutex); #else diff --git a/common/TCPConnection.cpp b/common/TCPConnection.cpp index 3ef538d02..5fe7b7ba8 100644 --- a/common/TCPConnection.cpp +++ b/common/TCPConnection.cpp @@ -904,7 +904,6 @@ ThreadReturnType TCPConnection::TCPConnectionLoop(void* tmp) { while (tcpc->RunLoop()) { Sleep(LOOP_GRANULARITY); if (!tcpc->ConnectReady()) { - _CP(TCPConnectionLoop); if (!tcpc->Process()) { //the processing loop has detecting an error.. //we want to drop the link immediately, so we clear buffers too. @@ -914,7 +913,6 @@ ThreadReturnType TCPConnection::TCPConnectionLoop(void* tmp) { Sleep(1); } else if (tcpc->GetAsyncConnect()) { - _CP(TCPConnectionLoop); if (tcpc->charAsyncConnect) tcpc->Connect(tcpc->charAsyncConnect, tcpc->GetrPort()); else diff --git a/common/TCPServer.cpp b/common/TCPServer.cpp index 415587b81..cfba6e94a 100644 --- a/common/TCPServer.cpp +++ b/common/TCPServer.cpp @@ -71,7 +71,6 @@ ThreadReturnType BaseTCPServer::TCPServerLoop(void* tmp) { tcps->MLoopRunning.lock(); while (tcps->RunLoop()) { - _CP(BaseTCPServerLoop); Sleep(SERVER_LOOP_GRANULARITY); tcps->Process(); } diff --git a/common/common_profile.h b/common/common_profile.h deleted file mode 100644 index 3dba80cbc..000000000 --- a/common/common_profile.h +++ /dev/null @@ -1,103 +0,0 @@ -/* EQEMu: Everquest Server Emulator - Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY except by those people which sell it, which - are required to give you total support for your newly bought product; - without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -#ifndef COMMON_PROFILE_H -#define COMMON_PROFILE_H - -#ifdef ZONE -#include "../common/features.h" - -#ifndef EQPROFILE -#ifdef COMMON_PROFILE -#undef COMMON_PROFILE -#endif -#endif - -#ifdef COMMON_PROFILE - -#include "../common/profiler.h" - -class CommonProfiler : public GeneralProfiler { -public: - enum { - Database_SaveInventory = 0, - Database_StoreCharacter, - Database_GetCharacterInfoForLogin, - Database_GetCharacterInfoForLogin_result, - Database_GetPlayerProfile, - Database_GetInventory, - Database_GetInventory_name, - Database_SetPlayerProfile, - Database_DBLoadItems, - Database_GetWaypoints, - Database_DBLoadNPCFactionLists, - - DBcore_RunQuery, - - DBAsync_ProcessWork, - DBAsync_DispatchWork, - DBAsyncLoop_loop, - - EQStreamServer_Process, - - EQStream_Process, - - EQStreamServerLoop, - EQStreamInLoop, - EQStreamOutLoop, - TCPServerLoop, - TCPConnectionLoop, - - Inventory_GetItem, - Inventory_HasItem, - - BaseTCPServerLoop, - - MakeRandomInt, - MakeRandomFloat, - - Mutex_lock, - Timer_Check, - - WorldConnection_Process, - - MaxCommonProfilerId - }; - - inline CommonProfiler() : GeneralProfiler(MaxCommonProfilerId) { } - -}; - -extern CommonProfiler _cp; - - -#define _CP(name) _GP(_cp, CommonProfiler, name) - -#else - //no zone profiling, dummy functions -#define _CP(name) ; - -#endif //COMMON_PROFILE - -#else //else !ZONE - -#define _CP(name) ; - -#endif //!ZONE - -#endif - diff --git a/common/database.cpp b/common/database.cpp index c9dfedba9..e856175a4 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -706,7 +706,6 @@ bool Database::DeleteCharacter(char *name) // Store new character information into the character_ and inventory tables bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inventory* inv, ExtendedProfile_Struct *ext) { - _CP(Database_StoreCharacter); char errbuf[MYSQL_ERRMSG_SIZE]; char query[256+sizeof(PlayerProfile_Struct)*2+sizeof(ExtendedProfile_Struct)*2+5]; char* end = query; diff --git a/common/dbasync.cpp b/common/dbasync.cpp index 5b23a47a2..4153bc6fa 100644 --- a/common/dbasync.cpp +++ b/common/dbasync.cpp @@ -11,7 +11,6 @@ #include #include #include "dbcore.h" -#include "common_profile.h" #include //#include "../common/MiscFunctions.h" #include "StringUtil.h" @@ -54,10 +53,8 @@ ThreadReturnType DBAsyncLoop(void* tmp) { //we could check dba->RunLoop() again to see if we //got turned off while we were waiting { - _CP(DBAsyncLoop_loop); dba->Process(); } -// Sleep(ASYNC_LOOP_GRANULARITY); } dba->MLoopRunning.unlock(); @@ -302,11 +299,7 @@ void DBAsync::CommitWrites() { } void DBAsync::ProcessWork(DBAsyncWork* iWork, bool iSleep) { - _CP(DBAsync_ProcessWork); DBAsyncQuery* CurrentQuery; -#if DEBUG_MYSQL_QUERIES >= 2 - std::cout << "Processing AsyncWork #" << iWork->GetWorkID() << std::endl; -#endif while ((CurrentQuery = iWork->PopQuery())) { CurrentQuery->Process(pDBC); iWork->PushAnswer(CurrentQuery); @@ -316,7 +309,6 @@ void DBAsync::ProcessWork(DBAsyncWork* iWork, bool iSleep) { } void DBAsync::DispatchWork(DBAsyncWork* iWork) { - _CP(DBAsync_DispatchWork); //if this work has a callback, call it //otherwise, stick the work on the finish queue if (iWork->pCB) { diff --git a/common/dbcore.cpp b/common/dbcore.cpp index 3f215cd0f..a2c6bc7f8 100644 --- a/common/dbcore.cpp +++ b/common/dbcore.cpp @@ -59,7 +59,6 @@ void DBcore::ping() { } bool DBcore::RunQuery(const char* query, uint32 querylen, char* errbuf, MYSQL_RES** result, uint32* affected_rows, uint32* last_insert_id, uint32* errnum, bool retry) { - _CP(DBcore_RunQuery); if (errnum) *errnum = 0; if (errbuf) @@ -68,11 +67,7 @@ bool DBcore::RunQuery(const char* query, uint32 querylen, char* errbuf, MYSQL_RE LockMutex lock(&MDatabase); if (pStatus != Connected) Open(); -#if DEBUG_MYSQL_QUERIES >= 1 - char tmp[120]; - strn0cpy(tmp, query, sizeof(tmp)); - std::cout << "QUERY: " << tmp << std::endl; -#endif + if (mysql_real_query(&mysql, query, querylen)) { if (mysql_errno(&mysql) == CR_SERVER_GONE_ERROR) pStatus = Error; diff --git a/common/debug.h b/common/debug.h index de04fe0ff..856e851e1 100644 --- a/common/debug.h +++ b/common/debug.h @@ -68,10 +68,6 @@ #endif #include "logsys.h" -#include "common_profile.h" -#ifdef ZONE -#include "../zone/zone_profile.h" -#endif #include "../common/Mutex.h" #include diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 7f0058af4..00f5355ab 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -200,7 +200,6 @@ bool SharedDatabase::VerifyInventory(uint32 account_id, int16 slot_id, const Ite } bool SharedDatabase::SaveInventory(uint32 char_id, const ItemInst* inst, int16 slot_id) { - _CP(Database_SaveInventory); char errbuf[MYSQL_ERRMSG_SIZE]; char* query = 0; bool ret = false; @@ -509,7 +508,6 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) { // Overloaded: Retrieve character inventory based on character id bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { - _CP(Database_GetInventory); char errbuf[MYSQL_ERRMSG_SIZE]; char* query = 0; MYSQL_RES* result; @@ -618,7 +616,6 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { // Overloaded: Retrieve character inventory based on account_id and character name bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv) { - _CP(Database_GetInventory_name); char errbuf[MYSQL_ERRMSG_SIZE]; char* query = 0; MYSQL_RES* result; @@ -1204,7 +1201,6 @@ bool SharedDatabase::LoadNPCFactionLists() { // character name "name". Return true if the character was found, otherwise false. // False will also be returned if there is a database error. bool SharedDatabase::GetPlayerProfile(uint32 account_id, char* name, PlayerProfile_Struct* pp, Inventory* inv, ExtendedProfile_Struct *ext, char* current_zone, uint32 *current_instance) { - _CP(Database_GetPlayerProfile); char errbuf[MYSQL_ERRMSG_SIZE]; char* query = 0; MYSQL_RES* result; @@ -1258,7 +1254,6 @@ bool SharedDatabase::GetPlayerProfile(uint32 account_id, char* name, PlayerProfi } bool SharedDatabase::SetPlayerProfile(uint32 account_id, uint32 charid, PlayerProfile_Struct* pp, Inventory* inv, ExtendedProfile_Struct *ext, uint32 current_zone, uint32 current_instance, uint8 MaxXTargets) { - _CP(Database_SetPlayerProfile); char errbuf[MYSQL_ERRMSG_SIZE]; char* query = 0; uint32 affected_rows = 0; diff --git a/common/timer.cpp b/common/timer.cpp index 637c8a563..eb6a081c2 100644 --- a/common/timer.cpp +++ b/common/timer.cpp @@ -82,13 +82,6 @@ int gettimeofday (timeval *tp, ...) /* This function checks if the timer triggered */ bool Timer::Check(bool iReset) { - _CP(Timer_Check); - if (this==0) { - std::cerr << "Null timer during ->Check()!?\n"; - return true; - } -// if (!current_time || !start_time || !timer_time) {cerr << "Timer::Check on a timer that does not have a vital member defined."; -// return true;} if (enabled && current_time-start_time > timer_time) { if (iReset) { if (pUseAcurateTiming) diff --git a/common/worldconn.cpp b/common/worldconn.cpp index 743ac920e..42375cb8a 100644 --- a/common/worldconn.cpp +++ b/common/worldconn.cpp @@ -59,8 +59,6 @@ void WorldConnection::OnConnected() { } void WorldConnection::Process() { - _CP(WorldConnection_Process); - //persistent connection.... if (!Connected()) { pConnected = tcpc.Connected(); diff --git a/world/net.cpp b/world/net.cpp index d8b9b3357..057367b00 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -68,14 +68,6 @@ #endif -/* -Zone only right now. -#ifdef EQPROFILE -#ifdef COMMON_PROFILE -CommonProfiler _cp; -#endif -#endif*/ - #include "zoneserver.h" #include "console.h" #include "LoginServer.h" diff --git a/zone/CMakeLists.txt b/zone/CMakeLists.txt index 4a5266ab1..3cf5b0cf2 100644 --- a/zone/CMakeLists.txt +++ b/zone/CMakeLists.txt @@ -112,7 +112,6 @@ SET(zone_sources worldserver.cpp zone.cpp zone_logsys.cpp - zone_profile.cpp ZoneConfig.cpp zonedb.cpp zonedbasync.cpp @@ -195,7 +194,6 @@ SET(zone_headers watermap.h worldserver.h zone.h - zone_profile.h ZoneConfig.h zonedb.h zonedbasync.h @@ -235,6 +233,4 @@ IF(UNIX) ADD_DEFINITIONS(-fPIC) ENDIF(UNIX) -INCLUDE_DIRECTORIES(${VLD_INCLUDE_DIR}) - SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/Bin) diff --git a/zone/Map.cpp b/zone/Map.cpp index 241d7bc53..95a6ba1a5 100644 --- a/zone/Map.cpp +++ b/zone/Map.cpp @@ -27,7 +27,6 @@ #define SLOW_AND_CRAPPY_MAKES_VALGRIND_HAPPY #endif -#include "zone_profile.h" #include "map.h" #include "zone.h" #ifdef _WINDOWS @@ -378,7 +377,6 @@ float Map::GetFaceHeight( int _idx, float x, float y ) const { bool Map::LineIntersectsZone(VERTEX start, VERTEX end, float step_mag, VERTEX *result, FACE **on) const { - _ZP(Map_LineIntersectsZone); // Cast a ray from start to end, checking for collisions in each node between the two points. // float stepx, stepy, stepz, curx, cury, curz; @@ -464,7 +462,6 @@ bool Map::LocWithinNode( NodeRef node_r, float x, float y ) const { } bool Map::LineIntersectsNode( NodeRef node_r, VERTEX p1, VERTEX p2, VERTEX *result, FACE **on) const { - _ZP(Map_LineIntersectsNode); if( node_r == NODE_NONE || node_r >= m_Nodes) { return(true); //can see through empty nodes, just allow LOS on error... } @@ -497,7 +494,6 @@ bool Map::LineIntersectsNode( NodeRef node_r, VERTEX p1, VERTEX p2, VERTEX *resu float Map::FindBestZ( NodeRef node_r, VERTEX p1, VERTEX *result, FACE **on) const { - _ZP(Map_FindBestZ); p1.z += RuleI(Map, FindBestZHeightAdjust); diff --git a/zone/MobAI.cpp b/zone/MobAI.cpp index 54b1ffc2f..773c720aa 100644 --- a/zone/MobAI.cpp +++ b/zone/MobAI.cpp @@ -47,8 +47,6 @@ extern Zone *zone; //NOTE: do NOT pass in beneficial and detrimental spell types into the same call here! bool NPC::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) { - _ZP(Mob_AICastSpell); -// Faction isnt checked here, it's assumed you wouldnt pass a spell type you wouldnt want casted on the mob if (!tar) return false; @@ -340,8 +338,6 @@ bool NPC::AIDoSpellCast(uint8 i, Mob* tar, int32 mana_cost, uint32* oDontDoAgain } bool EntityList::AICheckCloseBeneficialSpells(NPC* caster, uint8 iChance, float iRange, uint16 iSpellTypes) { - _ZP(EntityList_AICheckCloseBeneficialSpells); - if((iSpellTypes&SpellTypes_Detrimental) != 0) { //according to live, you can buff and heal through walls... //now with PCs, this only applies if you can TARGET the target, but @@ -991,8 +987,6 @@ void Client::AI_Process() } void Mob::AI_Process() { - _ZP(Mob_AI_Process); - if (!IsAIControlled()) return; @@ -1056,7 +1050,6 @@ void Mob::AI_Process() { if (engaged) { - _ZP(Mob_AI_Process_engaged); if (IsRooted()) SetTarget(hate_list.GetClosest(this)); else @@ -1449,7 +1442,6 @@ void Mob::AI_Process() { * by the clients. * */ - _ZP(Mob_AI_Process_scanarea); Mob* tmptar = entity_list.AICheckCloseAggro(this, GetAggroRange(), GetAssistRange()); if (tmptar) @@ -1457,11 +1449,9 @@ void Mob::AI_Process() { } else if (AImovement_timer->Check() && !IsRooted()) { - _ZP(Mob_AI_Process_move); SetRunAnimSpeed(0); if (IsPet()) { - _ZP(Mob_AI_Process_pet); // we're a pet, do as we're told switch (pStandingPetOrder) { @@ -1596,7 +1586,6 @@ void NPC::AI_DoMovement() { return; //this is idle movement at walk speed, and we are unable to walk right now. if (roambox_distance > 0) { - _ZP(Mob_AI_Process_roambox); if ( roambox_movingto_x > roambox_max_x || roambox_movingto_x < roambox_min_x @@ -1635,7 +1624,6 @@ void NPC::AI_DoMovement() { } else if (roamer) { - _ZP(Mob_AI_Process_roamer); if (AIwalking_timer->Check()) { movetimercompleted=true; @@ -1749,8 +1737,6 @@ void NPC::AI_DoMovement() { } else if (IsGuarding()) { - _ZP(Mob_AI_Process_guard); - bool CP2Moved; if(!RuleB(Pathing, Guard) || !zone->pathing) CP2Moved = CalculateNewPosition2(guard_x, guard_y, guard_z, walksp); @@ -1898,7 +1884,6 @@ void NPC::AI_Event_SpellCastFinished(bool iCastSucceeded, uint8 slot) { bool NPC::AI_EngagedCastCheck() { if (AIautocastspell_timer->Check(false)) { - _ZP(Mob_AI_Process_engaged_cast); AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting. mlog(AI__SPELLS, "Engaged autocast check triggered. Trying to cast healing spells then maybe offensive spells."); @@ -1922,7 +1907,6 @@ bool NPC::AI_EngagedCastCheck() { bool NPC::AI_PursueCastCheck() { if (AIautocastspell_timer->Check(false)) { - _ZP(Mob_AI_Process_pursue_cast); AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting. mlog(AI__SPELLS, "Engaged (pursuing) autocast check triggered. Trying to cast offensive spells."); @@ -1937,7 +1921,6 @@ bool NPC::AI_PursueCastCheck() { bool NPC::AI_IdleCastCheck() { if (AIautocastspell_timer->Check(false)) { - _ZP(Mob_AI_Process_autocast); #if MobAI_DEBUG_Spells >= 25 std::cout << "Non-Engaged autocast check triggered: " << this->GetName() << std::endl; #endif diff --git a/zone/aggro.cpp b/zone/aggro.cpp index 4c9c635dd..5215e1706 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -33,11 +33,9 @@ extern Zone* zone; //look around a client for things which might aggro the client. void EntityList::CheckClientAggro(Client *around) { - _ZP(EntityList_CheckClientAggro); LinkedListIterator iterator(mob_list); for(iterator.Reset(); iterator.MoreElements(); iterator.Advance()) { - _ZP(EntityList_CheckClientAggro_Loop); Mob* mob = iterator.GetData(); if(mob->IsClient()) //also ensures that mob != around continue; @@ -245,7 +243,6 @@ void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) { bool Mob::CheckWillAggro(Mob *mob) { if(!mob) return false; - _ZP(Mob_CheckWillAggro); //sometimes if a client has some lag while zoning into a dangerous place while either invis or a GM //they will aggro mobs even though it's supposed to be impossible, to lets make sure we've finished connecting @@ -369,7 +366,6 @@ bool Mob::CheckWillAggro(Mob *mob) { Mob* EntityList::AICheckCloseAggro(Mob* sender, float iAggroRange, float iAssistRange) { if (!sender || !sender->IsNPC()) return(nullptr); - _ZP(EntityList_AICheckCloseAggro); #ifdef REVERSE_AGGRO //with reverse aggro, npc->client is checked elsewhere, no need to check again @@ -433,7 +429,6 @@ int EntityList::GetHatedCount(Mob *attacker, Mob *exclude) { } void EntityList::AIYellForHelp(Mob* sender, Mob* attacker) { - _ZP(EntityList_AIYellForHelp); if(!sender || !attacker) return; if (sender->GetPrimaryFaction() == 0 ) @@ -1035,7 +1030,6 @@ bool Mob::CheckLosFN(float posX, float posY, float posZ, float mobSize) { return(false); #endif } - _ZP(Mob_CheckLosFN); VERTEX myloc; VERTEX oloc; diff --git a/zone/attack.cpp b/zone/attack.cpp index 61da974a6..f93e2f265 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -776,7 +776,6 @@ void Mob::MeleeMitigation(Mob *attacker, int32 &damage, int32 minhit, ExtraAttac //GetWeaponDamage(mob*, const Item_Struct*) is intended to be used for mobs or any other situation where we do not have a client inventory item //GetWeaponDamage(mob*, const ItemInst*) is intended to be used for situations where we have a client inventory item int Mob::GetWeaponDamage(Mob *against, const Item_Struct *weapon_item) { - _ZP(Mob_GetWeaponDamageA); int dmg = 0; int banedmg = 0; @@ -883,7 +882,6 @@ int Mob::GetWeaponDamage(Mob *against, const Item_Struct *weapon_item) { int Mob::GetWeaponDamage(Mob *against, const ItemInst *weapon_item, uint32 *hate) { - _ZP(Mob_GetWeaponDamageB); int dmg = 0; int banedmg = 0; @@ -1104,9 +1102,6 @@ int Mob::GetWeaponDamage(Mob *against, const ItemInst *weapon_item, uint32 *hate // IsFromSpell added to allow spell effects to use Attack. (Mainly for the Rampage AA right now.) bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool IsFromSpell, ExtraAttackOptions *opts) { - - _ZP(Client_Attack); - if (!other) { SetTarget(nullptr); LogFile->write(EQEMuLog::Error, "A null Mob object was passed to Client::Attack() for evaluation!"); @@ -1719,7 +1714,6 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool IsFromSpell, ExtraAttackOptions *opts) { - _ZP(NPC_Attack); int damage = 0; if (!other) { @@ -2046,7 +2040,6 @@ void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, SkillType attack_ski } bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_skill) { - _ZP(NPC_Death); mlog(COMBAT__HITS, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob->GetName(), damage, spell, attack_skill); Mob *oos = nullptr; @@ -2550,7 +2543,6 @@ void Mob::AddToHateList(Mob* other, int32 hate, int32 damage, bool iYellForHelp, if(IsNPC() && other->IsClient() && other->CastToClient()) parse->EventNPC(EVENT_AGGRO, this->CastToNPC(), other, "", 0); AI_Event_Engaged(other, iYellForHelp); - adverrorinfo = 8293; } } @@ -2637,23 +2629,11 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) { mlog(COMBAT__HITS, "Applying Reverse Damage Shield of value %d to %s", rev_ds, attacker->GetName()); attacker->Damage(this, -rev_ds, rev_ds_spell_id, ABJURE/*hackish*/, false); //"this" (us) will get the hate, etc. not sure how this works on Live, but it'll works for now, and tanks will love us for this //do we need to send a damage packet here also? - /* - EQApplicationPacket* outapp = new EQApplicationPacket(OP_Damage, sizeof(CombatDamage_Struct)); - CombatDamage_Struct* cds = (CombatDamage_Struct*)outapp->pBuffer; - cds->target = attacker->GetID(); - cds->source = GetID(); - cds->type = attacker->spellbonuses.ReverseDamageShieldType; - cds->spellid = 0x0; - cds->damage = rev_ds; - entity_list.QueueCloseClients(this, outapp); - safe_delete(outapp); - */ } } uint8 Mob::GetWeaponDamageBonus( const Item_Struct *Weapon ) { - _ZP(Mob_GetWeaponDamageBonus); // This function calculates and returns the damage bonus for the weapon identified by the parameter "Weapon". // Modified 9/21/2008 by Cantus @@ -3855,7 +3835,6 @@ void Mob::TryDefensiveProc(const ItemInst* weapon, Mob *on, uint16 hand, int dam } void Mob::TryWeaponProc(const ItemInst* weapon_g, Mob *on, uint16 hand) { - _ZP(Mob_TryWeaponProcA); if(!on) { SetTarget(nullptr); LogFile->write(EQEMuLog::Error, "A null Mob object was passed to Mob::TryWeaponProc for evaluation!"); @@ -3914,7 +3893,6 @@ void Mob::TryWeaponProc(const ItemInst* weapon_g, Mob *on, uint16 hand) { } void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct* weapon, Mob *on, uint16 hand) { - _ZP(Mob_TryWeaponProcB); uint16 skillinuse = 28; int ourlevel = GetLevel(); float ProcChance, ProcBonus; diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index 5bac6e143..ca0a35b1f 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -68,7 +68,6 @@ void NPC::CalcBonuses() void Client::CalcBonuses() { - _ZP(Client_CalcBonuses); memset(&itembonuses, 0, sizeof(StatBonuses)); CalcItemBonuses(&itembonuses); CalcEdibleBonuses(&itembonuses); diff --git a/zone/bot.cpp b/zone/bot.cpp index 6c74e7e1e..419cd6302 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -3048,8 +3048,6 @@ void Bot::SaveTimers() { bool Bot::Process() { - _ZP(Bot_Process); - if(IsStunned() && stunned_timer.Check()) { this->stunned = false; @@ -3495,8 +3493,6 @@ float Bot::GetMaxMeleeRangeToTarget(Mob* target) { // AI Processing for the Bot object void Bot::AI_Process() { - _ZP(Mob_BOT_Process); - if(!IsAIControlled()) return; @@ -3609,7 +3605,6 @@ void Bot::AI_Process() { if(IsEngaged()) { - _ZP(Mob_BOT_Process_IsEngaged); if(rest_timer.Enabled()) rest_timer.Disable(); @@ -3956,7 +3951,6 @@ void Bot::AI_Process() { // AI Processing for a Bot object's pet void Bot::PetAIProcess() { - _ZP(Bot_PET_Process); if( !HasPet() || !GetPet() || !GetPet()->IsNPC()) return; @@ -3983,7 +3977,6 @@ void Bot::PetAIProcess() { return; if (IsEngaged()) { - _ZP(Bot_PET_Process_IsEngaged); if (botPet->IsRooted()) botPet->SetTarget(hate_list.GetClosest(botPet)); @@ -6367,8 +6360,6 @@ void Bot::AddToHateList(Mob* other, int32 hate, int32 damage, bool iYellForHelp, bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, bool IsFromSpell, ExtraAttackOptions *opts) { - _ZP(Bot_Attack); - if (!other) { SetTarget(nullptr); LogFile->write(EQEMuLog::Error, "A null Mob object was passed to Bot::Attack for evaluation!"); @@ -8669,8 +8660,6 @@ void Bot::AI_Stop() { //iOther the mob who is doing the looking. It should figure out //what iOther thinks about 'this' FACTION_VALUE Bot::GetReverseFactionCon(Mob* iOther) { - _ZP(Bot_GetReverseFactionCon); - if(iOther->IsBot()) { return FACTION_ALLY; } @@ -9598,7 +9587,6 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t bool Result = false; if(zone && !zone->IsSpellBlocked(spell_id, GetX(), GetY(), GetZ())) { - _ZP(Bot_CastSpell); mlog(SPELLS__CASTING, "CastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item slot %d", spells[spell_id].name, spell_id, target_id, slot, cast_time, mana_cost, (item_slot==0xFFFFFFFF)?999:item_slot); @@ -15997,7 +15985,6 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { // This function has been reworked for the caster bots, when engaged. // Healers bots must heal thoses who loose HP. bool EntityList::Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, float iRange, uint16 iSpellTypes) { - _ZP(EntityList_Bot_AICheckCloseBeneficialSpells); if((iSpellTypes&SpellTypes_Detrimental) != 0) { //according to live, you can buff and heal through walls... diff --git a/zone/botspellsai.cpp b/zone/botspellsai.cpp index 191ed3a41..5e7e5f023 100644 --- a/zone/botspellsai.cpp +++ b/zone/botspellsai.cpp @@ -4,7 +4,6 @@ #include "../common/StringUtil.h" bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) { - _ZP(Bot_AICastSpell); if (!tar) { return false; @@ -856,7 +855,6 @@ bool Bot::AI_PursueCastCheck() { bool result = false; if (AIautocastspell_timer->Check(false)) { - _ZP(Bot_AI_Process_pursue_cast); AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting. @@ -887,7 +885,6 @@ bool Bot::AI_IdleCastCheck() { bool result = false; if (AIautocastspell_timer->Check(false)) { - _ZP(Bot_AI_IdleCastCheck); #if MobAI_DEBUG_Spells >= 25 cout << "Non-Engaged autocast check triggered: " << this->GetCleanName() << endl; #endif @@ -957,7 +954,6 @@ bool Bot::AI_EngagedCastCheck() { bool failedToCast = false; if (GetTarget() && AIautocastspell_timer->Check(false)) { - _ZP(Bot_AI_Process_engaged_cast); AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting. diff --git a/zone/client.cpp b/zone/client.cpp index 9d8707aea..572954974 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -488,7 +488,6 @@ bool Client::Save(uint8 iCommitNow) { if(!ClientDataLoaded()) return false; - _ZP(Client_Save); m_pp.x = x_pos; m_pp.y = y_pos; @@ -698,16 +697,6 @@ bool Client::SendAllPackets() { } void Client::QueuePacket(const EQApplicationPacket* app, bool ack_req, CLIENT_CONN_STATUS required_state, eqFilterType filter) { -/* if (app->opcode==0x9999) { - cout << "Sending an unknown opcode from: " << endl; - print_stacktrace(); - } - if (app->opcode==OP_SkillUpdate) { - cout << "Sending OP_SkillUpdate from: " << endl; - print_stacktrace(); - } -*/ - _ZP(Client_QueuePacket); if(filter!=FilterNone){ //this is incomplete... no support for FilterShowGroupOnly or FilterShowSelfOnly if(GetFilter(filter) == FilterHide) @@ -723,7 +712,6 @@ void Client::QueuePacket(const EQApplicationPacket* app, bool ack_req, CLIENT_CO { // todo: save packets for later use AddPacket(app, ack_req); -// LogFile->write(EQEMuLog::Normal, "Adding Packet to list (%d) (%d)", app->GetOpcode(), (int)required_state); } else if(eqs) @@ -7363,12 +7351,9 @@ FACTION_VALUE Client::GetReverseFactionCon(Mob* iOther) { //o-------------------------------------------------------------- FACTION_VALUE Client::GetFactionLevel(uint32 char_id, uint32 npc_id, uint32 p_race, uint32 p_class, uint32 p_deity, int32 pFaction, Mob* tnpc) { - _ZP(Client_GetFactionLevel); - if (pFaction < 0) return GetSpecialFactionCon(tnpc); FACTION_VALUE fac = FACTION_INDIFFERENT; - //int32 pFacValue; -Trumpcard: commenting. Not currently used. int32 tmpFactionValue; FactionMods fmods; @@ -7424,7 +7409,6 @@ FACTION_VALUE Client::GetFactionLevel(uint32 char_id, uint32 npc_id, uint32 p_ra //o-------------------------------------------------------------- void Client::SetFactionLevel(uint32 char_id, uint32 npc_id, uint8 char_class, uint8 char_race, uint8 char_deity) { - _ZP(Client_SetFactionLevel); int32 faction_id[MAX_NPC_FACTIONS]={ 0,0,0,0,0,0,0,0,0,0 }; int32 npc_value[MAX_NPC_FACTIONS]={ 0,0,0,0,0,0,0,0,0,0 }; uint8 temp[MAX_NPC_FACTIONS]={ 0,0,0,0,0,0,0,0,0,0 }; @@ -7517,7 +7501,6 @@ void Client::SetFactionLevel(uint32 char_id, uint32 npc_id, uint8 char_class, ui void Client::SetFactionLevel2(uint32 char_id, int32 faction_id, uint8 char_class, uint8 char_race, uint8 char_deity, int32 value, uint8 temp) { - _ZP(Client_SetFactionLevel2); int32 current_value; //Get the npc faction list if(faction_id > 0 && value != 0) { @@ -7562,7 +7545,6 @@ bool Client::HatedByClass(uint32 p_race, uint32 p_class, uint32 p_deity, int32 p { bool Result = false; - _ZP(Client_GetFactionLevel); int32 tmpFactionValue; FactionMods fmods; diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 3a7b69d8c..11dfc7be8 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -401,8 +401,6 @@ void ClearMappedOpcode(EmuOpcode op) { int Client::HandlePacket(const EQApplicationPacket *app) { - _ZP(Client_HandlePacket); - if(is_log_enabled(CLIENT__NET_IN_TRACE)) { char buffer[64]; app->build_header_dump(buffer); diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 3406d6fa4..2eead60a2 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -71,8 +71,6 @@ extern PetitionList petition_list; extern EntityList entity_list; bool Client::Process() { - _ZP(Client_Process); - adverrorinfo = 1; bool ret = true; if(Connected() || IsLD()) @@ -523,7 +521,6 @@ bool Client::Process() { } } - adverrorinfo = 2; if (position_timer.Check()) { if (IsAIControlled()) { @@ -599,9 +596,7 @@ bool Client::Process() { } } - adverrorinfo = 3; SpellProcess(); - adverrorinfo = 4; if (endupkeep_timer.Check() && !dead){ DoEnduranceUpkeep(); } @@ -690,8 +685,6 @@ bool Client::Process() { /************ Get all packets from packet manager out queue and process them ************/ - adverrorinfo = 5; - EQApplicationPacket *app = nullptr; if(!eqs->CheckState(CLOSING)) { @@ -721,24 +714,21 @@ bool Client::Process() { { GetMerc()->Depop(); } - adverrorinfo = 811; + client_state = CLIENT_LINKDEAD; - if (/*!loggedin || */zoning || instalog || GetGM()) + if (zoning || instalog || GetGM()) { - adverrorinfo = 811; Group *mygroup = GetGroup(); if (mygroup) { - adverrorinfo = 812; if (!zoning) { - entity_list.MessageGroup(this,true,15,"%s logged out.",GetName()); + entity_list.MessageGroup(this, true, 15, "%s logged out.", GetName()); mygroup->DelMember(this); } else { - entity_list.MessageGroup(this,true,15,"%s left the zone.",GetName()); + entity_list.MessageGroup(this, true, 15, "%s left the zone.", GetName()); mygroup->MemberZoned(this); } - adverrorinfo = 813; } Raid *myraid = entity_list.GetRaidByClient(this); if (myraid) @@ -757,7 +747,6 @@ bool Client::Process() { } else { - adverrorinfo = 814; LinkDead(); } OnDisconnect(true); @@ -766,7 +755,7 @@ bool Client::Process() { if (forget_timer.Check()) { forget_timer.Disable(); entity_list.ClearZoneFeignAggro(this); - Message(0,"Your enemies have forgotten you!"); + Message(0, "Your enemies have forgotten you!"); } return ret; diff --git a/zone/command.cpp b/zone/command.cpp index 259536aac..7080b4f3c 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -565,9 +565,6 @@ int command_add(const char *command_string, const char *desc, int access, CmdFun */ int command_realdispatch(Client *c, const char *message) { - _ZP(command_realdispatch); - - Seperator sep(message, ' ', 10, 100, true); // "three word argument" should be considered 1 arg command_logcommand(c, message); diff --git a/zone/entity.cpp b/zone/entity.cpp index 370a153d9..e19548465 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -323,7 +323,7 @@ void EntityList::AddClient(Client* client) { void EntityList::TrapProcess() { if(numclients < 1) return; - _ZP(EntityList_TrapProcess); + LinkedListIterator iterator(trap_list); iterator.Reset(); uint32 count=0; @@ -363,7 +363,6 @@ void EntityList::GroupProcess() { if(numclients < 1) return; - _ZP(EntityList_GroupProcess); iterator = group_list.begin(); while(iterator != group_list.end()) @@ -392,8 +391,6 @@ void EntityList::QueueToGroupsForNPCHealthAA(Mob* sender, const EQApplicationPac std::list::iterator iterator = group_list.begin(); - _ZP(EntityList_QueueToGroupsForNPCHealthAA); - while(iterator != group_list.end()) { (*iterator)->QueueHPPacketsForNPCHealthAA(sender, app); @@ -407,7 +404,6 @@ void EntityList::RaidProcess() { if(numclients < 1) return; - _ZP(EntityList_RaidProcess); iterator = raid_list.begin(); while(iterator != raid_list.end()) @@ -425,7 +421,6 @@ void EntityList::DoorProcess() { if(numclients < 1) return; #endif - _ZP(EntityList_DoorProcess); LinkedListIterator iterator(door_list); iterator.Reset(); uint32 count=0; @@ -443,7 +438,6 @@ void EntityList::DoorProcess() { } void EntityList::ObjectProcess() { - _ZP(EntityList_ObjectProcess); LinkedListIterator iterator(object_list); iterator.Reset(); uint32 count=0; @@ -461,7 +455,6 @@ void EntityList::ObjectProcess() { } void EntityList::CorpseProcess() { - _ZP(EntityList_CorpseProcess); LinkedListIterator iterator(corpse_list); iterator.Reset(); uint32 count=0; @@ -483,7 +476,6 @@ void EntityList::MobProcess() { if(numclients < 1) return; #endif - _ZP(EntityList_MobProcess); LinkedListIterator iterator(mob_list); iterator.Reset(); while(iterator.MoreElements()) @@ -532,7 +524,6 @@ void EntityList::MobProcess() { } void EntityList::BeaconProcess() { - _ZP(EntityList_BeaconProcess); LinkedListIterator iterator(beacon_list); int count; @@ -2626,7 +2617,6 @@ void EntityList::RemoveEntity(uint16 id) void EntityList::Process() { - _ZP(EntityList_Process); CheckSpawnQueue(); } diff --git a/zone/fearpath.cpp b/zone/fearpath.cpp index 3c96c3310..57a3de337 100644 --- a/zone/fearpath.cpp +++ b/zone/fearpath.cpp @@ -24,7 +24,6 @@ #include "../common/rulesys.h" #include "../common/MiscFunctions.h" -#include "zone_profile.h" #include "map.h" #include "zone.h" #include "pathing.h" diff --git a/zone/hate_list.cpp b/zone/hate_list.cpp index 7ff0ad61b..a6fb6be51 100644 --- a/zone/hate_list.cpp +++ b/zone/hate_list.cpp @@ -80,7 +80,6 @@ bool HateList::IsOnHateList(Mob *mob) tHateEntry *HateList::Find(Mob *ent) { - _ZP(HateList_Find); auto iterator = list.begin(); while(iterator != list.end()) { @@ -105,7 +104,6 @@ void HateList::Set(Mob* other, uint32 in_hate, uint32 in_dam) Mob* HateList::GetDamageTop(Mob* hater) { - _ZP(HateList_GetDamageTop); Mob* current = nullptr; Group* grp = nullptr; Raid* r = nullptr; @@ -149,7 +147,6 @@ Mob* HateList::GetDamageTop(Mob* hater) } Mob* HateList::GetClosest(Mob *hater) { - _ZP(HateList_GetClosest); Mob* close = nullptr; float closedist = 99999.9f; float thisdist; @@ -229,7 +226,6 @@ bool HateList::RemoveEnt(Mob *ent) } void HateList::DoFactionHits(int32 nfl_id) { - _ZP(HateList_DoFactionHits); if (nfl_id <= 0) return; auto iterator = list.begin(); @@ -250,7 +246,6 @@ void HateList::DoFactionHits(int32 nfl_id) { Mob *HateList::GetTop(Mob *center) { - _ZP(HateList_GetTop); Mob* top = nullptr; int32 hate = -1; @@ -406,8 +401,6 @@ Mob *HateList::GetTop(Mob *center) } Mob *HateList::GetMostHate(){ - _ZP(HateList_GetMostHate); - Mob* top = nullptr; int32 hate = -1; @@ -453,8 +446,6 @@ int32 HateList::GetEntHate(Mob *ent, bool damage) //looking for any mob with hate > -1 bool HateList::IsEmpty() { - _ZP(HateList_IsEmpty); - return(list.size() == 0); } diff --git a/zone/loottables.cpp b/zone/loottables.cpp index 889d2727f..00ff4b62d 100644 --- a/zone/loottables.cpp +++ b/zone/loottables.cpp @@ -29,9 +29,6 @@ // Queries the loottable: adds item & coin to the npc void ZoneDatabase::AddLootTableToNPC(NPC* npc,uint32 loottable_id, ItemList* itemlist, uint32* copper, uint32* silver, uint32* gold, uint32* plat) { - _ZP(Database_AddLootTableToNPC); -//if (loottable_id == 178190) -//DebugBreak(); const LootTable_Struct* lts = 0; *copper = 0; *silver = 0; diff --git a/zone/lua_client.cpp b/zone/lua_client.cpp index 3595af26f..dd48b88d2 100644 --- a/zone/lua_client.cpp +++ b/zone/lua_client.cpp @@ -1204,27 +1204,27 @@ void Lua_Client::QueuePacket(Lua_Packet app, bool ack_req, int client_connection self->QueuePacket(app, ack_req, static_cast(client_connection_status), static_cast(filter)); } -int32 Lua_Client::GetHunger() { +int Lua_Client::GetHunger() { Lua_Safe_Call_Int(); return self->GetHunger(); } -int32 Lua_Client::GetThirst() { +int Lua_Client::GetThirst() { Lua_Safe_Call_Int(); return self->GetThirst(); } -void Lua_Client::SetHunger(int32 in_hunger) { +void Lua_Client::SetHunger(int in_hunger) { Lua_Safe_Call_Void(); self->SetHunger(in_hunger); } -void Lua_Client::SetThirst(int32 in_thirst) { +void Lua_Client::SetThirst(int in_thirst) { Lua_Safe_Call_Void(); self->SetThirst(in_thirst); } -void Lua_Client::SetConsumption(int32 in_hunger, int32 in_thirst) { +void Lua_Client::SetConsumption(int in_hunger, int in_thirst) { Lua_Safe_Call_Void(); self->SetConsumption(in_hunger, in_thirst); } @@ -1469,11 +1469,11 @@ luabind::scope lua_register_client() { .def("QueuePacket", (void(Lua_Client::*)(Lua_Packet,bool))&Lua_Client::QueuePacket) .def("QueuePacket", (void(Lua_Client::*)(Lua_Packet,bool,int))&Lua_Client::QueuePacket) .def("QueuePacket", (void(Lua_Client::*)(Lua_Packet,bool,int,int))&Lua_Client::QueuePacket) - .def("GetHunger", (int32(Lua_Client::*)(void))&Lua_Client::GetHunger) - .def("GetThirst", (int32(Lua_Client::*)(void))&Lua_Client::GetThirst) - .def("SetHunger", (void(Lua_Client::*)(int32))&Lua_Client::SetHunger) - .def("SetThirst", (void(Lua_Client::*)(int32))&Lua_Client::SetThirst) - .def("SetConsumption", (void(Lua_Client::*)(int32, int32))&Lua_Client::SetConsumption); + .def("GetHunger", (int(Lua_Client::*)(void))&Lua_Client::GetHunger) + .def("GetThirst", (int(Lua_Client::*)(void))&Lua_Client::GetThirst) + .def("SetHunger", (void(Lua_Client::*)(int))&Lua_Client::SetHunger) + .def("SetThirst", (void(Lua_Client::*)(int))&Lua_Client::SetThirst) + .def("SetConsumption", (void(Lua_Client::*)(int, int))&Lua_Client::SetConsumption); } luabind::scope lua_register_inventory_where() { diff --git a/zone/lua_client.h b/zone/lua_client.h index 4de2bd8df..82443f29c 100644 --- a/zone/lua_client.h +++ b/zone/lua_client.h @@ -268,11 +268,11 @@ public: void QueuePacket(Lua_Packet app, bool ack_req); void QueuePacket(Lua_Packet app, bool ack_req, int client_connection_status); void QueuePacket(Lua_Packet app, bool ack_req, int client_connection_status, int filter); - int32 GetHunger(); - int32 GetThirst(); - void SetHunger(int32 in_hunger); - void SetThirst(int32 in_thirst); - void SetConsumption(int32 in_hunger, int32 in_thirst); + int GetHunger(); + int GetThirst(); + void SetHunger(int in_hunger); + void SetThirst(int in_thirst); + void SetConsumption(int in_hunger, int in_thirst); }; #endif diff --git a/zone/merc.cpp b/zone/merc.cpp index b0df06e35..6905f6007 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -81,20 +81,14 @@ Merc::~Merc() { void Merc::CalcBonuses() { - //_ZP(Merc_CalcBonuses); memset(&itembonuses, 0, sizeof(StatBonuses)); memset(&aabonuses, 0, sizeof(StatBonuses)); CalcItemBonuses(&itembonuses); CalcSpellBonuses(&spellbonuses); - //_log(AA__BONUSES, "Calculating AA Bonuses for %s.", this->GetCleanName()); - //CalcAABonuses(&aabonuses); //we're not quite ready for this - //_log(AA__BONUSES, "Finished calculating AA Bonuses for %s.", this->GetCleanName()); - CalcAC(); CalcATK(); - //CalcHaste(); CalcSTR(); CalcSTA(); @@ -1500,8 +1494,6 @@ void Merc::AI_Process() { if(IsEngaged()) { - _ZP(Mob_BOT_Process_IsEngaged); - if(rest_timer.Enabled()) rest_timer.Disable(); @@ -1868,7 +1860,6 @@ bool Merc::AI_EngagedCastCheck() { bool failedToCast = false; if (GetTarget() && AIautocastspell_timer->Check(false)) { - _ZP(Merc_AI_Process_engaged_cast); AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting. @@ -1926,7 +1917,6 @@ bool Merc::AI_IdleCastCheck() { bool failedToCast = false; if (AIautocastspell_timer->Check(false)) { - _ZP(Merc_AI_IdleCastCheck); #if MobAI_DEBUG_Spells >= 25 std::cout << "Non-Engaged autocast check triggered: " << this->GetCleanName() << std::endl; #endif @@ -1973,7 +1963,6 @@ bool Merc::AI_IdleCastCheck() { } bool EntityList::Merc_AICheckCloseBeneficialSpells(Merc* caster, uint8 iChance, float iRange, uint32 iSpellTypes) { - _ZP(EntityList_Merc_AICheckCloseBeneficialSpells); if((iSpellTypes&SpellTypes_Detrimental) != 0) { //according to live, you can buff and heal through walls... @@ -2083,7 +2072,6 @@ bool Merc::AIDoSpellCast(uint16 spellid, Mob* tar, int32 mana_cost, uint32* oDon } bool Merc::AICastSpell(int8 iChance, int32 iSpellTypes) { - _ZP(Bot_AICastSpell); if(!AI_HasSpells()) return false; @@ -4714,9 +4702,6 @@ void Merc::DoClassAttacks(Mob *target) { bool Merc::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool IsFromSpell, ExtraAttackOptions *opts) { - - _ZP(Client_Attack); - if (!other) { SetTarget(nullptr); LogFile->write(EQEMuLog::Error, "A null Mob object was passed to Merc::Attack() for evaluation!"); diff --git a/zone/mob.cpp b/zone/mob.cpp index e62024b64..2b978eb03 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -124,7 +124,6 @@ Mob::Mob(const char* in_name, move_tic_count = 0; _egnode = nullptr; - adverrorinfo = 0; name[0]=0; orig_name[0]=0; clean_name[0]=0; @@ -2180,7 +2179,6 @@ bool Mob::CanThisClassBlock(void) const } float Mob::Dist(const Mob &other) const { - _ZP(Mob_Dist); float xDiff = other.x_pos - x_pos; float yDiff = other.y_pos - y_pos; float zDiff = other.z_pos - z_pos; @@ -2191,7 +2189,6 @@ float Mob::Dist(const Mob &other) const { } float Mob::DistNoZ(const Mob &other) const { - _ZP(Mob_DistNoZ); float xDiff = other.x_pos - x_pos; float yDiff = other.y_pos - y_pos; @@ -2200,7 +2197,6 @@ float Mob::DistNoZ(const Mob &other) const { } float Mob::DistNoRoot(const Mob &other) const { - _ZP(Mob_DistNoRoot); float xDiff = other.x_pos - x_pos; float yDiff = other.y_pos - y_pos; float zDiff = other.z_pos - z_pos; @@ -2211,7 +2207,6 @@ float Mob::DistNoRoot(const Mob &other) const { } float Mob::DistNoRoot(float x, float y, float z) const { - _ZP(Mob_DistNoRoot); float xDiff = x - x_pos; float yDiff = y - y_pos; float zDiff = z - z_pos; @@ -2222,7 +2217,6 @@ float Mob::DistNoRoot(float x, float y, float z) const { } float Mob::DistNoRootNoZ(float x, float y) const { - _ZP(Mob_DistNoRoot); float xDiff = x - x_pos; float yDiff = y - y_pos; @@ -2230,7 +2224,6 @@ float Mob::DistNoRootNoZ(float x, float y) const { } float Mob::DistNoRootNoZ(const Mob &other) const { - _ZP(Mob_DistNoRootNoZ); float xDiff = other.x_pos - x_pos; float yDiff = other.y_pos - y_pos; diff --git a/zone/mob.h b/zone/mob.h index e9c8ddac4..8404c3804 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -640,7 +640,6 @@ public: inline bool IsStunned() const { return stunned; } inline bool IsSilenced() const { return silenced; } inline bool IsAmnesiad() const { return amnesiad; } - inline uint16 GetErrorNumber() const {return adverrorinfo;} int32 ReduceDamage(int32 damage); int32 AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTic, Mob* attacker); @@ -1052,7 +1051,6 @@ protected: Timer gravity_timer; Timer viral_timer; uint8 viral_timer_counter; - uint16 adverrorinfo; // MobAI stuff eStandingPetOrder pStandingPetOrder; diff --git a/zone/net.cpp b/zone/net.cpp index c07749855..a3b75dbaa 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -333,7 +333,6 @@ int main(int argc, char** argv) { temp_timer.Start(); while(RunLoops) { { //profiler block to omit the sleep from times - _ZP(net_main); //Advance the timer to our current point in time Timer::SetCurrentTime(); diff --git a/zone/npc.cpp b/zone/npc.cpp index 0113326bd..4d5557964 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -560,9 +560,6 @@ void NPC::RemoveCash() { bool NPC::Process() { - _ZP(NPC_Process); - - adverrorinfo = 1; if (IsStunned() && stunned_timer.Check()) { this->stunned = false; @@ -583,8 +580,6 @@ bool NPC::Process() return false; } - adverrorinfo = 2; - SpellProcess(); if(tic_timer.Check()) @@ -2321,8 +2316,6 @@ bool NPC::CanTalk() //iOther the mob who is doing the looking. It should figure out //what iOther thinks about 'this' FACTION_VALUE NPC::GetReverseFactionCon(Mob* iOther) { - _ZP(NPC_GetReverseFactionCon); - iOther = iOther->GetOwnerOrSelf(); int primaryFaction= iOther->GetPrimaryFaction(); diff --git a/zone/pathing.cpp b/zone/pathing.cpp index 904e50dac..96ad5b25a 100644 --- a/zone/pathing.cpp +++ b/zone/pathing.cpp @@ -23,8 +23,6 @@ extern Zone *zone; float VertexDistance(VERTEX a, VERTEX b) { - _ZP(Pathing_VertexDistance); - float xdist = a.x - b.x; float ydist = a.y - b.y; float zdist = a.z - b.z; @@ -33,8 +31,6 @@ float VertexDistance(VERTEX a, VERTEX b) float VertexDistanceNoRoot(VERTEX a, VERTEX b) { - _ZP(Pathing_VertexDistanceNoRoot); - float xdist = a.x - b.x; float ydist = a.y - b.y; float zdist = a.z - b.z; @@ -211,8 +207,6 @@ VERTEX PathManager::GetPathNodeCoordinates(int NodeNumber, bool BestZ) std::list PathManager::FindRoute(int startID, int endID) { - _ZP(Pathing_FindRoute_FromNodes); - _log(PATHING__DEBUG, "FindRoute from node %i to %i", startID, endID); memset(ClosedListFlag, 0, sizeof(int) * Head.PathNodeCount); @@ -358,9 +352,6 @@ bool SortPathNodesByDistance(PathNodeSortStruct n1, PathNodeSortStruct n2) std::list PathManager::FindRoute(VERTEX Start, VERTEX End) { - - _ZP(Pathing_FindRoute_FromVertices); - _log(PATHING__DEBUG, "FindRoute(%8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f)", Start.x, Start.y, Start.z, End.x, End.y, End.z); std::list noderoute; @@ -663,8 +654,6 @@ void PathManager::SimpleMeshTest() VERTEX Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &WaypointChanged, bool &NodeReached) { - _ZP(Pathing_UpdatePath); - WaypointChanged = false; NodeReached = false; @@ -1153,8 +1142,6 @@ int PathManager::FindNearestPathNode(VERTEX Position) bool PathManager::NoHazards(VERTEX From, VERTEX To) { - _ZP(Pathing_NoHazards); - // Test the Z coordinate at the mid point. // VERTEX MidPoint((From.x + To.x) / 2, (From.y + To.y) / 2, From.z); @@ -1293,9 +1280,6 @@ void Mob::PrintRoute() void PathManager::OpenDoors(int Node1, int Node2, Mob *ForWho) { - - _ZP(Pathing_OpenDoors); - if(!ForWho || (Node1 >= Head.PathNodeCount) || (Node2 >= Head.PathNodeCount) || (Node1 < 0) || (Node2 < 0)) return; diff --git a/zone/spawn2.cpp b/zone/spawn2.cpp index 30071ad33..a2426dd2c 100644 --- a/zone/spawn2.cpp +++ b/zone/spawn2.cpp @@ -138,8 +138,6 @@ uint32 Spawn2::despawnTimer(uint32 despawn_timer) } bool Spawn2::Process() { - _ZP(Spawn2_Process); - IsDespawned = false; if(!Enabled()) diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 0d43ee3c5..435795d0c 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -45,8 +45,6 @@ extern WorldServer worldserver; // in this case false will be returned, true otherwise bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) { - _ZP(Mob_SpellEffect); - int caster_level, buffslot, effect, effect_value, i; ItemInst *SummonedItem=nullptr; #ifdef SPELL_EFFECT_SPAM @@ -3056,8 +3054,6 @@ void Mob::BuffProcess() } void Mob::DoBuffTic(uint16 spell_id, int slot, uint32 ticsremaining, uint8 caster_level, Mob* caster) { - _ZP(Mob_DoBuffTic); - int effect, effect_value; if(!IsValidSpell(spell_id)) diff --git a/zone/spells.cpp b/zone/spells.cpp index 2aa1d1b0a..fb400032a 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -167,8 +167,6 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_time, int32 mana_cost, uint32* oSpellWillFinish, uint32 item_slot, uint32 timer, uint32 timer_duration, uint32 type, int16 *resist_adjust) { - _ZP(Mob_CastSpell); - mlog(SPELLS__CASTING, "CastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item slot %d", spells[spell_id].name, spell_id, target_id, slot, cast_time, mana_cost, (item_slot==0xFFFFFFFF)?999:item_slot); @@ -330,8 +328,6 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, uint32 item_slot, uint32 timer, uint32 timer_duration, uint32 type, int16 resist_adjust) { - _ZP(Mob_DoCastSpell); - Mob* pMob = nullptr; int32 orgcasttime; EQApplicationPacket *outapp = nullptr; @@ -800,8 +796,6 @@ void Mob::InterruptSpell(uint16 message, uint16 color, uint16 spellid) void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, uint16 mana_used, uint32 inventory_slot, int16 resist_adjust) { - _ZP(Mob_CastedSpellFinished); - bool IsFromItem = false; if(IsClient() && slot != USE_ITEM_SPELL_SLOT && slot != POTION_BELT_SPELL_SLOT && spells[spell_id].recast_time > 1000) { // 10 is item @@ -1676,8 +1670,6 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 mana_used, uint32 inventory_slot, int16 resist_adjust, bool isproc) { - _ZP(Mob_SpellFinished); - //EQApplicationPacket *outapp = nullptr; Mob *ae_center = nullptr; @@ -3741,7 +3733,6 @@ void Mob::BuffFadeByEffect(int effectid, int skipslot) // returns true if the spell should fail, false otherwise bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { - _ZP(Mob_IsImmuneToSpell); int effect_index; if(caster == nullptr) diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index c00d629f8..64f8230a5 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -520,8 +520,6 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b if(GetID()==0) return true; - _ZP(Mob_CalculateNewPosition2); - if ((x_pos-x == 0) && (y_pos-y == 0)) {//spawn is at target coords if(z_pos-z != 0) { z_pos = z; @@ -755,12 +753,9 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec if(GetID()==0) return true; - _ZP(Mob_CalculateNewPosition); - float nx = x_pos; float ny = y_pos; float nz = z_pos; -// float nh = heading; // if NPC is rooted if (speed == 0.0) { @@ -917,14 +912,12 @@ void NPC::AssignWaypoints(int32 grid) { if(!GridErr) { this->CastToNPC()->SetGrid(grid); // Assign grid number - adverrorinfo = 7561; // Retrieve all waypoints for this grid if(database.RunQuery(query,MakeAnyLenString(&query,"SELECT `x`,`y`,`z`,`pause`,`heading` FROM grid_entries WHERE `gridid`=%i AND `zoneid`=%i ORDER BY `number`",grid,zone->GetZoneID()),errbuf,&result)) { roamer = true; max_wp = -1; // Initialize it; will increment it for each waypoint successfully added to the list - adverrorinfo = 7564; while((row = mysql_fetch_row(result))) { @@ -1084,7 +1077,6 @@ uint8 ZoneDatabase::GetGridType2(uint32 grid, uint16 zoneid) { } bool ZoneDatabase::GetWaypoints(uint32 grid, uint16 zoneid, uint32 num, wplist* wp) { - _CP(Database_GetWaypoints); char *query = 0; char errbuff[MYSQL_ERRMSG_SIZE]; MYSQL_RES *result; diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index aecffb906..edadc94f3 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -135,8 +135,6 @@ void WorldServer::OnConnected() { } void WorldServer::Process() { - _ZP(WorldServer_Process); - WorldConnection::Process(); if (!Connected()) diff --git a/zone/zone.cpp b/zone/zone.cpp index 0ef69d39d..1a294e10b 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -81,7 +81,6 @@ extern DBAsyncFinishedQueue MTdbafq; extern DBAsync *dbasync; bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { - _ZP(Zone_Bootup); const char* zonename = database.GetZoneName(iZoneID); if (iZoneID == 0 || zonename == 0) @@ -1272,10 +1271,6 @@ uint32 Zone::CountAuth() { } bool Zone::Process() { - LockMutex lock(&MZoneLock); - _ZP(Zone_Process); - - spawn_conditions.Process(); if(spawn2_timer.Check()) { @@ -1430,7 +1425,6 @@ bool Zone::Process() { } void Zone::StartShutdownTimer(uint32 set_time) { - MZoneLock.lock(); if (set_time > autoshutdown_timer.GetRemainingTime()) { if (set_time == (RuleI(Zone, AutoShutdownDelay))) { @@ -1438,11 +1432,10 @@ void Zone::StartShutdownTimer(uint32 set_time) { } autoshutdown_timer.Start(set_time, false); } - MZoneLock.unlock(); } bool Zone::Depop(bool StartSpawnTimer) { -std::map::iterator itr; + std::map::iterator itr; entity_list.Depop(StartSpawnTimer); // Refresh npctable, getting current info from database. @@ -1462,7 +1455,6 @@ void Zone::Repop(uint32 delay) { LinkedListIterator iterator(spawn2_list); - MZoneLock.lock(); iterator.Reset(); while (iterator.MoreElements()) { iterator.RemoveCurrent(); @@ -1471,8 +1463,6 @@ void Zone::Repop(uint32 delay) { if (!database.PopulateZoneSpawnList(zoneid, spawn2_list, GetInstanceVersion(), delay)) LogFile->write(EQEMuLog::Debug, "Error in Zone::Repop: database.PopulateZoneSpawnList failed"); - MZoneLock.unlock(); - initgrids_timer.Start(); //MODDING HOOK FOR REPOP diff --git a/zone/zone.h b/zone/zone.h index f9012b314..0b340acaa 100644 --- a/zone/zone.h +++ b/zone/zone.h @@ -322,7 +322,6 @@ private: QGlobalCache *qGlobals; Timer hotzone_timer; - Mutex MZoneLock; }; #endif diff --git a/zone/zone_profile.cpp b/zone/zone_profile.cpp deleted file mode 100644 index 56b7bd9a2..000000000 --- a/zone/zone_profile.cpp +++ /dev/null @@ -1,299 +0,0 @@ -/* EQEMu: Everquest Server Emulator - Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY except by those people which sell it, which - are required to give you total support for your newly bought product; - without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -#include "../common/debug.h" -#include "../common/features.h" - -#ifdef EQPROFILE -#include "zone_profile.h" -#include "../common/common_profile.h" -#include "../common/timer.h" -#include "../common/rdtsc.h" - -#include -#include -#ifdef WIN32 - #include - - #define snprintf _snprintf - #define vsnprintf _vsnprintf - #define strncasecmp _strnicmp - #define strcasecmp _stricmp -#else - #include - #include - #include -#endif - -#include -#include - -#ifdef COMMON_PROFILE -CommonProfiler _cp; -#endif -#ifdef ZONE_PROFILE -ZoneProfiler _zp; -#endif - -class _DZP_Data { -public: - _DZP_Data(const char *_str, unsigned long long _count, double _dur) { - str = _str; - count = _count; - dur = _dur; - } - - const char *str; - unsigned long long count; - double dur; -}; - -bool operator<(const _DZP_Data &l, const _DZP_Data &r) { - return(l.dur < r.dur); -} - -RDTSC_Collector __DZP_timer(true); - -#ifdef COMMON_PROFILE -/* - -*/ -const char *__cp_names[CommonProfiler::MaxCommonProfilerId] = { - "Database_SaveInventory = 0", - "Database_StoreCharacter", - "Database_GetCharacterInfoForLogin", - "Database_GetCharacterInfoForLogin_result", - "Database_GetPlayerProfile", - "Database_GetInventory", - "Database_GetInventory_name", - "Database_SetPlayerProfile", - "Database_DBLoadItems", - "Database_GetWaypoints", - "Database_DBLoadNPCFactionLists", - - "DBcore_RunQuery", - - "DBAsync_ProcessWork", - "DBAsync_DispatchWork", - "DBAsyncLoop_loop", - - "EQStreamServer_Process", - - "EQStream_Process", - - "EQStreamServerLoop", - "EQStreamInLoop", - "EQStreamOutLoop", - "TCPServerLoop", - "TCPConnectionLoop", - - "Inventory_GetItem", - "Inventory_HasItem", - - "MakeRandomFloat", - - "Mutex_lock", - "Timer_Check", - - "WorldConnection_Process" -}; -#endif - -#ifdef ZONE_PROFILE -const char *__zp_names[ZoneProfiler::MaxZoneProfilerId] = { - "Client_Process = 0", - "Client_HandlePacket", - "Client_QueuePacket", - "Client_Save", - "Client_Attack", - "Client_CalcBonuses", - "Client_GetFactionLevel", - "Client_SetFactionLevel", - "Client_SetFactionLevel2", - - "NPC_Attack", - "NPC_GetReverseFactionCon", - "NPC_Process", - "NPC_Death", -#ifdef EQBOTS - "NPC_BotAttackMelee", -#endif - - "EntityList_TrapProcess", - "EntityList_GroupProcess", - "EntityList_QueueToGroupsForNPCHealthAA", - "EntityList_DoorProcess", - "EntityList_ObjectProcess", - "EntityList_CorpseProcess", - "EntityList_MobProcess", - "EntityList_BeaconProcess", - "EntityList_Process", - "EntityList_RaidProcess", - "EntityList_AICheckCloseAggro", - "EntityList_AICheckCloseBeneficialSpells", - "EntityList_CheckClientAggro", - "EntityList_CheckClientAggro_Loop", - "EntityList_AIYellForHelp", -#ifdef EQBOTS - "EntityList_Bot_AICheckCloseBeneficialSpells", -#endif - - "HateList_Find", - "HateList_GetDamageTop", - "HateList_GetClosest", - "HateList_DoFactionHits", - "HateList_GetTop", - "HateList_IsEmpty", - "HateList_GetMostHate", - - "Mob_CheckWillAggro", - "Mob_CheckLosFN", - "Mob_Dist", - "Mob_DistNoZ", - "Mob_DistNoRoot", - "Mob_DistNoRootNoZ", - "Mob_AICastSpell", - "Mob_SpellEffect", - "Mob_DoBuffTic", - "Mob_CastSpell", - "Mob_DoCastSpell", - "Mob_CastedSpellFinished", - "Mob_SpellFinished", - "Mob_IsImmuneToSpell", - "Mob_CalculateNewPosition", - "Mob_CalculateNewPosition2", - "Mob_GetWeaponDamageA", - "Mob_GetWeaponDamage", - "Mob_GetWeaponDamageBonus", - "Mob_TryWeaponProcA", - "Mob_TryWeaponProcB", -#ifdef EQBOTS - "NPC_Bot_AICastSpell", - "Bot_AI_Process_pursue_cast", - "Bot_PET_Process_IsEngaged", -#endif - - "Map_LineIntersectsZone", - "Map_LineIntersectsNode", - "Map_FindBestZ", - - "Pathing_FindRoute_FromNodes", - "Pathing_CheckTerrainPassable", - "Pathing_FindRoute_FromVertices", - "Pathing_UpdatePath", - "Pathing_NoHazards", - "Pathing_OpenDoors", - "Pathing_VertexDistance", - "Pathing_VertexDistanceNoRoot", - - "Mob_AI_Process", - "Mob_AI_Process_engaged", - "Mob_AI_Process_engaged_cast", - "Mob_AI_Process_pursue_cast", - "Mob_AI_Process_autocast", - "Mob_AI_Process_scanarea", - "Mob_AI_Process_move", - "Mob_AI_Process_pet", - "Mob_AI_Process_roambox", - "Mob_AI_Process_roamer", - "Mob_AI_Process_guard", -#ifdef EQBOTS - "Mob_BOT_Process", - "Mob_BOT_Process_IsEngaged", - "Bot_AI_Process_engaged_cast", - "NPC_Bot_AI_IdleCastCheck", -#endif - - "Database_AddLootTableToNPC", - - "Zone_Bootup", - "Zone_Process", - - "WorldServer_Process", - - "Spawn2_Process", - - "PerlembParser_SendCommands", - "PerlXSParser_SendCommands", - - "command_realdispatch", - "net_main" -}; -#endif - -void DumpZoneProfile() { - __DZP_timer.stop(); - time_t aclock; - struct tm *newtime; - - time( &aclock ); /* Get time in seconds */ - newtime = localtime( &aclock ); /* Convert time to struct */ - LogFile->write(EQEMuLog::Debug, "Profiling dump at: [%02d/%02d - %02d:%02d:%02d] (%.2f ms of data)", - newtime->tm_mon+1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec, - __DZP_timer.getTotalDuration()); - - std::vector<_DZP_Data> data; - - - int r; -#ifdef COMMON_PROFILE - //Dump common profile - for(r = 0; r < CommonProfiler::MaxCommonProfilerId; r++) { - data.push_back(_DZP_Data(__cp_names[r], _cp.getCount(r), _cp.getTotalDuration(r))); - } -#endif - -#ifdef ZONE_PROFILE - //Dump zone profile - for(r = 0; r < ZoneProfiler::MaxZoneProfilerId; r++) { - data.push_back(_DZP_Data(__zp_names[r], _zp.getCount(r), _zp.getTotalDuration(r))); - } -#endif - - sort(data.begin(), data.end()); - - std::vector<_DZP_Data>::iterator cur,end; - cur = data.begin(); - end = data.end(); - - for(; cur != end; cur++) { - if(cur->count == 0) - continue; //dont print empty timers. - - LogFile->write(EQEMuLog::Debug, "..%s: %llu calls, %.4fms", cur->str, (unsigned long long)cur->count, cur->dur); - } - - LogFile->write(EQEMuLog::Debug, "End Profiling dump at: [%02d/%02d - %02d:%02d:%02d] (%.2f ms of data)", - newtime->tm_mon+1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec, - __DZP_timer.getTotalDuration()); - - __DZP_timer.start(); -} - -void ResetZoneProfile() { - LogFile->write(EQEMuLog::Debug, "Profiling information reset..."); -#ifdef COMMON_PROFILE - _cp.reset(); -#endif -#ifdef ZONE_PROFILE - _zp.reset(); -#endif - __DZP_timer.reset(); -} - -#endif //EQPROFILE - diff --git a/zone/zone_profile.h b/zone/zone_profile.h deleted file mode 100644 index 071612d65..000000000 --- a/zone/zone_profile.h +++ /dev/null @@ -1,165 +0,0 @@ -/* EQEMu: Everquest Server Emulator - Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY except by those people which sell it, which - are required to give you total support for your newly bought product; - without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -#ifndef ZONE_PROFILE_H -#define ZONE_PROFILE_H - -#ifdef ZONE //only possibly profile if we are building zone -#include "../common/features.h" -#endif - -#ifdef EQPROFILE - extern void DumpZoneProfile(); - extern void ResetZoneProfile(); - #ifdef PROFILE_DUMP_TIME - extern void ProfilerProcess(); - #endif -#else - #ifdef ZONE_PROFILE //no EQPROFILE == no zone profile - #undef ZONE_PROFILE - #endif -#endif - -#ifdef ZONE_PROFILE - -#include "../common/profiler.h" - -class ZoneProfiler : public GeneralProfiler { -public: - enum { - Client_Process = 0, - Client_HandlePacket, - Client_QueuePacket, - Client_Save, - Client_Attack, - Client_CalcBonuses, - Client_GetFactionLevel, - Client_SetFactionLevel, - Client_SetFactionLevel2, - - NPC_Attack, - NPC_GetReverseFactionCon, - NPC_Process, - NPC_Death, - - EntityList_TrapProcess, - EntityList_GroupProcess, - EntityList_QueueToGroupsForNPCHealthAA, - EntityList_DoorProcess, - EntityList_ObjectProcess, - EntityList_CorpseProcess, - EntityList_MobProcess, - EntityList_BeaconProcess, - EntityList_Process, - EntityList_RaidProcess, - EntityList_AICheckCloseAggro, - EntityList_AICheckCloseBeneficialSpells, - EntityList_CheckClientAggro, - EntityList_CheckClientAggro_Loop, - EntityList_AIYellForHelp, - - HateList_Find, - HateList_GetDamageTop, - HateList_GetClosest, - HateList_DoFactionHits, - HateList_GetTop, - HateList_IsEmpty, - HateList_GetMostHate, - - Mob_CheckWillAggro, - Mob_CheckLosFN, - Mob_Dist, - Mob_DistNoZ, - Mob_DistNoRoot, - Mob_DistNoRootNoZ, - Mob_AICastSpell, - Mob_SpellEffect, - Mob_DoBuffTic, - Mob_CastSpell, - Mob_DoCastSpell, - Mob_CastedSpellFinished, - Mob_SpellFinished, - Mob_IsImmuneToSpell, - Mob_CalculateNewPosition, - Mob_CalculateNewPosition2, - Mob_GetWeaponDamageA, - Mob_GetWeaponDamageB, - Mob_GetWeaponDamageBonus, - Mob_TryWeaponProcA, - Mob_TryWeaponProcB, - - Map_LineIntersectsZone, - Map_LineIntersectsNode, - Map_FindBestZ, - - Pathing_FindRoute_FromNodes, - Pathing_CheckTerrainPassable, - Pathing_FindRoute_FromVertices, - Pathing_UpdatePath, - Pathing_NoHazards, - Pathing_OpenDoors, - Pathing_VertexDistance, - Pathing_VertexDistanceNoRoot, - - Mob_AI_Process, - Mob_AI_Process_engaged, - Mob_AI_Process_engaged_cast, - Mob_AI_Process_pursue_cast, - Mob_AI_Process_autocast, - Mob_AI_Process_scanarea, - Mob_AI_Process_move, - Mob_AI_Process_pet, - Mob_AI_Process_roambox, - Mob_AI_Process_roamer, - Mob_AI_Process_guard, - - - - Database_AddLootTableToNPC, - - Zone_Bootup, - Zone_Process, - - WorldServer_Process, - - Spawn2_Process, - - PerlembParser_SendCommands, - PerlXSParser_SendCommands, - - command_realdispatch, - - net_main, - - MaxZoneProfilerId - }; - - inline ZoneProfiler() : GeneralProfiler(MaxZoneProfilerId) { } - -}; - -extern ZoneProfiler _zp; - -#define _ZP(name) _GP(_zp, ZoneProfiler, name) -#else - //no zone profiling, dummy functions -#define _ZP(name) ; - -#endif //ZONE_PROFILE - -#endif - diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 065a26c99..47d88ae4d 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -833,7 +833,6 @@ bool ZoneDatabase::GetCharacterInfoForLogin(const char* name, uint32* character_ char* current_zone, PlayerProfile_Struct* pp, Inventory* inv, ExtendedProfile_Struct *ext, uint32* pplen, uint32* guilddbid, uint8* guildrank, uint8 *class_, uint8 *level, bool *LFP, bool *LFG, uint8 *NumXTargets, uint8 *firstlogon) { - _CP(Database_GetCharacterInfoForLogin); char errbuf[MYSQL_ERRMSG_SIZE]; char *query = 0; uint32 querylen; @@ -871,7 +870,6 @@ bool ZoneDatabase::GetCharacterInfoForLogin_result(MYSQL_RES* result, uint32* character_id, char* current_zone, PlayerProfile_Struct* pp, Inventory* inv, ExtendedProfile_Struct *ext, uint32* pplen, uint32* guilddbid, uint8* guildrank, uint8 *class_, uint8 *level, bool *LFP, bool *LFG, uint8 *NumXTargets, uint8* firstlogon) { - _CP(Database_GetCharacterInfoForLogin_result); MYSQL_ROW row; unsigned long* lengths;