diff --git a/common/eq_stream_factory.cpp b/common/eq_stream_factory.cpp index 7d2a7e365..3bd6ad185 100644 --- a/common/eq_stream_factory.cpp +++ b/common/eq_stream_factory.cpp @@ -26,13 +26,13 @@ ThreadReturnType EQStreamFactoryReaderLoop(void *eqfs) EQStreamFactory *fs=(EQStreamFactory *)eqfs; #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 fs->ReaderLoop(); #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 THREAD_RETURN(nullptr); @@ -43,13 +43,13 @@ ThreadReturnType EQStreamFactoryWriterLoop(void *eqfs) EQStreamFactory *fs=(EQStreamFactory *)eqfs; #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 fs->WriterLoop(); #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 THREAD_RETURN(nullptr); diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 3cce91ebe..e15c99087 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -50,6 +50,7 @@ public: /* If you add to this, make sure you update LogCategoryName */ enum LogCategory { + None = 0, Zone_Server = 1, World_Server, UCS_Server, diff --git a/common/tcp_server.cpp b/common/tcp_server.cpp index 9e0553d40..f1154b120 100644 --- a/common/tcp_server.cpp +++ b/common/tcp_server.cpp @@ -68,7 +68,7 @@ ThreadReturnType BaseTCPServer::TCPServerLoop(void* tmp) { BaseTCPServer* tcps = (BaseTCPServer*) tmp; #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 tcps->MLoopRunning.lock(); @@ -79,7 +79,7 @@ ThreadReturnType BaseTCPServer::TCPServerLoop(void* tmp) { tcps->MLoopRunning.unlock(); #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 THREAD_RETURN(nullptr); diff --git a/world/zoneserver.cpp b/world/zoneserver.cpp index a55009514..3cf75a90d 100644 --- a/world/zoneserver.cpp +++ b/world/zoneserver.cpp @@ -785,7 +785,6 @@ bool ZoneServer::Process() { } case ServerOP_RequestOnlineGuildMembers: { 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); break; } diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index b45f69e7b..382436e65 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -759,7 +759,7 @@ void Client::CompleteConnect() //enforce some rules.. 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); return; } @@ -9136,7 +9136,7 @@ void Client::Handle_OP_LoadSpellSet(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(); diff --git a/zone/exp.cpp b/zone/exp.cpp index c1ceeeae2..47d864706 100644 --- a/zone/exp.cpp +++ b/zone/exp.cpp @@ -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) { - 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 = RuleI(AA, ExpPerPoint); //this may be redundant since we're doing this in Client::FinishConnState2() 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 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 set_aaxp = set_aaxp - (max_AAXP * m_pp.aapoints); diff --git a/zone/fearpath.cpp b/zone/fearpath.cpp index e2e3be399..3a3fdcd58 100644 --- a/zone/fearpath.cpp +++ b/zone/fearpath.cpp @@ -167,11 +167,11 @@ void Mob::CalculateNewFearpoint() fear_walkto_z = Loc.z; 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; } - 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; diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 3062db265..22816a75f 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -2866,7 +2866,7 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool if (log) { 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) { 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) { 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; } diff --git a/zone/net.cpp b/zone/net.cpp index 5cfe506cd..b630dadb2 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -343,7 +343,7 @@ int main(int argc, char** argv) { RegisterAllPatches(stream_identifier); #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 Timer quest_timers(100); diff --git a/zone/pathing.cpp b/zone/pathing.cpp index dc0d4cb40..07b145d34 100644 --- a/zone/pathing.cpp +++ b/zone/pathing.cpp @@ -207,7 +207,7 @@ Map::Vertex PathManager::GetPathNodeCoordinates(int NodeNumber, bool BestZ) std::deque 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); @@ -330,7 +330,7 @@ std::deque 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; } @@ -352,7 +352,7 @@ auto path_compare = [](const PathNodeSortStruct& a, const PathNodeSortStruct& b) std::deque 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 noderoute; @@ -386,7 +386,7 @@ std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) 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)) { @@ -396,11 +396,11 @@ std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) } 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; } - 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 @@ -424,8 +424,8 @@ std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) 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.LogDebug(EQEmuLogSys::Detail, " (%8.3f, %8.3f, %8.3f) to (%8.3f, %8.3f, %8.3f)", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from End Position.", PathNodes[(*Iterator).id].id); + 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, PathNodes[(*Iterator).id].v.x, PathNodes[(*Iterator).id].v.y, PathNodes[(*Iterator).id].v.z); @@ -437,11 +437,11 @@ std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) } 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; } - 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) { @@ -673,7 +673,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(To == From) 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) { @@ -681,7 +681,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & 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) { @@ -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(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. 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. 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; @@ -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. 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) || ((PathingTraversedNodes >= RuleI(Pathing, MinNodesTraversedForLOSCheck)) && (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck)) && 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); - 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)) && (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; else PathingLOSState = NoLOS; - logger.LogDebug(EQEmuLogSys::Detail, "NoLOS"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); 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(); return To; } else { - logger.LogDebug(EQEmuLogSys::Detail, " Continuing on node path."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path."); } } else @@ -802,7 +802,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(Route.size() == 0) { - logger.LogDebug(EQEmuLogSys::Detail, "Missing node after teleport."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Missing node after teleport."); return To; } @@ -812,7 +812,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & 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(); @@ -823,7 +823,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } 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); } @@ -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 // 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; } @@ -845,11 +845,11 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & && (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck)) && 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); - 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)) && (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; else PathingLOSState = NoLOS; - logger.LogDebug(EQEmuLogSys::Detail, "NoLOS"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); 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(); return To; } else { - logger.LogDebug(EQEmuLogSys::Detail, " Continuing on node path."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path."); } } 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. // - 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. PathingDestination = To; // 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)) && (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)) PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; - logger.LogDebug(EQEmuLogSys::Detail, "NoLOS"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); 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(); return To; } 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()) { - 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()); } - logger.LogDebug(EQEmuLogSys::Detail, "Short route update timer expired."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Short route update timer expired."); } else { 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()); } - 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. @@ -940,7 +940,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // Destination unreachable via pathing, return direct route. 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(); 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. 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()); @@ -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. 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; @@ -979,7 +979,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(Route.size() == 0) { - logger.LogDebug(EQEmuLogSys::Detail, "Missing node after teleport."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Missing node after teleport."); return To; } @@ -989,7 +989,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & 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(); @@ -999,7 +999,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & NextNode = Route.front(); } // 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); @@ -1007,7 +1007,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } 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; } } @@ -1015,7 +1015,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } 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(); // 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()) { - 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; } @@ -1044,22 +1044,22 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckLong)) && (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)) PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; - logger.LogDebug(EQEmuLogSys::Detail, "NoLOS"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); 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; } } - 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); @@ -1067,14 +1067,14 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & 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; } 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(); @@ -1082,7 +1082,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } 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; @@ -1124,7 +1124,7 @@ int PathManager::FindNearestPathNode(Map::Vertex Position) 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)) { @@ -1134,7 +1134,7 @@ int PathManager::FindNearestPathNode(Map::Vertex Position) } 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 ClosestPathNodeToStart; @@ -1150,14 +1150,14 @@ bool PathManager::NoHazards(Map::Vertex From, Map::Vertex To) 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); return false; } 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); } @@ -1189,7 +1189,7 @@ bool PathManager::NoHazardsAccurate(Map::Vertex From, Map::Vertex To) float NewZ = zone->zonemap->FindBestZ(TestPoint, nullptr); 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); return false; } @@ -1215,30 +1215,30 @@ bool PathManager::NoHazardsAccurate(Map::Vertex From, Map::Vertex To) } 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; } else { 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; } 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 { - 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 { - logger.LogDebug(EQEmuLogSys::Detail, "No water map loaded for hazards!"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No water map loaded for hazards!"); } curx += stepx; @@ -1290,7 +1290,7 @@ void PathManager::OpenDoors(int Node1, int Node2, Mob *ForWho) 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); } diff --git a/zone/perl_client.cpp b/zone/perl_client.cpp index 82600923d..59a865887 100644 --- a/zone/perl_client.cpp +++ b/zone/perl_client.cpp @@ -1271,15 +1271,15 @@ XS(XS_Client_MovePC) } else { 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()) - 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 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 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"); } @@ -1317,15 +1317,15 @@ XS(XS_Client_MovePCInstance) } else { 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()) - 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 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 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"); diff --git a/zone/trading.cpp b/zone/trading.cpp index 4c06dfc42..761c954f8 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -368,7 +368,7 @@ void Client::ResetTrade() { break; 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; } @@ -588,7 +588,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st break; 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; } @@ -1486,7 +1486,7 @@ static void BazaarAuditTrail(const char *seller, const char *buyer, const char * seller, buyer, itemName, quantity, totalCost, tranType); auto results = database.QueryDatabase(query); 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)); auto results = database.QueryDatabase(query); 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; } @@ -2081,7 +2081,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { TraderCharges_Struct* gis = database.LoadTraderItemWithCharges(CharacterID()); 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; } @@ -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 // - 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]; database.DoEscapeString(escSearchString, searchString, strlen(searchString)); @@ -2280,7 +2280,7 @@ void Client::SendBuyerResults(char* searchString, uint32 searchID) { safe_delete_array(escSearchString); auto results = database.QueryDatabase(query); 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; } diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index 3bce1101a..7bbd5db5d 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -386,7 +386,7 @@ void WorldServer::Process() { } } 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); } } diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 507e1ef27..5a8c19e16 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -619,7 +619,7 @@ void ZoneDatabase::SaveTraderItem(uint32 CharID, uint32 ItemID, uint32 SerialNum CharID, ItemID, SerialNumber, Charges, ItemCost, Slot); auto results = QueryDatabase(query); 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); auto results = QueryDatabase(query); 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()); } @@ -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); auto results = QueryDatabase(query); 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; } @@ -661,7 +661,7 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg NewPrice, CharID, ItemID, Charges); auto results = QueryDatabase(query); 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; } @@ -671,7 +671,7 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg NewPrice, CharID, ItemID); auto results = QueryDatabase(query); 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){ @@ -680,7 +680,7 @@ void ZoneDatabase::DeleteTraderItem(uint32 char_id){ const std::string query = "DELETE FROM trader"; auto results = QueryDatabase(query); 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; } @@ -688,7 +688,7 @@ void ZoneDatabase::DeleteTraderItem(uint32 char_id){ std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i", char_id); auto results = QueryDatabase(query); 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) { @@ -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); auto results = QueryDatabase(query); 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) { @@ -705,7 +705,7 @@ void ZoneDatabase::DeleteBuyLines(uint32 CharID) { const std::string query = "DELETE FROM buyer"; auto results = QueryDatabase(query); 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; } @@ -713,7 +713,7 @@ void ZoneDatabase::DeleteBuyLines(uint32 CharID) { std::string query = StringFormat("DELETE FROM buyer WHERE charid = %i", CharID); auto results = QueryDatabase(query); 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); auto results = QueryDatabase(query); 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); auto results = QueryDatabase(query); 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); auto results = QueryDatabase(query); 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()); } diff --git a/zone/zoning.cpp b/zone/zoning.cpp index 741a2fbd2..d2d814414 100644 --- a/zone/zoning.cpp +++ b/zone/zoning.cpp @@ -680,7 +680,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z 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 //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. @@ -854,23 +854,23 @@ bool Client::CanBeInZone() { char flag_needed[128]; if(!database.GetSafePoints(zone->GetShortName(), zone->GetInstanceVersion(), &safe_x, &safe_y, &safe_z, &minstatus, &minlevel, flag_needed)) { //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); } 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); } 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); } if(flag_needed[0] != '\0') { //the flag needed string is not empty, meaning a flag is required. 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); } }