Consolidate EQEmuLogsys::Debug calls into DebugCategory

This commit is contained in:
Akkadius 2015-01-17 23:59:06 -06:00
parent 7d14fad782
commit d45ed9befa
15 changed files with 116 additions and 116 deletions

View File

@ -26,13 +26,13 @@ ThreadReturnType EQStreamFactoryReaderLoop(void *eqfs)
EQStreamFactory *fs=(EQStreamFactory *)eqfs; EQStreamFactory *fs=(EQStreamFactory *)eqfs;
#ifndef WIN32 #ifndef WIN32
logger.LogDebug(EQEmuLogSys::Detail, "Starting EQStreamFactoryReaderLoop with thread ID %d", pthread_self()); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting EQStreamFactoryReaderLoop with thread ID %d", pthread_self());
#endif #endif
fs->ReaderLoop(); fs->ReaderLoop();
#ifndef WIN32 #ifndef WIN32
logger.LogDebug(EQEmuLogSys::Detail, "Ending EQStreamFactoryReaderLoop with thread ID %d", pthread_self()); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending EQStreamFactoryReaderLoop with thread ID %d", pthread_self());
#endif #endif
THREAD_RETURN(nullptr); THREAD_RETURN(nullptr);
@ -43,13 +43,13 @@ ThreadReturnType EQStreamFactoryWriterLoop(void *eqfs)
EQStreamFactory *fs=(EQStreamFactory *)eqfs; EQStreamFactory *fs=(EQStreamFactory *)eqfs;
#ifndef WIN32 #ifndef WIN32
logger.LogDebug(EQEmuLogSys::Detail, "Starting EQStreamFactoryWriterLoop with thread ID %d", pthread_self()); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting EQStreamFactoryWriterLoop with thread ID %d", pthread_self());
#endif #endif
fs->WriterLoop(); fs->WriterLoop();
#ifndef WIN32 #ifndef WIN32
logger.LogDebug(EQEmuLogSys::Detail, "Ending EQStreamFactoryWriterLoop with thread ID %d", pthread_self()); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending EQStreamFactoryWriterLoop with thread ID %d", pthread_self());
#endif #endif
THREAD_RETURN(nullptr); THREAD_RETURN(nullptr);

View File

