Removed Common Profiler and Zone Profiler. They're well past outdated status and are just code bloat.

This commit is contained in:
KimLS
2013-08-29 15:46:40 -07:00
parent 406e2f84eb
commit fcd9b525a8
49 changed files with 23 additions and 866 deletions
-1
View File
@@ -94,7 +94,6 @@ SET(common_headers
bodytypes.h
breakdowns.h
classes.h
common_profile.h
Condition.h
crash.h
CRC16.h
-2
View File
@@ -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
-2
View File
@@ -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);
-14
View File
@@ -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
-2
View File
@@ -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
-1
View File
@@ -71,7 +71,6 @@ ThreadReturnType BaseTCPServer::TCPServerLoop(void* tmp) {
tcps->MLoopRunning.lock();
while (tcps->RunLoop()) {
_CP(BaseTCPServerLoop);
Sleep(SERVER_LOOP_GRANULARITY);
tcps->Process();
}
-103
View File
@@ -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
-1
View File
@@ -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;
-8
View File
@@ -11,7 +11,6 @@
#include <mysqld_error.h>
#include <limits.h>
#include "dbcore.h"
#include "common_profile.h"
#include <string.h>
//#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) {
+1 -6
View File
@@ -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;
-4
View File
@@ -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 <stdio.h>
-5
View File
@@ -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;
-7
View File
@@ -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)
-2
View File
@@ -59,8 +59,6 @@ void WorldConnection::OnConnected() {
}
void WorldConnection::Process() {
_CP(WorldConnection_Process);
//persistent connection....
if (!Connected()) {
pConnected = tcpc.Connected();