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
+13 -13
View File
@@ -84,7 +84,7 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c
uint32 errnum= 0;
char errbuf[MYSQL_ERRMSG_SIZE];
if (!Open(host, user, passwd, database, port, &errnum, errbuf)) {
Log.Log(EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf);
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf);
return false;
}
@@ -706,7 +706,7 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven
charid = GetCharacterID(pp->name);
if(!charid) {
Log.Log(EQEmuLogSys::Error, "StoreCharacter: no character id");
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "StoreCharacter: no character id");
return false;
}
@@ -736,7 +736,7 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven
auto results = QueryDatabase(invquery);
if (!results.RowsAffected())
Log.Log(EQEmuLogSys::Error, "StoreCharacter inventory failed. Query '%s' %s", invquery.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "StoreCharacter inventory failed. Query '%s' %s", invquery.c_str(), results.ErrorMessage().c_str());
#if EQDEBUG >= 9
else
Log.Log(EQEmuLogSys::Debug, "StoreCharacter inventory succeeded. Query '%s'", invquery.c_str());
@@ -805,7 +805,7 @@ uint32 Database::GetAccountIDByChar(uint32 char_id) {
std::string query = StringFormat("SELECT `account_id` FROM `character_data` WHERE `id` = %i LIMIT 1", char_id);
auto results = QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "Error in GetAccountIDByChar query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetAccountIDByChar query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
return 0;
}
@@ -3162,28 +3162,28 @@ void Database::SetLFP(uint32 CharID, bool LFP) {
std::string query = StringFormat("UPDATE `character_data` SET `lfp` = %i WHERE `id` = %i",LFP, CharID);
auto results = QueryDatabase(query);
if (!results.Success())
Log.Log(EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str());
}
void Database::SetLoginFlags(uint32 CharID, bool LFP, bool LFG, uint8 firstlogon) {
std::string query = StringFormat("update `character_data` SET `lfp` = %i, `lfg` = %i, `firstlogon` = %i WHERE `id` = %i",LFP, LFG, firstlogon, CharID);
auto results = QueryDatabase(query);
if (!results.Success())
Log.Log(EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str());
}
void Database::SetLFG(uint32 CharID, bool LFG) {
std::string query = StringFormat("update `character_data` SET `lfg` = %i WHERE `id` = %i",LFG, CharID);
auto results = QueryDatabase(query);
if (!results.Success())
Log.Log(EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str());
}
void Database::SetFirstLogon(uint32 CharID, uint8 firstlogon) {
std::string query = StringFormat( "UPDATE `character_data` SET `firstlogon` = %i WHERE `id` = %i",firstlogon, CharID);
auto results = QueryDatabase(query);
if (!results.Success())
Log.Log(EQEmuLogSys::Error, "Error updating firstlogon for character %i : %s", CharID, results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating firstlogon for character %i : %s", CharID, results.ErrorMessage().c_str());
}
void Database::AddReport(std::string who, std::string against, std::string lines) {
@@ -3195,7 +3195,7 @@ void Database::AddReport(std::string who, std::string against, std::string lines
safe_delete_array(escape_str);
if (!results.Success())
Log.Log(EQEmuLogSys::Error, "Error adding a report for %s: %s", who.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding a report for %s: %s", who.c_str(), results.ErrorMessage().c_str());
}
void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ismerc) {
@@ -3206,7 +3206,7 @@ void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ism
auto results = QueryDatabase(query);
if (!results.Success())
Log.Log(EQEmuLogSys::Error, "Error deleting character from group id: %s", results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error deleting character from group id: %s", results.ErrorMessage().c_str());
return;
}
@@ -3216,7 +3216,7 @@ void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ism
auto results = QueryDatabase(query);
if (!results.Success())
Log.Log(EQEmuLogSys::Error, "Error adding character to group id: %s", results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding character to group id: %s", results.ErrorMessage().c_str());
}
void Database::ClearAllGroups(void)
@@ -3255,7 +3255,7 @@ uint32 Database::GetGroupID(const char* name){
if (!results.Success())
{
Log.Log(EQEmuLogSys::Error, "Error getting group id: %s", results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting group id: %s", results.ErrorMessage().c_str());
return 0;
}
@@ -4049,7 +4049,7 @@ void Database::GetCharactersInInstance(uint16 instance_id, std::list<uint32> &ch
if (!results.Success())
{
Log.Log(EQEmuLogSys::Error, "Error in GetCharactersInInstace query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetCharactersInInstace query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
return;
}
+3 -3
View File
@@ -141,7 +141,7 @@ bool EQTime::saveFile(const char *filename)
of.open(filename);
if(!of)
{
Log.Log(EQEmuLogSys::Error, "EQTime::saveFile failed: Unable to open file '%s'", filename);
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "EQTime::saveFile failed: Unable to open file '%s'", filename);
return false;
}
//Enable for debugging
@@ -165,14 +165,14 @@ bool EQTime::loadFile(const char *filename)
in.open(filename);
if(!in)
{
Log.Log(EQEmuLogSys::Error, "Could not load EQTime file %s", filename);
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not load EQTime file %s", filename);
return false;
}
in >> version;
in.ignore(80, '\n');
if(version != EQT_VERSION)
{
Log.Log(EQEmuLogSys::Error, "'%s' is NOT a valid EQTime file. File version is %i, EQTime version is %i", filename, version, EQT_VERSION);
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "'%s' is NOT a valid EQTime file. File version is %i, EQTime version is %i", filename, version, EQT_VERSION);
return false;
}
//in >> eqTime.start_eqtime.day;
+1 -1
View File
@@ -337,7 +337,7 @@ uint32 BaseGuildManager::_GetFreeGuildID() {
if (!results.Success())
{
Log.Log(EQEmuLogSys::Error, "Error in _GetFreeGuildID query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in _GetFreeGuildID query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
continue;
}
+1 -1
View File
@@ -1153,7 +1153,7 @@ int16 Inventory::_PutItem(int16 slot_id, ItemInst* inst)
}
if (result == INVALID_INDEX) {
Log.Log(EQEmuLogSys::Error, "Inventory::_PutItem: Invalid slot_id specified (%i) with parent slot id (%i)", slot_id, parentSlot);
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Inventory::_PutItem: Invalid slot_id specified (%i) with parent slot id (%i)", slot_id, parentSlot);
Inventory::MarkDirty(inst); // Slot not found, clean up
}
+7 -7
View File
@@ -135,7 +135,7 @@ bool PersistentTimer::Load(Database *db) {
auto results = db->QueryDatabase(query);
if (!results.Success()) {
#if EQDEBUG > 5
Log.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str());
#endif
return false;
}
@@ -168,7 +168,7 @@ bool PersistentTimer::Store(Database *db) {
auto results = db->QueryDatabase(query);
if (!results.Success()) {
#if EQDEBUG > 5
Log.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Store, error: %s", results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Store, error: %s", results.ErrorMessage().c_str());
#endif
return false;
}
@@ -188,7 +188,7 @@ bool PersistentTimer::Clear(Database *db) {
auto results = db->QueryDatabase(query);
if (!results.Success()) {
#if EQDEBUG > 5
Log.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str());
#endif
return false;
}
@@ -200,7 +200,7 @@ bool PersistentTimer::Clear(Database *db) {
/* This function checks if the timer triggered */
bool PersistentTimer::Expired(Database *db, bool iReset) {
if (this == nullptr) {
Log.Log(EQEmuLogSys::Error, "Null timer during ->Check()!?\n");
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Null timer during ->Check()!?\n");
return(true);
}
uint32 current_time = get_current_time();
@@ -292,7 +292,7 @@ bool PTimerList::Load(Database *db) {
auto results = db->QueryDatabase(query);
if (!results.Success()) {
#if EQDEBUG > 5
Log.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str());
#endif
return false;
}
@@ -351,7 +351,7 @@ bool PTimerList::Clear(Database *db) {
auto results = db->QueryDatabase(query);
if (!results.Success()) {
#if EQDEBUG > 5
Log.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str());
#endif
return false;
}
@@ -443,7 +443,7 @@ bool PTimerList::ClearOffline(Database *db, uint32 char_id, pTimerType type) {
auto results = db->QueryDatabase(query);
if (!results.Success()) {
#if EQDEBUG > 5
Log.Log(EQEmuLogSys::Error, "Error in PTimerList::ClearOffline, error: %s", results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PTimerList::ClearOffline, error: %s", results.ErrorMessage().c_str());
#endif
return false;
}
+4 -4
View File
@@ -282,7 +282,7 @@ bool RuleManager::LoadRules(Database *db, const char *ruleset) {
auto results = db->QueryDatabase(query);
if (!results.Success())
{
Log.Log(EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str());
return false;
}
@@ -329,7 +329,7 @@ int RuleManager::GetRulesetID(Database *db, const char *rulesetname) {
safe_delete_array(rst);
auto results = db->QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str());
return -1;
}
@@ -369,7 +369,7 @@ std::string RuleManager::GetRulesetName(Database *db, int id) {
auto results = db->QueryDatabase(query);
if (!results.Success())
{
Log.Log(EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str());
return "";
}
@@ -390,7 +390,7 @@ bool RuleManager::ListRulesets(Database *db, std::map<int, std::string> &into) {
auto results = db->QueryDatabase(query);
if (results.Success())
{
Log.Log(EQEmuLogSys::Error, "Error in ListRulesets query %s: %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ListRulesets query %s: %s", query.c_str(), results.ErrorMessage().c_str());
return false;
}
+47 -47
View File
@@ -124,7 +124,7 @@ bool SharedDatabase::VerifyInventory(uint32 account_id, int16 slot_id, const Ite
account_id, slot_id);
auto results = QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "Error runing inventory verification query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error runing inventory verification query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
//returning true is less harmful in the face of a query error
return true;
}
@@ -214,7 +214,7 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, i
}
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "UpdateInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "UpdateInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
return false;
}
@@ -258,7 +258,7 @@ bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const ItemInst* inst,
}
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "UpdateSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "UpdateSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
return false;
}
@@ -271,7 +271,7 @@ bool SharedDatabase::DeleteInventorySlot(uint32 char_id, int16 slot_id) {
std::string query = StringFormat("DELETE FROM inventory WHERE charid = %i AND slotid = %i", char_id, slot_id);
auto results = QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "DeleteInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "DeleteInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
return false;
}
@@ -284,7 +284,7 @@ bool SharedDatabase::DeleteInventorySlot(uint32 char_id, int16 slot_id) {
char_id, base_slot_id, (base_slot_id+10));
results = QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "DeleteInventorySlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "DeleteInventorySlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
return false;
}
@@ -299,7 +299,7 @@ bool SharedDatabase::DeleteSharedBankSlot(uint32 char_id, int16 slot_id) {
std::string query = StringFormat("DELETE FROM sharedbank WHERE acctid=%i AND slotid=%i", account_id, slot_id);
auto results = QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "DeleteSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "DeleteSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
return false;
}
@@ -313,7 +313,7 @@ bool SharedDatabase::DeleteSharedBankSlot(uint32 char_id, int16 slot_id) {
account_id, base_slot_id, (base_slot_id+10));
results = QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "DeleteSharedBankSlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "DeleteSharedBankSlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
return false;
}
@@ -403,7 +403,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) {
"FROM sharedbank WHERE acctid=%i", id);
auto results = QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "Database::GetSharedBank(uint32 account_id): %s", results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Database::GetSharedBank(uint32 account_id): %s", results.ErrorMessage().c_str());
return false;
}
@@ -473,7 +473,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) {
if (put_slot_id != INVALID_INDEX)
continue;
Log.Log(EQEmuLogSys::Error, "Warning: Invalid slot_id for item in shared bank inventory: %s=%i, item_id=%i, slot_id=%i",
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Invalid slot_id for item in shared bank inventory: %s=%i, item_id=%i, slot_id=%i",
((is_charid==true)? "charid": "acctid"), id, item_id, slot_id);
if (is_charid)
@@ -492,8 +492,8 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) {
"FROM inventory WHERE charid = %i ORDER BY slotid", char_id);
auto results = QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
Log.Log(EQEmuLogSys::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n");
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n");
return false;
}
@@ -587,7 +587,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) {
else if (slot_id >= 3111 && slot_id <= 3179)
{
// Admins: please report any occurrences of this error
Log.Log(EQEmuLogSys::Error, "Warning: Defunct location for item in inventory: charid=%i, item_id=%i, slot_id=%i .. pushing to cursor...", char_id, item_id, slot_id);
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Defunct location for item in inventory: charid=%i, item_id=%i, slot_id=%i .. pushing to cursor...", char_id, item_id, slot_id);
put_slot_id = inv->PushCursor(*inst);
}
else
@@ -599,7 +599,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) {
// Save ptr to item in inventory
if (put_slot_id == INVALID_INDEX) {
Log.Log(EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: charid=%i, item_id=%i, slot_id=%i",char_id, item_id, slot_id);
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: charid=%i, item_id=%i, slot_id=%i",char_id, item_id, slot_id);
}
}
@@ -617,8 +617,8 @@ bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv)
name, account_id);
auto results = QueryDatabase(query);
if (!results.Success()){
Log.Log(EQEmuLogSys::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
Log.Log(EQEmuLogSys::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n");
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n");
return false;
}
@@ -704,7 +704,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv)
// Save ptr to item in inventory
if (put_slot_id == INVALID_INDEX)
Log.Log(EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: name=%s, acctid=%i, item_id=%i, slot_id=%i", name, account_id, item_id, slot_id);
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: name=%s, acctid=%i, item_id=%i, slot_id=%i", name, account_id, item_id, slot_id);
}
@@ -720,7 +720,7 @@ void SharedDatabase::GetItemsCount(int32 &item_count, uint32 &max_id) {
const std::string query = "SELECT MAX(id), count(*) FROM items";
auto results = QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "Error in GetItemsCount '%s': '%s'", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetItemsCount '%s': '%s'", query.c_str(), results.ErrorMessage().c_str());
return;
}
@@ -760,7 +760,7 @@ bool SharedDatabase::LoadItems() {
items_hash = new EQEmu::FixedMemoryHashSet<Item_Struct>(reinterpret_cast<uint8*>(items_mmf->Get()), size);
mutex.Unlock();
} catch(std::exception& ex) {
Log.Log(EQEmuLogSys::Error, "Error Loading Items: %s", ex.what());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Items: %s", ex.what());
return false;
}
@@ -805,7 +805,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
"updated FROM items ORDER BY id";
auto results = QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "LoadItems '%s', %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "LoadItems '%s', %s", query.c_str(), results.ErrorMessage().c_str());
return;
}
@@ -1018,7 +1018,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
try {
hash.insert(item.ID, item);
} catch(std::exception &ex) {
Log.Log(EQEmuLogSys::Error, "Database::LoadItems: %s", ex.what());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Database::LoadItems: %s", ex.what());
break;
}
}
@@ -1079,7 +1079,7 @@ std::string SharedDatabase::GetBook(const char *txtfile)
}
if (results.RowCount() == 0) {
Log.Log(EQEmuLogSys::Error, "No book to send, (%s)", txtfile);
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "No book to send, (%s)", txtfile);
txtout.assign(" ",1);
return txtout;
}
@@ -1097,7 +1097,7 @@ void SharedDatabase::GetFactionListInfo(uint32 &list_count, uint32 &max_lists) {
const std::string query = "SELECT COUNT(*), MAX(id) FROM npc_faction";
auto results = QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str());
return;
}
@@ -1132,7 +1132,7 @@ void SharedDatabase::LoadNPCFactionLists(void *data, uint32 size, uint32 list_co
"ON npc_faction.id = npc_faction_entries.npc_faction_id ORDER BY npc_faction.id;";
auto results = QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str());
return;
}
@@ -1198,7 +1198,7 @@ bool SharedDatabase::LoadNPCFactionLists() {
faction_hash = new EQEmu::FixedMemoryHashSet<NPCFactionList>(reinterpret_cast<uint8*>(faction_mmf->Get()), size);
mutex.Unlock();
} catch(std::exception& ex) {
Log.Log(EQEmuLogSys::Error, "Error Loading npc factions: %s", ex.what());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading npc factions: %s", ex.what());
return false;
}
@@ -1216,8 +1216,8 @@ ItemInst* SharedDatabase::CreateItem(uint32 item_id, int16 charges, uint32 aug1,
inst = CreateBaseItem(item, charges);
if (inst == nullptr) {
Log.Log(EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()");
Log.Log(EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges);
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()");
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges);
return nullptr;
}
@@ -1242,8 +1242,8 @@ ItemInst* SharedDatabase::CreateItem(const Item_Struct* item, int16 charges, uin
inst = CreateBaseItem(item, charges);
if (inst == nullptr) {
Log.Log(EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()");
Log.Log(EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges);
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()");
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges);
return nullptr;
}
@@ -1273,8 +1273,8 @@ ItemInst* SharedDatabase::CreateBaseItem(const Item_Struct* item, int16 charges)
inst = new ItemInst(item, charges);
if (inst == nullptr) {
Log.Log(EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateBaseItem()");
Log.Log(EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges);
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateBaseItem()");
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges);
return nullptr;
}
@@ -1344,7 +1344,7 @@ bool SharedDatabase::LoadSkillCaps() {
mutex.Unlock();
} catch(std::exception &ex) {
Log.Log(EQEmuLogSys::Error, "Error loading skill caps: %s", ex.what());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading skill caps: %s", ex.what());
return false;
}
@@ -1360,7 +1360,7 @@ void SharedDatabase::LoadSkillCaps(void *data) {
const std::string query = "SELECT skillID, class, level, cap FROM skill_caps ORDER BY skillID, class, level";
auto results = QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "Error loading skill caps from database: %s", results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading skill caps from database: %s", results.ErrorMessage().c_str());
return;
}
@@ -1462,7 +1462,7 @@ void SharedDatabase::LoadDamageShieldTypes(SPDat_Spell_Struct* sp, int32 iMaxSpe
"AND `spellid` <= %i", iMaxSpellID);
auto results = QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "Error in LoadDamageShieldTypes: %s %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadDamageShieldTypes: %s %s", query.c_str(), results.ErrorMessage().c_str());
return;
}
@@ -1658,7 +1658,7 @@ int SharedDatabase::GetMaxBaseDataLevel() {
const std::string query = "SELECT MAX(level) FROM base_data";
auto results = QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "Error in GetMaxBaseDataLevel query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetMaxBaseDataLevel query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
return -1;
}
@@ -1691,7 +1691,7 @@ bool SharedDatabase::LoadBaseData() {
mutex.Unlock();
} catch(std::exception& ex) {
Log.Log(EQEmuLogSys::Error, "Error Loading Base Data: %s", ex.what());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Base Data: %s", ex.what());
return false;
}
@@ -1704,7 +1704,7 @@ void SharedDatabase::LoadBaseData(void *data, int max_level) {
const std::string query = "SELECT * FROM base_data ORDER BY level, class ASC";
auto results = QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "Error in LoadBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
return;
}
@@ -1716,22 +1716,22 @@ void SharedDatabase::LoadBaseData(void *data, int max_level) {
cl = atoi(row[1]);
if(lvl <= 0) {
Log.Log(EQEmuLogSys::Error, "Non fatal error: base_data.level <= 0, ignoring.");
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Non fatal error: base_data.level <= 0, ignoring.");
continue;
}
if(lvl >= max_level) {
Log.Log(EQEmuLogSys::Error, "Non fatal error: base_data.level >= max_level, ignoring.");
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Non fatal error: base_data.level >= max_level, ignoring.");
continue;
}
if(cl <= 0) {
Log.Log(EQEmuLogSys::Error, "Non fatal error: base_data.cl <= 0, ignoring.");
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Non fatal error: base_data.cl <= 0, ignoring.");
continue;
}
if(cl > 16) {
Log.Log(EQEmuLogSys::Error, "Non fatal error: base_data.class > 16, ignoring.");
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Non fatal error: base_data.class > 16, ignoring.");
continue;
}
@@ -1784,7 +1784,7 @@ void SharedDatabase::GetLootTableInfo(uint32 &loot_table_count, uint32 &max_loot
const std::string query = "SELECT COUNT(*), MAX(id), (SELECT COUNT(*) FROM loottable_entries) FROM loottable";
auto results = QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str());
return;
}
@@ -1806,7 +1806,7 @@ void SharedDatabase::GetLootDropInfo(uint32 &loot_drop_count, uint32 &max_loot_d
const std::string query = "SELECT COUNT(*), MAX(id), (SELECT COUNT(*) FROM lootdrop_entries) FROM lootdrop";
auto results = QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str());
return;
}
@@ -1832,7 +1832,7 @@ void SharedDatabase::LoadLootTables(void *data, uint32 size) {
"ON loottable.id = loottable_entries.loottable_id ORDER BY id";
auto results = QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str());
return;
}
@@ -1886,7 +1886,7 @@ void SharedDatabase::LoadLootDrops(void *data, uint32 size) {
"ON lootdrop.id = lootdrop_entries.lootdrop_id ORDER BY lootdrop_id";
auto results = QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "Error getting loot drop info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting loot drop info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str());
}
uint32 current_id = 0;
@@ -1940,7 +1940,7 @@ bool SharedDatabase::LoadLoot() {
loot_drop_mmf->Size());
mutex.Unlock();
} catch(std::exception &ex) {
Log.Log(EQEmuLogSys::Error, "Error loading loot: %s", ex.what());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading loot: %s", ex.what());
return false;
}
@@ -1956,7 +1956,7 @@ const LootTable_Struct* SharedDatabase::GetLootTable(uint32 loottable_id) {
return &loot_table_hash->at(loottable_id);
}
} catch(std::exception &ex) {
Log.Log(EQEmuLogSys::Error, "Could not get loot table: %s", ex.what());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not get loot table: %s", ex.what());
}
return nullptr;
}
@@ -1970,7 +1970,7 @@ const LootDrop_Struct* SharedDatabase::GetLootDrop(uint32 lootdrop_id) {
return &loot_drop_hash->at(lootdrop_id);
}
} catch(std::exception &ex) {
Log.Log(EQEmuLogSys::Error, "Could not get loot drop: %s", ex.what());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not get loot drop: %s", ex.what());
}
return nullptr;
}