@ -50,6 +50,7 @@ public:
/* If you add to this, make sure you update LogCategoryName */ /* If you add to this, make sure you update LogCategoryName */
enum LogCategory { enum LogCategory {
None = 0,
Zone_Server = 1, Zone_Server = 1,
World_Server, World_Server,
UCS_Server, UCS_Server,

View File

@ -68,7 +68,7 @@ ThreadReturnType BaseTCPServer::TCPServerLoop(void* tmp) {
BaseTCPServer* tcps = (BaseTCPServer*) tmp; BaseTCPServer* tcps = (BaseTCPServer*) tmp;
#ifndef WIN32 #ifndef WIN32
logger.LogDebug(EQEmuLogSys::Detail, "Starting TCPServerLoop with thread ID %d", pthread_self()); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting TCPServerLoop with thread ID %d", pthread_self());
#endif #endif
tcps->MLoopRunning.lock(); tcps->MLoopRunning.lock();
@ -79,7 +79,7 @@ ThreadReturnType BaseTCPServer::TCPServerLoop(void* tmp) {
tcps->MLoopRunning.unlock(); tcps->MLoopRunning.unlock();
#ifndef WIN32 #ifndef WIN32
logger.LogDebug(EQEmuLogSys::Detail, "Ending TCPServerLoop with thread ID %d", pthread_self()); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending TCPServerLoop with thread ID %d", pthread_self());
#endif #endif
THREAD_RETURN(nullptr); THREAD_RETURN(nullptr);

View File

@ -785,7 +785,6 @@ bool ZoneServer::Process() {
} }
case ServerOP_RequestOnlineGuildMembers: { case ServerOP_RequestOnlineGuildMembers: {
ServerRequestOnlineGuildMembers_Struct *srogms = (ServerRequestOnlineGuildMembers_Struct*) pack->pBuffer; ServerRequestOnlineGuildMembers_Struct *srogms = (ServerRequestOnlineGuildMembers_Struct*) pack->pBuffer;
zlog(GUILDS__IN_PACKETS, "ServerOP_RequestOnlineGuildMembers Recieved. FromID=%i GuildID=%i", srogms->FromID, srogms->GuildID);
client_list.SendOnlineGuildMembers(srogms->FromID, srogms->GuildID); client_list.SendOnlineGuildMembers(srogms->FromID, srogms->GuildID);
break; break;
} }

View File

@ -759,7 +759,7 @@ void Client::CompleteConnect()
//enforce some rules.. //enforce some rules..
if (!CanBeInZone()) { if (!CanBeInZone()) {
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Kicking char from zone, not allowed here"); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Kicking char from zone, not allowed here");
GoToSafeCoords(database.GetZoneID("arena"), 0); GoToSafeCoords(database.GetZoneID("arena"), 0);
return; return;
} }
@ -9136,7 +9136,7 @@ void Client::Handle_OP_LoadSpellSet(const EQApplicationPacket *app)
void Client::Handle_OP_Logout(const EQApplicationPacket *app) void Client::Handle_OP_Logout(const EQApplicationPacket *app)
{ {
logger.LogDebug(EQEmuLogSys::Detail, "%s sent a logout packet.", GetName()); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "%s sent a logout packet.", GetName());
SendLogoutPackets(); SendLogoutPackets();

View File

@ -240,7 +240,7 @@ void Client::AddEXP(uint32 in_add_exp, uint8 conlevel, bool resexp) {
} }
void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) {
logger.LogDebug(EQEmuLogSys::Detail, "Attempting to Set Exp for %s (XP: %u, AAXP: %u, Rez: %s)", this->GetCleanName(), set_exp, set_aaxp, isrezzexp ? "true" : "false"); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Attempting to Set Exp for %s (XP: %u, AAXP: %u, Rez: %s)", this->GetCleanName(), set_exp, set_aaxp, isrezzexp ? "true" : "false");
//max_AAXP = GetEXPForLevel(52) - GetEXPForLevel(51); //GetEXPForLevel() doesn't depend on class/race, just level, so it shouldn't change between Clients //max_AAXP = GetEXPForLevel(52) - GetEXPForLevel(51); //GetEXPForLevel() doesn't depend on class/race, just level, so it shouldn't change between Clients
max_AAXP = RuleI(AA, ExpPerPoint); //this may be redundant since we're doing this in Client::FinishConnState2() max_AAXP = RuleI(AA, ExpPerPoint); //this may be redundant since we're doing this in Client::FinishConnState2()
if (max_AAXP == 0 || GetEXPForLevel(GetLevel()) == 0xFFFFFFFF) { if (max_AAXP == 0 || GetEXPForLevel(GetLevel()) == 0xFFFFFFFF) {
@ -308,7 +308,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) {
//figure out how many AA points we get from the exp were setting //figure out how many AA points we get from the exp were setting
m_pp.aapoints = set_aaxp / max_AAXP; m_pp.aapoints = set_aaxp / max_AAXP;
logger.LogDebug(EQEmuLogSys::Detail, "Calculating additional AA Points from AAXP for %s: %u / %u = %.1f points", this->GetCleanName(), set_aaxp, max_AAXP, (float)set_aaxp / (float)max_AAXP); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Calculating additional AA Points from AAXP for %s: %u / %u = %.1f points", this->GetCleanName(), set_aaxp, max_AAXP, (float)set_aaxp / (float)max_AAXP);
//get remainder exp points, set in PP below //get remainder exp points, set in PP below
set_aaxp = set_aaxp - (max_AAXP * m_pp.aapoints); set_aaxp = set_aaxp - (max_AAXP * m_pp.aapoints);

View File

@ -167,11 +167,11 @@ void Mob::CalculateNewFearpoint()
fear_walkto_z = Loc.z; fear_walkto_z = Loc.z;
curfp = true; curfp = true;
logger.LogDebug(EQEmuLogSys::Detail, "Feared to node %i (%8.3f, %8.3f, %8.3f)", Node, Loc.x, Loc.y, Loc.z); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Feared to node %i (%8.3f, %8.3f, %8.3f)", Node, Loc.x, Loc.y, Loc.z);
return; return;
} }
logger.LogDebug(EQEmuLogSys::Detail, "No path found to selected node. Falling through to old fear point selection."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No path found to selected node. Falling through to old fear point selection.");
} }
int loop = 0; int loop = 0;

View File

@ -2866,7 +2866,7 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool
if (log) { if (log) {
logger.Log(EQEmuLogSys::Error, "Target interrogate inventory flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE")); logger.Log(EQEmuLogSys::Error, "Target interrogate inventory flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE"));
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Client::InterrogateInventory() -- End"); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::InterrogateInventory() -- End");
} }
if (!silent) { if (!silent) {
requester->Message(1, "Target interrogation flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE")); requester->Message(1, "Target interrogation flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE"));
@ -2881,7 +2881,7 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool
void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 head, int16 index, const ItemInst* inst, const ItemInst* parent, bool log, bool silent, bool &error, int depth) void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 head, int16 index, const ItemInst* inst, const ItemInst* parent, bool log, bool silent, bool &error, int depth)
{ {
if (depth >= 10) { if (depth >= 10) {
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Client::InterrogateInventory_() - Recursion count has exceeded the maximum allowable (You have a REALLY BIG PROBLEM!!)"); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::InterrogateInventory_() - Recursion count has exceeded the maximum allowable (You have a REALLY BIG PROBLEM!!)");
return; return;
} }

View File

@ -343,7 +343,7 @@ int main(int argc, char** argv) {
RegisterAllPatches(stream_identifier); RegisterAllPatches(stream_identifier);
#ifndef WIN32 #ifndef WIN32
logger.LogDebug(EQEmuLogSys::Detail, "Main thread running with thread id %d", pthread_self()); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Main thread running with thread id %d", pthread_self());
#endif #endif
Timer quest_timers(100); Timer quest_timers(100);

View File

@ -207,7 +207,7 @@ Map::Vertex PathManager::GetPathNodeCoordinates(int NodeNumber, bool BestZ)
std::deque<int> PathManager::FindRoute(int startID, int endID) std::deque<int> PathManager::FindRoute(int startID, int endID)
{ {
logger.LogDebug(EQEmuLogSys::Detail, "FindRoute from node %i to %i", startID, endID); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "FindRoute from node %i to %i", startID, endID);
memset(ClosedListFlag, 0, sizeof(int) * Head.PathNodeCount); memset(ClosedListFlag, 0, sizeof(int) * Head.PathNodeCount);
@ -330,7 +330,7 @@ std::deque<int> PathManager::FindRoute(int startID, int endID)
} }
} }
logger.LogDebug(EQEmuLogSys::Detail, "Unable to find a route."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Unable to find a route.");
return Route; return Route;
} }
@ -352,7 +352,7 @@ auto path_compare = [](const PathNodeSortStruct& a, const PathNodeSortStruct& b)
std::deque<int> PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) std::deque<int> PathManager::FindRoute(Map::Vertex Start, Map::Vertex End)
{ {
logger.LogDebug(EQEmuLogSys::Detail, "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); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "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::deque<int> noderoute; std::deque<int> noderoute;
@ -386,7 +386,7 @@ std::deque<int> PathManager::FindRoute(Map::Vertex Start, Map::Vertex End)
for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator)
{ {
logger.LogDebug(EQEmuLogSys::Detail, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id);
if(!zone->zonemap->LineIntersectsZone(Start, PathNodes[(*Iterator).id].v, 1.0f, nullptr)) if(!zone->zonemap->LineIntersectsZone(Start, PathNodes[(*Iterator).id].v, 1.0f, nullptr))
{ {
@ -396,11 +396,11 @@ std::deque<int> PathManager::FindRoute(Map::Vertex Start, Map::Vertex End)
} }
if(ClosestPathNodeToStart <0 ) { if(ClosestPathNodeToStart <0 ) {
logger.LogDebug(EQEmuLogSys::Detail, "No LOS to any starting Path Node within range."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any starting Path Node within range.");
return noderoute; return noderoute;
} }
logger.LogDebug(EQEmuLogSys::Detail, "Closest Path Node To Start: %2d", ClosestPathNodeToStart); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Closest Path Node To Start: %2d", ClosestPathNodeToStart);
// Find the nearest PathNode the end point has LOS to // Find the nearest PathNode the end point has LOS to
@ -424,8 +424,8 @@ std::deque<int> PathManager::FindRoute(Map::Vertex Start, Map::Vertex End)
for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator)
{ {
logger.LogDebug(EQEmuLogSys::Detail, "Checking Reachability of Node %i from End Position.", PathNodes[(*Iterator).id].id); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from End Position.", PathNodes[(*Iterator).id].id);
logger.LogDebug(EQEmuLogSys::Detail, " (%8.3f, %8.3f, %8.3f) to (%8.3f, %8.3f, %8.3f)", logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " (%8.3f, %8.3f, %8.3f) to (%8.3f, %8.3f, %8.3f)",
End.x, End.y, End.z, End.x, End.y, End.z,
PathNodes[(*Iterator).id].v.x, PathNodes[(*Iterator).id].v.y, PathNodes[(*Iterator).id].v.z); PathNodes[(*Iterator).id].v.x, PathNodes[(*Iterator).id].v.y, PathNodes[(*Iterator).id].v.z);
@ -437,11 +437,11 @@ std::deque<int> PathManager::FindRoute(Map::Vertex Start, Map::Vertex End)
} }
if(ClosestPathNodeToEnd < 0) { if(ClosestPathNodeToEnd < 0) {
logger.LogDebug(EQEmuLogSys::Detail, "No LOS to any end Path Node within range."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any end Path Node within range.");
return noderoute; return noderoute;
} }
logger.LogDebug(EQEmuLogSys::Detail, "Closest Path Node To End: %2d", ClosestPathNodeToEnd); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Closest Path Node To End: %2d", ClosestPathNodeToEnd);
if(ClosestPathNodeToStart == ClosestPathNodeToEnd) if(ClosestPathNodeToStart == ClosestPathNodeToEnd)
{ {
@ -673,7 +673,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
if(To == From) if(To == From)
return To; return To;
logger.LogDebug(EQEmuLogSys::Detail, "UpdatePath. From(%8.3f, %8.3f, %8.3f) To(%8.3f, %8.3f, %8.3f)", From.x, From.y, From.z, To.x, To.y, To.z); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "UpdatePath. From(%8.3f, %8.3f, %8.3f) To(%8.3f, %8.3f, %8.3f)", From.x, From.y, From.z, To.x, To.y, To.z);
if(From == PathingLastPosition) if(From == PathingLastPosition)
{ {
@ -681,7 +681,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
if((PathingLoopCount > 5) && !IsRooted()) if((PathingLoopCount > 5) && !IsRooted())
{ {
logger.LogDebug(EQEmuLogSys::Detail, "appears to be stuck. Teleporting them to next position.", GetName()); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "appears to be stuck. Teleporting them to next position.", GetName());
if(Route.size() == 0) if(Route.size() == 0)
{ {
@ -721,7 +721,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
// If we are already pathing, and the destination is the same as before ... // If we are already pathing, and the destination is the same as before ...
if(SameDestination) if(SameDestination)
{ {
logger.LogDebug(EQEmuLogSys::Detail, " Still pathing to the same destination."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Still pathing to the same destination.");
// Get the coordinates of the first path node we are going to. // Get the coordinates of the first path node we are going to.
NextNode = Route.front(); NextNode = Route.front();
@ -732,7 +732,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
// We have reached the path node. // We have reached the path node.
if(NodeLoc == From) if(NodeLoc == From)
{ {
logger.LogDebug(EQEmuLogSys::Detail, " Arrived at node %i", NextNode); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Arrived at node %i", NextNode);
NodeReached = true; NodeReached = true;
@ -746,17 +746,17 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
// target, and we may run past the target if we don't check LOS at this point. // target, and we may run past the target if we don't check LOS at this point.
int RouteSize = Route.size(); int RouteSize = Route.size();
logger.LogDebug(EQEmuLogSys::Detail, "Route size is %i", RouteSize); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Route size is %i", RouteSize);
if((RouteSize == 2) if((RouteSize == 2)
|| ((PathingTraversedNodes >= RuleI(Pathing, MinNodesTraversedForLOSCheck)) || ((PathingTraversedNodes >= RuleI(Pathing, MinNodesTraversedForLOSCheck))
&& (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck)) && (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck))
&& PathingLOSCheckTimer->Check())) && PathingLOSCheckTimer->Check()))
{ {
logger.LogDebug(EQEmuLogSys::Detail, " Checking distance to target."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking distance to target.");
float Distance = VertexDistanceNoRoot(From, To); float Distance = VertexDistanceNoRoot(From, To);
logger.LogDebug(EQEmuLogSys::Detail, " Distance between From and To (NoRoot) is %8.3f", Distance); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Distance between From and To (NoRoot) is %8.3f", Distance);
if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort))
&& (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold)))
@ -765,18 +765,18 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
PathingLOSState = HaveLOS; PathingLOSState = HaveLOS;
else else
PathingLOSState = NoLOS; PathingLOSState = NoLOS;
logger.LogDebug(EQEmuLogSys::Detail, "NoLOS"); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS");
if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To))
{ {
logger.LogDebug(EQEmuLogSys::Detail, " No hazards. Running directly to target."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target.");
Route.clear(); Route.clear();
return To; return To;
} }
else else
{ {
logger.LogDebug(EQEmuLogSys::Detail, " Continuing on node path."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path.");
} }
} }
else else
@ -802,7 +802,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
if(Route.size() == 0) if(Route.size() == 0)
{ {
logger.LogDebug(EQEmuLogSys::Detail, "Missing node after teleport."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Missing node after teleport.");
return To; return To;
} }
@ -812,7 +812,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
Teleport(NodeLoc); Teleport(NodeLoc);
logger.LogDebug(EQEmuLogSys::Detail, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z);
Route.pop_front(); Route.pop_front();
@ -823,7 +823,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
} }
zone->pathing->OpenDoors(PathingLastNodeVisited, NextNode, this); zone->pathing->OpenDoors(PathingLastNodeVisited, NextNode, this);
logger.LogDebug(EQEmuLogSys::Detail, " Now moving to node %i", NextNode); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Now moving to node %i", NextNode);
return zone->pathing->GetPathNodeCoordinates(NextNode); return zone->pathing->GetPathNodeCoordinates(NextNode);
} }
@ -831,7 +831,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
{ {
// we have run all the nodes, all that is left is the direct path from the last node // we have run all the nodes, all that is left is the direct path from the last node
// to the destination // to the destination
logger.LogDebug(EQEmuLogSys::Detail, " Reached end of node path, running direct to target."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Reached end of node path, running direct to target.");
return To; return To;
} }
@ -845,11 +845,11 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
&& (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck)) && (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck))
&& PathingLOSCheckTimer->Check()) && PathingLOSCheckTimer->Check())
{ {
logger.LogDebug(EQEmuLogSys::Detail, " Checking distance to target."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking distance to target.");
float Distance = VertexDistanceNoRoot(From, To); float Distance = VertexDistanceNoRoot(From, To);
logger.LogDebug(EQEmuLogSys::Detail, " Distance between From and To (NoRoot) is %8.3f", Distance); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Distance between From and To (NoRoot) is %8.3f", Distance);
if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort))
&& (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold)))
@ -858,18 +858,18 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
PathingLOSState = HaveLOS; PathingLOSState = HaveLOS;
else else
PathingLOSState = NoLOS; PathingLOSState = NoLOS;
logger.LogDebug(EQEmuLogSys::Detail, "NoLOS"); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS");
if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To))
{ {
logger.LogDebug(EQEmuLogSys::Detail, " No hazards. Running directly to target."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target.");
Route.clear(); Route.clear();
return To; return To;
} }
else else
{ {
logger.LogDebug(EQEmuLogSys::Detail, " Continuing on node path."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path.");
} }
} }
else else
@ -881,7 +881,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
{ {
// We get here if we were already pathing, but our destination has now changed. // We get here if we were already pathing, but our destination has now changed.
// //
logger.LogDebug(EQEmuLogSys::Detail, " Target has changed position."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Target has changed position.");
// Update our record of where we are going to. // Update our record of where we are going to.
PathingDestination = To; PathingDestination = To;
// Check if we now have LOS etc to the new destination. // Check if we now have LOS etc to the new destination.
@ -892,23 +892,23 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort))
&& (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold)))
{ {
logger.LogDebug(EQEmuLogSys::Detail, " Checking for short LOS at distance %8.3f.", Distance); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking for short LOS at distance %8.3f.", Distance);
if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr)) if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr))
PathingLOSState = HaveLOS; PathingLOSState = HaveLOS;
else else
PathingLOSState = NoLOS; PathingLOSState = NoLOS;
logger.LogDebug(EQEmuLogSys::Detail, "NoLOS"); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS");
if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To))
{ {
logger.LogDebug(EQEmuLogSys::Detail, " No hazards. Running directly to target."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target.");
Route.clear(); Route.clear();
return To; return To;
} }
else else
{ {
logger.LogDebug(EQEmuLogSys::Detail, " Continuing on node path."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path.");
} }
} }
} }
@ -919,19 +919,19 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
{ {
if(!PathingRouteUpdateTimerShort->Check()) if(!PathingRouteUpdateTimerShort->Check())
{ {
logger.LogDebug(EQEmuLogSys::Detail, "Short route update timer not yet expired."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Short route update timer not yet expired.");
return zone->pathing->GetPathNodeCoordinates(Route.front()); return zone->pathing->GetPathNodeCoordinates(Route.front());
} }
logger.LogDebug(EQEmuLogSys::Detail, "Short route update timer expired."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Short route update timer expired.");
} }
else else
{ {
if(!PathingRouteUpdateTimerLong->Check()) if(!PathingRouteUpdateTimerLong->Check())
{ {
logger.LogDebug(EQEmuLogSys::Detail, "Long route update timer not yet expired."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Long route update timer not yet expired.");
return zone->pathing->GetPathNodeCoordinates(Route.front()); return zone->pathing->GetPathNodeCoordinates(Route.front());
} }
logger.LogDebug(EQEmuLogSys::Detail, "Long route update timer expired."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Long route update timer expired.");
} }
// We are already pathing, destination changed, no LOS. Find the nearest node to our destination. // We are already pathing, destination changed, no LOS. Find the nearest node to our destination.
@ -940,7 +940,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
// Destination unreachable via pathing, return direct route. // Destination unreachable via pathing, return direct route.
if(DestinationPathNode == -1) if(DestinationPathNode == -1)
{ {
logger.LogDebug(EQEmuLogSys::Detail, " Unable to find path node for new destination. Running straight to target."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Unable to find path node for new destination. Running straight to target.");
Route.clear(); Route.clear();
return To; return To;
} }
@ -948,7 +948,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
// one, we will carry on on our path. // one, we will carry on on our path.
if(DestinationPathNode == Route.back()) if(DestinationPathNode == Route.back())
{ {
logger.LogDebug(EQEmuLogSys::Detail, " Same destination Node (%i). Continue with current path.", DestinationPathNode); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Same destination Node (%i). Continue with current path.", DestinationPathNode);
NodeLoc = zone->pathing->GetPathNodeCoordinates(Route.front()); NodeLoc = zone->pathing->GetPathNodeCoordinates(Route.front());
@ -956,7 +956,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
// Check if we have reached a path node. // Check if we have reached a path node.
if(NodeLoc == From) if(NodeLoc == From)
{ {
logger.LogDebug(EQEmuLogSys::Detail, " Arrived at node %i, moving to next one.\n", Route.front()); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Arrived at node %i, moving to next one.\n", Route.front());
NodeReached = true; NodeReached = true;
@ -979,7 +979,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
if(Route.size() == 0) if(Route.size() == 0)
{ {
logger.LogDebug(EQEmuLogSys::Detail, "Missing node after teleport."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Missing node after teleport.");
return To; return To;
} }
@ -989,7 +989,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
Teleport(NodeLoc); Teleport(NodeLoc);
logger.LogDebug(EQEmuLogSys::Detail, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z);
Route.pop_front(); Route.pop_front();
@ -999,7 +999,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
NextNode = Route.front(); NextNode = Route.front();
} }
// Return the coords of our next path node on the route. // Return the coords of our next path node on the route.
logger.LogDebug(EQEmuLogSys::Detail, " Now moving to node %i", NextNode); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Now moving to node %i", NextNode);
zone->pathing->OpenDoors(PathingLastNodeVisited, NextNode, this); zone->pathing->OpenDoors(PathingLastNodeVisited, NextNode, this);
@ -1007,7 +1007,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
} }
else else
{ {
logger.LogDebug(EQEmuLogSys::Detail, " Reached end of path grid. Running direct to target."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Reached end of path grid. Running direct to target.");
return To; return To;
} }
} }
@ -1015,7 +1015,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
} }
else else
{ {
logger.LogDebug(EQEmuLogSys::Detail, " Target moved. End node is different. Clearing route."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Target moved. End node is different. Clearing route.");
Route.clear(); Route.clear();
// We will now fall through to get a new route. // We will now fall through to get a new route.
@ -1025,11 +1025,11 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
} }
logger.LogDebug(EQEmuLogSys::Detail, " Our route list is empty."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Our route list is empty.");
if((SameDestination) && !PathingLOSCheckTimer->Check()) if((SameDestination) && !PathingLOSCheckTimer->Check())
{ {
logger.LogDebug(EQEmuLogSys::Detail, " Destination same as before, LOS check timer not reached. Returning To."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Destination same as before, LOS check timer not reached. Returning To.");
return To; return To;
} }
@ -1044,22 +1044,22 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckLong)) if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckLong))
&& (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold)))
{ {
logger.LogDebug(EQEmuLogSys::Detail, " Checking for long LOS at distance %8.3f.", Distance); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking for long LOS at distance %8.3f.", Distance);
if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr)) if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr))
PathingLOSState = HaveLOS; PathingLOSState = HaveLOS;
else else
PathingLOSState = NoLOS; PathingLOSState = NoLOS;
logger.LogDebug(EQEmuLogSys::Detail, "NoLOS"); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS");
if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To))
{ {
logger.LogDebug(EQEmuLogSys::Detail, "Target is reachable. Running directly there."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Target is reachable. Running directly there.");
return To; return To;
} }
} }
logger.LogDebug(EQEmuLogSys::Detail, " Calculating new route to target."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Calculating new route to target.");
Route = zone->pathing->FindRoute(From, To); Route = zone->pathing->FindRoute(From, To);
@ -1067,14 +1067,14 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
if(Route.size() == 0) if(Route.size() == 0)
{ {
logger.LogDebug(EQEmuLogSys::Detail, " No route available, running direct."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " No route available, running direct.");
return To; return To;
} }
if(SameDestination && (Route.front() == PathingLastNodeVisited)) if(SameDestination && (Route.front() == PathingLastNodeVisited))
{ {
logger.LogDebug(EQEmuLogSys::Detail, " Probable loop detected. Same destination and Route.front() == PathingLastNodeVisited."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Probable loop detected. Same destination and Route.front() == PathingLastNodeVisited.");
Route.clear(); Route.clear();
@ -1082,7 +1082,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
} }
NodeLoc = zone->pathing->GetPathNodeCoordinates(Route.front()); NodeLoc = zone->pathing->GetPathNodeCoordinates(Route.front());
logger.LogDebug(EQEmuLogSys::Detail, " New route determined, heading for node %i", Route.front()); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " New route determined, heading for node %i", Route.front());
PathingLoopCount = 0; PathingLoopCount = 0;
@ -1124,7 +1124,7 @@ int PathManager::FindNearestPathNode(Map::Vertex Position)
for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator)
{ {
logger.LogDebug(EQEmuLogSys::Detail, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id);
if(!zone->zonemap->LineIntersectsZone(Position, PathNodes[(*Iterator).id].v, 1.0f, nullptr)) if(!zone->zonemap->LineIntersectsZone(Position, PathNodes[(*Iterator).id].v, 1.0f, nullptr))
{ {
@ -1134,7 +1134,7 @@ int PathManager::FindNearestPathNode(Map::Vertex Position)
} }
if(ClosestPathNodeToStart <0 ) { if(ClosestPathNodeToStart <0 ) {
logger.LogDebug(EQEmuLogSys::Detail, "No LOS to any starting Path Node within range."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any starting Path Node within range.");
return -1; return -1;
} }
return ClosestPathNodeToStart; return ClosestPathNodeToStart;
@ -1150,14 +1150,14 @@ bool PathManager::NoHazards(Map::Vertex From, Map::Vertex To)
if(ABS(NewZ - From.z) > RuleR(Pathing, ZDiffThreshold)) if(ABS(NewZ - From.z) > RuleR(Pathing, ZDiffThreshold))
{ {
logger.LogDebug(EQEmuLogSys::Detail, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f", logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f",
From.x, From.y, From.z, MidPoint.x, MidPoint.y, MidPoint.z, NewZ - From.z); From.x, From.y, From.z, MidPoint.x, MidPoint.y, MidPoint.z, NewZ - From.z);
return false; return false;
} }
else else
{ {
logger.LogDebug(EQEmuLogSys::Detail, "No HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f", logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f",
From.x, From.y, From.z, MidPoint.x, MidPoint.y, MidPoint.z, NewZ - From.z); From.x, From.y, From.z, MidPoint.x, MidPoint.y, MidPoint.z, NewZ - From.z);
} }
@ -1189,7 +1189,7 @@ bool PathManager::NoHazardsAccurate(Map::Vertex From, Map::Vertex To)
float NewZ = zone->zonemap->FindBestZ(TestPoint, nullptr); float NewZ = zone->zonemap->FindBestZ(TestPoint, nullptr);
if (ABS(NewZ - last_z) > 5.0f) if (ABS(NewZ - last_z) > 5.0f)
{ {
logger.LogDebug(EQEmuLogSys::Detail, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Best Z %8.3f, Z Change is %8.3f", logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Best Z %8.3f, Z Change is %8.3f",
From.x, From.y, From.z, TestPoint.x, TestPoint.y, TestPoint.z, NewZ, NewZ - From.z); From.x, From.y, From.z, TestPoint.x, TestPoint.y, TestPoint.z, NewZ, NewZ - From.z);
return false; return false;
} }
@ -1215,30 +1215,30 @@ bool PathManager::NoHazardsAccurate(Map::Vertex From, Map::Vertex To)
} }
if (best_z2 == -999990) if (best_z2 == -999990)
{ {
logger.LogDebug(EQEmuLogSys::Detail, " HAZARD DETECTED, really deep water/lava!"); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED, really deep water/lava!");
return false; return false;
} }
else else
{ {
if (ABS(NewZ - best_z2) > RuleR(Pathing, ZDiffThreshold)) if (ABS(NewZ - best_z2) > RuleR(Pathing, ZDiffThreshold))
{ {
logger.LogDebug(EQEmuLogSys::Detail, " HAZARD DETECTED, water is fairly deep at %8.3f units deep", ABS(NewZ - best_z2)); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED, water is fairly deep at %8.3f units deep", ABS(NewZ - best_z2));
return false; return false;
} }
else else
{ {
logger.LogDebug(EQEmuLogSys::Detail, " HAZARD NOT DETECTED, water is shallow at %8.3f units deep", ABS(NewZ - best_z2)); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD NOT DETECTED, water is shallow at %8.3f units deep", ABS(NewZ - best_z2));
} }
} }
} }
else else
{ {
logger.LogDebug(EQEmuLogSys::Detail, "Hazard point not in water or lava!"); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Hazard point not in water or lava!");
} }
} }
else else
{ {
logger.LogDebug(EQEmuLogSys::Detail, "No water map loaded for hazards!"); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No water map loaded for hazards!");
} }
curx += stepx; curx += stepx;
@ -1290,7 +1290,7 @@ void PathManager::OpenDoors(int Node1, int Node2, Mob *ForWho)
if(d && !d->IsDoorOpen() ) if(d && !d->IsDoorOpen() )
{ {
logger.LogDebug(EQEmuLogSys::Detail, "Opening door %i for %s", PathNodes[Node1].Neighbours[i].DoorID, ForWho->GetName()); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Opening door %i for %s", PathNodes[Node1].Neighbours[i].DoorID, ForWho->GetName());
d->ForceOpen(ForWho); d->ForceOpen(ForWho);
} }

