More _log Client replacements

This commit is contained in:
Akkadius 2015-01-10 18:52:27 -06:00
parent d459c144fe
commit b2a1597e73
7 changed files with 36 additions and 38 deletions

View File

@ -759,7 +759,7 @@ void Client::CompleteConnect()
//enforce some rules.. //enforce some rules..
if (!CanBeInZone()) { if (!CanBeInZone()) {
_log(CLIENT__ERROR, "Kicking char from zone, not allowed here"); logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Kicking char from zone, not allowed here");
GoToSafeCoords(database.GetZoneID("arena"), 0); GoToSafeCoords(database.GetZoneID("arena"), 0);
return; return;
} }

View File

@ -2848,8 +2848,6 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool
if (autolog && error && (!log)) if (autolog && error && (!log))
log = true; log = true;
if (log)
_log(INVENTORY__ERROR, "Client::InterrogateInventory() called for %s by %s with an error state of %s", GetName(), requester->GetName(), (error ? "TRUE" : "FALSE"));
if (!silent) if (!silent)
requester->Message(1, "--- Inventory Interrogation Report for %s (requested by: %s, error state: %s) ---", GetName(), requester->GetName(), (error ? "TRUE" : "FALSE")); requester->Message(1, "--- Inventory Interrogation Report for %s (requested by: %s, error state: %s) ---", GetName(), requester->GetName(), (error ? "TRUE" : "FALSE"));
@ -2868,7 +2866,7 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool
if (log) { if (log) {
_log(INVENTORY__ERROR, "Target interrogate inventory flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE")); _log(INVENTORY__ERROR, "Target interrogate inventory flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE"));
_log(INVENTORY__ERROR, "Client::InterrogateInventory() -- End"); logger.LogDebug(EQEmuLogSys::Detail, "[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"));
@ -2883,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) {
_log(INVENTORY__ERROR, "Client::InterrogateInventory_() - Recursion count has exceeded the maximum allowable (You have a REALLY BIG PROBLEM!!)"); logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Client::InterrogateInventory_() - Recursion count has exceeded the maximum allowable (You have a REALLY BIG PROBLEM!!)");
return; return;
} }

View File

