mirror of
https://github.com/EQEmu/Server.git
synced 2026-08-29 04:28:00 +00:00
Simplify error logging
This commit is contained in:
+11
-11
@@ -625,21 +625,21 @@ void Client::DropItem(int16 slot_id, bool recurse)
|
||||
(inst->GetItem() ? inst->GetItem()->Name : "null data"), inst->GetID(), (inst->IsDroppable(false) ? "true" : "false"));
|
||||
|
||||
if (!inst->IsDroppable(false))
|
||||
Log(Logs::General, Logs::Error, "Non-droppable item being processed for drop by '%s'", GetCleanName());
|
||||
LogError("Non-droppable item being processed for drop by [{}]", GetCleanName());
|
||||
|
||||
for (auto iter1 : *inst->GetContents()) { // depth 1
|
||||
Log(Logs::General, Logs::Inventory, "-depth: 1, Item: '%s' (id: %u), IsDroppable: %s",
|
||||
(iter1.second->GetItem() ? iter1.second->GetItem()->Name : "null data"), iter1.second->GetID(), (iter1.second->IsDroppable(false) ? "true" : "false"));
|
||||
|
||||
if (!iter1.second->IsDroppable(false))
|
||||
Log(Logs::General, Logs::Error, "Non-droppable item being processed for drop by '%s'", GetCleanName());
|
||||
LogError("Non-droppable item being processed for drop by [{}]", GetCleanName());
|
||||
|
||||
for (auto iter2 : *iter1.second->GetContents()) { // depth 2
|
||||
Log(Logs::General, Logs::Inventory, "--depth: 2, Item: '%s' (id: %u), IsDroppable: %s",
|
||||
(iter2.second->GetItem() ? iter2.second->GetItem()->Name : "null data"), iter2.second->GetID(), (iter2.second->IsDroppable(false) ? "true" : "false"));
|
||||
|
||||
if (!iter2.second->IsDroppable(false))
|
||||
Log(Logs::General, Logs::Error, "Non-droppable item being processed for drop by '%s'", GetCleanName());
|
||||
LogError("Non-droppable item being processed for drop by [{}]", GetCleanName());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1672,7 +1672,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
//verify shared bank transactions in the database
|
||||
if (src_inst && src_slot_id >= EQEmu::invslot::SHARED_BANK_BEGIN && src_slot_id <= EQEmu::invbag::SHARED_BANK_BAGS_END) {
|
||||
if(!database.VerifyInventory(account_id, src_slot_id, src_inst)) {
|
||||
Log(Logs::General, Logs::Error, "Player %s on account %s was found exploiting the shared bank.\n", GetName(), account_name);
|
||||
LogError("Player [{}] on account [{}] was found exploiting the shared bank.\n", GetName(), account_name);
|
||||
DeleteItemInInventory(dst_slot_id,0,true);
|
||||
return(false);
|
||||
}
|
||||
@@ -1687,7 +1687,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
}
|
||||
if (dst_inst && dst_slot_id >= EQEmu::invslot::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::invbag::SHARED_BANK_BAGS_END) {
|
||||
if(!database.VerifyInventory(account_id, dst_slot_id, dst_inst)) {
|
||||
Log(Logs::General, Logs::Error, "Player %s on account %s was found exploting the shared bank.\n", GetName(), account_name);
|
||||
LogError("Player [{}] on account [{}] was found exploting the shared bank.\n", GetName(), account_name);
|
||||
DeleteItemInInventory(src_slot_id,0,true);
|
||||
return(false);
|
||||
}
|
||||
@@ -3122,10 +3122,10 @@ void Client::SetBandolier(const EQApplicationPacket *app)
|
||||
Log(Logs::Detail, Logs::Inventory, "returning item %s in weapon slot %i to inventory", InvItem->GetItem()->Name, WeaponSlot);
|
||||
if (MoveItemToInventory(InvItem)) {
|
||||
database.SaveInventory(character_id, 0, WeaponSlot);
|
||||
Log(Logs::General, Logs::Error, "returning item %s in weapon slot %i to inventory", InvItem->GetItem()->Name, WeaponSlot);
|
||||
LogError("returning item [{}] in weapon slot [{}] to inventory", InvItem->GetItem()->Name, WeaponSlot);
|
||||
}
|
||||
else {
|
||||
Log(Logs::General, Logs::Error, "Char: %s, ERROR returning %s to inventory", GetName(), InvItem->GetItem()->Name);
|
||||
LogError("Char: [{}], ERROR returning [{}] to inventory", GetName(), InvItem->GetItem()->Name);
|
||||
}
|
||||
safe_delete(InvItem);
|
||||
}
|
||||
@@ -3159,7 +3159,7 @@ void Client::SetBandolier(const EQApplicationPacket *app)
|
||||
if(InvItem) {
|
||||
// If there was already an item in that weapon slot that we replaced, find a place to put it
|
||||
if (!MoveItemToInventory(InvItem)) {
|
||||
Log(Logs::General, Logs::Error, "Char: %s, ERROR returning %s to inventory", GetName(), InvItem->GetItem()->Name);
|
||||
LogError("Char: [{}], ERROR returning [{}] to inventory", GetName(), InvItem->GetItem()->Name);
|
||||
}
|
||||
safe_delete(InvItem);
|
||||
}
|
||||
@@ -3176,7 +3176,7 @@ void Client::SetBandolier(const EQApplicationPacket *app)
|
||||
database.SaveInventory(character_id, 0, WeaponSlot);
|
||||
}
|
||||
else {
|
||||
Log(Logs::General, Logs::Error, "Char: %s, ERROR returning %s to inventory", GetName(), InvItem->GetItem()->Name);
|
||||
LogError("Char: [{}], ERROR returning [{}] to inventory", GetName(), InvItem->GetItem()->Name);
|
||||
}
|
||||
safe_delete(InvItem);
|
||||
}
|
||||
@@ -3394,7 +3394,7 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool
|
||||
log = true;
|
||||
|
||||
if (log) {
|
||||
Log(Logs::General, Logs::Error, "Client::InterrogateInventory() called for %s by %s with an error state of %s", GetName(), requester->GetName(), (error ? "TRUE" : "FALSE"));
|
||||
LogError("Client::InterrogateInventory() called for [{}] by [{}] with an error state of [{}]", GetName(), requester->GetName(), (error ? "TRUE" : "FALSE"));
|
||||
}
|
||||
if (!silent) {
|
||||
requester->Message(Chat::Default, "--- Inventory Interrogation Report for %s (requested by: %s, error state: %s) ---", GetName(), requester->GetName(), (error ? "TRUE" : "FALSE"));
|
||||
@@ -3415,7 +3415,7 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool
|
||||
}
|
||||
|
||||
if (log) {
|
||||
Log(Logs::General, Logs::Error, "Target interrogate inventory flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE"));
|
||||
LogError("Target interrogate inventory flag: [{}]", (GetInterrogateInvState() ? "TRUE" : "FALSE"));
|
||||
Log(Logs::Detail, Logs::None, "[CLIENT] Client::InterrogateInventory() -- End");
|
||||
}
|
||||
if (!silent) {
|
||||
|
||||
Reference in New Issue
Block a user