View File

@ -1271,15 +1271,15 @@ XS(XS_Client_MovePC)
} }
else { else {
if (THIS->IsMerc()) if (THIS->IsMerc())
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Merc reference"); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Merc reference");
else if (THIS->IsNPC()) else if (THIS->IsNPC())
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type NPC reference"); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type NPC reference");
#ifdef BOTS #ifdef BOTS
else if (THIS->IsBot()) else if (THIS->IsBot())
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Bot reference"); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Bot reference");
#endif #endif
else else
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePC) attempted to process an Unknown type reference"); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process an Unknown type reference");
Perl_croak(aTHX_ "THIS is not of type Client"); Perl_croak(aTHX_ "THIS is not of type Client");
} }
@ -1317,15 +1317,15 @@ XS(XS_Client_MovePCInstance)
} }
else { else {
if (THIS->IsMerc()) if (THIS->IsMerc())
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Merc reference"); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Merc reference");
else if (THIS->IsNPC()) else if (THIS->IsNPC())
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type NPC reference"); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type NPC reference");
#ifdef BOTS #ifdef BOTS
else if (THIS->IsBot()) else if (THIS->IsBot())
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Bot reference"); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Bot reference");
#endif #endif
else else
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process an Unknown type reference"); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process an Unknown type reference");
Perl_croak(aTHX_ "THIS is not of type Client"); Perl_croak(aTHX_ "THIS is not of type Client");

