Consolidate 'LogType' Error logs over to 'LogCategory'

This commit is contained in:
Akkadius
2015-01-18 01:30:25 -06:00
parent b3fc0ab06d
commit e691735a2d
61 changed files with 594 additions and 594 deletions
+32 -32
View File
@@ -42,7 +42,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme
{
if (!user || !in_augment)
{
Log.Log(EQEmuLogSys::Error, "Client or AugmentItem_Struct not set in Object::HandleAugmentation");
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Client or AugmentItem_Struct not set in Object::HandleAugmentation");
return;
}
@@ -89,7 +89,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme
if(!container)
{
Log.Log(EQEmuLogSys::Error, "Player tried to augment an item without a container set.");
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Player tried to augment an item without a container set.");
user->Message(13, "Error: This item is not a container!");
return;
}
@@ -243,7 +243,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme
void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Object *worldo)
{
if (!user || !in_combine) {
Log.Log(EQEmuLogSys::Error, "Client or NewCombine_Struct not set in Object::HandleCombine");
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Client or NewCombine_Struct not set in Object::HandleCombine");
return;
}
@@ -418,7 +418,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
if(success && spec.replace_container) {
if(worldcontainer){
//should report this error, but we dont have the recipe ID, so its not very useful
Log.Log(EQEmuLogSys::Error, "Replace container combine executed in a world container.");
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Replace container combine executed in a world container.");
}
else
user->DeleteItemInInventory(in_combine->container_slot, 0, true);
@@ -444,7 +444,7 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac
//ask the database for the recipe to make sure it exists...
DBTradeskillRecipe_Struct spec;
if (!database.GetTradeRecipe(rac->recipe_id, rac->object_type, rac->some_id, user->CharacterID(), &spec)) {
Log.Log(EQEmuLogSys::Error, "Unknown recipe for HandleAutoCombine: %u\n", rac->recipe_id);
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown recipe for HandleAutoCombine: %u\n", rac->recipe_id);
user->QueuePacket(outapp);
safe_delete(outapp);
return;
@@ -467,21 +467,21 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac
rac->recipe_id);
auto results = database.QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "Error in HandleAutoCombine query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in HandleAutoCombine query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
user->QueuePacket(outapp);
safe_delete(outapp);
return;
}
if(results.RowCount() < 1) {
Log.Log(EQEmuLogSys::Error, "Error in HandleAutoCombine: no components returned");
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in HandleAutoCombine: no components returned");
user->QueuePacket(outapp);
safe_delete(outapp);
return;
}
if(results.RowCount() > 10) {
Log.Log(EQEmuLogSys::Error, "Error in HandleAutoCombine: too many components returned (%u)", results.RowCount());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in HandleAutoCombine: too many components returned (%u)", results.RowCount());
user->QueuePacket(outapp);
safe_delete(outapp);
return;
@@ -676,7 +676,7 @@ void Client::TradeskillSearchResults(const std::string query, unsigned long objt
auto results = database.QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "Error in TradeskillSearchResults query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in TradeskillSearchResults query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
return;
}
@@ -684,7 +684,7 @@ void Client::TradeskillSearchResults(const std::string query, unsigned long objt
return; //search gave no results... not an error
if(results.ColumnCount() != 6) {
Log.Log(EQEmuLogSys::Error, "Error in TradeskillSearchResults query '%s': Invalid column count in result", query.c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in TradeskillSearchResults query '%s': Invalid column count in result", query.c_str());
return;
}
@@ -730,17 +730,17 @@ void Client::SendTradeskillDetails(uint32 recipe_id) {
recipe_id);
auto results = database.QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "Error in SendTradeskillDetails query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SendTradeskillDetails query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
return;
}
if(results.RowCount() < 1) {
Log.Log(EQEmuLogSys::Error, "Error in SendTradeskillDetails: no components returned");
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SendTradeskillDetails: no components returned");
return;
}
if(results.RowCount() > 10) {
Log.Log(EQEmuLogSys::Error, "Error in SendTradeskillDetails: too many components returned (%u)", results.RowCount());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SendTradeskillDetails: too many components returned (%u)", results.RowCount());
return;
}
@@ -1232,8 +1232,8 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3
buf2.c_str(), containers.c_str(), count, sum);
auto results = QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe search, query: %s", query.c_str());
Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe search, error: %s", results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe search, query: %s", query.c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe search, error: %s", results.ErrorMessage().c_str());
return false;
}
@@ -1254,7 +1254,7 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3
//length limit on buf2
if(index == 214) { //Maximum number of recipe matches (19 * 215 = 4096)
Log.Log(EQEmuLogSys::Error, "GetTradeRecipe warning: Too many matches. Unable to search all recipe entries. Searched %u of %u possible entries.", index + 1, results.RowCount());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "GetTradeRecipe warning: Too many matches. Unable to search all recipe entries. Searched %u of %u possible entries.", index + 1, results.RowCount());
break;
}
}
@@ -1266,8 +1266,8 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3
"AND sum(tre.item_id * tre.componentcount) = %u", buf2.c_str(), count, sum);
results = QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str());
Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str());
return false;
}
}
@@ -1292,18 +1292,18 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3
"AND tre.item_id = %u;", buf2.c_str(), containerId);
results = QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str());
Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str());
return false;
}
if(results.RowCount() == 0) { //Recipe contents matched more than 1 recipe, but not in this container
Log.Log(EQEmuLogSys::Error, "Combine error: Incorrect container is being used!");
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Combine error: Incorrect container is being used!");
return false;
}
if (results.RowCount() > 1) //Recipe contents matched more than 1 recipe in this container
Log.Log(EQEmuLogSys::Error, "Combine error: Recipe is not unique! %u matches found for container %u. Continuing with first recipe match.", results.RowCount(), containerId);
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Combine error: Recipe is not unique! %u matches found for container %u. Continuing with first recipe match.", results.RowCount(), containerId);
}
@@ -1320,7 +1320,7 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3
recipe_id);
results = QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "Error in tradeskill verify query: '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in tradeskill verify query: '%s': %s", query.c_str(), results.ErrorMessage().c_str());
return GetTradeRecipe(recipe_id, c_type, some_id, char_id, spec);
}
@@ -1375,8 +1375,8 @@ bool ZoneDatabase::GetTradeRecipe(uint32 recipe_id, uint8 c_type, uint32 some_id
char_id, (unsigned long)recipe_id, containers.c_str());
auto results = QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, query: %s", query.c_str());
Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, query: %s", query.c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str());
return false;
}
@@ -1407,12 +1407,12 @@ bool ZoneDatabase::GetTradeRecipe(uint32 recipe_id, uint8 c_type, uint32 some_id
"WHERE successcount > 0 AND recipe_id = %u", recipe_id);
results = QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecept success query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecept success query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
return false;
}
if(results.RowCount() < 1) {
Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecept success: no success items returned");
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecept success: no success items returned");
return false;
}
@@ -1464,7 +1464,7 @@ void ZoneDatabase::UpdateRecipeMadecount(uint32 recipe_id, uint32 char_id, uint3
recipe_id, char_id, madeCount, madeCount);
auto results = QueryDatabase(query);
if (!results.Success())
Log.Log(EQEmuLogSys::Error, "Error in UpdateRecipeMadecount query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdateRecipeMadecount query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
}
void Client::LearnRecipe(uint32 recipeID)
@@ -1477,7 +1477,7 @@ void Client::LearnRecipe(uint32 recipeID)
"WHERE tr.id = %u ;", CharacterID(), recipeID);
auto results = database.QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "Error in Client::LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
return;
}
@@ -1503,7 +1503,7 @@ void Client::LearnRecipe(uint32 recipeID)
recipeID, CharacterID());
results = database.QueryDatabase(query);
if (!results.Success())
Log.Log(EQEmuLogSys::Error, "Error in LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
}
@@ -1553,7 +1553,7 @@ bool ZoneDatabase::EnableRecipe(uint32 recipe_id)
"WHERE id = %u;", recipe_id);
auto results = QueryDatabase(query);
if (!results.Success())
Log.Log(EQEmuLogSys::Error, "Error in EnableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in EnableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
return results.RowsAffected() > 0;
}
@@ -1564,7 +1564,7 @@ bool ZoneDatabase::DisableRecipe(uint32 recipe_id)
"WHERE id = %u;", recipe_id);
auto results = QueryDatabase(query);
if (!results.Success())
Log.Log(EQEmuLogSys::Error, "Error in DisableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DisableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
return results.RowsAffected() > 0;
}