Renamed DoLog to Out as the aggregate logging function for simplicity of use and shortened syntax of Log.Out

This commit is contained in:
Akkadius
2015-01-18 02:00:15 -06:00
parent 1c048cb1d1
commit c025765283
119 changed files with 2653 additions and 2653 deletions
+41 -41
View File
@@ -42,7 +42,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme
{
if (!user || !in_augment)
{
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Client or AugmentItem_Struct not set in Object::HandleAugmentation");
Log.Out(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.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Player tried to augment an item without a container set.");
Log.Out(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.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Client or NewCombine_Struct not set in Object::HandleCombine");
Log.Out(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.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Replace container combine executed in a world container.");
Log.Out(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.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown recipe for HandleAutoCombine: %u\n", rac->recipe_id);
Log.Out(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.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in HandleAutoCombine query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.Out(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.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in HandleAutoCombine: no components returned");
Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in HandleAutoCombine: no components returned");
user->QueuePacket(outapp);
safe_delete(outapp);
return;
}
if(results.RowCount() > 10) {
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in HandleAutoCombine: too many components returned (%u)", results.RowCount());
Log.Out(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.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in TradeskillSearchResults query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.Out(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.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in TradeskillSearchResults query '%s': Invalid column count in result", query.c_str());
Log.Out(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.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SendTradeskillDetails query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SendTradeskillDetails query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
return;
}
if(results.RowCount() < 1) {
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SendTradeskillDetails: no components returned");
Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SendTradeskillDetails: no components returned");
return;
}
if(results.RowCount() > 10) {
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SendTradeskillDetails: too many components returned (%u)", results.RowCount());
Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SendTradeskillDetails: too many components returned (%u)", results.RowCount());
return;
}
@@ -901,7 +901,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
//handle caps
if(spec->nofail) {
chance = 100; //cannot fail.
Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...This combine cannot fail.");
Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...This combine cannot fail.");
} else if(over_trivial >= 0) {
// At reaching trivial the chance goes to 95% going up an additional
// percent for every 40 skillpoints above the trivial.
@@ -921,8 +921,8 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
chance = 95;
}
Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Current skill: %d , Trivial: %d , Success chance: %f percent", user_skill , spec->trivial , chance);
Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Bonusstat: %d , INT: %d , WIS: %d , DEX: %d , STR: %d", bonusstat , GetINT() , GetWIS() , GetDEX() , GetSTR());
Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Current skill: %d , Trivial: %d , Success chance: %f percent", user_skill , spec->trivial , chance);
Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Bonusstat: %d , INT: %d , WIS: %d , DEX: %d , STR: %d", bonusstat , GetINT() , GetWIS() , GetDEX() , GetSTR());
float res = zone->random.Real(0, 99);
int aa_chance = 0;
@@ -1066,7 +1066,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
Message_StringID(4, TRADESKILL_SUCCEED, spec->name.c_str());
Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "Tradeskill success");
Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "Tradeskill success");
itr = spec->onsuccess.begin();
while(itr != spec->onsuccess.end() && !spec->quest) {
@@ -1098,7 +1098,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
Message_StringID(MT_Emote,TRADESKILL_FAILED);
Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "Tradeskill failed");
Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "Tradeskill failed");
if (this->GetGroup())
{
entity_list.MessageGroup(this,true,MT_Skills,"%s was unsuccessful in %s tradeskill attempt.",GetName(),this->GetGender() == 0 ? "his" : this->GetGender() == 1 ? "her" : "its");
@@ -1177,9 +1177,9 @@ void Client::CheckIncreaseTradeskill(int16 bonusstat, int16 stat_modifier, float
NotifyNewTitlesAvailable();
}
Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...skillup_modifier: %f , success_modifier: %d , stat modifier: %d", skillup_modifier , success_modifier , stat_modifier);
Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Stage1 chance was: %f percent", chance_stage1);
Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Stage2 chance was: %f percent. 0 percent means stage1 failed", chance_stage2);
Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...skillup_modifier: %f , success_modifier: %d , stat modifier: %d", skillup_modifier , success_modifier , stat_modifier);
Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Stage1 chance was: %f percent", chance_stage1);
Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Stage2 chance was: %f percent. 0 percent means stage1 failed", chance_stage2);
}
bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint32 some_id,
@@ -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.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe search, query: %s", query.c_str());
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe search, error: %s", results.ErrorMessage().c_str());
Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe search, query: %s", query.c_str());
Log.Out(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.DoLog(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());
Log.Out(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.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str());
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str());
Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str());
Log.Out(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.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str());
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str());
Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str());
Log.Out(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.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Combine error: Incorrect container is being used!");
Log.Out(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.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Combine error: Recipe is not unique! %u matches found for container %u. Continuing with first recipe match.", results.RowCount(), containerId);
Log.Out(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.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in tradeskill verify query: '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.Out(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.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, query: %s", query.c_str());
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str());
Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, query: %s", query.c_str());
Log.Out(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.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecept success query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.Out(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.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecept success: no success items returned");
Log.Out(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.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdateRecipeMadecount query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdateRecipeMadecount query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
}
void Client::LearnRecipe(uint32 recipeID)
@@ -1477,12 +1477,12 @@ void Client::LearnRecipe(uint32 recipeID)
"WHERE tr.id = %u ;", CharacterID(), recipeID);
auto results = database.QueryDatabase(query);
if (!results.Success()) {
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
return;
}
if (results.RowCount() != 1) {
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Client::LearnRecipe - RecipeID: %d had %d occurences.", recipeID, results.RowCount());
Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Client::LearnRecipe - RecipeID: %d had %d occurences.", recipeID, results.RowCount());
return;
}
@@ -1503,7 +1503,7 @@ void Client::LearnRecipe(uint32 recipeID)
recipeID, CharacterID());
results = database.QueryDatabase(query);
if (!results.Success())
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.Out(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.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in EnableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.Out(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.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DisableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DisableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
return results.RowsAffected() > 0;
}