View File

@ -368,7 +368,7 @@ void Client::ResetTrade() {
break; break;
if (partial_inst->GetID() != inst->GetID()) { if (partial_inst->GetID() != inst->GetID()) {
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()"); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()");
break; break;
} }
@ -588,7 +588,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
break; break;
if (partial_inst->GetID() != inst->GetID()) { if (partial_inst->GetID() != inst->GetID()) {
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()"); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()");
break; break;
} }
@ -1486,7 +1486,7 @@ static void BazaarAuditTrail(const char *seller, const char *buyer, const char *
seller, buyer, itemName, quantity, totalCost, tranType); seller, buyer, itemName, quantity, totalCost, tranType);
auto results = database.QueryDatabase(query); auto results = database.QueryDatabase(query);
if(!results.Success()) if(!results.Success())
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Audit write error: %s : %s", query.c_str(), results.ErrorMessage().c_str()); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Audit write error: %s : %s", query.c_str(), results.ErrorMessage().c_str());
} }
@ -1836,7 +1836,7 @@ void Client::SendBazaarResults(uint32 TraderID, uint32 Class_, uint32 Race, uint
searchValues.c_str(), searchCriteria.c_str(), RuleI(Bazaar, MaxSearchResults)); searchValues.c_str(), searchCriteria.c_str(), RuleI(Bazaar, MaxSearchResults));
auto results = database.QueryDatabase(query); auto results = database.QueryDatabase(query);
if (!results.Success()) { if (!results.Success()) {
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to retrieve Bazaar Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to retrieve Bazaar Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str());
return; return;
} }
@ -2081,7 +2081,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) {
TraderCharges_Struct* gis = database.LoadTraderItemWithCharges(CharacterID()); TraderCharges_Struct* gis = database.LoadTraderItemWithCharges(CharacterID());
if(!gis) { if(!gis) {
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Error retrieving Trader items details to update price."); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Error retrieving Trader items details to update price.");
return; return;
} }
@ -2270,7 +2270,7 @@ void Client::SendBuyerResults(char* searchString, uint32 searchID) {
// This method is called when a potential seller in the /barter window searches for matching buyers // This method is called when a potential seller in the /barter window searches for matching buyers
// //
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Client::SendBuyerResults %s\n", searchString); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::SendBuyerResults %s\n", searchString);
char* escSearchString = new char[strlen(searchString) * 2 + 1]; char* escSearchString = new char[strlen(searchString) * 2 + 1];
database.DoEscapeString(escSearchString, searchString, strlen(searchString)); database.DoEscapeString(escSearchString, searchString, strlen(searchString));
@ -2280,7 +2280,7 @@ void Client::SendBuyerResults(char* searchString, uint32 searchID) {
safe_delete_array(escSearchString); safe_delete_array(escSearchString);
auto results = database.QueryDatabase(query); auto results = database.QueryDatabase(query);
if (!results.Success()) { if (!results.Success()) {
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to retrieve Barter Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to retrieve Barter Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str());
return; return;
} }