@ -1271,15 +1271,15 @@ XS(XS_Client_MovePC)
} }
else { else {
if (THIS->IsMerc()) if (THIS->IsMerc())
_log(CLIENT__ERROR, "Perl(XS_Client_MovePC) attempted to process a type Merc reference"); logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Merc reference");
else if (THIS->IsNPC()) else if (THIS->IsNPC())
_log(CLIENT__ERROR, "Perl(XS_Client_MovePC) attempted to process a type NPC reference"); logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type NPC reference");
#ifdef BOTS #ifdef BOTS
else if (THIS->IsBot()) else if (THIS->IsBot())
_log(CLIENT__ERROR, "Perl(XS_Client_MovePC) attempted to process a type Bot reference"); logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Bot reference");
#endif #endif
else else
_log(CLIENT__ERROR, "Perl(XS_Client_MovePC) attempted to process an Unknown type reference"); logger.LogDebug(EQEmuLogSys::Detail, "[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())
_log(CLIENT__ERROR, "Perl(XS_Client_MovePCInstance) attempted to process a type Merc reference"); logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Merc reference");
else if (THIS->IsNPC()) else if (THIS->IsNPC())
_log(CLIENT__ERROR, "Perl(XS_Client_MovePCInstance) attempted to process a type NPC reference"); logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type NPC reference");
#ifdef BOTS #ifdef BOTS
else if (THIS->IsBot()) else if (THIS->IsBot())
_log(CLIENT__ERROR, "Perl(XS_Client_MovePCInstance) attempted to process a type Bot reference"); logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Bot reference");
#endif #endif
else else
_log(CLIENT__ERROR, "Perl(XS_Client_MovePCInstance) attempted to process an Unknown type reference"); logger.LogDebug(EQEmuLogSys::Detail, "[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()) {
_log(TRADING__ERROR, "Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()"); logger.LogDebug(EQEmuLogSys::Detail, "[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()) {
_log(TRADING__ERROR, "Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()"); logger.LogDebug(EQEmuLogSys::Detail, "[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())
_log(TRADING__CLIENT, "Audit write error: %s : %s", query.c_str(), results.ErrorMessage().c_str()); logger.LogDebug(EQEmuLogSys::Detail, "[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()) {
_log(TRADING__CLIENT, "Failed to retrieve Bazaar Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); logger.LogDebug(EQEmuLogSys::Detail, "[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) {
_log(TRADING__CLIENT, "Error retrieving Trader items details to update price."); logger.LogDebug(EQEmuLogSys::Detail, "[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
// //
_log(TRADING__BARTER, "Client::SendBuyerResults %s\n", searchString); logger.LogDebug(EQEmuLogSys::Detail, "[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()) {
_log(TRADING__CLIENT, "Failed to retrieve Barter Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to retrieve Barter Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str());
return; return;
} }

View File

@ -387,7 +387,7 @@ void WorldServer::Process() {
} }
else { else {
#ifdef _EQDEBUG #ifdef _EQDEBUG
_log(ZONE__WORLD, "Error: WhoAllReturnStruct did not point to a valid client! " logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT]
"id=%i, playerineqstring=%i, playersinzonestring=%i. Dumping WhoAllReturnStruct:", "id=%i, playerineqstring=%i, playersinzonestring=%i. Dumping WhoAllReturnStruct:",
wars->id, wars->playerineqstring, wars->playersinzonestring); wars->id, wars->playerineqstring, wars->playersinzonestring);
#endif #endif

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())
_log(TRADING__CLIENT, "Failed to save trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); 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());
} }
@ -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())
_log(TRADING__CLIENT, "Failed to update charges for trader item: %i for char_id: %i, the error was: %s\n", logger.LogDebug(EQEmuLogSys::Detail, "[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())
_log(TRADING__CLIENT, "Failed to remove trader item(s): %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); 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());
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())
_log(TRADING__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.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());
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())
_log(TRADING__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.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());
} }
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())
_log(TRADING__CLIENT, "Failed to delete all trader items data, the error was: %s\n", results.ErrorMessage().c_str()); logger.LogDebug(EQEmuLogSys::Detail, "[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())
_log(TRADING__CLIENT, "Failed to delete trader item data for char_id: %i, the error was: %s\n", char_id, results.ErrorMessage().c_str()); 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());
} }
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())
_log(TRADING__CLIENT, "Failed to delete trader item data for char_id: %i, the error was: %s\n",CharID, results.ErrorMessage().c_str()); 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());
} }
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())
_log(TRADING__CLIENT, "Failed to delete all buyer items data, the error was: %s\n",results.ErrorMessage().c_str()); logger.LogDebug(EQEmuLogSys::Detail, "[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())
_log(TRADING__CLIENT, "Failed to delete buyer item data for charid: %i, the error was: %s\n",CharID,results.ErrorMessage().c_str()); logger.LogDebug(EQEmuLogSys::Detail, "[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())
_log(TRADING__CLIENT, "Failed to save buline item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); 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());
} }
@ -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())
_log(TRADING__CLIENT, "Failed to delete buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str()); logger.LogDebug(EQEmuLogSys::Detail, "[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())
_log(TRADING__CLIENT, "Failed to update quantity in buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str()); 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());
} }

View File

@ -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...
_log(CLIENT__ERROR, "Unable to query zone info for ourself '%s'", zone->GetShortName()); logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Unable to query zone info for ourself '%s'", zone->GetShortName());
return(false); return(false);
} }
if(GetLevel() < minlevel) { if(GetLevel() < minlevel) {
_log(CLIENT__ERROR, "Character does not meet min level requirement (%d < %d)!", GetLevel(), minlevel); logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Character does not meet min level requirement (%d < %d)!", GetLevel(), minlevel);
return(false); return(false);
} }
if(Admin() < minstatus) { if(Admin() < minstatus) {
_log(CLIENT__ERROR, "Character does not meet min status requirement (%d < %d)!", Admin(), minstatus); logger.LogDebug(EQEmuLogSys::Detail, "[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())) {
_log(CLIENT__ERROR, "Character does not have the flag to be in this zone (%s)!", flag_needed); logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Character does not have the flag to be in this zone (%s)!", flag_needed);
return(false); return(false);
} }
} }