View File

@ -386,7 +386,7 @@ void WorldServer::Process() {
} }
} }
else { else {
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] id=%i, playerineqstring=%i, playersinzonestring=%i. Dumping WhoAllReturnStruct:", logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] id=%i, playerineqstring=%i, playersinzonestring=%i. Dumping WhoAllReturnStruct:",
wars->id, wars->playerineqstring, wars->playersinzonestring); wars->id, wars->playerineqstring, wars->playersinzonestring);
} }
} }

View File

@ -619,7 +619,7 @@ void ZoneDatabase::SaveTraderItem(uint32 CharID, uint32 ItemID, uint32 SerialNum
CharID, ItemID, SerialNumber, Charges, ItemCost, Slot); CharID, ItemID, SerialNumber, Charges, ItemCost, Slot);
auto results = QueryDatabase(query); auto results = QueryDatabase(query);
if (!results.Success()) if (!results.Success())
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to save trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to save trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str());
} }
@ -630,7 +630,7 @@ void ZoneDatabase::UpdateTraderItemCharges(int CharID, uint32 SerialNumber, int3
Charges, CharID, SerialNumber); Charges, CharID, SerialNumber);
auto results = QueryDatabase(query); auto results = QueryDatabase(query);
if (!results.Success()) if (!results.Success())
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to update charges for trader item: %i for char_id: %i, the error was: %s\n", logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update charges for trader item: %i for char_id: %i, the error was: %s\n",
SerialNumber, CharID, results.ErrorMessage().c_str()); SerialNumber, CharID, results.ErrorMessage().c_str());
} }
@ -650,7 +650,7 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg
std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i AND item_id = %i",CharID, ItemID); std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i AND item_id = %i",CharID, ItemID);
auto results = QueryDatabase(query); auto results = QueryDatabase(query);
if (!results.Success()) if (!results.Success())
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to remove trader item(s): %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to remove trader item(s): %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str());
return; return;
} }
@ -661,7 +661,7 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg
NewPrice, CharID, ItemID, Charges); NewPrice, CharID, ItemID, Charges);
auto results = QueryDatabase(query); auto results = QueryDatabase(query);
if (!results.Success()) if (!results.Success())
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str());
return; return;
} }
@ -671,7 +671,7 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg
NewPrice, CharID, ItemID); NewPrice, CharID, ItemID);
auto results = QueryDatabase(query); auto results = QueryDatabase(query);
if (!results.Success()) if (!results.Success())
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str());
} }
void ZoneDatabase::DeleteTraderItem(uint32 char_id){ void ZoneDatabase::DeleteTraderItem(uint32 char_id){
@ -680,7 +680,7 @@ void ZoneDatabase::DeleteTraderItem(uint32 char_id){
const std::string query = "DELETE FROM trader"; const std::string query = "DELETE FROM trader";
auto results = QueryDatabase(query); auto results = QueryDatabase(query);
if (!results.Success()) if (!results.Success())
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to delete all trader items data, the error was: %s\n", results.ErrorMessage().c_str()); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete all trader items data, the error was: %s\n", results.ErrorMessage().c_str());
return; return;
} }
@ -688,7 +688,7 @@ void ZoneDatabase::DeleteTraderItem(uint32 char_id){
std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i", char_id); std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i", char_id);
auto results = QueryDatabase(query); auto results = QueryDatabase(query);
if (!results.Success()) if (!results.Success())
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n", char_id, results.ErrorMessage().c_str()); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n", char_id, results.ErrorMessage().c_str());
} }
void ZoneDatabase::DeleteTraderItem(uint32 CharID,uint16 SlotID) { void ZoneDatabase::DeleteTraderItem(uint32 CharID,uint16 SlotID) {
@ -696,7 +696,7 @@ void ZoneDatabase::DeleteTraderItem(uint32 CharID,uint16 SlotID) {
std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i And slot_id = %i", CharID, SlotID); std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i And slot_id = %i", CharID, SlotID);
auto results = QueryDatabase(query); auto results = QueryDatabase(query);
if (!results.Success()) if (!results.Success())
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n",CharID, results.ErrorMessage().c_str()); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n",CharID, results.ErrorMessage().c_str());
} }
void ZoneDatabase::DeleteBuyLines(uint32 CharID) { void ZoneDatabase::DeleteBuyLines(uint32 CharID) {
@ -705,7 +705,7 @@ void ZoneDatabase::DeleteBuyLines(uint32 CharID) {
const std::string query = "DELETE FROM buyer"; const std::string query = "DELETE FROM buyer";
auto results = QueryDatabase(query); auto results = QueryDatabase(query);
if (!results.Success()) if (!results.Success())
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to delete all buyer items data, the error was: %s\n",results.ErrorMessage().c_str()); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete all buyer items data, the error was: %s\n",results.ErrorMessage().c_str());
return; return;
} }
@ -713,7 +713,7 @@ void ZoneDatabase::DeleteBuyLines(uint32 CharID) {
std::string query = StringFormat("DELETE FROM buyer WHERE charid = %i", CharID); std::string query = StringFormat("DELETE FROM buyer WHERE charid = %i", CharID);
auto results = QueryDatabase(query); auto results = QueryDatabase(query);
if (!results.Success()) if (!results.Success())
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to delete buyer item data for charid: %i, the error was: %s\n",CharID,results.ErrorMessage().c_str()); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete buyer item data for charid: %i, the error was: %s\n",CharID,results.ErrorMessage().c_str());
} }
@ -722,7 +722,7 @@ void ZoneDatabase::AddBuyLine(uint32 CharID, uint32 BuySlot, uint32 ItemID, cons
CharID, BuySlot, ItemID, ItemName, Quantity, Price); CharID, BuySlot, ItemID, ItemName, Quantity, Price);
auto results = QueryDatabase(query); auto results = QueryDatabase(query);
if (!results.Success()) if (!results.Success())
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to save buline item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to save buline item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str());
} }
@ -730,7 +730,7 @@ void ZoneDatabase::RemoveBuyLine(uint32 CharID, uint32 BuySlot) {
std::string query = StringFormat("DELETE FROM buyer WHERE charid = %i AND buyslot = %i", CharID, BuySlot); std::string query = StringFormat("DELETE FROM buyer WHERE charid = %i AND buyslot = %i", CharID, BuySlot);
auto results = QueryDatabase(query); auto results = QueryDatabase(query);
if (!results.Success()) if (!results.Success())
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to delete buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str()); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str());
} }
@ -743,7 +743,7 @@ void ZoneDatabase::UpdateBuyLine(uint32 CharID, uint32 BuySlot, uint32 Quantity)
std::string query = StringFormat("UPDATE buyer SET quantity = %i WHERE charid = %i AND buyslot = %i", Quantity, CharID, BuySlot); std::string query = StringFormat("UPDATE buyer SET quantity = %i WHERE charid = %i AND buyslot = %i", Quantity, CharID, BuySlot);
auto results = QueryDatabase(query); auto results = QueryDatabase(query);
if (!results.Success()) if (!results.Success())
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to update quantity in buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str()); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update quantity in buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str());
} }

View File

@ -680,7 +680,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z
safe_delete(outapp); safe_delete(outapp);
} }
logger.LogDebug(EQEmuLogSys::Detail, "Player %s has requested a zoning to LOC x=%f, y=%f, z=%f, heading=%f in zoneid=%i", GetName(), x, y, z, heading, zoneID); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Player %s has requested a zoning to LOC x=%f, y=%f, z=%f, heading=%f in zoneid=%i", GetName(), x, y, z, heading, zoneID);
//Clear zonesummon variables if we're zoning to our own zone //Clear zonesummon variables if we're zoning to our own zone
//Client wont generate a zone change packet to the server in this case so //Client wont generate a zone change packet to the server in this case so
//They aren't needed and it keeps behavior on next zone attempt from being undefined. //They aren't needed and it keeps behavior on next zone attempt from being undefined.
@ -854,23 +854,23 @@ bool Client::CanBeInZone() {
char flag_needed[128]; char flag_needed[128];
if(!database.GetSafePoints(zone->GetShortName(), zone->GetInstanceVersion(), &safe_x, &safe_y, &safe_z, &minstatus, &minlevel, flag_needed)) { if(!database.GetSafePoints(zone->GetShortName(), zone->GetInstanceVersion(), &safe_x, &safe_y, &safe_z, &minstatus, &minlevel, flag_needed)) {
//this should not happen... //this should not happen...
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Unable to query zone info for ourself '%s'", zone->GetShortName()); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Unable to query zone info for ourself '%s'", zone->GetShortName());
return(false); return(false);
} }
if(GetLevel() < minlevel) { if(GetLevel() < minlevel) {
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Character does not meet min level requirement (%d < %d)!", GetLevel(), minlevel); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Character does not meet min level requirement (%d < %d)!", GetLevel(), minlevel);
return(false); return(false);
} }
if(Admin() < minstatus) { if(Admin() < minstatus) {
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Character does not meet min status requirement (%d < %d)!", Admin(), minstatus); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Character does not meet min status requirement (%d < %d)!", Admin(), minstatus);
return(false); return(false);
} }
if(flag_needed[0] != '\0') { if(flag_needed[0] != '\0') {
//the flag needed string is not empty, meaning a flag is required. //the flag needed string is not empty, meaning a flag is required.
if(Admin() < minStatusToIgnoreZoneFlags && !HasZoneFlag(zone->GetZoneID())) { if(Admin() < minStatusToIgnoreZoneFlags && !HasZoneFlag(zone->GetZoneID())) {
logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Character does not have the flag to be in this zone (%s)!", flag_needed); logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Character does not have the flag to be in this zone (%s)!", flag_needed);
return(false); return(false);
} }
} }