diff options
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rwxr-xr-x | src/server/game/Globals/ObjectMgr.cpp | 1566 |
1 files changed, 636 insertions, 930 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 9dea557f650..08a76008fde 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -296,8 +296,7 @@ void ObjectMgr::LoadCreatureLocales() } } while (result->NextRow()); - sLog->outString(">> Loaded %lu creature locale strings in %u ms", (unsigned long)_creatureLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu creature locale strings in %u ms", (unsigned long)_creatureLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadGossipMenuItemsLocales() @@ -333,8 +332,7 @@ void ObjectMgr::LoadGossipMenuItemsLocales() } } while (result->NextRow()); - sLog->outString(">> Loaded %lu gossip_menu_option locale strings in %u ms", (unsigned long)_gossipMenuItemsLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu gossip_menu_option locale strings in %u ms", (unsigned long)_gossipMenuItemsLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadPointOfInterestLocales() @@ -360,8 +358,7 @@ void ObjectMgr::LoadPointOfInterestLocales() AddLocaleString(fields[i].GetString(), LocaleConstant(i), data.IconName); } while (result->NextRow()); - sLog->outString(">> Loaded %lu points_of_interest locale strings in %u ms", (unsigned long)_pointOfInterestLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu points_of_interest locale strings in %u ms", (unsigned long)_pointOfInterestLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadCreatureTemplates() @@ -388,8 +385,7 @@ void ObjectMgr::LoadCreatureTemplates() if (!result) { - sLog->outString(">> Loaded 0 creature template definitions. DB table `creature_template` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creature template definitions. DB table `creature_template` is empty."); return; } @@ -491,8 +487,7 @@ void ObjectMgr::LoadCreatureTemplates() for (CreatureTemplateContainer::const_iterator itr = _creatureTemplateStore.begin(); itr != _creatureTemplateStore.end(); ++itr) CheckCreatureTemplate(&itr->second); - sLog->outString(">> Loaded %u creature definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadCreatureTemplateAddons() @@ -504,8 +499,7 @@ void ObjectMgr::LoadCreatureTemplateAddons() if (!result) { - sLog->outString(">> Loaded 0 creature template addon definitions. DB table `creature_template_addon` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creature template addon definitions. DB table `creature_template_addon` is empty."); return; } @@ -518,7 +512,7 @@ void ObjectMgr::LoadCreatureTemplateAddons() if (!sObjectMgr->GetCreatureTemplate(entry)) { - sLog->outErrorDb("Creature template (Entry: %u) does not exist but has a record in `creature_template_addon`", entry); + sLog->outError(LOG_FILTER_SQL, "Creature template (Entry: %u) does not exist but has a record in `creature_template_addon`", entry); continue; } @@ -538,7 +532,7 @@ void ObjectMgr::LoadCreatureTemplateAddons() SpellInfo const* AdditionalSpellInfo = sSpellMgr->GetSpellInfo(uint32(atol(*itr))); if (!AdditionalSpellInfo) { - sLog->outErrorDb("Creature (Entry: %u) has wrong spell %u defined in `auras` field in `creature_template_addon`.", entry, uint32(atol(*itr))); + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has wrong spell %u defined in `auras` field in `creature_template_addon`.", entry, uint32(atol(*itr))); continue; } creatureAddon.auras[i++] = uint32(atol(*itr)); @@ -548,14 +542,14 @@ void ObjectMgr::LoadCreatureTemplateAddons() { if (!sCreatureDisplayInfoStore.LookupEntry(creatureAddon.mount)) { - sLog->outErrorDb("Creature (Entry: %u) has invalid displayInfoId (%u) for mount defined in `creature_template_addon`", entry, creatureAddon.mount); + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has invalid displayInfoId (%u) for mount defined in `creature_template_addon`", entry, creatureAddon.mount); creatureAddon.mount = 0; } } if (!sEmotesStore.LookupEntry(creatureAddon.emote)) { - sLog->outErrorDb("Creature (Entry: %u) has invalid emote (%u) defined in `creature_addon`.", entry, creatureAddon.emote); + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has invalid emote (%u) defined in `creature_addon`.", entry, creatureAddon.emote); creatureAddon.emote = 0; } @@ -563,8 +557,7 @@ void ObjectMgr::LoadCreatureTemplateAddons() } while (result->NextRow()); - sLog->outString(">> Loaded %u creature template addons in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature template addons in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) @@ -582,7 +575,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) CreatureTemplate const* difficultyInfo = GetCreatureTemplate(cInfo->DifficultyEntry[diff]); if (!difficultyInfo) { - sLog->outErrorDb("Creature (Entry: %u) has `difficulty_entry_%u`=%u but creature entry %u does not exist.", + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has `difficulty_entry_%u`=%u but creature entry %u does not exist.", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff], cInfo->DifficultyEntry[diff]); continue; } @@ -593,20 +586,20 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) ok2 = false; if (_difficultyEntries[diff2].find(cInfo->Entry) != _difficultyEntries[diff2].end()) { - sLog->outErrorDb("Creature (Entry: %u) is listed as `difficulty_entry_%u` of another creature, but itself lists %u in `difficulty_entry_%u`.", + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) is listed as `difficulty_entry_%u` of another creature, but itself lists %u in `difficulty_entry_%u`.", cInfo->Entry, diff2 + 1, cInfo->DifficultyEntry[diff], diff + 1); continue; } if (_difficultyEntries[diff2].find(cInfo->DifficultyEntry[diff]) != _difficultyEntries[diff2].end()) { - sLog->outErrorDb("Creature (Entry: %u) already listed as `difficulty_entry_%u` for another entry.", cInfo->DifficultyEntry[diff], diff2 + 1); + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) already listed as `difficulty_entry_%u` for another entry.", cInfo->DifficultyEntry[diff], diff2 + 1); continue; } if (_hasDifficultyEntries[diff2].find(cInfo->DifficultyEntry[diff]) != _hasDifficultyEntries[diff2].end()) { - sLog->outErrorDb("Creature (Entry: %u) has `difficulty_entry_%u`=%u but creature entry %u has itself a value in `difficulty_entry_%u`.", + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has `difficulty_entry_%u`=%u but creature entry %u has itself a value in `difficulty_entry_%u`.", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff], cInfo->DifficultyEntry[diff], diff2 + 1); continue; } @@ -617,51 +610,51 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) if (cInfo->unit_class != difficultyInfo->unit_class) { - sLog->outErrorDb("Creature (Entry: %u, class %u) has different `unit_class` in difficulty %u mode (Entry: %u, class %u).", + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u, class %u) has different `unit_class` in difficulty %u mode (Entry: %u, class %u).", cInfo->Entry, cInfo->unit_class, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->unit_class); continue; } if (cInfo->npcflag != difficultyInfo->npcflag) { - sLog->outErrorDb("Creature (Entry: %u) has different `npcflag` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]); + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has different `npcflag` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]); continue; } if (cInfo->trainer_class != difficultyInfo->trainer_class) { - sLog->outErrorDb("Creature (Entry: %u) has different `trainer_class` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]); + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has different `trainer_class` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]); continue; } if (cInfo->trainer_race != difficultyInfo->trainer_race) { - sLog->outErrorDb("Creature (Entry: %u) has different `trainer_race` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]); + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has different `trainer_race` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]); continue; } if (cInfo->trainer_type != difficultyInfo->trainer_type) { - sLog->outErrorDb("Creature (Entry: %u) has different `trainer_type` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]); + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has different `trainer_type` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]); continue; } if (cInfo->trainer_spell != difficultyInfo->trainer_spell) { - sLog->outErrorDb("Creature (Entry: %u) has different `trainer_spell` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]); + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has different `trainer_spell` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]); continue; } if (!difficultyInfo->AIName.empty()) { - sLog->outErrorDb("Creature (Entry: %u) lists difficulty %u mode entry %u with `AIName` filled in. `AIName` of difficulty 0 mode creature is always used instead.", + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) lists difficulty %u mode entry %u with `AIName` filled in. `AIName` of difficulty 0 mode creature is always used instead.", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]); continue; } if (difficultyInfo->ScriptID) { - sLog->outErrorDb("Creature (Entry: %u) lists difficulty %u mode entry %u with `ScriptName` filled in. `ScriptName` of difficulty 0 mode creature is always used instead.", + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) lists difficulty %u mode entry %u with `ScriptName` filled in. `ScriptName` of difficulty 0 mode creature is always used instead.", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]); continue; } @@ -673,11 +666,11 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(cInfo->faction_A); if (!factionTemplate) - sLog->outErrorDb("Creature (Entry: %u) has non-existing faction_A template (%u).", cInfo->Entry, cInfo->faction_A); + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has non-existing faction_A template (%u).", cInfo->Entry, cInfo->faction_A); factionTemplate = sFactionTemplateStore.LookupEntry(cInfo->faction_H); if (!factionTemplate) - sLog->outErrorDb("Creature (Entry: %u) has non-existing faction_H template (%u).", cInfo->Entry, cInfo->faction_H); + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has non-existing faction_H template (%u).", cInfo->Entry, cInfo->faction_H); // used later for scale CreatureDisplayInfoEntry const* displayScaleEntry = NULL; @@ -687,7 +680,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(cInfo->Modelid1); if (!displayEntry) { - sLog->outErrorDb("Creature (Entry: %u) lists non-existing Modelid1 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid1); + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) lists non-existing Modelid1 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid1); const_cast<CreatureTemplate*>(cInfo)->Modelid1 = 0; } else if (!displayScaleEntry) @@ -695,7 +688,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid1); if (!modelInfo) - sLog->outErrorDb("No model data exist for `Modelid1` = %u listed by creature (Entry: %u).", cInfo->Modelid1, cInfo->Entry); + sLog->outError(LOG_FILTER_SQL, "No model data exist for `Modelid1` = %u listed by creature (Entry: %u).", cInfo->Modelid1, cInfo->Entry); } if (cInfo->Modelid2) @@ -703,7 +696,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(cInfo->Modelid2); if (!displayEntry) { - sLog->outErrorDb("Creature (Entry: %u) lists non-existing Modelid2 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid2); + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) lists non-existing Modelid2 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid2); const_cast<CreatureTemplate*>(cInfo)->Modelid2 = 0; } else if (!displayScaleEntry) @@ -711,7 +704,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid2); if (!modelInfo) - sLog->outErrorDb("No model data exist for `Modelid2` = %u listed by creature (Entry: %u).", cInfo->Modelid2, cInfo->Entry); + sLog->outError(LOG_FILTER_SQL, "No model data exist for `Modelid2` = %u listed by creature (Entry: %u).", cInfo->Modelid2, cInfo->Entry); } if (cInfo->Modelid3) @@ -719,7 +712,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(cInfo->Modelid3); if (!displayEntry) { - sLog->outErrorDb("Creature (Entry: %u) lists non-existing Modelid3 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid3); + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) lists non-existing Modelid3 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid3); const_cast<CreatureTemplate*>(cInfo)->Modelid3 = 0; } else if (!displayScaleEntry) @@ -727,7 +720,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid3); if (!modelInfo) - sLog->outErrorDb("No model data exist for `Modelid3` = %u listed by creature (Entry: %u).", cInfo->Modelid3, cInfo->Entry); + sLog->outError(LOG_FILTER_SQL, "No model data exist for `Modelid3` = %u listed by creature (Entry: %u).", cInfo->Modelid3, cInfo->Entry); } if (cInfo->Modelid4) @@ -735,7 +728,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(cInfo->Modelid4); if (!displayEntry) { - sLog->outErrorDb("Creature (Entry: %u) lists non-existing Modelid4 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid4); + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) lists non-existing Modelid4 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid4); const_cast<CreatureTemplate*>(cInfo)->Modelid4 = 0; } else if (!displayScaleEntry) @@ -743,11 +736,11 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid4); if (!modelInfo) - sLog->outErrorDb("No model data exist for `Modelid4` = %u listed by creature (Entry: %u).", cInfo->Modelid4, cInfo->Entry); + sLog->outError(LOG_FILTER_SQL, "No model data exist for `Modelid4` = %u listed by creature (Entry: %u).", cInfo->Modelid4, cInfo->Entry); } if (!displayScaleEntry) - sLog->outErrorDb("Creature (Entry: %u) does not have any existing display id in Modelid1/Modelid2/Modelid3/Modelid4.", cInfo->Entry); + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) does not have any existing display id in Modelid1/Modelid2/Modelid3/Modelid4.", cInfo->Entry); for (int k = 0; k < MAX_KILL_CREDIT; ++k) { @@ -755,7 +748,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) { if (!GetCreatureTemplate(cInfo->KillCredit[k])) { - sLog->outErrorDb("Creature (Entry: %u) lists non-existing creature entry %u in `KillCredit%d`.", cInfo->Entry, cInfo->KillCredit[k], k + 1); + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) lists non-existing creature entry %u in `KillCredit%d`.", cInfo->Entry, cInfo->KillCredit[k], k + 1); const_cast<CreatureTemplate*>(cInfo)->KillCredit[k] = 0; } } @@ -763,13 +756,13 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) if (!cInfo->unit_class || ((1 << (cInfo->unit_class-1)) & CLASSMASK_ALL_CREATURES) == 0) { - sLog->outErrorDb("Creature (Entry: %u) has invalid unit_class (%u) in creature_template. Set to 1 (UNIT_CLASS_WARRIOR).", cInfo->Entry, cInfo->unit_class); + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has invalid unit_class (%u) in creature_template. Set to 1 (UNIT_CLASS_WARRIOR).", cInfo->Entry, cInfo->unit_class); const_cast<CreatureTemplate*>(cInfo)->unit_class = UNIT_CLASS_WARRIOR; } if (cInfo->dmgschool >= MAX_SPELL_SCHOOL) { - sLog->outErrorDb("Creature (Entry: %u) has invalid spell school value (%u) in `dmgschool`.", cInfo->Entry, cInfo->dmgschool); + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has invalid spell school value (%u) in `dmgschool`.", cInfo->Entry, cInfo->dmgschool); const_cast<CreatureTemplate*>(cInfo)->dmgschool = SPELL_SCHOOL_NORMAL; } @@ -780,30 +773,30 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) const_cast<CreatureTemplate*>(cInfo)->rangeattacktime = BASE_ATTACK_TIME; if ((cInfo->npcflag & UNIT_NPC_FLAG_TRAINER) && cInfo->trainer_type >= MAX_TRAINER_TYPE) - sLog->outErrorDb("Creature (Entry: %u) has wrong trainer type %u.", cInfo->Entry, cInfo->trainer_type); + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has wrong trainer type %u.", cInfo->Entry, cInfo->trainer_type); if (cInfo->type && !sCreatureTypeStore.LookupEntry(cInfo->type)) { - sLog->outErrorDb("Creature (Entry: %u) has invalid creature type (%u) in `type`.", cInfo->Entry, cInfo->type); + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has invalid creature type (%u) in `type`.", cInfo->Entry, cInfo->type); const_cast<CreatureTemplate*>(cInfo)->type = CREATURE_TYPE_HUMANOID; } // must exist or used hidden but used in data horse case if (cInfo->family && !sCreatureFamilyStore.LookupEntry(cInfo->family) && cInfo->family != CREATURE_FAMILY_HORSE_CUSTOM) { - sLog->outErrorDb("Creature (Entry: %u) has invalid creature family (%u) in `family`.", cInfo->Entry, cInfo->family); + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has invalid creature family (%u) in `family`.", cInfo->Entry, cInfo->family); const_cast<CreatureTemplate*>(cInfo)->family = 0; } if (cInfo->InhabitType <= 0 || cInfo->InhabitType > INHABIT_ANYWHERE) { - sLog->outErrorDb("Creature (Entry: %u) has wrong value (%u) in `InhabitType`, creature will not correctly walk/swim/fly.", cInfo->Entry, cInfo->InhabitType); + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has wrong value (%u) in `InhabitType`, creature will not correctly walk/swim/fly.", cInfo->Entry, cInfo->InhabitType); const_cast<CreatureTemplate*>(cInfo)->InhabitType = INHABIT_ANYWHERE; } if (cInfo->HoverHeight < 0.0f) { - sLog->outErrorDb("Creature (Entry: %u) has wrong value (%f) in `HoverHeight`", cInfo->Entry, cInfo->HoverHeight); + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has wrong value (%f) in `HoverHeight`", cInfo->Entry, cInfo->HoverHeight); const_cast<CreatureTemplate*>(cInfo)->HoverHeight = 1.0f; } @@ -812,7 +805,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) VehicleEntry const* vehId = sVehicleStore.LookupEntry(cInfo->VehicleId); if (!vehId) { - sLog->outErrorDb("Creature (Entry: %u) has a non-existing VehicleId (%u). This *WILL* cause the client to freeze!", cInfo->Entry, cInfo->VehicleId); + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has a non-existing VehicleId (%u). This *WILL* cause the client to freeze!", cInfo->Entry, cInfo->VehicleId); const_cast<CreatureTemplate*>(cInfo)->VehicleId = 0; } } @@ -821,21 +814,21 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) { CreatureSpellDataEntry const* spellDataId = sCreatureSpellDataStore.LookupEntry(cInfo->PetSpellDataId); if (!spellDataId) - sLog->outErrorDb("Creature (Entry: %u) has non-existing PetSpellDataId (%u).", cInfo->Entry, cInfo->PetSpellDataId); + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has non-existing PetSpellDataId (%u).", cInfo->Entry, cInfo->PetSpellDataId); } for (uint8 j = 0; j < CREATURE_MAX_SPELLS; ++j) { if (cInfo->spells[j] && !sSpellMgr->GetSpellInfo(cInfo->spells[j])) { - sLog->outErrorDb("Creature (Entry: %u) has non-existing Spell%d (%u), set to 0.", cInfo->Entry, j+1, cInfo->spells[j]); + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has non-existing Spell%d (%u), set to 0.", cInfo->Entry, j+1, cInfo->spells[j]); const_cast<CreatureTemplate*>(cInfo)->spells[j] = 0; } } if (cInfo->MovementType >= MAX_DB_MOTION_TYPE) { - sLog->outErrorDb("Creature (Entry: %u) has wrong movement generator type (%u), ignored and set to IDLE.", cInfo->Entry, cInfo->MovementType); + sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has wrong movement generator type (%u), ignored and set to IDLE.", cInfo->Entry, cInfo->MovementType); const_cast<CreatureTemplate*>(cInfo)->MovementType = IDLE_MOTION_TYPE; } @@ -843,7 +836,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) { if (!GetEquipmentInfo(cInfo->equipmentId)) { - sLog->outErrorDb("Table `creature_template` lists creature (Entry: %u) with `equipment_id` %u not found in table `creature_equip_template`, set to no equipment.", cInfo->Entry, cInfo->equipmentId); + sLog->outError(LOG_FILTER_SQL, "Table `creature_template` lists creature (Entry: %u) with `equipment_id` %u not found in table `creature_equip_template`, set to no equipment.", cInfo->Entry, cInfo->equipmentId); const_cast<CreatureTemplate*>(cInfo)->equipmentId = 0; } } @@ -859,13 +852,13 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) if (cInfo->expansion > (MAX_CREATURE_BASE_HP - 1)) { - sLog->outErrorDb("Table `creature_template` lists creature (Entry: %u) with expansion %u. Ignored and set to 0.", cInfo->Entry, cInfo->expansion); + sLog->outError(LOG_FILTER_SQL, "Table `creature_template` lists creature (Entry: %u) with expansion %u. Ignored and set to 0.", cInfo->Entry, cInfo->expansion); const_cast<CreatureTemplate*>(cInfo)->expansion = 0; } if (uint32 badFlags = (cInfo->flags_extra & ~CREATURE_FLAG_EXTRA_DB_ALLOWED)) { - sLog->outErrorDb("Table `creature_template` lists creature (Entry: %u) with disallowed `flags_extra` %u, removing incorrect flag.", cInfo->Entry, badFlags); + sLog->outError(LOG_FILTER_SQL, "Table `creature_template` lists creature (Entry: %u) with disallowed `flags_extra` %u, removing incorrect flag.", cInfo->Entry, badFlags); const_cast<CreatureTemplate*>(cInfo)->flags_extra &= CREATURE_FLAG_EXTRA_DB_ALLOWED; } @@ -881,8 +874,7 @@ void ObjectMgr::LoadCreatureAddons() if (!result) { - sLog->outString(">> Loaded 0 creature addon definitions. DB table `creature_addon` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creature addon definitions. DB table `creature_addon` is empty."); return; } @@ -896,7 +888,7 @@ void ObjectMgr::LoadCreatureAddons() CreatureData const* creData = GetCreatureData(guid); if (!creData) { - sLog->outErrorDb("Creature (GUID: %u) does not exist but has a record in `creature_addon`", guid); + sLog->outError(LOG_FILTER_SQL, "Creature (GUID: %u) does not exist but has a record in `creature_addon`", guid); continue; } @@ -906,7 +898,7 @@ void ObjectMgr::LoadCreatureAddons() if (creData->movementType == WAYPOINT_MOTION_TYPE && !creatureAddon.path_id) { const_cast<CreatureData*>(creData)->movementType = IDLE_MOTION_TYPE; - sLog->outErrorDb("Creature (GUID %u) has movement type set to WAYPOINT_MOTION_TYPE but no path assigned", guid); + sLog->outError(LOG_FILTER_SQL, "Creature (GUID %u) has movement type set to WAYPOINT_MOTION_TYPE but no path assigned", guid); } creatureAddon.mount = fields[2].GetUInt32(); @@ -922,7 +914,7 @@ void ObjectMgr::LoadCreatureAddons() SpellInfo const* AdditionalSpellInfo = sSpellMgr->GetSpellInfo(uint32(atol(*itr))); if (!AdditionalSpellInfo) { - sLog->outErrorDb("Creature (GUID: %u) has wrong spell %u defined in `auras` field in `creature_addon`.", guid, uint32(atol(*itr))); + sLog->outError(LOG_FILTER_SQL, "Creature (GUID: %u) has wrong spell %u defined in `auras` field in `creature_addon`.", guid, uint32(atol(*itr))); continue; } creatureAddon.auras[i++] = uint32(atol(*itr)); @@ -932,14 +924,14 @@ void ObjectMgr::LoadCreatureAddons() { if (!sCreatureDisplayInfoStore.LookupEntry(creatureAddon.mount)) { - sLog->outErrorDb("Creature (GUID: %u) has invalid displayInfoId (%u) for mount defined in `creature_addon`", guid, creatureAddon.mount); + sLog->outError(LOG_FILTER_SQL, "Creature (GUID: %u) has invalid displayInfoId (%u) for mount defined in `creature_addon`", guid, creatureAddon.mount); creatureAddon.mount = 0; } } if (!sEmotesStore.LookupEntry(creatureAddon.emote)) { - sLog->outErrorDb("Creature (GUID: %u) has invalid emote (%u) defined in `creature_addon`.", guid, creatureAddon.emote); + sLog->outError(LOG_FILTER_SQL, "Creature (GUID: %u) has invalid emote (%u) defined in `creature_addon`.", guid, creatureAddon.emote); creatureAddon.emote = 0; } @@ -947,8 +939,7 @@ void ObjectMgr::LoadCreatureAddons() } while (result->NextRow()); - sLog->outString(">> Loaded %u creature addons in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature addons in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } CreatureAddon const* ObjectMgr::GetCreatureAddon(uint32 lowguid) @@ -986,8 +977,7 @@ void ObjectMgr::LoadEquipmentTemplates() if (!result) { - sLog->outString(">> Loaded 0 creature equipment templates. DB table `creature_equip_template` is empty!"); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creature equipment templates. DB table `creature_equip_template` is empty!"); return; } @@ -1013,7 +1003,7 @@ void ObjectMgr::LoadEquipmentTemplates() if (!dbcItem) { - sLog->outErrorDb("Unknown item (entry=%u) in creature_equip_template.itemEntry%u for entry = %u, forced to 0.", + sLog->outError(LOG_FILTER_SQL, "Unknown item (entry=%u) in creature_equip_template.itemEntry%u for entry = %u, forced to 0.", equipmentInfo.ItemEntry[i], i+1, entry); equipmentInfo.ItemEntry[i] = 0; continue; @@ -1029,7 +1019,7 @@ void ObjectMgr::LoadEquipmentTemplates() dbcItem->InventoryType != INVTYPE_THROWN && dbcItem->InventoryType != INVTYPE_RANGEDRIGHT) { - sLog->outErrorDb("Item (entry=%u) in creature_equip_template.itemEntry%u for entry = %u is not equipable in a hand, forced to 0.", + sLog->outError(LOG_FILTER_SQL, "Item (entry=%u) in creature_equip_template.itemEntry%u for entry = %u is not equipable in a hand, forced to 0.", equipmentInfo.ItemEntry[i], i+1, entry); equipmentInfo.ItemEntry[i] = 0; } @@ -1039,8 +1029,7 @@ void ObjectMgr::LoadEquipmentTemplates() } while (result->NextRow()); - sLog->outString(">> Loaded %u equipment templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u equipment templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } CreatureModelInfo const* ObjectMgr::GetCreatureModelInfo(uint32 modelId) @@ -1097,7 +1086,7 @@ CreatureModelInfo const* ObjectMgr::GetCreatureModelRandomGender(uint32* display { CreatureModelInfo const* minfo_tmp = GetCreatureModelInfo(modelInfo->modelid_other_gender); if (!minfo_tmp) - sLog->outErrorDb("Model (Entry: %u) has modelid_other_gender %u not found in table `creature_model_info`. ", *displayID, modelInfo->modelid_other_gender); + sLog->outError(LOG_FILTER_SQL, "Model (Entry: %u) has modelid_other_gender %u not found in table `creature_model_info`. ", *displayID, modelInfo->modelid_other_gender); else { // Model ID changed @@ -1117,8 +1106,7 @@ void ObjectMgr::LoadCreatureModelInfo() if (!result) { - sLog->outString(">> Loaded 0 creature model definitions. DB table `creature_model_info` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creature model definitions. DB table `creature_model_info` is empty."); return; } @@ -1141,17 +1129,17 @@ void ObjectMgr::LoadCreatureModelInfo() // Checks if (!sCreatureDisplayInfoStore.LookupEntry(modelId)) - sLog->outErrorDb("Table `creature_model_info` has model for not existed display id (%u).", modelId); + sLog->outError(LOG_FILTER_SQL, "Table `creature_model_info` has model for not existed display id (%u).", modelId); if (modelInfo.gender > GENDER_NONE) { - sLog->outErrorDb("Table `creature_model_info` has wrong gender (%u) for display id (%u).", uint32(modelInfo.gender), modelId); + sLog->outError(LOG_FILTER_SQL, "Table `creature_model_info` has wrong gender (%u) for display id (%u).", uint32(modelInfo.gender), modelId); modelInfo.gender = GENDER_MALE; } if (modelInfo.modelid_other_gender && !sCreatureDisplayInfoStore.LookupEntry(modelInfo.modelid_other_gender)) { - sLog->outErrorDb("Table `creature_model_info` has not existed alt.gender model (%u) for existed display id (%u).", modelInfo.modelid_other_gender, modelId); + sLog->outError(LOG_FILTER_SQL, "Table `creature_model_info` has not existed alt.gender model (%u) for existed display id (%u).", modelInfo.modelid_other_gender, modelId); modelInfo.modelid_other_gender = 0; } @@ -1162,8 +1150,7 @@ void ObjectMgr::LoadCreatureModelInfo() } while (result->NextRow()); - sLog->outString(">> Loaded %u creature model based info in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature model based info in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadLinkedRespawn() @@ -1176,8 +1163,8 @@ void ObjectMgr::LoadLinkedRespawn() if (!result) { - sLog->outErrorDb(">> Loaded 0 linked respawns. DB table `linked_respawn` is empty."); - sLog->outString(); + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 linked respawns. DB table `linked_respawn` is empty."); + return; } @@ -1198,7 +1185,7 @@ void ObjectMgr::LoadLinkedRespawn() const CreatureData* slave = GetCreatureData(guidLow); if (!slave) { - sLog->outErrorDb("Couldn't get creature data for GUIDLow %u", guidLow); + sLog->outError(LOG_FILTER_SQL, "Couldn't get creature data for GUIDLow %u", guidLow); error = true; break; } @@ -1206,7 +1193,7 @@ void ObjectMgr::LoadLinkedRespawn() const CreatureData* master = GetCreatureData(linkedGuidLow); if (!master) { - sLog->outErrorDb("Couldn't get creature data for GUIDLow %u", linkedGuidLow); + sLog->outError(LOG_FILTER_SQL, "Couldn't get creature data for GUIDLow %u", linkedGuidLow); error = true; break; } @@ -1214,14 +1201,14 @@ void ObjectMgr::LoadLinkedRespawn() const MapEntry* const map = sMapStore.LookupEntry(master->mapid); if (!map || !map->Instanceable() || (master->mapid != slave->mapid)) { - sLog->outErrorDb("Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow); + sLog->outError(LOG_FILTER_SQL, "Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow); error = true; break; } if (!(master->spawnMask & slave->spawnMask)) // they must have a possibility to meet (normal/heroic difficulty) { - sLog->outErrorDb("LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow); + sLog->outError(LOG_FILTER_SQL, "LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow); error = true; break; } @@ -1235,7 +1222,7 @@ void ObjectMgr::LoadLinkedRespawn() const CreatureData* slave = GetCreatureData(guidLow); if (!slave) { - sLog->outErrorDb("Couldn't get creature data for GUIDLow %u", guidLow); + sLog->outError(LOG_FILTER_SQL, "Couldn't get creature data for GUIDLow %u", guidLow); error = true; break; } @@ -1243,7 +1230,7 @@ void ObjectMgr::LoadLinkedRespawn() const GameObjectData* master = GetGOData(linkedGuidLow); if (!master) { - sLog->outErrorDb("Couldn't get gameobject data for GUIDLow %u", linkedGuidLow); + sLog->outError(LOG_FILTER_SQL, "Couldn't get gameobject data for GUIDLow %u", linkedGuidLow); error = true; break; } @@ -1251,14 +1238,14 @@ void ObjectMgr::LoadLinkedRespawn() const MapEntry* const map = sMapStore.LookupEntry(master->mapid); if (!map || !map->Instanceable() || (master->mapid != slave->mapid)) { - sLog->outErrorDb("Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow); + sLog->outError(LOG_FILTER_SQL, "Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow); error = true; break; } if (!(master->spawnMask & slave->spawnMask)) // they must have a possibility to meet (normal/heroic difficulty) { - sLog->outErrorDb("LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow); + sLog->outError(LOG_FILTER_SQL, "LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow); error = true; break; } @@ -1272,7 +1259,7 @@ void ObjectMgr::LoadLinkedRespawn() const GameObjectData* slave = GetGOData(guidLow); if (!slave) { - sLog->outErrorDb("Couldn't get gameobject data for GUIDLow %u", guidLow); + sLog->outError(LOG_FILTER_SQL, "Couldn't get gameobject data for GUIDLow %u", guidLow); error = true; break; } @@ -1280,7 +1267,7 @@ void ObjectMgr::LoadLinkedRespawn() const GameObjectData* master = GetGOData(linkedGuidLow); if (!master) { - sLog->outErrorDb("Couldn't get gameobject data for GUIDLow %u", linkedGuidLow); + sLog->outError(LOG_FILTER_SQL, "Couldn't get gameobject data for GUIDLow %u", linkedGuidLow); error = true; break; } @@ -1288,14 +1275,14 @@ void ObjectMgr::LoadLinkedRespawn() const MapEntry* const map = sMapStore.LookupEntry(master->mapid); if (!map || !map->Instanceable() || (master->mapid != slave->mapid)) { - sLog->outErrorDb("Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow); + sLog->outError(LOG_FILTER_SQL, "Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow); error = true; break; } if (!(master->spawnMask & slave->spawnMask)) // they must have a possibility to meet (normal/heroic difficulty) { - sLog->outErrorDb("LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow); + sLog->outError(LOG_FILTER_SQL, "LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow); error = true; break; } @@ -1309,7 +1296,7 @@ void ObjectMgr::LoadLinkedRespawn() const GameObjectData* slave = GetGOData(guidLow); if (!slave) { - sLog->outErrorDb("Couldn't get gameobject data for GUIDLow %u", guidLow); + sLog->outError(LOG_FILTER_SQL, "Couldn't get gameobject data for GUIDLow %u", guidLow); error = true; break; } @@ -1317,7 +1304,7 @@ void ObjectMgr::LoadLinkedRespawn() const CreatureData* master = GetCreatureData(linkedGuidLow); if (!master) { - sLog->outErrorDb("Couldn't get creature data for GUIDLow %u", linkedGuidLow); + sLog->outError(LOG_FILTER_SQL, "Couldn't get creature data for GUIDLow %u", linkedGuidLow); error = true; break; } @@ -1325,14 +1312,14 @@ void ObjectMgr::LoadLinkedRespawn() const MapEntry* const map = sMapStore.LookupEntry(master->mapid); if (!map || !map->Instanceable() || (master->mapid != slave->mapid)) { - sLog->outErrorDb("Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow); + sLog->outError(LOG_FILTER_SQL, "Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow); error = true; break; } if (!(master->spawnMask & slave->spawnMask)) // they must have a possibility to meet (normal/heroic difficulty) { - sLog->outErrorDb("LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow); + sLog->outError(LOG_FILTER_SQL, "LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow); error = true; break; } @@ -1348,8 +1335,7 @@ void ObjectMgr::LoadLinkedRespawn() } while (result->NextRow()); - sLog->outString(">> Loaded " UI64FMTD " linked respawns in %u ms", uint64(_linkedRespawnStore.size()), GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded " UI64FMTD " linked respawns in %u ms", uint64(_linkedRespawnStore.size()), GetMSTimeDiffToNow(oldMSTime)); } bool ObjectMgr::SetCreatureLinkedRespawn(uint32 guidLow, uint32 linkedGuidLow) @@ -1374,13 +1360,13 @@ bool ObjectMgr::SetCreatureLinkedRespawn(uint32 guidLow, uint32 linkedGuidLow) const MapEntry* const map = sMapStore.LookupEntry(master->mapid); if (!map || !map->Instanceable() || (master->mapid != slave->mapid)) { - sLog->outErrorDb("Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow); + sLog->outError(LOG_FILTER_SQL, "Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow); return false; } if (!(master->spawnMask & slave->spawnMask)) // they must have a possibility to meet (normal/heroic difficulty) { - sLog->outErrorDb("LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow); + sLog->outError(LOG_FILTER_SQL, "LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow); return false; } @@ -1408,8 +1394,8 @@ void ObjectMgr::LoadCreatures() if (!result) { - sLog->outErrorDb(">> Loaded 0 creatures. DB table `creature` is empty."); - sLog->outString(); + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 creatures. DB table `creature` is empty."); + return; } @@ -1433,7 +1419,7 @@ void ObjectMgr::LoadCreatures() CreatureTemplate const* cInfo = GetCreatureTemplate(entry); if (!cInfo) { - sLog->outErrorDb("Table `creature` has creature (GUID: %u) with non existing creature entry %u, skipped.", guid, entry); + sLog->outError(LOG_FILTER_SQL, "Table `creature` has creature (GUID: %u) with non existing creature entry %u, skipped.", guid, entry); continue; } @@ -1463,19 +1449,19 @@ void ObjectMgr::LoadCreatures() MapEntry const* mapEntry = sMapStore.LookupEntry(data.mapid); if (!mapEntry) { - sLog->outErrorDb("Table `creature` have creature (GUID: %u) that spawned at not existed map (Id: %u), skipped.", guid, data.mapid); + sLog->outError(LOG_FILTER_SQL, "Table `creature` have creature (GUID: %u) that spawned at not existed map (Id: %u), skipped.", guid, data.mapid); continue; } if (data.spawnMask & ~spawnMasks[data.mapid]) - sLog->outErrorDb("Table `creature` have creature (GUID: %u) that have wrong spawn mask %u including not supported difficulty modes for map (Id: %u).", guid, data.spawnMask, data.mapid); + sLog->outError(LOG_FILTER_SQL, "Table `creature` have creature (GUID: %u) that have wrong spawn mask %u including not supported difficulty modes for map (Id: %u).", guid, data.spawnMask, data.mapid); bool ok = true; for (uint32 diff = 0; diff < MAX_DIFFICULTY - 1 && ok; ++diff) { if (_difficultyEntries[diff].find(data.id) != _difficultyEntries[diff].end()) { - sLog->outErrorDb("Table `creature` have creature (GUID: %u) that listed as difficulty %u template (entry: %u) in `creature_template`, skipped.", + sLog->outError(LOG_FILTER_SQL, "Table `creature` have creature (GUID: %u) that listed as difficulty %u template (entry: %u) in `creature_template`, skipped.", guid, diff + 1, data.id); ok = false; } @@ -1488,7 +1474,7 @@ void ObjectMgr::LoadCreatures() { if (!GetEquipmentInfo(data.equipmentId)) { - sLog->outErrorDb("Table `creature` have creature (Entry: %u) with equipment_id %u not found in table `creature_equip_template`, set to no equipment.", data.id, data.equipmentId); + sLog->outError(LOG_FILTER_SQL, "Table `creature` have creature (Entry: %u) with equipment_id %u not found in table `creature_equip_template`, set to no equipment.", data.id, data.equipmentId); data.equipmentId = -1; } } @@ -1496,19 +1482,19 @@ void ObjectMgr::LoadCreatures() if (cInfo->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND) { if (!mapEntry || !mapEntry->IsDungeon()) - sLog->outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with `creature_template`.`flags_extra` including CREATURE_FLAG_EXTRA_INSTANCE_BIND but creature are not in instance.", guid, data.id); + sLog->outError(LOG_FILTER_SQL, "Table `creature` have creature (GUID: %u Entry: %u) with `creature_template`.`flags_extra` including CREATURE_FLAG_EXTRA_INSTANCE_BIND but creature are not in instance.", guid, data.id); } if (data.spawndist < 0.0f) { - sLog->outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with `spawndist`< 0, set to 0.", guid, data.id); + sLog->outError(LOG_FILTER_SQL, "Table `creature` have creature (GUID: %u Entry: %u) with `spawndist`< 0, set to 0.", guid, data.id); data.spawndist = 0.0f; } else if (data.movementType == RANDOM_MOTION_TYPE) { if (data.spawndist == 0.0f) { - sLog->outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with `MovementType`=1 (random movement) but with `spawndist`=0, replace by idle movement type (0).", guid, data.id); + sLog->outError(LOG_FILTER_SQL, "Table `creature` have creature (GUID: %u Entry: %u) with `MovementType`=1 (random movement) but with `spawndist`=0, replace by idle movement type (0).", guid, data.id); data.movementType = IDLE_MOTION_TYPE; } } @@ -1516,14 +1502,14 @@ void ObjectMgr::LoadCreatures() { if (data.spawndist != 0.0f) { - sLog->outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with `MovementType`=0 (idle) have `spawndist`<>0, set to 0.", guid, data.id); + sLog->outError(LOG_FILTER_SQL, "Table `creature` have creature (GUID: %u Entry: %u) with `MovementType`=0 (idle) have `spawndist`<>0, set to 0.", guid, data.id); data.spawndist = 0.0f; } } if (data.phaseMask == 0) { - sLog->outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with `phaseMask`=0 (not visible for anyone), set to 1.", guid, data.id); + sLog->outError(LOG_FILTER_SQL, "Table `creature` have creature (GUID: %u Entry: %u) with `phaseMask`=0 (not visible for anyone), set to 1.", guid, data.id); data.phaseMask = 1; } @@ -1535,8 +1521,7 @@ void ObjectMgr::LoadCreatures() } while (result->NextRow()); - sLog->outString(">> Loaded %u creatures in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creatures in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::AddCreatureToGrid(uint32 guid, CreatureData const* data) @@ -1606,7 +1591,7 @@ uint32 ObjectMgr::AddGOData(uint32 entry, uint32 mapId, float x, float y, float GameObject* go = new GameObject; if (!go->LoadGameObjectFromDB(guid, map)) { - sLog->outError("AddGOData: cannot add gameobject entry %u to map", entry); + sLog->outError(LOG_FILTER_GENERAL, "AddGOData: cannot add gameobject entry %u to map", entry); delete go; return 0; } @@ -1641,7 +1626,7 @@ bool ObjectMgr::MoveCreData(uint32 guid, uint32 mapId, Position pos) Creature* creature = new Creature; if (!creature->LoadCreatureFromDB(guid, map)) { - sLog->outError("AddCreature: cannot add creature entry %u to map", guid); + sLog->outError(LOG_FILTER_GENERAL, "AddCreature: cannot add creature entry %u to map", guid); delete creature; return false; } @@ -1693,7 +1678,7 @@ uint32 ObjectMgr::AddCreData(uint32 entry, uint32 /*team*/, uint32 mapId, float Creature* creature = new Creature; if (!creature->LoadCreatureFromDB(guid, map)) { - sLog->outError("AddCreature: cannot add creature entry %u to map", entry); + sLog->outError(LOG_FILTER_GENERAL, "AddCreature: cannot add creature entry %u to map", entry); delete creature; return 0; } @@ -1718,8 +1703,8 @@ void ObjectMgr::LoadGameobjects() if (!result) { - sLog->outErrorDb(">> Loaded 0 gameobjects. DB table `gameobject` is empty."); - sLog->outString(); + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 gameobjects. DB table `gameobject` is empty."); + return; } @@ -1742,7 +1727,7 @@ void ObjectMgr::LoadGameobjects() GameObjectTemplate const* gInfo = GetGameObjectTemplate(entry); if (!gInfo) { - sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u) with non existing gameobject entry %u, skipped.", guid, entry); + sLog->outError(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u) with non existing gameobject entry %u, skipped.", guid, entry); continue; } @@ -1754,14 +1739,14 @@ void ObjectMgr::LoadGameobjects() case GAMEOBJECT_TYPE_SPELL_FOCUS: break; default: - sLog->outErrorDb("Gameobject (GUID: %u Entry %u GoType: %u) doesn't have a displayId (%u), not loaded.", guid, entry, gInfo->type, gInfo->displayId); + sLog->outError(LOG_FILTER_SQL, "Gameobject (GUID: %u Entry %u GoType: %u) doesn't have a displayId (%u), not loaded.", guid, entry, gInfo->type, gInfo->displayId); break; } } if (gInfo->displayId && !sGameObjectDisplayInfoStore.LookupEntry(gInfo->displayId)) { - sLog->outErrorDb("Gameobject (GUID: %u Entry %u GoType: %u) has an invalid displayId (%u), not loaded.", guid, entry, gInfo->type, gInfo->displayId); + sLog->outError(LOG_FILTER_SQL, "Gameobject (GUID: %u Entry %u GoType: %u) has an invalid displayId (%u), not loaded.", guid, entry, gInfo->type, gInfo->displayId); continue; } @@ -1782,13 +1767,13 @@ void ObjectMgr::LoadGameobjects() MapEntry const* mapEntry = sMapStore.LookupEntry(data.mapid); if (!mapEntry) { - sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) spawned on a non-existed map (Id: %u), skip", guid, data.id, data.mapid); + sLog->outError(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u Entry: %u) spawned on a non-existed map (Id: %u), skip", guid, data.id, data.mapid); continue; } if (data.spawntimesecs == 0 && gInfo->IsDespawnAtAction()) { - sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with `spawntimesecs` (0) value, but the gameobejct is marked as despawnable at action.", guid, data.id); + sLog->outError(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u Entry: %u) with `spawntimesecs` (0) value, but the gameobejct is marked as despawnable at action.", guid, data.id); } data.animprogress = fields[12].GetUInt8(); @@ -1797,7 +1782,7 @@ void ObjectMgr::LoadGameobjects() uint32 go_state = fields[13].GetUInt8(); if (go_state >= MAX_GO_STATE) { - sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid `state` (%u) value, skip", guid, data.id, go_state); + sLog->outError(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid `state` (%u) value, skip", guid, data.id, go_state); continue; } data.go_state = GOState(go_state); @@ -1805,7 +1790,7 @@ void ObjectMgr::LoadGameobjects() data.spawnMask = fields[14].GetUInt8(); if (data.spawnMask & ~spawnMasks[data.mapid]) - sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) that has wrong spawn mask %u including not supported difficulty modes for map (Id: %u), skip", guid, data.id, data.spawnMask, data.mapid); + sLog->outError(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u Entry: %u) that has wrong spawn mask %u including not supported difficulty modes for map (Id: %u), skip", guid, data.id, data.spawnMask, data.mapid); data.phaseMask = fields[15].GetUInt16(); int16 gameEvent = fields[16].GetInt8(); @@ -1813,25 +1798,25 @@ void ObjectMgr::LoadGameobjects() if (data.rotation2 < -1.0f || data.rotation2 > 1.0f) { - sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid rotation2 (%f) value, skip", guid, data.id, data.rotation2); + sLog->outError(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid rotation2 (%f) value, skip", guid, data.id, data.rotation2); continue; } if (data.rotation3 < -1.0f || data.rotation3 > 1.0f) { - sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid rotation3 (%f) value, skip", guid, data.id, data.rotation3); + sLog->outError(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid rotation3 (%f) value, skip", guid, data.id, data.rotation3); continue; } if (!MapManager::IsValidMapCoord(data.mapid, data.posX, data.posY, data.posZ, data.orientation)) { - sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid coordinates, skip", guid, data.id); + sLog->outError(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid coordinates, skip", guid, data.id); continue; } if (data.phaseMask == 0) { - sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with `phaseMask`=0 (not visible for anyone), set to 1.", guid, data.id); + sLog->outError(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u Entry: %u) with `phaseMask`=0 (not visible for anyone), set to 1.", guid, data.id); data.phaseMask = 1; } @@ -1840,8 +1825,7 @@ void ObjectMgr::LoadGameobjects() ++count; } while (result->NextRow()); - sLog->outString(">> Loaded %lu gameobjects in %u ms", (unsigned long)_gameObjectDataStore.size(), GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu gameobjects in %u ms", (unsigned long)_gameObjectDataStore.size(), GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::AddGameobjectToGrid(uint32 guid, GameObjectData const* data) @@ -1872,71 +1856,6 @@ void ObjectMgr::RemoveGameobjectFromGrid(uint32 guid, GameObjectData const* data } } -void ObjectMgr::LoadCreatureRespawnTimes() -{ - uint32 oldMSTime = getMSTime(); - - uint32 count = 0; - - PreparedQueryResult result = CharacterDatabase.Query(CharacterDatabase.GetPreparedStatement(CHAR_SEL_CREATURE_RESPAWNS)); - if (!result) - { - sLog->outString(">> Loaded 0 creature respawn time."); - sLog->outString(); - return; - } - - do - { - Field* fields = result->Fetch(); - - uint32 loguid = fields[0].GetUInt32(); - uint32 respawn_time = fields[1].GetUInt32(); - uint32 instance = fields[2].GetUInt32(); - - _creatureRespawnTimes[MAKE_PAIR64(loguid, instance)] = time_t(respawn_time); - - ++count; - } while (result->NextRow()); - - sLog->outString(">> Loaded %lu creature respawn times in %u ms", (unsigned long)_creatureRespawnTimes.size(), GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); -} - -void ObjectMgr::LoadGameobjectRespawnTimes() -{ - uint32 oldMSTime = getMSTime(); - - // Remove outdated data - CharacterDatabase.DirectExecute("DELETE FROM gameobject_respawn WHERE respawnTime <= UNIX_TIMESTAMP(NOW())"); - - uint32 count = 0; - - PreparedQueryResult result = CharacterDatabase.Query(CharacterDatabase.GetPreparedStatement(CHAR_SEL_GO_RESPAWNS)); - if (!result) - { - sLog->outString(">> Loaded 0 gameobject respawn times. DB table `gameobject_respawn` is empty!"); - sLog->outString(); - return; - } - - do - { - Field* fields = result->Fetch(); - - uint32 loguid = fields[0].GetUInt32(); - uint32 respawn_time = fields[1].GetUInt32(); - uint32 instance = fields[2].GetUInt32(); - - _goRespawnTimes[MAKE_PAIR64(loguid, instance)] = time_t(respawn_time); - - ++count; - } while (result->NextRow()); - - sLog->outString(); - sLog->outString(">> Loaded %lu gameobject respawn times in %u ms", (unsigned long)_goRespawnTimes.size(), GetMSTimeDiffToNow(oldMSTime)); -} - Player* ObjectMgr::GetPlayerByLowGUID(uint32 lowguid) const { uint64 guid = MAKE_NEW_GUID(lowguid, 0, HIGHGUID_PLAYER); @@ -2074,8 +1993,7 @@ void ObjectMgr::LoadItemLocales() } } while (result->NextRow()); - sLog->outString(">> Loaded %lu Item locale strings in %u ms", (unsigned long)_itemLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu Item locale strings in %u ms", (unsigned long)_itemLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadItemTemplates() @@ -2111,14 +2029,13 @@ void ObjectMgr::LoadItemTemplates() // 118 119 120 121 122 123 124 125 "TotemCategory, socketColor_1, socketContent_1, socketColor_2, socketContent_2, socketColor_3, socketContent_3, socketBonus, " // 126 127 128 129 130 131 132 133 - "GemProperties, RequiredDisenchantSkill, ArmorDamageModifier, Duration, ItemLimitCategory, HolidayId, ScriptName, DisenchantID, " + "GemProperties, RequiredDisenchantSkill, ArmorDamageModifier, duration, ItemLimitCategory, HolidayId, ScriptName, DisenchantID, " // 134 135 136 - "FoodType, minMoneyLoot, maxMoneyLoot FROM item_template"); + "FoodType, minMoneyLoot, maxMoneyLoot, flagsCustom FROM item_template"); if (!result) { - sLog->outString(">> Loaded 0 item templates. DB table `item_template` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 item templates. DB table `item_template` is empty."); return; } @@ -2230,7 +2147,7 @@ void ObjectMgr::LoadItemTemplates() itemTemplate.GemProperties = fields[126].GetUInt32(); itemTemplate.RequiredDisenchantSkill = uint32(fields[127].GetInt16()); itemTemplate.ArmorDamageModifier = fields[128].GetFloat(); - itemTemplate.Duration = fields[129].GetInt32(); + itemTemplate.Duration = fields[129].GetUInt32(); itemTemplate.ItemLimitCategory = uint32(fields[130].GetInt16()); itemTemplate.HolidayId = fields[131].GetUInt32(); itemTemplate.ScriptId = sObjectMgr->GetScriptId(fields[132].GetCString()); @@ -2238,6 +2155,7 @@ void ObjectMgr::LoadItemTemplates() itemTemplate.FoodType = uint32(fields[134].GetUInt8()); itemTemplate.MinMoneyLoot = fields[135].GetUInt32(); itemTemplate.MaxMoneyLoot = fields[136].GetUInt32(); + itemTemplate.FlagsCu = fields[137].GetUInt32(); // Checks @@ -2247,61 +2165,61 @@ void ObjectMgr::LoadItemTemplates() { if (itemTemplate.Class != dbcitem->Class) { - sLog->outErrorDb("Item (Entry: %u) does not have a correct class %u, must be %u .", entry, itemTemplate.Class, dbcitem->Class); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) does not have a correct class %u, must be %u .", entry, itemTemplate.Class, dbcitem->Class); if (enforceDBCAttributes) itemTemplate.Class = dbcitem->Class; } if (itemTemplate.Unk0 != dbcitem->Unk0) { - sLog->outErrorDb("Item (Entry: %u) does not have a correct Unk0 (%i), must be %i .", entry, itemTemplate.Unk0, dbcitem->Unk0); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) does not have a correct Unk0 (%i), must be %i .", entry, itemTemplate.Unk0, dbcitem->Unk0); if (enforceDBCAttributes) itemTemplate.Unk0 = dbcitem->Unk0; } if (itemTemplate.Material != dbcitem->Material) { - sLog->outErrorDb("Item (Entry: %u) does not have a correct material (%i), must be %i .", entry, itemTemplate.Material, dbcitem->Material); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) does not have a correct material (%i), must be %i .", entry, itemTemplate.Material, dbcitem->Material); if (enforceDBCAttributes) itemTemplate.Material = dbcitem->Material; } if (itemTemplate.InventoryType != dbcitem->InventoryType) { - sLog->outErrorDb("Item (Entry: %u) does not have a correct inventory type (%u), must be %u .", entry, itemTemplate.InventoryType, dbcitem->InventoryType); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) does not have a correct inventory type (%u), must be %u .", entry, itemTemplate.InventoryType, dbcitem->InventoryType); if (enforceDBCAttributes) itemTemplate.InventoryType = dbcitem->InventoryType; } if (itemTemplate.DisplayInfoID != dbcitem->DisplayId) { - sLog->outErrorDb("Item (Entry: %u) does not have a correct display id (%u), must be %u .", entry, itemTemplate.DisplayInfoID, dbcitem->DisplayId); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) does not have a correct display id (%u), must be %u .", entry, itemTemplate.DisplayInfoID, dbcitem->DisplayId); if (enforceDBCAttributes) itemTemplate.DisplayInfoID = dbcitem->DisplayId; } if (itemTemplate.Sheath != dbcitem->Sheath) { - sLog->outErrorDb("Item (Entry: %u) does not have a correct sheathid (%u), must be %u .", entry, itemTemplate.Sheath, dbcitem->Sheath); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) does not have a correct sheathid (%u), must be %u .", entry, itemTemplate.Sheath, dbcitem->Sheath); if (enforceDBCAttributes) itemTemplate.Sheath = dbcitem->Sheath; } } else - sLog->outErrorDb("Item (Entry: %u) does not exist in item.dbc! (not correct id?).", entry); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) does not exist in item.dbc! (not correct id?).", entry); if (itemTemplate.Class >= MAX_ITEM_CLASS) { - sLog->outErrorDb("Item (Entry: %u) has wrong Class value (%u)", entry, itemTemplate.Class); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong Class value (%u)", entry, itemTemplate.Class); itemTemplate.Class = ITEM_CLASS_MISC; } if (itemTemplate.SubClass >= MaxItemSubclassValues[itemTemplate.Class]) { - sLog->outErrorDb("Item (Entry: %u) has wrong Subclass value (%u) for class %u", entry, itemTemplate.SubClass, itemTemplate.Class); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong Subclass value (%u) for class %u", entry, itemTemplate.SubClass, itemTemplate.Class); itemTemplate.SubClass = 0;// exist for all item classes } if (itemTemplate.Quality >= MAX_ITEM_QUALITY) { - sLog->outErrorDb("Item (Entry: %u) has wrong Quality value (%u)", entry, itemTemplate.Quality); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong Quality value (%u)", entry, itemTemplate.Quality); itemTemplate.Quality = ITEM_QUALITY_NORMAL; } @@ -2309,36 +2227,36 @@ void ObjectMgr::LoadItemTemplates() { if (FactionEntry const* faction = sFactionStore.LookupEntry(HORDE)) if ((itemTemplate.AllowableRace & faction->BaseRepRaceMask[0]) == 0) - sLog->outErrorDb("Item (Entry: %u) has value (%u) in `AllowableRace` races, not compatible with ITEM_FLAGS_EXTRA_HORDE_ONLY (%u) in Flags field, item cannot be equipped or used by these races.", + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has value (%u) in `AllowableRace` races, not compatible with ITEM_FLAGS_EXTRA_HORDE_ONLY (%u) in Flags field, item cannot be equipped or used by these races.", entry, itemTemplate.AllowableRace, ITEM_FLAGS_EXTRA_HORDE_ONLY); if (itemTemplate.Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) - sLog->outErrorDb("Item (Entry: %u) has value (%u) in `Flags2` flags (ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) and ITEM_FLAGS_EXTRA_HORDE_ONLY (%u) in Flags field, this is a wrong combination.", + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has value (%u) in `Flags2` flags (ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) and ITEM_FLAGS_EXTRA_HORDE_ONLY (%u) in Flags field, this is a wrong combination.", entry, ITEM_FLAGS_EXTRA_ALLIANCE_ONLY, ITEM_FLAGS_EXTRA_HORDE_ONLY); } else if (itemTemplate.Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) { if (FactionEntry const* faction = sFactionStore.LookupEntry(ALLIANCE)) if ((itemTemplate.AllowableRace & faction->BaseRepRaceMask[0]) == 0) - sLog->outErrorDb("Item (Entry: %u) has value (%u) in `AllowableRace` races, not compatible with ITEM_FLAGS_EXTRA_ALLIANCE_ONLY (%u) in Flags field, item cannot be equipped or used by these races.", + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has value (%u) in `AllowableRace` races, not compatible with ITEM_FLAGS_EXTRA_ALLIANCE_ONLY (%u) in Flags field, item cannot be equipped or used by these races.", entry, itemTemplate.AllowableRace, ITEM_FLAGS_EXTRA_ALLIANCE_ONLY); } if (itemTemplate.BuyCount <= 0) { - sLog->outErrorDb("Item (Entry: %u) has wrong BuyCount value (%u), set to default(1).", entry, itemTemplate.BuyCount); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong BuyCount value (%u), set to default(1).", entry, itemTemplate.BuyCount); itemTemplate.BuyCount = 1; } if (itemTemplate.InventoryType >= MAX_INVTYPE) { - sLog->outErrorDb("Item (Entry: %u) has wrong InventoryType value (%u)", entry, itemTemplate.InventoryType); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong InventoryType value (%u)", entry, itemTemplate.InventoryType); itemTemplate.InventoryType = INVTYPE_NON_EQUIP; } if (itemTemplate.RequiredSkill >= MAX_SKILL_TYPE) { - sLog->outErrorDb("Item (Entry: %u) has wrong RequiredSkill value (%u)", entry, itemTemplate.RequiredSkill); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong RequiredSkill value (%u)", entry, itemTemplate.RequiredSkill); itemTemplate.RequiredSkill = 0; } @@ -2358,60 +2276,60 @@ void ObjectMgr::LoadItemTemplates() if (req) { if (!(itemTemplate.AllowableClass & CLASSMASK_ALL_PLAYABLE)) - sLog->outErrorDb("Item (Entry: %u) does not have any playable classes (%u) in `AllowableClass` and can't be equipped or used.", entry, itemTemplate.AllowableClass); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) does not have any playable classes (%u) in `AllowableClass` and can't be equipped or used.", entry, itemTemplate.AllowableClass); if (!(itemTemplate.AllowableRace & RACEMASK_ALL_PLAYABLE)) - sLog->outErrorDb("Item (Entry: %u) does not have any playable races (%u) in `AllowableRace` and can't be equipped or used.", entry, itemTemplate.AllowableRace); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) does not have any playable races (%u) in `AllowableRace` and can't be equipped or used.", entry, itemTemplate.AllowableRace); } } if (itemTemplate.RequiredSpell && !sSpellMgr->GetSpellInfo(itemTemplate.RequiredSpell)) { - sLog->outErrorDb("Item (Entry: %u) has a wrong (non-existing) spell in RequiredSpell (%u)", entry, itemTemplate.RequiredSpell); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has a wrong (non-existing) spell in RequiredSpell (%u)", entry, itemTemplate.RequiredSpell); itemTemplate.RequiredSpell = 0; } if (itemTemplate.RequiredReputationRank >= MAX_REPUTATION_RANK) - sLog->outErrorDb("Item (Entry: %u) has wrong reputation rank in RequiredReputationRank (%u), item can't be used.", entry, itemTemplate.RequiredReputationRank); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong reputation rank in RequiredReputationRank (%u), item can't be used.", entry, itemTemplate.RequiredReputationRank); if (itemTemplate.RequiredReputationFaction) { if (!sFactionStore.LookupEntry(itemTemplate.RequiredReputationFaction)) { - sLog->outErrorDb("Item (Entry: %u) has wrong (not existing) faction in RequiredReputationFaction (%u)", entry, itemTemplate.RequiredReputationFaction); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong (not existing) faction in RequiredReputationFaction (%u)", entry, itemTemplate.RequiredReputationFaction); itemTemplate.RequiredReputationFaction = 0; } if (itemTemplate.RequiredReputationRank == MIN_REPUTATION_RANK) - sLog->outErrorDb("Item (Entry: %u) has min. reputation rank in RequiredReputationRank (0) but RequiredReputationFaction > 0, faction setting is useless.", entry); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has min. reputation rank in RequiredReputationRank (0) but RequiredReputationFaction > 0, faction setting is useless.", entry); } if (itemTemplate.MaxCount < -1) { - sLog->outErrorDb("Item (Entry: %u) has too large negative in maxcount (%i), replace by value (-1) no storing limits.", entry, itemTemplate.MaxCount); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has too large negative in maxcount (%i), replace by value (-1) no storing limits.", entry, itemTemplate.MaxCount); itemTemplate.MaxCount = -1; } if (itemTemplate.Stackable == 0) { - sLog->outErrorDb("Item (Entry: %u) has wrong value in stackable (%i), replace by default 1.", entry, itemTemplate.Stackable); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong value in stackable (%i), replace by default 1.", entry, itemTemplate.Stackable); itemTemplate.Stackable = 1; } else if (itemTemplate.Stackable < -1) { - sLog->outErrorDb("Item (Entry: %u) has too large negative in stackable (%i), replace by value (-1) no stacking limits.", entry, itemTemplate.Stackable); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has too large negative in stackable (%i), replace by value (-1) no stacking limits.", entry, itemTemplate.Stackable); itemTemplate.Stackable = -1; } if (itemTemplate.ContainerSlots > MAX_BAG_SIZE) { - sLog->outErrorDb("Item (Entry: %u) has too large value in ContainerSlots (%u), replace by hardcoded limit (%u).", entry, itemTemplate.ContainerSlots, MAX_BAG_SIZE); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has too large value in ContainerSlots (%u), replace by hardcoded limit (%u).", entry, itemTemplate.ContainerSlots, MAX_BAG_SIZE); itemTemplate.ContainerSlots = MAX_BAG_SIZE; } if (itemTemplate.StatsCount > MAX_ITEM_PROTO_STATS) { - sLog->outErrorDb("Item (Entry: %u) has too large value in statscount (%u), replace by hardcoded limit (%u).", entry, itemTemplate.StatsCount, MAX_ITEM_PROTO_STATS); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has too large value in statscount (%u), replace by hardcoded limit (%u).", entry, itemTemplate.StatsCount, MAX_ITEM_PROTO_STATS); itemTemplate.StatsCount = MAX_ITEM_PROTO_STATS; } @@ -2420,7 +2338,7 @@ void ObjectMgr::LoadItemTemplates() // for ItemStatValue != 0 if (itemTemplate.ItemStat[j].ItemStatValue && itemTemplate.ItemStat[j].ItemStatType >= MAX_ITEM_MOD) { - sLog->outErrorDb("Item (Entry: %u) has wrong (non-existing?) stat_type%d (%u)", entry, j+1, itemTemplate.ItemStat[j].ItemStatType); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong (non-existing?) stat_type%d (%u)", entry, j+1, itemTemplate.ItemStat[j].ItemStatType); itemTemplate.ItemStat[j].ItemStatType = 0; } @@ -2428,7 +2346,7 @@ void ObjectMgr::LoadItemTemplates() { case ITEM_MOD_SPELL_HEALING_DONE: case ITEM_MOD_SPELL_DAMAGE_DONE: - sLog->outErrorDb("Item (Entry: %u) has deprecated stat_type%d (%u)", entry, j+1, itemTemplate.ItemStat[j].ItemStatType); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has deprecated stat_type%d (%u)", entry, j+1, itemTemplate.ItemStat[j].ItemStatType); break; default: break; @@ -2439,7 +2357,7 @@ void ObjectMgr::LoadItemTemplates() { if (itemTemplate.Damage[j].DamageType >= MAX_SPELL_SCHOOL) { - sLog->outErrorDb("Item (Entry: %u) has wrong dmg_type%d (%u)", entry, j+1, itemTemplate.Damage[j].DamageType); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong dmg_type%d (%u)", entry, j+1, itemTemplate.Damage[j].DamageType); itemTemplate.Damage[j].DamageType = 0; } } @@ -2450,7 +2368,7 @@ void ObjectMgr::LoadItemTemplates() // spell_1 if (itemTemplate.Spells[0].SpellTrigger != ITEM_SPELLTRIGGER_ON_USE) { - sLog->outErrorDb("Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u) for special learning format", entry, 0+1, itemTemplate.Spells[0].SpellTrigger); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u) for special learning format", entry, 0+1, itemTemplate.Spells[0].SpellTrigger); itemTemplate.Spells[0].SpellId = 0; itemTemplate.Spells[0].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; itemTemplate.Spells[1].SpellId = 0; @@ -2460,14 +2378,14 @@ void ObjectMgr::LoadItemTemplates() // spell_2 have learning spell if (itemTemplate.Spells[1].SpellTrigger != ITEM_SPELLTRIGGER_LEARN_SPELL_ID) { - sLog->outErrorDb("Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u) for special learning format.", entry, 1+1, itemTemplate.Spells[1].SpellTrigger); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u) for special learning format.", entry, 1+1, itemTemplate.Spells[1].SpellTrigger); itemTemplate.Spells[0].SpellId = 0; itemTemplate.Spells[1].SpellId = 0; itemTemplate.Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; } else if (!itemTemplate.Spells[1].SpellId) { - sLog->outErrorDb("Item (Entry: %u) does not have an expected spell in spellid_%d in special learning format.", entry, 1+1); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) does not have an expected spell in spellid_%d in special learning format.", entry, 1+1); itemTemplate.Spells[0].SpellId = 0; itemTemplate.Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; } @@ -2476,7 +2394,7 @@ void ObjectMgr::LoadItemTemplates() SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itemTemplate.Spells[1].SpellId); if (!spellInfo && !DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, itemTemplate.Spells[1].SpellId, NULL)) { - sLog->outErrorDb("Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%d)", entry, 1+1, itemTemplate.Spells[1].SpellId); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%d)", entry, 1+1, itemTemplate.Spells[1].SpellId); itemTemplate.Spells[0].SpellId = 0; itemTemplate.Spells[1].SpellId = 0; itemTemplate.Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; @@ -2484,7 +2402,7 @@ void ObjectMgr::LoadItemTemplates() // allowed only in special format else if ((itemTemplate.Spells[1].SpellId == 483) || (itemTemplate.Spells[1].SpellId == 55884)) { - sLog->outErrorDb("Item (Entry: %u) has broken spell in spellid_%d (%d)", entry, 1+1, itemTemplate.Spells[1].SpellId); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has broken spell in spellid_%d (%d)", entry, 1+1, itemTemplate.Spells[1].SpellId); itemTemplate.Spells[0].SpellId = 0; itemTemplate.Spells[1].SpellId = 0; itemTemplate.Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; @@ -2496,13 +2414,13 @@ void ObjectMgr::LoadItemTemplates() { if (itemTemplate.Spells[j].SpellTrigger != ITEM_SPELLTRIGGER_ON_USE) { - sLog->outErrorDb("Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u)", entry, j+1, itemTemplate.Spells[j].SpellTrigger); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u)", entry, j+1, itemTemplate.Spells[j].SpellTrigger); itemTemplate.Spells[j].SpellId = 0; itemTemplate.Spells[j].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; } else if (itemTemplate.Spells[j].SpellId != 0) { - sLog->outErrorDb("Item (Entry: %u) has wrong spell in spellid_%d (%d) for learning special format", entry, j+1, itemTemplate.Spells[j].SpellId); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong spell in spellid_%d (%d) for learning special format", entry, j+1, itemTemplate.Spells[j].SpellId); itemTemplate.Spells[j].SpellId = 0; } } @@ -2514,7 +2432,7 @@ void ObjectMgr::LoadItemTemplates() { if (itemTemplate.Spells[j].SpellTrigger >= MAX_ITEM_SPELLTRIGGER || itemTemplate.Spells[j].SpellTrigger == ITEM_SPELLTRIGGER_LEARN_SPELL_ID) { - sLog->outErrorDb("Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u)", entry, j+1, itemTemplate.Spells[j].SpellTrigger); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u)", entry, j+1, itemTemplate.Spells[j].SpellTrigger); itemTemplate.Spells[j].SpellId = 0; itemTemplate.Spells[j].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; } @@ -2524,13 +2442,13 @@ void ObjectMgr::LoadItemTemplates() SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itemTemplate.Spells[j].SpellId); if (!spellInfo && !DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, itemTemplate.Spells[j].SpellId, NULL)) { - sLog->outErrorDb("Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%d)", entry, j+1, itemTemplate.Spells[j].SpellId); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%d)", entry, j+1, itemTemplate.Spells[j].SpellId); itemTemplate.Spells[j].SpellId = 0; } // allowed only in special format else if ((itemTemplate.Spells[j].SpellId == 483) || (itemTemplate.Spells[j].SpellId == 55884)) { - sLog->outErrorDb("Item (Entry: %u) has broken spell in spellid_%d (%d)", entry, j+1, itemTemplate.Spells[j].SpellId); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has broken spell in spellid_%d (%d)", entry, j+1, itemTemplate.Spells[j].SpellId); itemTemplate.Spells[j].SpellId = 0; } } @@ -2538,17 +2456,17 @@ void ObjectMgr::LoadItemTemplates() } if (itemTemplate.Bonding >= MAX_BIND_TYPE) - sLog->outErrorDb("Item (Entry: %u) has wrong Bonding value (%u)", entry, itemTemplate.Bonding); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong Bonding value (%u)", entry, itemTemplate.Bonding); if (itemTemplate.PageText && !GetPageText(itemTemplate.PageText)) - sLog->outErrorDb("Item (Entry: %u) has non existing first page (Id:%u)", entry, itemTemplate.PageText); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has non existing first page (Id:%u)", entry, itemTemplate.PageText); if (itemTemplate.LockID && !sLockStore.LookupEntry(itemTemplate.LockID)) - sLog->outErrorDb("Item (Entry: %u) has wrong LockID (%u)", entry, itemTemplate.LockID); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong LockID (%u)", entry, itemTemplate.LockID); if (itemTemplate.Sheath >= MAX_SHEATHETYPE) { - sLog->outErrorDb("Item (Entry: %u) has wrong Sheath (%u)", entry, itemTemplate.Sheath); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong Sheath (%u)", entry, itemTemplate.Sheath); itemTemplate.Sheath = SHEATHETYPE_NONE; } @@ -2560,28 +2478,28 @@ void ObjectMgr::LoadItemTemplates() else if (!sItemRandomPropertiesStore.LookupEntry(GetItemEnchantMod(itemTemplate.RandomProperty))) { - sLog->outErrorDb("Item (Entry: %u) has unknown (wrong or not listed in `item_enchantment_template`) RandomProperty (%u)", entry, itemTemplate.RandomProperty); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has unknown (wrong or not listed in `item_enchantment_template`) RandomProperty (%u)", entry, itemTemplate.RandomProperty); itemTemplate.RandomProperty = 0; } } if (itemTemplate.RandomSuffix && !sItemRandomSuffixStore.LookupEntry(GetItemEnchantMod(itemTemplate.RandomSuffix))) { - sLog->outErrorDb("Item (Entry: %u) has wrong RandomSuffix (%u)", entry, itemTemplate.RandomSuffix); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong RandomSuffix (%u)", entry, itemTemplate.RandomSuffix); itemTemplate.RandomSuffix = 0; } if (itemTemplate.ItemSet && !sItemSetStore.LookupEntry(itemTemplate.ItemSet)) { - sLog->outErrorDb("Item (Entry: %u) have wrong ItemSet (%u)", entry, itemTemplate.ItemSet); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) have wrong ItemSet (%u)", entry, itemTemplate.ItemSet); itemTemplate.ItemSet = 0; } if (itemTemplate.Area && !GetAreaEntryByAreaID(itemTemplate.Area)) - sLog->outErrorDb("Item (Entry: %u) has wrong Area (%u)", entry, itemTemplate.Area); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong Area (%u)", entry, itemTemplate.Area); if (itemTemplate.Map && !sMapStore.LookupEntry(itemTemplate.Map)) - sLog->outErrorDb("Item (Entry: %u) has wrong Map (%u)", entry, itemTemplate.Map); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong Map (%u)", entry, itemTemplate.Map); if (itemTemplate.BagFamily) { @@ -2595,7 +2513,7 @@ void ObjectMgr::LoadItemTemplates() ItemBagFamilyEntry const* bf = sItemBagFamilyStore.LookupEntry(j+1); if (!bf) { - sLog->outErrorDb("Item (Entry: %u) has bag family bit set not listed in ItemBagFamily.dbc, remove bit", entry); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has bag family bit set not listed in ItemBagFamily.dbc, remove bit", entry); itemTemplate.BagFamily &= ~mask; continue; } @@ -2605,7 +2523,7 @@ void ObjectMgr::LoadItemTemplates() CurrencyTypesEntry const* ctEntry = sCurrencyTypesStore.LookupEntry(itemTemplate.ItemId); if (!ctEntry) { - sLog->outErrorDb("Item (Entry: %u) has currency bag family bit set in BagFamily but not listed in CurrencyTypes.dbc, remove bit", entry); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has currency bag family bit set in BagFamily but not listed in CurrencyTypes.dbc, remove bit", entry); itemTemplate.BagFamily &= ~mask; } } @@ -2613,38 +2531,44 @@ void ObjectMgr::LoadItemTemplates() } if (itemTemplate.TotemCategory && !sTotemCategoryStore.LookupEntry(itemTemplate.TotemCategory)) - sLog->outErrorDb("Item (Entry: %u) has wrong TotemCategory (%u)", entry, itemTemplate.TotemCategory); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong TotemCategory (%u)", entry, itemTemplate.TotemCategory); for (uint8 j = 0; j < MAX_ITEM_PROTO_SOCKETS; ++j) { if (itemTemplate.Socket[j].Color && (itemTemplate.Socket[j].Color & SOCKET_COLOR_ALL) != itemTemplate.Socket[j].Color) { - sLog->outErrorDb("Item (Entry: %u) has wrong socketColor_%d (%u)", entry, j+1, itemTemplate.Socket[j].Color); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong socketColor_%d (%u)", entry, j+1, itemTemplate.Socket[j].Color); itemTemplate.Socket[j].Color = 0; } } if (itemTemplate.GemProperties && !sGemPropertiesStore.LookupEntry(itemTemplate.GemProperties)) - sLog->outErrorDb("Item (Entry: %u) has wrong GemProperties (%u)", entry, itemTemplate.GemProperties); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong GemProperties (%u)", entry, itemTemplate.GemProperties); if (itemTemplate.FoodType >= MAX_PET_DIET) { - sLog->outErrorDb("Item (Entry: %u) has wrong FoodType value (%u)", entry, itemTemplate.FoodType); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong FoodType value (%u)", entry, itemTemplate.FoodType); itemTemplate.FoodType = 0; } if (itemTemplate.ItemLimitCategory && !sItemLimitCategoryStore.LookupEntry(itemTemplate.ItemLimitCategory)) { - sLog->outErrorDb("Item (Entry: %u) has wrong LimitCategory value (%u)", entry, itemTemplate.ItemLimitCategory); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong LimitCategory value (%u)", entry, itemTemplate.ItemLimitCategory); itemTemplate.ItemLimitCategory = 0; } if (itemTemplate.HolidayId && !sHolidaysStore.LookupEntry(itemTemplate.HolidayId)) { - sLog->outErrorDb("Item (Entry: %u) has wrong HolidayId value (%u)", entry, itemTemplate.HolidayId); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) has wrong HolidayId value (%u)", entry, itemTemplate.HolidayId); itemTemplate.HolidayId = 0; } + if (itemTemplate.FlagsCu & ITEM_FLAGS_CU_DURATION_REAL_TIME && !itemTemplate.Duration) + { + sLog->outError(LOG_FILTER_SQL, "Item (Entry %u) has flag ITEM_FLAGS_CU_DURATION_REAL_TIME but it does not have duration limit", entry); + itemTemplate.FlagsCu &= ~ITEM_FLAGS_CU_DURATION_REAL_TIME; + } + ++count; } while (result->NextRow()); @@ -2670,10 +2594,9 @@ void ObjectMgr::LoadItemTemplates() } for (std::set<uint32>::const_iterator itr = notFoundOutfit.begin(); itr != notFoundOutfit.end(); ++itr) - sLog->outErrorDb("Item (Entry: %u) does not exist in `item_template` but is referenced in `CharStartOutfit.dbc`", *itr); + sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) does not exist in `item_template` but is referenced in `CharStartOutfit.dbc`", *itr); - sLog->outString(">> Loaded %u item templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u item templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } ItemTemplate const* ObjectMgr::GetItemTemplate(uint32 entry) @@ -2708,8 +2631,7 @@ void ObjectMgr::LoadItemSetNameLocales() AddLocaleString(fields[i].GetString(), LocaleConstant(i), data.Name); } while (result->NextRow()); - sLog->outString(">> Loaded " UI64FMTD " Item set name locale strings in %u ms", uint64(_itemSetNameLocaleStore.size()), GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded " UI64FMTD " Item set name locale strings in %u ms", uint64(_itemSetNameLocaleStore.size()), GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadItemSetNames() @@ -2731,14 +2653,13 @@ void ObjectMgr::LoadItemSetNames() if (setEntry->itemId[i]) itemSetItems.insert(setEntry->itemId[i]); } - + // 0 1 2 QueryResult result = WorldDatabase.Query("SELECT `entry`, `name`, `InventoryType` FROM `item_set_names`"); if (!result) { - sLog->outString(">> Loaded 0 item set names. DB table `item_set_names` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 item set names. DB table `item_set_names` is empty."); return; } @@ -2752,7 +2673,7 @@ void ObjectMgr::LoadItemSetNames() uint32 entry = fields[0].GetUInt32(); if (itemSetItems.find(entry) == itemSetItems.end()) { - sLog->outErrorDb("Item set name (Entry: %u) not found in ItemSet.dbc, data useless.", entry); + sLog->outError(LOG_FILTER_SQL, "Item set name (Entry: %u) not found in ItemSet.dbc, data useless.", entry); continue; } @@ -2762,7 +2683,7 @@ void ObjectMgr::LoadItemSetNames() uint32 invType = fields[2].GetUInt8(); if (invType >= MAX_INVTYPE) { - sLog->outErrorDb("Item set name (Entry: %u) has wrong InventoryType value (%u)", entry, invType); + sLog->outError(LOG_FILTER_SQL, "Item set name (Entry: %u) has wrong InventoryType value (%u)", entry, invType); invType = INVTYPE_NON_EQUIP; } @@ -2781,19 +2702,18 @@ void ObjectMgr::LoadItemSetNames() pProto = sObjectMgr->GetItemTemplate(entry); if (pProto) { - sLog->outErrorDb("Item set part (Entry: %u) does not have entry in `item_set_names`, adding data from `item_template`.", entry); + sLog->outError(LOG_FILTER_SQL, "Item set part (Entry: %u) does not have entry in `item_set_names`, adding data from `item_template`.", entry); ItemSetNameEntry &data = _itemSetNameStore[entry]; data.name = pProto->Name1; data.InventoryType = pProto->InventoryType; ++count; } else - sLog->outErrorDb("Item set part (Entry: %u) does not have entry in `item_set_names`, set will not display properly.", entry); + sLog->outError(LOG_FILTER_SQL, "Item set part (Entry: %u) does not have entry in `item_set_names`, set will not display properly.", entry); } } - sLog->outString(">> Loaded %u item set names in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u item set names in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadVehicleTemplateAccessories() @@ -2809,8 +2729,8 @@ void ObjectMgr::LoadVehicleTemplateAccessories() if (!result) { - sLog->outErrorDb(">> Loaded 0 vehicle template accessories. DB table `vehicle_template_accessory` is empty."); - sLog->outString(); + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 vehicle template accessories. DB table `vehicle_template_accessory` is empty."); + return; } @@ -2827,19 +2747,19 @@ void ObjectMgr::LoadVehicleTemplateAccessories() if (!sObjectMgr->GetCreatureTemplate(uiEntry)) { - sLog->outErrorDb("Table `vehicle_template_accessory`: creature template entry %u does not exist.", uiEntry); + sLog->outError(LOG_FILTER_SQL, "Table `vehicle_template_accessory`: creature template entry %u does not exist.", uiEntry); continue; } if (!sObjectMgr->GetCreatureTemplate(uiAccessory)) { - sLog->outErrorDb("Table `vehicle_template_accessory`: Accessory %u does not exist.", uiAccessory); + sLog->outError(LOG_FILTER_SQL, "Table `vehicle_template_accessory`: Accessory %u does not exist.", uiAccessory); continue; } if (_spellClickInfoStore.find(uiEntry) == _spellClickInfoStore.end()) { - sLog->outErrorDb("Table `vehicle_template_accessory`: creature template entry %u has no data in npc_spellclick_spells", uiEntry); + sLog->outError(LOG_FILTER_SQL, "Table `vehicle_template_accessory`: creature template entry %u has no data in npc_spellclick_spells", uiEntry); continue; } @@ -2849,8 +2769,7 @@ void ObjectMgr::LoadVehicleTemplateAccessories() } while (result->NextRow()); - sLog->outString(">> Loaded %u Vehicle Template Accessories in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u Vehicle Template Accessories in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadVehicleAccessories() @@ -2866,8 +2785,7 @@ void ObjectMgr::LoadVehicleAccessories() if (!result) { - sLog->outString(">> Loaded 0 Vehicle Accessories in %u ms", GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 Vehicle Accessories in %u ms", GetMSTimeDiffToNow(oldMSTime)); return; } @@ -2884,7 +2802,7 @@ void ObjectMgr::LoadVehicleAccessories() if (!sObjectMgr->GetCreatureTemplate(uiAccessory)) { - sLog->outErrorDb("Table `vehicle_accessory`: Accessory %u does not exist.", uiAccessory); + sLog->outError(LOG_FILTER_SQL, "Table `vehicle_accessory`: Accessory %u does not exist.", uiAccessory); continue; } @@ -2894,8 +2812,7 @@ void ObjectMgr::LoadVehicleAccessories() } while (result->NextRow()); - sLog->outString(">> Loaded %u Vehicle Accessories in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u Vehicle Accessories in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadPetLevelInfo() @@ -2907,8 +2824,8 @@ void ObjectMgr::LoadPetLevelInfo() if (!result) { - sLog->outErrorDb(">> Loaded 0 level pet stats definitions. DB table `pet_levelstats` is empty."); - sLog->outString(); + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 level pet stats definitions. DB table `pet_levelstats` is empty."); + return; } @@ -2921,7 +2838,7 @@ void ObjectMgr::LoadPetLevelInfo() uint32 creature_id = fields[0].GetUInt32(); if (!sObjectMgr->GetCreatureTemplate(creature_id)) { - sLog->outErrorDb("Wrong creature id %u in `pet_levelstats` table, ignoring.", creature_id); + sLog->outError(LOG_FILTER_SQL, "Wrong creature id %u in `pet_levelstats` table, ignoring.", creature_id); continue; } @@ -2929,17 +2846,17 @@ void ObjectMgr::LoadPetLevelInfo() if (current_level > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { if (current_level > STRONG_MAX_LEVEL) // hardcoded level maximum - sLog->outErrorDb("Wrong (> %u) level %u in `pet_levelstats` table, ignoring.", STRONG_MAX_LEVEL, current_level); + sLog->outError(LOG_FILTER_SQL, "Wrong (> %u) level %u in `pet_levelstats` table, ignoring.", STRONG_MAX_LEVEL, current_level); else { - sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `pet_levelstats` table, ignoring.", current_level); + sLog->outInfo(LOG_FILTER_GENERAL, "Unused (> MaxPlayerLevel in worldserver.conf) level %u in `pet_levelstats` table, ignoring.", current_level); ++count; // make result loading percent "expected" correct in case disabled detail mode for example. } continue; } else if (current_level < 1) { - sLog->outErrorDb("Wrong (<1) level %u in `pet_levelstats` table, ignoring.", current_level); + sLog->outError(LOG_FILTER_SQL, "Wrong (<1) level %u in `pet_levelstats` table, ignoring.", current_level); continue; } @@ -2972,7 +2889,7 @@ void ObjectMgr::LoadPetLevelInfo() // fatal error if no level 1 data if (!pInfo || pInfo[0].health == 0) { - sLog->outErrorDb("Creature %u does not have pet stats data for Level 1!", itr->first); + sLog->outError(LOG_FILTER_SQL, "Creature %u does not have pet stats data for Level 1!", itr->first); exit(1); } @@ -2981,14 +2898,13 @@ void ObjectMgr::LoadPetLevelInfo() { if (pInfo[level].health == 0) { - sLog->outErrorDb("Creature %u has no data for Level %i pet stats data, using data of Level %i.", itr->first, level+1, level); + sLog->outError(LOG_FILTER_SQL, "Creature %u has no data for Level %i pet stats data, using data of Level %i.", itr->first, level+1, level); pInfo[level] = pInfo[level-1]; } } } - sLog->outString(">> Loaded %u level pet stats definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u level pet stats definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } PetLevelInfo const* ObjectMgr::GetPetLevelInfo(uint32 creature_id, uint8 level) const @@ -3010,7 +2926,7 @@ void ObjectMgr::PlayerCreateInfoAddItemHelper(uint32 race_, uint32 class_, uint3 else { if (count < -1) - sLog->outErrorDb("Invalid count %i specified on item %u be removed from original player create info (use -1)!", count, itemId); + sLog->outError(LOG_FILTER_SQL, "Invalid count %i specified on item %u be removed from original player create info (use -1)!", count, itemId); uint32 RaceClass = (race_) | (class_ << 8); bool doneOne = false; @@ -3032,7 +2948,7 @@ void ObjectMgr::PlayerCreateInfoAddItemHelper(uint32 race_, uint32 class_, uint3 } if (!found) - sLog->outErrorDb("Item %u specified to be removed from original create info not found in dbc!", itemId); + sLog->outError(LOG_FILTER_SQL, "Item %u specified to be removed from original create info not found in dbc!", itemId); if (!doneOne) doneOne = true; @@ -3054,8 +2970,8 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - sLog->outString(); - sLog->outErrorDb(">> Loaded 0 player create definitions. DB table `playercreateinfo` is empty."); + + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 player create definitions. DB table `playercreateinfo` is empty."); exit(1); } else @@ -3077,39 +2993,39 @@ void ObjectMgr::LoadPlayerInfo() if (current_race >= MAX_RACES) { - sLog->outErrorDb("Wrong race %u in `playercreateinfo` table, ignoring.", current_race); + sLog->outError(LOG_FILTER_SQL, "Wrong race %u in `playercreateinfo` table, ignoring.", current_race); continue; } ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(current_race); if (!rEntry) { - sLog->outErrorDb("Wrong race %u in `playercreateinfo` table, ignoring.", current_race); + sLog->outError(LOG_FILTER_SQL, "Wrong race %u in `playercreateinfo` table, ignoring.", current_race); continue; } if (current_class >= MAX_CLASSES) { - sLog->outErrorDb("Wrong class %u in `playercreateinfo` table, ignoring.", current_class); + sLog->outError(LOG_FILTER_SQL, "Wrong class %u in `playercreateinfo` table, ignoring.", current_class); continue; } if (!sChrClassesStore.LookupEntry(current_class)) { - sLog->outErrorDb("Wrong class %u in `playercreateinfo` table, ignoring.", current_class); + sLog->outError(LOG_FILTER_SQL, "Wrong class %u in `playercreateinfo` table, ignoring.", current_class); continue; } // accept DB data only for valid position (and non instanceable) if (!MapManager::IsValidMapCoord(mapId, positionX, positionY, positionZ, orientation)) { - sLog->outErrorDb("Wrong home position for class %u race %u pair in `playercreateinfo` table, ignoring.", current_class, current_race); + sLog->outError(LOG_FILTER_SQL, "Wrong home position for class %u race %u pair in `playercreateinfo` table, ignoring.", current_class, current_race); continue; } if (sMapStore.LookupEntry(mapId)->Instanceable()) { - sLog->outErrorDb("Home position in instanceable map for class %u race %u pair in `playercreateinfo` table, ignoring.", current_class, current_race); + sLog->outError(LOG_FILTER_SQL, "Home position in instanceable map for class %u race %u pair in `playercreateinfo` table, ignoring.", current_class, current_race); continue; } @@ -3129,13 +3045,12 @@ void ObjectMgr::LoadPlayerInfo() } while (result->NextRow()); - sLog->outString(">> Loaded %u player create definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u player create definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } // Load playercreate items - sLog->outString("Loading Player Create Items Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Player Create Items Data..."); { uint32 oldMSTime = getMSTime(); // 0 1 2 3 @@ -3143,8 +3058,7 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - sLog->outString(">> Loaded 0 custom player create items. DB table `playercreateinfo_item` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 custom player create items. DB table `playercreateinfo_item` is empty."); } else { @@ -3157,14 +3071,14 @@ void ObjectMgr::LoadPlayerInfo() uint32 current_race = fields[0].GetUInt8(); if (current_race >= MAX_RACES) { - sLog->outErrorDb("Wrong race %u in `playercreateinfo_item` table, ignoring.", current_race); + sLog->outError(LOG_FILTER_SQL, "Wrong race %u in `playercreateinfo_item` table, ignoring.", current_race); continue; } uint32 current_class = fields[1].GetUInt8(); if (current_class >= MAX_CLASSES) { - sLog->outErrorDb("Wrong class %u in `playercreateinfo_item` table, ignoring.", current_class); + sLog->outError(LOG_FILTER_SQL, "Wrong class %u in `playercreateinfo_item` table, ignoring.", current_class); continue; } @@ -3172,7 +3086,7 @@ void ObjectMgr::LoadPlayerInfo() if (!GetItemTemplate(item_id)) { - sLog->outErrorDb("Item id %u (race %u class %u) in `playercreateinfo_item` table but not listed in `item_template`, ignoring.", item_id, current_race, current_class); + sLog->outError(LOG_FILTER_SQL, "Item id %u (race %u class %u) in `playercreateinfo_item` table but not listed in `item_template`, ignoring.", item_id, current_race, current_class); continue; } @@ -3180,7 +3094,7 @@ void ObjectMgr::LoadPlayerInfo() if (!amount) { - sLog->outErrorDb("Item id %u (class %u race %u) have amount == 0 in `playercreateinfo_item` table, ignoring.", item_id, current_race, current_class); + sLog->outError(LOG_FILTER_SQL, "Item id %u (class %u race %u) have amount == 0 in `playercreateinfo_item` table, ignoring.", item_id, current_race, current_class); continue; } @@ -3201,13 +3115,12 @@ void ObjectMgr::LoadPlayerInfo() } while (result->NextRow()); - sLog->outString(">> Loaded %u custom player create items in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u custom player create items in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } // Load playercreate spells - sLog->outString("Loading Player Create Spell Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Player Create Spell Data..."); { uint32 oldMSTime = getMSTime(); @@ -3216,8 +3129,8 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - sLog->outErrorDb(">> Loaded 0 player create spells. DB table `%s` is empty.", sWorld->getBoolConfig(CONFIG_START_ALL_SPELLS) ? "playercreateinfo_spell_custom" : "playercreateinfo_spell"); - sLog->outString(); + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 player create spells. DB table `%s` is empty.", sWorld->getBoolConfig(CONFIG_START_ALL_SPELLS) ? "playercreateinfo_spell_custom" : "playercreateinfo_spell"); + } else { @@ -3230,14 +3143,14 @@ void ObjectMgr::LoadPlayerInfo() uint32 current_race = fields[0].GetUInt8(); if (current_race >= MAX_RACES) { - sLog->outErrorDb("Wrong race %u in `playercreateinfo_spell` table, ignoring.", current_race); + sLog->outError(LOG_FILTER_SQL, "Wrong race %u in `playercreateinfo_spell` table, ignoring.", current_race); continue; } uint32 current_class = fields[1].GetUInt8(); if (current_class >= MAX_CLASSES) { - sLog->outErrorDb("Wrong class %u in `playercreateinfo_spell` table, ignoring.", current_class); + sLog->outError(LOG_FILTER_SQL, "Wrong class %u in `playercreateinfo_spell` table, ignoring.", current_class); continue; } @@ -3258,13 +3171,12 @@ void ObjectMgr::LoadPlayerInfo() } while (result->NextRow()); - sLog->outString(">> Loaded %u player create spells in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u player create spells in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } // Load playercreate actions - sLog->outString("Loading Player Create Action Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Player Create Action Data..."); { uint32 oldMSTime = getMSTime(); @@ -3273,8 +3185,8 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - sLog->outErrorDb(">> Loaded 0 player create actions. DB table `playercreateinfo_action` is empty."); - sLog->outString(); + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 player create actions. DB table `playercreateinfo_action` is empty."); + } else { @@ -3287,14 +3199,14 @@ void ObjectMgr::LoadPlayerInfo() uint32 current_race = fields[0].GetUInt8(); if (current_race >= MAX_RACES) { - sLog->outErrorDb("Wrong race %u in `playercreateinfo_action` table, ignoring.", current_race); + sLog->outError(LOG_FILTER_SQL, "Wrong race %u in `playercreateinfo_action` table, ignoring.", current_race); continue; } uint32 current_class = fields[1].GetUInt8(); if (current_class >= MAX_CLASSES) { - sLog->outErrorDb("Wrong class %u in `playercreateinfo_action` table, ignoring.", current_class); + sLog->outError(LOG_FILTER_SQL, "Wrong class %u in `playercreateinfo_action` table, ignoring.", current_class); continue; } @@ -3305,13 +3217,12 @@ void ObjectMgr::LoadPlayerInfo() } while (result->NextRow()); - sLog->outString(">> Loaded %u player create actions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u player create actions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } // Loading levels data (class only dependent) - sLog->outString("Loading Player Create Level HP/Mana Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Player Create Level HP/Mana Data..."); { uint32 oldMSTime = getMSTime(); @@ -3320,8 +3231,8 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - sLog->outErrorDb(">> Loaded 0 level health/mana definitions. DB table `game_event_condition` is empty."); - sLog->outString(); + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 level health/mana definitions. DB table `game_event_condition` is empty."); + exit(1); } @@ -3334,14 +3245,14 @@ void ObjectMgr::LoadPlayerInfo() uint32 current_class = fields[0].GetUInt8(); if (current_class >= MAX_CLASSES) { - sLog->outErrorDb("Wrong class %u in `player_classlevelstats` table, ignoring.", current_class); + sLog->outError(LOG_FILTER_SQL, "Wrong class %u in `player_classlevelstats` table, ignoring.", current_class); continue; } uint8 current_level = fields[1].GetUInt8(); // Can't be > than STRONG_MAX_LEVEL (hardcoded level maximum) due to var type if (current_level > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { - sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_classlevelstats` table, ignoring.", current_level); + sLog->outInfo(LOG_FILTER_GENERAL, "Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_classlevelstats` table, ignoring.", current_level); ++count; // make result loading percent "expected" correct in case disabled detail mode for example. continue; } @@ -3372,7 +3283,7 @@ void ObjectMgr::LoadPlayerInfo() // fatal error if no level 1 data if (!pClassInfo->levelInfo || pClassInfo->levelInfo[0].basehealth == 0) { - sLog->outErrorDb("Class %i Level 1 does not have health/mana data!", class_); + sLog->outError(LOG_FILTER_SQL, "Class %i Level 1 does not have health/mana data!", class_); exit(1); } @@ -3381,18 +3292,17 @@ void ObjectMgr::LoadPlayerInfo() { if (pClassInfo->levelInfo[level].basehealth == 0) { - sLog->outErrorDb("Class %i Level %i does not have health/mana data. Using stats data of level %i.", class_, level+1, level); + sLog->outError(LOG_FILTER_SQL, "Class %i Level %i does not have health/mana data. Using stats data of level %i.", class_, level+1, level); pClassInfo->levelInfo[level] = pClassInfo->levelInfo[level-1]; } } } - sLog->outString(">> Loaded %u level health/mana definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u level health/mana definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } // Loading levels data (class/race dependent) - sLog->outString("Loading Player Create Level Stats Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Player Create Level Stats Data..."); { uint32 oldMSTime = getMSTime(); @@ -3401,8 +3311,8 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - sLog->outErrorDb(">> Loaded 0 level stats definitions. DB table `player_levelstats` is empty."); - sLog->outString(); + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 level stats definitions. DB table `player_levelstats` is empty."); + exit(1); } @@ -3415,14 +3325,14 @@ void ObjectMgr::LoadPlayerInfo() uint32 current_race = fields[0].GetUInt8(); if (current_race >= MAX_RACES) { - sLog->outErrorDb("Wrong race %u in `player_levelstats` table, ignoring.", current_race); + sLog->outError(LOG_FILTER_SQL, "Wrong race %u in `player_levelstats` table, ignoring.", current_race); continue; } uint32 current_class = fields[1].GetUInt8(); if (current_class >= MAX_CLASSES) { - sLog->outErrorDb("Wrong class %u in `player_levelstats` table, ignoring.", current_class); + sLog->outError(LOG_FILTER_SQL, "Wrong class %u in `player_levelstats` table, ignoring.", current_class); continue; } @@ -3430,10 +3340,10 @@ void ObjectMgr::LoadPlayerInfo() if (current_level > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { if (current_level > STRONG_MAX_LEVEL) // hardcoded level maximum - sLog->outErrorDb("Wrong (> %u) level %u in `player_levelstats` table, ignoring.", STRONG_MAX_LEVEL, current_level); + sLog->outError(LOG_FILTER_SQL, "Wrong (> %u) level %u in `player_levelstats` table, ignoring.", STRONG_MAX_LEVEL, current_level); else { - sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_levelstats` table, ignoring.", current_level); + sLog->outInfo(LOG_FILTER_GENERAL, "Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_levelstats` table, ignoring.", current_level); ++count; // make result loading percent "expected" correct in case disabled detail mode for example. } continue; @@ -3485,7 +3395,7 @@ void ObjectMgr::LoadPlayerInfo() // fatal error if no level 1 data if (!pInfo->levelInfo || pInfo->levelInfo[0].stats[0] == 0) { - sLog->outErrorDb("Race %i Class %i Level 1 does not have stats data!", race, class_); + sLog->outError(LOG_FILTER_SQL, "Race %i Class %i Level 1 does not have stats data!", race, class_); exit(1); } @@ -3494,19 +3404,18 @@ void ObjectMgr::LoadPlayerInfo() { if (pInfo->levelInfo[level].stats[0] == 0) { - sLog->outErrorDb("Race %i Class %i Level %i does not have stats data. Using stats data of level %i.", race, class_, level+1, level); + sLog->outError(LOG_FILTER_SQL, "Race %i Class %i Level %i does not have stats data. Using stats data of level %i.", race, class_, level+1, level); pInfo->levelInfo[level] = pInfo->levelInfo[level-1]; } } } } - sLog->outString(">> Loaded %u level stats definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u level stats definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } // Loading xp per level data - sLog->outString("Loading Player Create XP Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Player Create XP Data..."); { uint32 oldMSTime = getMSTime(); @@ -3519,8 +3428,8 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - sLog->outErrorDb(">> Loaded 0 xp for level definitions. DB table `player_xp_for_level` is empty."); - sLog->outString(); + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 xp for level definitions. DB table `player_xp_for_level` is empty."); + exit(1); } @@ -3536,10 +3445,10 @@ void ObjectMgr::LoadPlayerInfo() if (current_level >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { if (current_level > STRONG_MAX_LEVEL) // hardcoded level maximum - sLog->outErrorDb("Wrong (> %u) level %u in `player_xp_for_level` table, ignoring.", STRONG_MAX_LEVEL, current_level); + sLog->outError(LOG_FILTER_SQL, "Wrong (> %u) level %u in `player_xp_for_level` table, ignoring.", STRONG_MAX_LEVEL, current_level); else { - sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_xp_for_levels` table, ignoring.", current_level); + sLog->outInfo(LOG_FILTER_GENERAL, "Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_xp_for_levels` table, ignoring.", current_level); ++count; // make result loading percent "expected" correct in case disabled detail mode for example. } continue; @@ -3555,13 +3464,12 @@ void ObjectMgr::LoadPlayerInfo() { if (_playerXPperLevel[level] == 0) { - sLog->outErrorDb("Level %i does not have XP for level data. Using data of level [%i] + 100.", level+1, level); + sLog->outError(LOG_FILTER_SQL, "Level %i does not have XP for level data. Using data of level [%i] + 100.", level+1, level); _playerXPperLevel[level] = _playerXPperLevel[level-1]+100; } } - sLog->outString(">> Loaded %u xp for level definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u xp for level definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } @@ -3718,8 +3626,8 @@ void ObjectMgr::LoadQuests() " FROM quest_template"); if (!result) { - sLog->outErrorDb(">> Loaded 0 quests definitions. DB table `quest_template` is empty."); - sLog->outString(); + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 quests definitions. DB table `quest_template` is empty."); + return; } @@ -3748,18 +3656,18 @@ void ObjectMgr::LoadQuests() // additional quest integrity checks (GO, creature_template and item_template must be loaded already) if (qinfo->GetQuestMethod() >= 3) - sLog->outErrorDb("Quest %u has `Method` = %u, expected values are 0, 1 or 2.", qinfo->GetQuestId(), qinfo->GetQuestMethod()); + sLog->outError(LOG_FILTER_SQL, "Quest %u has `Method` = %u, expected values are 0, 1 or 2.", qinfo->GetQuestId(), qinfo->GetQuestMethod()); if (qinfo->Flags & ~QUEST_TRINITY_FLAGS_DB_ALLOWED) { - sLog->outErrorDb("Quest %u has `SpecialFlags` = %u > max allowed value. Correct `SpecialFlags` to value <= %u", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `SpecialFlags` = %u > max allowed value. Correct `SpecialFlags` to value <= %u", qinfo->GetQuestId(), qinfo->Flags >> 20, QUEST_TRINITY_FLAGS_DB_ALLOWED >> 20); qinfo->Flags &= QUEST_TRINITY_FLAGS_DB_ALLOWED; } if (qinfo->Flags & QUEST_FLAGS_DAILY && qinfo->Flags & QUEST_FLAGS_WEEKLY) { - sLog->outErrorDb("Weekly Quest %u is marked as daily quest in `Flags`, removed daily flag.", qinfo->GetQuestId()); + sLog->outError(LOG_FILTER_SQL, "Weekly Quest %u is marked as daily quest in `Flags`, removed daily flag.", qinfo->GetQuestId()); qinfo->Flags &= ~QUEST_FLAGS_DAILY; } @@ -3767,7 +3675,7 @@ void ObjectMgr::LoadQuests() { if (!(qinfo->Flags & QUEST_TRINITY_FLAGS_REPEATABLE)) { - sLog->outErrorDb("Daily Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId()); + sLog->outError(LOG_FILTER_SQL, "Daily Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId()); qinfo->Flags |= QUEST_TRINITY_FLAGS_REPEATABLE; } } @@ -3776,7 +3684,7 @@ void ObjectMgr::LoadQuests() { if (!(qinfo->Flags & QUEST_TRINITY_FLAGS_REPEATABLE)) { - sLog->outErrorDb("Weekly Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId()); + sLog->outError(LOG_FILTER_SQL, "Weekly Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId()); qinfo->Flags |= QUEST_TRINITY_FLAGS_REPEATABLE; } } @@ -3788,7 +3696,7 @@ void ObjectMgr::LoadQuests() { if (uint32 id = qinfo->RewardChoiceItemId[j]) { - sLog->outErrorDb("Quest %u has `RewardChoiceItemId%d` = %u but item from `RewardChoiceItemId%d` can't be rewarded with quest flag QUEST_FLAGS_AUTO_REWARDED.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardChoiceItemId%d` = %u but item from `RewardChoiceItemId%d` can't be rewarded with quest flag QUEST_FLAGS_AUTO_REWARDED.", qinfo->GetQuestId(), j+1, id, j+1); // no changes, quest ignore this data } @@ -3800,7 +3708,7 @@ void ObjectMgr::LoadQuests() { if (!GetAreaEntryByAreaID(qinfo->ZoneOrSort)) { - sLog->outErrorDb("Quest %u has `ZoneOrSort` = %u (zone case) but zone with this id does not exist.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `ZoneOrSort` = %u (zone case) but zone with this id does not exist.", qinfo->GetQuestId(), qinfo->ZoneOrSort); // no changes, quest not dependent from this value but can have problems at client } @@ -3811,7 +3719,7 @@ void ObjectMgr::LoadQuests() QuestSortEntry const* qSort = sQuestSortStore.LookupEntry(-int32(qinfo->ZoneOrSort)); if (!qSort) { - sLog->outErrorDb("Quest %u has `ZoneOrSort` = %i (sort case) but quest sort with this id does not exist.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `ZoneOrSort` = %i (sort case) but quest sort with this id does not exist.", qinfo->GetQuestId(), qinfo->ZoneOrSort); // no changes, quest not dependent from this value but can have problems at client (note some may be 0, we must allow this so no check) } @@ -3820,7 +3728,7 @@ void ObjectMgr::LoadQuests() { if (qinfo->RequiredSkillId != skill_id) { - sLog->outErrorDb("Quest %u has `ZoneOrSort` = %i but `RequiredSkillId` does not have a corresponding value (%d).", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `ZoneOrSort` = %i but `RequiredSkillId` does not have a corresponding value (%d).", qinfo->GetQuestId(), qinfo->ZoneOrSort, skill_id); //override, and force proper value here? } @@ -3832,7 +3740,7 @@ void ObjectMgr::LoadQuests() { if (!(qinfo->RequiredClasses & CLASSMASK_ALL_PLAYABLE)) { - sLog->outErrorDb("Quest %u does not contain any playable classes in `RequiredClasses` (%u), value set to 0 (all classes).", qinfo->GetQuestId(), qinfo->RequiredClasses); + sLog->outError(LOG_FILTER_SQL, "Quest %u does not contain any playable classes in `RequiredClasses` (%u), value set to 0 (all classes).", qinfo->GetQuestId(), qinfo->RequiredClasses); qinfo->RequiredClasses = 0; } } @@ -3841,7 +3749,7 @@ void ObjectMgr::LoadQuests() { if (!(qinfo->RequiredRaces & RACEMASK_ALL_PLAYABLE)) { - sLog->outErrorDb("Quest %u does not contain any playable races in `RequiredRaces` (%u), value set to 0 (all races).", qinfo->GetQuestId(), qinfo->RequiredRaces); + sLog->outError(LOG_FILTER_SQL, "Quest %u does not contain any playable races in `RequiredRaces` (%u), value set to 0 (all races).", qinfo->GetQuestId(), qinfo->RequiredRaces); qinfo->RequiredRaces = 0; } } @@ -3850,7 +3758,7 @@ void ObjectMgr::LoadQuests() { if (!sSkillLineStore.LookupEntry(qinfo->RequiredSkillId)) { - sLog->outErrorDb("Quest %u has `RequiredSkillId` = %u but this skill does not exist", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredSkillId` = %u but this skill does not exist", qinfo->GetQuestId(), qinfo->RequiredSkillId); } } @@ -3859,7 +3767,7 @@ void ObjectMgr::LoadQuests() { if (qinfo->RequiredSkillPoints > sWorld->GetConfigMaxSkillValue()) { - sLog->outErrorDb("Quest %u has `RequiredSkillPoints` = %u but max possible skill is %u, quest can't be done.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredSkillPoints` = %u but max possible skill is %u, quest can't be done.", qinfo->GetQuestId(), qinfo->RequiredSkillPoints, sWorld->GetConfigMaxSkillValue()); // no changes, quest can't be done for this requirement } @@ -3868,77 +3776,77 @@ void ObjectMgr::LoadQuests() if (qinfo->RequiredFactionId2 && !sFactionStore.LookupEntry(qinfo->RequiredFactionId2)) { - sLog->outErrorDb("Quest %u has `RequiredFactionId2` = %u but faction template %u does not exist, quest can't be done.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredFactionId2` = %u but faction template %u does not exist, quest can't be done.", qinfo->GetQuestId(), qinfo->RequiredFactionId2, qinfo->RequiredFactionId2); // no changes, quest can't be done for this requirement } if (qinfo->RequiredFactionId1 && !sFactionStore.LookupEntry(qinfo->RequiredFactionId1)) { - sLog->outErrorDb("Quest %u has `RequiredFactionId1` = %u but faction template %u does not exist, quest can't be done.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredFactionId1` = %u but faction template %u does not exist, quest can't be done.", qinfo->GetQuestId(), qinfo->RequiredFactionId1, qinfo->RequiredFactionId1); // no changes, quest can't be done for this requirement } if (qinfo->RequiredMinRepFaction && !sFactionStore.LookupEntry(qinfo->RequiredMinRepFaction)) { - sLog->outErrorDb("Quest %u has `RequiredMinRepFaction` = %u but faction template %u does not exist, quest can't be done.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredMinRepFaction` = %u but faction template %u does not exist, quest can't be done.", qinfo->GetQuestId(), qinfo->RequiredMinRepFaction, qinfo->RequiredMinRepFaction); // no changes, quest can't be done for this requirement } if (qinfo->RequiredMaxRepFaction && !sFactionStore.LookupEntry(qinfo->RequiredMaxRepFaction)) { - sLog->outErrorDb("Quest %u has `RequiredMaxRepFaction` = %u but faction template %u does not exist, quest can't be done.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredMaxRepFaction` = %u but faction template %u does not exist, quest can't be done.", qinfo->GetQuestId(), qinfo->RequiredMaxRepFaction, qinfo->RequiredMaxRepFaction); // no changes, quest can't be done for this requirement } if (qinfo->RequiredMinRepValue && qinfo->RequiredMinRepValue > ReputationMgr::Reputation_Cap) { - sLog->outErrorDb("Quest %u has `RequiredMinRepValue` = %d but max reputation is %u, quest can't be done.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredMinRepValue` = %d but max reputation is %u, quest can't be done.", qinfo->GetQuestId(), qinfo->RequiredMinRepValue, ReputationMgr::Reputation_Cap); // no changes, quest can't be done for this requirement } if (qinfo->RequiredMinRepValue && qinfo->RequiredMaxRepValue && qinfo->RequiredMaxRepValue <= qinfo->RequiredMinRepValue) { - sLog->outErrorDb("Quest %u has `RequiredMaxRepValue` = %d and `RequiredMinRepValue` = %d, quest can't be done.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredMaxRepValue` = %d and `RequiredMinRepValue` = %d, quest can't be done.", qinfo->GetQuestId(), qinfo->RequiredMaxRepValue, qinfo->RequiredMinRepValue); // no changes, quest can't be done for this requirement } if (!qinfo->RequiredFactionId1 && qinfo->RequiredFactionValue1 != 0) { - sLog->outErrorDb("Quest %u has `RequiredFactionValue1` = %d but `RequiredFactionId1` is 0, value has no effect", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredFactionValue1` = %d but `RequiredFactionId1` is 0, value has no effect", qinfo->GetQuestId(), qinfo->RequiredFactionValue1); // warning } if (!qinfo->RequiredFactionId2 && qinfo->RequiredFactionValue2 != 0) { - sLog->outErrorDb("Quest %u has `RequiredFactionValue2` = %d but `RequiredFactionId2` is 0, value has no effect", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredFactionValue2` = %d but `RequiredFactionId2` is 0, value has no effect", qinfo->GetQuestId(), qinfo->RequiredFactionValue2); // warning } if (!qinfo->RequiredMinRepFaction && qinfo->RequiredMinRepValue != 0) { - sLog->outErrorDb("Quest %u has `RequiredMinRepValue` = %d but `RequiredMinRepFaction` is 0, value has no effect", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredMinRepValue` = %d but `RequiredMinRepFaction` is 0, value has no effect", qinfo->GetQuestId(), qinfo->RequiredMinRepValue); // warning } if (!qinfo->RequiredMaxRepFaction && qinfo->RequiredMaxRepValue != 0) { - sLog->outErrorDb("Quest %u has `RequiredMaxRepValue` = %d but `RequiredMaxRepFaction` is 0, value has no effect", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredMaxRepValue` = %d but `RequiredMaxRepFaction` is 0, value has no effect", qinfo->GetQuestId(), qinfo->RequiredMaxRepValue); // warning } if (qinfo->RewardTitleId && !sCharTitlesStore.LookupEntry(qinfo->RewardTitleId)) { - sLog->outErrorDb("Quest %u has `RewardTitleId` = %u but CharTitle Id %u does not exist, quest can't be rewarded with title.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardTitleId` = %u but CharTitle Id %u does not exist, quest can't be rewarded with title.", qinfo->GetQuestId(), qinfo->GetCharTitleId(), qinfo->GetCharTitleId()); qinfo->RewardTitleId = 0; // quest can't reward this title @@ -3948,20 +3856,20 @@ void ObjectMgr::LoadQuests() { if (!sObjectMgr->GetItemTemplate(qinfo->SourceItemId)) { - sLog->outErrorDb("Quest %u has `SourceItemId` = %u but item with entry %u does not exist, quest can't be done.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `SourceItemId` = %u but item with entry %u does not exist, quest can't be done.", qinfo->GetQuestId(), qinfo->SourceItemId, qinfo->SourceItemId); qinfo->SourceItemId = 0; // quest can't be done for this requirement } else if (qinfo->SourceItemIdCount == 0) { - sLog->outErrorDb("Quest %u has `SourceItemId` = %u but `SourceItemIdCount` = 0, set to 1 but need fix in DB.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `SourceItemId` = %u but `SourceItemIdCount` = 0, set to 1 but need fix in DB.", qinfo->GetQuestId(), qinfo->SourceItemId); qinfo->SourceItemIdCount = 1; // update to 1 for allow quest work for backward compatibility with DB } } else if (qinfo->SourceItemIdCount>0) { - sLog->outErrorDb("Quest %u has `SourceItemId` = 0 but `SourceItemIdCount` = %u, useless value.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `SourceItemId` = 0 but `SourceItemIdCount` = %u, useless value.", qinfo->GetQuestId(), qinfo->SourceItemIdCount); qinfo->SourceItemIdCount=0; // no quest work changes in fact } @@ -3971,13 +3879,13 @@ void ObjectMgr::LoadQuests() SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->SourceSpellid); if (!spellInfo) { - sLog->outErrorDb("Quest %u has `SourceSpellid` = %u but spell %u doesn't exist, quest can't be done.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `SourceSpellid` = %u but spell %u doesn't exist, quest can't be done.", qinfo->GetQuestId(), qinfo->SourceSpellid, qinfo->SourceSpellid); qinfo->SourceSpellid = 0; // quest can't be done for this requirement } else if (!SpellMgr::IsSpellValid(spellInfo)) { - sLog->outErrorDb("Quest %u has `SourceSpellid` = %u but spell %u is broken, quest can't be done.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `SourceSpellid` = %u but spell %u is broken, quest can't be done.", qinfo->GetQuestId(), qinfo->SourceSpellid, qinfo->SourceSpellid); qinfo->SourceSpellid = 0; // quest can't be done for this requirement } @@ -3990,7 +3898,7 @@ void ObjectMgr::LoadQuests() { if (qinfo->RequiredItemCount[j] == 0) { - sLog->outErrorDb("Quest %u has `RequiredItemId%d` = %u but `RequiredItemCount%d` = 0, quest can't be done.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredItemId%d` = %u but `RequiredItemCount%d` = 0, quest can't be done.", qinfo->GetQuestId(), j+1, id, j+1); // no changes, quest can't be done for this requirement } @@ -3999,14 +3907,14 @@ void ObjectMgr::LoadQuests() if (!sObjectMgr->GetItemTemplate(id)) { - sLog->outErrorDb("Quest %u has `RequiredItemId%d` = %u but item with entry %u does not exist, quest can't be done.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredItemId%d` = %u but item with entry %u does not exist, quest can't be done.", qinfo->GetQuestId(), j+1, id, id); qinfo->RequiredItemCount[j] = 0; // prevent incorrect work of quest } } else if (qinfo->RequiredItemCount[j]>0) { - sLog->outErrorDb("Quest %u has `RequiredItemId%d` = 0 but `RequiredItemCount%d` = %u, quest can't be done.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredItemId%d` = 0 but `RequiredItemCount%d` = %u, quest can't be done.", qinfo->GetQuestId(), j+1, j+1, qinfo->RequiredItemCount[j]); qinfo->RequiredItemCount[j] = 0; // prevent incorrect work of quest } @@ -4019,7 +3927,7 @@ void ObjectMgr::LoadQuests() { if (!sObjectMgr->GetItemTemplate(id)) { - sLog->outErrorDb("Quest %u has `RequiredSourceItemId%d` = %u but item with entry %u does not exist, quest can't be done.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredSourceItemId%d` = %u but item with entry %u does not exist, quest can't be done.", qinfo->GetQuestId(), j+1, id, id); // no changes, quest can't be done for this requirement } @@ -4028,7 +3936,7 @@ void ObjectMgr::LoadQuests() { if (qinfo->RequiredSourceItemCount[j]>0) { - sLog->outErrorDb("Quest %u has `RequiredSourceItemId%d` = 0 but `RequiredSourceItemCount%d` = %u.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredSourceItemId%d` = 0 but `RequiredSourceItemCount%d` = %u.", qinfo->GetQuestId(), j+1, j+1, qinfo->RequiredSourceItemCount[j]); // no changes, quest ignore this data } @@ -4043,7 +3951,7 @@ void ObjectMgr::LoadQuests() SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(id); if (!spellInfo) { - sLog->outErrorDb("Quest %u has `ReqSpellCast%d` = %u but spell %u does not exist, quest can't be done.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `ReqSpellCast%d` = %u but spell %u does not exist, quest can't be done.", qinfo->GetQuestId(), j+1, id, id); continue; } @@ -4065,7 +3973,7 @@ void ObjectMgr::LoadQuests() { if (!qinfo->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) { - sLog->outErrorDb("Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT for quest %u and RequiredNpcOrGo%d = 0, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags or RequiredNpcOrGo%d must be fixed, quest modified to enable objective.", spellInfo->Id, qinfo->Id, j+1, j+1); + sLog->outError(LOG_FILTER_SQL, "Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT for quest %u and RequiredNpcOrGo%d = 0, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags or RequiredNpcOrGo%d must be fixed, quest modified to enable objective.", spellInfo->Id, qinfo->Id, j+1, j+1); // this will prevent quest completing without objective const_cast<Quest*>(qinfo)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT); @@ -4073,7 +3981,7 @@ void ObjectMgr::LoadQuests() } else { - sLog->outErrorDb("Quest %u has `ReqSpellCast%d` = %u and RequiredNpcOrGo%d = 0 but spell %u does not have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT effect for this quest, quest can't be done.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `ReqSpellCast%d` = %u and RequiredNpcOrGo%d = 0 but spell %u does not have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT effect for this quest, quest can't be done.", qinfo->GetQuestId(), j+1, id, j+1, id); // no changes, quest can't be done for this requirement } @@ -4086,14 +3994,14 @@ void ObjectMgr::LoadQuests() int32 id = qinfo->RequiredNpcOrGo[j]; if (id < 0 && !sObjectMgr->GetGameObjectTemplate(-id)) { - sLog->outErrorDb("Quest %u has `RequiredNpcOrGo%d` = %i but gameobject %u does not exist, quest can't be done.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredNpcOrGo%d` = %i but gameobject %u does not exist, quest can't be done.", qinfo->GetQuestId(), j+1, id, uint32(-id)); qinfo->RequiredNpcOrGo[j] = 0; // quest can't be done for this requirement } if (id > 0 && !sObjectMgr->GetCreatureTemplate(id)) { - sLog->outErrorDb("Quest %u has `RequiredNpcOrGo%d` = %i but creature with entry %u does not exist, quest can't be done.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredNpcOrGo%d` = %i but creature with entry %u does not exist, quest can't be done.", qinfo->GetQuestId(), j+1, id, uint32(id)); qinfo->RequiredNpcOrGo[j] = 0; // quest can't be done for this requirement } @@ -4106,14 +4014,14 @@ void ObjectMgr::LoadQuests() if (!qinfo->RequiredNpcOrGoCount[j]) { - sLog->outErrorDb("Quest %u has `RequiredNpcOrGo%d` = %u but `RequiredNpcOrGoCount%d` = 0, quest can't be done.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredNpcOrGo%d` = %u but `RequiredNpcOrGoCount%d` = 0, quest can't be done.", qinfo->GetQuestId(), j+1, id, j+1); // no changes, quest can be incorrectly done, but we already report this } } else if (qinfo->RequiredNpcOrGoCount[j]>0) { - sLog->outErrorDb("Quest %u has `RequiredNpcOrGo%d` = 0 but `RequiredNpcOrGoCount%d` = %u.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredNpcOrGo%d` = 0 but `RequiredNpcOrGoCount%d` = %u.", qinfo->GetQuestId(), j+1, j+1, qinfo->RequiredNpcOrGoCount[j]); // no changes, quest ignore this data } @@ -4126,21 +4034,21 @@ void ObjectMgr::LoadQuests() { if (!sObjectMgr->GetItemTemplate(id)) { - sLog->outErrorDb("Quest %u has `RewardChoiceItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardChoiceItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.", qinfo->GetQuestId(), j+1, id, id); qinfo->RewardChoiceItemId[j] = 0; // no changes, quest will not reward this } if (!qinfo->RewardChoiceItemCount[j]) { - sLog->outErrorDb("Quest %u has `RewardChoiceItemId%d` = %u but `RewardChoiceItemCount%d` = 0, quest can't be done.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardChoiceItemId%d` = %u but `RewardChoiceItemCount%d` = 0, quest can't be done.", qinfo->GetQuestId(), j+1, id, j+1); // no changes, quest can't be done } } else if (qinfo->RewardChoiceItemCount[j]>0) { - sLog->outErrorDb("Quest %u has `RewardChoiceItemId%d` = 0 but `RewardChoiceItemCount%d` = %u.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardChoiceItemId%d` = 0 but `RewardChoiceItemCount%d` = %u.", qinfo->GetQuestId(), j+1, j+1, qinfo->RewardChoiceItemCount[j]); // no changes, quest ignore this data } @@ -4153,21 +4061,21 @@ void ObjectMgr::LoadQuests() { if (!sObjectMgr->GetItemTemplate(id)) { - sLog->outErrorDb("Quest %u has `RewardItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.", qinfo->GetQuestId(), j+1, id, id); qinfo->RewardItemId[j] = 0; // no changes, quest will not reward this item } if (!qinfo->RewardItemIdCount[j]) { - sLog->outErrorDb("Quest %u has `RewardItemId%d` = %u but `RewardItemIdCount%d` = 0, quest will not reward this item.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardItemId%d` = %u but `RewardItemIdCount%d` = 0, quest will not reward this item.", qinfo->GetQuestId(), j+1, id, j+1); // no changes } } else if (qinfo->RewardItemIdCount[j]>0) { - sLog->outErrorDb("Quest %u has `RewardItemId%d` = 0 but `RewardItemIdCount%d` = %u.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardItemId%d` = 0 but `RewardItemIdCount%d` = %u.", qinfo->GetQuestId(), j+1, j+1, qinfo->RewardItemIdCount[j]); // no changes, quest ignore this data } @@ -4179,18 +4087,18 @@ void ObjectMgr::LoadQuests() { if (abs(qinfo->RewardFactionValueId[j]) > 9) { - sLog->outErrorDb("Quest %u has RewardFactionValueId%d = %i. That is outside the range of valid values (-9 to 9).", qinfo->GetQuestId(), j+1, qinfo->RewardFactionValueId[j]); + sLog->outError(LOG_FILTER_SQL, "Quest %u has RewardFactionValueId%d = %i. That is outside the range of valid values (-9 to 9).", qinfo->GetQuestId(), j+1, qinfo->RewardFactionValueId[j]); } if (!sFactionStore.LookupEntry(qinfo->RewardFactionId[j])) { - sLog->outErrorDb("Quest %u has `RewardFactionId%d` = %u but raw faction (faction.dbc) %u does not exist, quest will not reward reputation for this faction.", qinfo->GetQuestId(), j+1, qinfo->RewardFactionId[j], qinfo->RewardFactionId[j]); + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardFactionId%d` = %u but raw faction (faction.dbc) %u does not exist, quest will not reward reputation for this faction.", qinfo->GetQuestId(), j+1, qinfo->RewardFactionId[j], qinfo->RewardFactionId[j]); qinfo->RewardFactionId[j] = 0; // quest will not reward this } } else if (qinfo->RewardFactionValueIdOverride[j] != 0) { - sLog->outErrorDb("Quest %u has `RewardFactionId%d` = 0 but `RewardFactionValueIdOverride%d` = %i.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardFactionId%d` = 0 but `RewardFactionValueIdOverride%d` = %i.", qinfo->GetQuestId(), j+1, j+1, qinfo->RewardFactionValueIdOverride[j]); // no changes, quest ignore this data } @@ -4202,21 +4110,21 @@ void ObjectMgr::LoadQuests() if (!spellInfo) { - sLog->outErrorDb("Quest %u has `RewardSpell` = %u but spell %u does not exist, spell removed as display reward.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardSpell` = %u but spell %u does not exist, spell removed as display reward.", qinfo->GetQuestId(), qinfo->RewardSpell, qinfo->RewardSpell); qinfo->RewardSpell = 0; // no spell reward will display for this quest } else if (!SpellMgr::IsSpellValid(spellInfo)) { - sLog->outErrorDb("Quest %u has `RewardSpell` = %u but spell %u is broken, quest will not have a spell reward.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardSpell` = %u but spell %u is broken, quest will not have a spell reward.", qinfo->GetQuestId(), qinfo->RewardSpell, qinfo->RewardSpell); qinfo->RewardSpell = 0; // no spell reward will display for this quest } else if (GetTalentSpellCost(qinfo->RewardSpell)) { - sLog->outErrorDb("Quest %u has `RewardSpell` = %u but spell %u is talent, quest will not have a spell reward.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardSpell` = %u but spell %u is talent, quest will not have a spell reward.", qinfo->GetQuestId(), qinfo->RewardSpell, qinfo->RewardSpell); qinfo->RewardSpell = 0; // no spell reward will display for this quest } @@ -4228,21 +4136,21 @@ void ObjectMgr::LoadQuests() if (!spellInfo) { - sLog->outErrorDb("Quest %u has `RewardSpellCast` = %u but spell %u does not exist, quest will not have a spell reward.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardSpellCast` = %u but spell %u does not exist, quest will not have a spell reward.", qinfo->GetQuestId(), qinfo->RewardSpellCast, qinfo->RewardSpellCast); qinfo->RewardSpellCast = 0; // no spell will be casted on player } else if (!SpellMgr::IsSpellValid(spellInfo)) { - sLog->outErrorDb("Quest %u has `RewardSpellCast` = %u but spell %u is broken, quest will not have a spell reward.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardSpellCast` = %u but spell %u is broken, quest will not have a spell reward.", qinfo->GetQuestId(), qinfo->RewardSpellCast, qinfo->RewardSpellCast); qinfo->RewardSpellCast = 0; // no spell will be casted on player } else if (GetTalentSpellCost(qinfo->RewardSpellCast)) { - sLog->outErrorDb("Quest %u has `RewardSpell` = %u but spell %u is talent, quest will not have a spell reward.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardSpell` = %u but spell %u is talent, quest will not have a spell reward.", qinfo->GetQuestId(), qinfo->RewardSpellCast, qinfo->RewardSpellCast); qinfo->RewardSpellCast = 0; // no spell will be casted on player } @@ -4252,7 +4160,7 @@ void ObjectMgr::LoadQuests() { if (!sMailTemplateStore.LookupEntry(qinfo->RewardMailTemplateId)) { - sLog->outErrorDb("Quest %u has `RewardMailTemplateId` = %u but mail template %u does not exist, quest will not have a mail reward.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardMailTemplateId` = %u but mail template %u does not exist, quest will not have a mail reward.", qinfo->GetQuestId(), qinfo->RewardMailTemplateId, qinfo->RewardMailTemplateId); qinfo->RewardMailTemplateId = 0; // no mail will send to player qinfo->RewardMailDelay = 0; // no mail will send to player @@ -4260,7 +4168,7 @@ void ObjectMgr::LoadQuests() else if (usedMailTemplates.find(qinfo->RewardMailTemplateId) != usedMailTemplates.end()) { std::map<uint32, uint32>::const_iterator used_mt_itr = usedMailTemplates.find(qinfo->RewardMailTemplateId); - sLog->outErrorDb("Quest %u has `RewardMailTemplateId` = %u but mail template %u already used for quest %u, quest will not have a mail reward.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardMailTemplateId` = %u but mail template %u already used for quest %u, quest will not have a mail reward.", qinfo->GetQuestId(), qinfo->RewardMailTemplateId, qinfo->RewardMailTemplateId, used_mt_itr->second); qinfo->RewardMailTemplateId = 0; // no mail will send to player qinfo->RewardMailDelay = 0; // no mail will send to player @@ -4274,7 +4182,7 @@ void ObjectMgr::LoadQuests() QuestMap::iterator qNextItr = _questTemplates.find(qinfo->NextQuestIdChain); if (qNextItr == _questTemplates.end()) { - sLog->outErrorDb("Quest %u has `NextQuestIdChain` = %u but quest %u does not exist, quest chain will not work.", + sLog->outError(LOG_FILTER_SQL, "Quest %u has `NextQuestIdChain` = %u but quest %u does not exist, quest chain will not work.", qinfo->GetQuestId(), qinfo->NextQuestIdChain, qinfo->NextQuestIdChain); qinfo->NextQuestIdChain = 0; } @@ -4287,7 +4195,7 @@ void ObjectMgr::LoadQuests() { if (_questTemplates.find(abs(qinfo->GetPrevQuestId())) == _questTemplates.end()) { - sLog->outErrorDb("Quest %d has PrevQuestId %i, but no such quest", qinfo->GetQuestId(), qinfo->GetPrevQuestId()); + sLog->outError(LOG_FILTER_SQL, "Quest %d has PrevQuestId %i, but no such quest", qinfo->GetQuestId(), qinfo->GetPrevQuestId()); } else { @@ -4300,7 +4208,7 @@ void ObjectMgr::LoadQuests() QuestMap::iterator qNextItr = _questTemplates.find(abs(qinfo->GetNextQuestId())); if (qNextItr == _questTemplates.end()) { - sLog->outErrorDb("Quest %d has NextQuestId %i, but no such quest", qinfo->GetQuestId(), qinfo->GetNextQuestId()); + sLog->outError(LOG_FILTER_SQL, "Quest %d has NextQuestId %i, but no such quest", qinfo->GetQuestId(), qinfo->GetNextQuestId()); } else { @@ -4339,7 +4247,7 @@ void ObjectMgr::LoadQuests() if (!quest->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) { - sLog->outErrorDb("Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE for quest %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags must be fixed, quest modified to enable objective.", spellInfo->Id, quest_id); + sLog->outError(LOG_FILTER_SQL, "Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE for quest %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags must be fixed, quest modified to enable objective.", spellInfo->Id, quest_id); // this will prevent quest completing without objective const_cast<Quest*>(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT); @@ -4347,8 +4255,7 @@ void ObjectMgr::LoadQuests() } } - sLog->outString(">> Loaded %lu quests definitions in %u ms", (unsigned long)_questTemplates.size(), GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu quests definitions in %u ms", (unsigned long)_questTemplates.size(), GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadQuestLocales() @@ -4396,8 +4303,7 @@ void ObjectMgr::LoadQuestLocales() } } while (result->NextRow()); - sLog->outString(">> Loaded %lu Quest locale strings in %u ms", (unsigned long)_questLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu Quest locale strings in %u ms", (unsigned long)_questLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadScripts(ScriptsType type) @@ -4415,7 +4321,7 @@ void ObjectMgr::LoadScripts(ScriptsType type) if (sScriptMgr->IsScriptScheduled()) // function cannot be called when scripts are in use. return; - sLog->outString("Loading %s...", tableName.c_str()); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading %s...", tableName.c_str()); scripts->clear(); // need for reload support @@ -4425,8 +4331,7 @@ void ObjectMgr::LoadScripts(ScriptsType type) if (!result) { - sLog->outString(">> Loaded 0 script definitions. DB table `%s` is empty!", tableName.c_str()); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 script definitions. DB table `%s` is empty!", tableName.c_str()); return; } @@ -4457,19 +4362,19 @@ void ObjectMgr::LoadScripts(ScriptsType type) { if (tmp.Talk.ChatType > CHAT_TYPE_WHISPER && tmp.Talk.ChatType != CHAT_MSG_RAID_BOSS_WHISPER) { - sLog->outErrorDb("Table `%s` has invalid talk type (datalong = %u) in SCRIPT_COMMAND_TALK for script id %u", + sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid talk type (datalong = %u) in SCRIPT_COMMAND_TALK for script id %u", tableName.c_str(), tmp.Talk.ChatType, tmp.id); continue; } if (!tmp.Talk.TextID) { - sLog->outErrorDb("Table `%s` has invalid talk text id (dataint = %i) in SCRIPT_COMMAND_TALK for script id %u", + sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid talk text id (dataint = %i) in SCRIPT_COMMAND_TALK for script id %u", tableName.c_str(), tmp.Talk.TextID, tmp.id); continue; } if (tmp.Talk.TextID < MIN_DB_SCRIPT_STRING_ID || tmp.Talk.TextID >= MAX_DB_SCRIPT_STRING_ID) { - sLog->outErrorDb("Table `%s` has out of range text id (dataint = %i expected %u-%u) in SCRIPT_COMMAND_TALK for script id %u", + sLog->outError(LOG_FILTER_SQL, "Table `%s` has out of range text id (dataint = %i expected %u-%u) in SCRIPT_COMMAND_TALK for script id %u", tableName.c_str(), tmp.Talk.TextID, MIN_DB_SCRIPT_STRING_ID, MAX_DB_SCRIPT_STRING_ID, tmp.id); continue; } @@ -4481,7 +4386,7 @@ void ObjectMgr::LoadScripts(ScriptsType type) { if (!sEmotesStore.LookupEntry(tmp.Emote.EmoteID)) { - sLog->outErrorDb("Table `%s` has invalid emote id (datalong = %u) in SCRIPT_COMMAND_EMOTE for script id %u", + sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid emote id (datalong = %u) in SCRIPT_COMMAND_EMOTE for script id %u", tableName.c_str(), tmp.Emote.EmoteID, tmp.id); continue; } @@ -4492,14 +4397,14 @@ void ObjectMgr::LoadScripts(ScriptsType type) { if (!sMapStore.LookupEntry(tmp.TeleportTo.MapID)) { - sLog->outErrorDb("Table `%s` has invalid map (Id: %u) in SCRIPT_COMMAND_TELEPORT_TO for script id %u", + sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid map (Id: %u) in SCRIPT_COMMAND_TELEPORT_TO for script id %u", tableName.c_str(), tmp.TeleportTo.MapID, tmp.id); continue; } if (!Trinity::IsValidMapCoord(tmp.TeleportTo.DestX, tmp.TeleportTo.DestY, tmp.TeleportTo.DestZ, tmp.TeleportTo.Orientation)) { - sLog->outErrorDb("Table `%s` has invalid coordinates (X: %f Y: %f Z: %f O: %f) in SCRIPT_COMMAND_TELEPORT_TO for script id %u", + sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid coordinates (X: %f Y: %f Z: %f O: %f) in SCRIPT_COMMAND_TELEPORT_TO for script id %u", tableName.c_str(), tmp.TeleportTo.DestX, tmp.TeleportTo.DestY, tmp.TeleportTo.DestZ, tmp.TeleportTo.Orientation, tmp.id); continue; } @@ -4511,14 +4416,14 @@ void ObjectMgr::LoadScripts(ScriptsType type) Quest const* quest = GetQuestTemplate(tmp.QuestExplored.QuestID); if (!quest) { - sLog->outErrorDb("Table `%s` has invalid quest (ID: %u) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u", + sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid quest (ID: %u) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u", tableName.c_str(), tmp.QuestExplored.QuestID, tmp.id); continue; } if (!quest->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) { - sLog->outErrorDb("Table `%s` has quest (ID: %u) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT in quest flags. Script command or quest flags wrong. Quest modified to require objective.", + sLog->outError(LOG_FILTER_SQL, "Table `%s` has quest (ID: %u) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT in quest flags. Script command or quest flags wrong. Quest modified to require objective.", tableName.c_str(), tmp.QuestExplored.QuestID, tmp.id); // this will prevent quest completing without objective @@ -4529,21 +4434,21 @@ void ObjectMgr::LoadScripts(ScriptsType type) if (float(tmp.QuestExplored.Distance) > DEFAULT_VISIBILITY_DISTANCE) { - sLog->outErrorDb("Table `%s` has too large distance (%u) for exploring objective complete in `datalong2` in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u", + sLog->outError(LOG_FILTER_SQL, "Table `%s` has too large distance (%u) for exploring objective complete in `datalong2` in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u", tableName.c_str(), tmp.QuestExplored.Distance, tmp.id); continue; } if (tmp.QuestExplored.Distance && float(tmp.QuestExplored.Distance) > DEFAULT_VISIBILITY_DISTANCE) { - sLog->outErrorDb("Table `%s` has too large distance (%u) for exploring objective complete in `datalong2` in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, max distance is %f or 0 for disable distance check", + sLog->outError(LOG_FILTER_SQL, "Table `%s` has too large distance (%u) for exploring objective complete in `datalong2` in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, max distance is %f or 0 for disable distance check", tableName.c_str(), tmp.QuestExplored.Distance, tmp.id, DEFAULT_VISIBILITY_DISTANCE); continue; } if (tmp.QuestExplored.Distance && float(tmp.QuestExplored.Distance) < INTERACTION_DISTANCE) { - sLog->outErrorDb("Table `%s` has too small distance (%u) for exploring objective complete in `datalong2` in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, min distance is %f or 0 for disable distance check", + sLog->outError(LOG_FILTER_SQL, "Table `%s` has too small distance (%u) for exploring objective complete in `datalong2` in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, min distance is %f or 0 for disable distance check", tableName.c_str(), tmp.QuestExplored.Distance, tmp.id, INTERACTION_DISTANCE); continue; } @@ -4555,7 +4460,7 @@ void ObjectMgr::LoadScripts(ScriptsType type) { if (!GetCreatureTemplate(tmp.KillCredit.CreatureEntry)) { - sLog->outErrorDb("Table `%s` has invalid creature (Entry: %u) in SCRIPT_COMMAND_KILL_CREDIT for script id %u", + sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid creature (Entry: %u) in SCRIPT_COMMAND_KILL_CREDIT for script id %u", tableName.c_str(), tmp.KillCredit.CreatureEntry, tmp.id); continue; } @@ -4567,7 +4472,7 @@ void ObjectMgr::LoadScripts(ScriptsType type) GameObjectData const* data = GetGOData(tmp.RespawnGameobject.GOGuid); if (!data) { - sLog->outErrorDb("Table `%s` has invalid gameobject (GUID: %u) in SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id %u", + sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid gameobject (GUID: %u) in SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id %u", tableName.c_str(), tmp.RespawnGameobject.GOGuid, tmp.id); continue; } @@ -4575,7 +4480,7 @@ void ObjectMgr::LoadScripts(ScriptsType type) GameObjectTemplate const* info = GetGameObjectTemplate(data->id); if (!info) { - sLog->outErrorDb("Table `%s` has gameobject with invalid entry (GUID: %u Entry: %u) in SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id %u", + sLog->outError(LOG_FILTER_SQL, "Table `%s` has gameobject with invalid entry (GUID: %u Entry: %u) in SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id %u", tableName.c_str(), tmp.RespawnGameobject.GOGuid, data->id, tmp.id); continue; } @@ -4586,7 +4491,7 @@ void ObjectMgr::LoadScripts(ScriptsType type) info->type == GAMEOBJECT_TYPE_BUTTON || info->type == GAMEOBJECT_TYPE_TRAP) { - sLog->outErrorDb("Table `%s` have gameobject type (%u) unsupported by command SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id %u", + sLog->outError(LOG_FILTER_SQL, "Table `%s` have gameobject type (%u) unsupported by command SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id %u", tableName.c_str(), info->entry, tmp.id); continue; } @@ -4597,14 +4502,14 @@ void ObjectMgr::LoadScripts(ScriptsType type) { if (!Trinity::IsValidMapCoord(tmp.TempSummonCreature.PosX, tmp.TempSummonCreature.PosY, tmp.TempSummonCreature.PosZ, tmp.TempSummonCreature.Orientation)) { - sLog->outErrorDb("Table `%s` has invalid coordinates (X: %f Y: %f Z: %f O: %f) in SCRIPT_COMMAND_TEMP_SUMMON_CREATURE for script id %u", + sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid coordinates (X: %f Y: %f Z: %f O: %f) in SCRIPT_COMMAND_TEMP_SUMMON_CREATURE for script id %u", tableName.c_str(), tmp.TempSummonCreature.PosX, tmp.TempSummonCreature.PosY, tmp.TempSummonCreature.PosZ, tmp.TempSummonCreature.Orientation, tmp.id); continue; } if (!GetCreatureTemplate(tmp.TempSummonCreature.CreatureEntry)) { - sLog->outErrorDb("Table `%s` has invalid creature (Entry: %u) in SCRIPT_COMMAND_TEMP_SUMMON_CREATURE for script id %u", + sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid creature (Entry: %u) in SCRIPT_COMMAND_TEMP_SUMMON_CREATURE for script id %u", tableName.c_str(), tmp.TempSummonCreature.CreatureEntry, tmp.id); continue; } @@ -4617,7 +4522,7 @@ void ObjectMgr::LoadScripts(ScriptsType type) GameObjectData const* data = GetGOData(tmp.ToggleDoor.GOGuid); if (!data) { - sLog->outErrorDb("Table `%s` has invalid gameobject (GUID: %u) in %s for script id %u", + sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid gameobject (GUID: %u) in %s for script id %u", tableName.c_str(), tmp.ToggleDoor.GOGuid, GetScriptCommandName(tmp.command).c_str(), tmp.id); continue; } @@ -4625,14 +4530,14 @@ void ObjectMgr::LoadScripts(ScriptsType type) GameObjectTemplate const* info = GetGameObjectTemplate(data->id); if (!info) { - sLog->outErrorDb("Table `%s` has gameobject with invalid entry (GUID: %u Entry: %u) in %s for script id %u", + sLog->outError(LOG_FILTER_SQL, "Table `%s` has gameobject with invalid entry (GUID: %u Entry: %u) in %s for script id %u", tableName.c_str(), tmp.ToggleDoor.GOGuid, data->id, GetScriptCommandName(tmp.command).c_str(), tmp.id); continue; } if (info->type != GAMEOBJECT_TYPE_DOOR) { - sLog->outErrorDb("Table `%s` has gameobject type (%u) non supported by command %s for script id %u", + sLog->outError(LOG_FILTER_SQL, "Table `%s` has gameobject type (%u) non supported by command %s for script id %u", tableName.c_str(), info->entry, GetScriptCommandName(tmp.command).c_str(), tmp.id); continue; } @@ -4644,13 +4549,13 @@ void ObjectMgr::LoadScripts(ScriptsType type) { if (!sSpellMgr->GetSpellInfo(tmp.RemoveAura.SpellID)) { - sLog->outErrorDb("Table `%s` using non-existent spell (id: %u) in SCRIPT_COMMAND_REMOVE_AURA for script id %u", + sLog->outError(LOG_FILTER_SQL, "Table `%s` using non-existent spell (id: %u) in SCRIPT_COMMAND_REMOVE_AURA for script id %u", tableName.c_str(), tmp.RemoveAura.SpellID, tmp.id); continue; } if (tmp.RemoveAura.Flags & ~0x1) // 1 bits (0, 1) { - sLog->outErrorDb("Table `%s` using unknown flags in datalong2 (%u) in SCRIPT_COMMAND_REMOVE_AURA for script id %u", + sLog->outError(LOG_FILTER_SQL, "Table `%s` using unknown flags in datalong2 (%u) in SCRIPT_COMMAND_REMOVE_AURA for script id %u", tableName.c_str(), tmp.RemoveAura.Flags, tmp.id); continue; } @@ -4661,25 +4566,25 @@ void ObjectMgr::LoadScripts(ScriptsType type) { if (!sSpellMgr->GetSpellInfo(tmp.CastSpell.SpellID)) { - sLog->outErrorDb("Table `%s` using non-existent spell (id: %u) in SCRIPT_COMMAND_CAST_SPELL for script id %u", + sLog->outError(LOG_FILTER_SQL, "Table `%s` using non-existent spell (id: %u) in SCRIPT_COMMAND_CAST_SPELL for script id %u", tableName.c_str(), tmp.CastSpell.SpellID, tmp.id); continue; } if (tmp.CastSpell.Flags > 4) // targeting type { - sLog->outErrorDb("Table `%s` using unknown target in datalong2 (%u) in SCRIPT_COMMAND_CAST_SPELL for script id %u", + sLog->outError(LOG_FILTER_SQL, "Table `%s` using unknown target in datalong2 (%u) in SCRIPT_COMMAND_CAST_SPELL for script id %u", tableName.c_str(), tmp.CastSpell.Flags, tmp.id); continue; } if (tmp.CastSpell.Flags != 4 && tmp.CastSpell.CreatureEntry & ~0x1) // 1 bit (0, 1) { - sLog->outErrorDb("Table `%s` using unknown flags in dataint (%u) in SCRIPT_COMMAND_CAST_SPELL for script id %u", + sLog->outError(LOG_FILTER_SQL, "Table `%s` using unknown flags in dataint (%u) in SCRIPT_COMMAND_CAST_SPELL for script id %u", tableName.c_str(), tmp.CastSpell.CreatureEntry, tmp.id); continue; } else if (tmp.CastSpell.Flags == 4 && !GetCreatureTemplate(tmp.CastSpell.CreatureEntry)) { - sLog->outErrorDb("Table `%s` using invalid creature entry in dataint (%u) in SCRIPT_COMMAND_CAST_SPELL for script id %u", + sLog->outError(LOG_FILTER_SQL, "Table `%s` using invalid creature entry in dataint (%u) in SCRIPT_COMMAND_CAST_SPELL for script id %u", tableName.c_str(), tmp.CastSpell.CreatureEntry, tmp.id); continue; } @@ -4690,13 +4595,13 @@ void ObjectMgr::LoadScripts(ScriptsType type) { if (!GetItemTemplate(tmp.CreateItem.ItemEntry)) { - sLog->outErrorDb("Table `%s` has nonexistent item (entry: %u) in SCRIPT_COMMAND_CREATE_ITEM for script id %u", + sLog->outError(LOG_FILTER_SQL, "Table `%s` has nonexistent item (entry: %u) in SCRIPT_COMMAND_CREATE_ITEM for script id %u", tableName.c_str(), tmp.CreateItem.ItemEntry, tmp.id); continue; } if (!tmp.CreateItem.Amount) { - sLog->outErrorDb("Table `%s` SCRIPT_COMMAND_CREATE_ITEM but amount is %u for script id %u", + sLog->outError(LOG_FILTER_SQL, "Table `%s` SCRIPT_COMMAND_CREATE_ITEM but amount is %u for script id %u", tableName.c_str(), tmp.CreateItem.Amount, tmp.id); continue; } @@ -4717,8 +4622,7 @@ void ObjectMgr::LoadScripts(ScriptsType type) } while (result->NextRow()); - sLog->outString(">> Loaded %u script definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u script definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadGameObjectScripts() @@ -4729,7 +4633,7 @@ void ObjectMgr::LoadGameObjectScripts() for (ScriptMapMap::const_iterator itr = sGameObjectScripts.begin(); itr != sGameObjectScripts.end(); ++itr) { if (!GetGOData(itr->first)) - sLog->outErrorDb("Table `gameobject_scripts` has not existing gameobject (GUID: %u) as script id", itr->first); + sLog->outError(LOG_FILTER_SQL, "Table `gameobject_scripts` has not existing gameobject (GUID: %u) as script id", itr->first); } } @@ -4741,7 +4645,7 @@ void ObjectMgr::LoadQuestEndScripts() for (ScriptMapMap::const_iterator itr = sQuestEndScripts.begin(); itr != sQuestEndScripts.end(); ++itr) { if (!GetQuestTemplate(itr->first)) - sLog->outErrorDb("Table `quest_end_scripts` has not existing quest (Id: %u) as script id", itr->first); + sLog->outError(LOG_FILTER_SQL, "Table `quest_end_scripts` has not existing quest (Id: %u) as script id", itr->first); } } @@ -4753,7 +4657,7 @@ void ObjectMgr::LoadQuestStartScripts() for (ScriptMapMap::const_iterator itr = sQuestStartScripts.begin(); itr != sQuestStartScripts.end(); ++itr) { if (!GetQuestTemplate(itr->first)) - sLog->outErrorDb("Table `quest_start_scripts` has not existing quest (Id: %u) as script id", itr->first); + sLog->outError(LOG_FILTER_SQL, "Table `quest_start_scripts` has not existing quest (Id: %u) as script id", itr->first); } } @@ -4769,14 +4673,14 @@ void ObjectMgr::LoadSpellScripts() if (!spellInfo) { - sLog->outErrorDb("Table `spell_scripts` has not existing spell (Id: %u) as script id", spellId); + sLog->outError(LOG_FILTER_SQL, "Table `spell_scripts` has not existing spell (Id: %u) as script id", spellId); continue; } uint8 i = (uint8)((uint32(itr->first) >> 24) & 0x000000FF); //check for correct spellEffect if (!spellInfo->Effects[i].Effect || (spellInfo->Effects[i].Effect != SPELL_EFFECT_SCRIPT_EFFECT && spellInfo->Effects[i].Effect != SPELL_EFFECT_DUMMY)) - sLog->outErrorDb("Table `spell_scripts` - spell %u effect %u is not SPELL_EFFECT_SCRIPT_EFFECT or SPELL_EFFECT_DUMMY", spellId, i); + sLog->outError(LOG_FILTER_SQL, "Table `spell_scripts` - spell %u effect %u is not SPELL_EFFECT_SCRIPT_EFFECT or SPELL_EFFECT_DUMMY", spellId, i); } } @@ -4818,7 +4722,7 @@ void ObjectMgr::LoadEventScripts() { std::set<uint32>::const_iterator itr2 = evt_scripts.find(itr->first); if (itr2 == evt_scripts.end()) - sLog->outErrorDb("Table `event_scripts` has script (Id: %u) not referring to any gameobject_template type 10 data2 field, type 3 data6 field, type 13 data 2 field or any spell effect %u", + sLog->outError(LOG_FILTER_SQL, "Table `event_scripts` has script (Id: %u) not referring to any gameobject_template type 10 data2 field, type 3 data6 field, type 13 data 2 field or any spell effect %u", itr->first, SPELL_EFFECT_SEND_EVENT); } } @@ -4849,7 +4753,7 @@ void ObjectMgr::LoadWaypointScripts() } for (std::set<uint32>::iterator itr = actionSet.begin(); itr != actionSet.end(); ++itr) - sLog->outErrorDb("There is no waypoint which links to the waypoint script %u", *itr); + sLog->outError(LOG_FILTER_SQL, "There is no waypoint which links to the waypoint script %u", *itr); } void ObjectMgr::LoadSpellScriptNames() @@ -4862,8 +4766,7 @@ void ObjectMgr::LoadSpellScriptNames() if (!result) { - sLog->outString(">> Loaded 0 spell script names. DB table `spell_script_names` is empty!"); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell script names. DB table `spell_script_names` is empty!"); return; } @@ -4874,11 +4777,11 @@ void ObjectMgr::LoadSpellScriptNames() Field* fields = result->Fetch(); - int32 spellId = fields[0].GetInt32(); + int32 spellId = fields[0].GetInt32(); const char *scriptName = fields[1].GetCString(); bool allRanks = false; - if (spellId <=0) + if (spellId <= 0) { allRanks = true; spellId = -spellId; @@ -4887,7 +4790,7 @@ void ObjectMgr::LoadSpellScriptNames() SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); if (!spellInfo) { - sLog->outErrorDb("Scriptname:`%s` spell (spell_id:%d) does not exist in `Spell.dbc`.", scriptName, fields[0].GetInt32()); + sLog->outError(LOG_FILTER_SQL, "Scriptname:`%s` spell (spell_id:%d) does not exist in `Spell.dbc`.", scriptName, fields[0].GetInt32()); continue; } @@ -4895,7 +4798,7 @@ void ObjectMgr::LoadSpellScriptNames() { if (sSpellMgr->GetFirstSpellInChain(spellId) != uint32(spellId)) { - sLog->outErrorDb("Scriptname:`%s` spell (spell_id:%d) is not first rank of spell.", scriptName, fields[0].GetInt32()); + sLog->outError(LOG_FILTER_SQL, "Scriptname:`%s` spell (spell_id:%d) is not first rank of spell.", scriptName, fields[0].GetInt32()); continue; } while (spellInfo) @@ -4910,8 +4813,7 @@ void ObjectMgr::LoadSpellScriptNames() } while (result->NextRow()); - sLog->outString(">> Loaded %u spell script names in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell script names in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::ValidateSpellScripts() @@ -4920,8 +4822,7 @@ void ObjectMgr::ValidateSpellScripts() if (_spellScriptsStore.empty()) { - sLog->outString(">> Validated 0 scripts."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Validated 0 scripts."); return; } @@ -4941,7 +4842,7 @@ void ObjectMgr::ValidateSpellScripts() bool valid = true; if (!spellScript && !auraScript) { - sLog->outError("TSCR: Functions GetSpellScript() and GetAuraScript() of script `%s` do not return objects - script skipped", GetScriptName(sitr->second->second)); + sLog->outError(LOG_FILTER_TSCR, "Functions GetSpellScript() and GetAuraScript() of script `%s` do not return objects - script skipped", GetScriptName(sitr->second->second)); valid = false; } if (spellScript) @@ -4968,8 +4869,7 @@ void ObjectMgr::ValidateSpellScripts() ++count; } - sLog->outString(">> Validated %u scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Validated %u scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadPageTexts() @@ -4981,8 +4881,7 @@ void ObjectMgr::LoadPageTexts() if (!result) { - sLog->outString(">> Loaded 0 page texts. DB table `page_text` is empty!"); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 page texts. DB table `page_text` is empty!"); return; } @@ -5006,13 +4905,12 @@ void ObjectMgr::LoadPageTexts() { PageTextContainer::const_iterator itr2 = _pageTextStore.find(itr->second.NextPage); if (itr2 == _pageTextStore.end()) - sLog->outErrorDb("Page text (Id: %u) has not existing next page (Id: %u)", itr->first, itr->second.NextPage); + sLog->outError(LOG_FILTER_SQL, "Page text (Id: %u) has not existing next page (Id: %u)", itr->first, itr->second.NextPage); } } - sLog->outString(">> Loaded %u page texts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u page texts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } PageText const* ObjectMgr::GetPageText(uint32 pageEntry) @@ -5047,8 +4945,7 @@ void ObjectMgr::LoadPageTextLocales() AddLocaleString(fields[i].GetString(), LocaleConstant(i), data.Text); } while (result->NextRow()); - sLog->outString(">> Loaded %lu PageText locale strings in %u ms", (unsigned long)_pageTextLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu PageText locale strings in %u ms", (unsigned long)_pageTextLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadInstanceTemplate() @@ -5060,8 +4957,7 @@ void ObjectMgr::LoadInstanceTemplate() if (!result) { - sLog->outString(">> Loaded 0 instance templates. DB table `page_text` is empty!"); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 instance templates. DB table `page_text` is empty!"); return; } @@ -5074,7 +4970,7 @@ void ObjectMgr::LoadInstanceTemplate() if (!MapManager::IsValidMAP(mapID, true)) { - sLog->outErrorDb("ObjectMgr::LoadInstanceTemplate: bad mapid %d for template!", mapID); + sLog->outError(LOG_FILTER_SQL, "ObjectMgr::LoadInstanceTemplate: bad mapid %d for template!", mapID); continue; } @@ -5090,8 +4986,7 @@ void ObjectMgr::LoadInstanceTemplate() } while (result->NextRow()); - sLog->outString(">> Loaded %u instance templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u instance templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } InstanceTemplate const* ObjectMgr::GetInstanceTemplate(uint32 mapID) @@ -5111,8 +5006,8 @@ void ObjectMgr::LoadInstanceEncounters() QueryResult result = WorldDatabase.Query("SELECT entry, creditType, creditEntry, lastEncounterDungeon FROM instance_encounters"); if (!result) { - sLog->outErrorDb(">> Loaded 0 instance encounters, table is empty!"); - sLog->outString(); + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 instance encounters, table is empty!"); + return; } @@ -5128,13 +5023,13 @@ void ObjectMgr::LoadInstanceEncounters() DungeonEncounterEntry const* dungeonEncounter = sDungeonEncounterStore.LookupEntry(entry); if (!dungeonEncounter) { - sLog->outErrorDb("Table `instance_encounters` has an invalid encounter id %u, skipped!", entry); + sLog->outError(LOG_FILTER_SQL, "Table `instance_encounters` has an invalid encounter id %u, skipped!", entry); continue; } if (lastEncounterDungeon && !sLFGDungeonStore.LookupEntry(lastEncounterDungeon)) { - sLog->outErrorDb("Table `instance_encounters` has an encounter %u (%s) marked as final for invalid dungeon id %u, skipped!", entry, dungeonEncounter->encounterName[0], lastEncounterDungeon); + sLog->outError(LOG_FILTER_SQL, "Table `instance_encounters` has an encounter %u (%s) marked as final for invalid dungeon id %u, skipped!", entry, dungeonEncounter->encounterName[0], lastEncounterDungeon); continue; } @@ -5143,7 +5038,7 @@ void ObjectMgr::LoadInstanceEncounters() { if (itr != dungeonLastBosses.end()) { - sLog->outErrorDb("Table `instance_encounters` specified encounter %u (%s) as last encounter but %u (%s) is already marked as one, skipped!", entry, dungeonEncounter->encounterName[0], itr->second->id, itr->second->encounterName[0]); + sLog->outError(LOG_FILTER_SQL, "Table `instance_encounters` specified encounter %u (%s) as last encounter but %u (%s) is already marked as one, skipped!", entry, dungeonEncounter->encounterName[0], itr->second->id, itr->second->encounterName[0]); continue; } @@ -5157,7 +5052,7 @@ void ObjectMgr::LoadInstanceEncounters() CreatureTemplate const* creatureInfo = GetCreatureTemplate(creditEntry); if (!creatureInfo) { - sLog->outErrorDb("Table `instance_encounters` has an invalid creature (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName[0]); + sLog->outError(LOG_FILTER_SQL, "Table `instance_encounters` has an invalid creature (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName[0]); continue; } const_cast<CreatureTemplate*>(creatureInfo)->flags_extra |= CREATURE_FLAG_EXTRA_DUNGEON_BOSS; @@ -5166,12 +5061,12 @@ void ObjectMgr::LoadInstanceEncounters() case ENCOUNTER_CREDIT_CAST_SPELL: if (!sSpellMgr->GetSpellInfo(creditEntry)) { - sLog->outErrorDb("Table `instance_encounters` has an invalid spell (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName[0]); + sLog->outError(LOG_FILTER_SQL, "Table `instance_encounters` has an invalid spell (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName[0]); continue; } break; default: - sLog->outErrorDb("Table `instance_encounters` has an invalid credit type (%u) for encounter %u (%s), skipped!", creditType, entry, dungeonEncounter->encounterName[0]); + sLog->outError(LOG_FILTER_SQL, "Table `instance_encounters` has an invalid credit type (%u) for encounter %u (%s), skipped!", creditType, entry, dungeonEncounter->encounterName[0]); continue; } @@ -5180,8 +5075,7 @@ void ObjectMgr::LoadInstanceEncounters() ++count; } while (result->NextRow()); - sLog->outString(">> Loaded %u instance encounters in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u instance encounters in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } GossipText const* ObjectMgr::GetGossipText(uint32 Text_ID) const @@ -5201,8 +5095,7 @@ void ObjectMgr::LoadGossipText() int count = 0; if (!result) { - sLog->outString(">> Loaded %u npc texts", count); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u npc texts", count); return; } _gossipTextStore.rehash(result->GetRowCount()); @@ -5219,7 +5112,7 @@ void ObjectMgr::LoadGossipText() uint32 Text_ID = fields[cic++].GetUInt32(); if (!Text_ID) { - sLog->outErrorDb("Table `npc_text` has record wit reserved id 0, ignore."); + sLog->outError(LOG_FILTER_SQL, "Table `npc_text` has record wit reserved id 0, ignore."); continue; } @@ -5241,8 +5134,7 @@ void ObjectMgr::LoadGossipText() } } while (result->NextRow()); - sLog->outString(">> Loaded %u npc texts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u npc texts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadNpcTextLocales() @@ -5284,8 +5176,7 @@ void ObjectMgr::LoadNpcTextLocales() } } while (result->NextRow()); - sLog->outString(">> Loaded %lu NpcText locale strings in %u ms", (unsigned long)_npcTextLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu NpcText locale strings in %u ms", (unsigned long)_npcTextLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); } //not very fast function but it is called only once a day, or on starting-up @@ -5296,7 +5187,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) time_t curTime = time(NULL); tm* lt = localtime(&curTime); uint64 basetime(curTime); - sLog->outDetail("Returning mails current time: hour: %d, minute: %d, second: %d ", lt->tm_hour, lt->tm_min, lt->tm_sec); + sLog->outInfo(LOG_FILTER_GENERAL, "Returning mails current time: hour: %d, minute: %d, second: %d ", lt->tm_hour, lt->tm_min, lt->tm_sec); // Delete all old mails without item and without body immediately, if starting server if (!serverUp) @@ -5310,8 +5201,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) { - sLog->outString(">> No expired mails found."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> No expired mails found."); return; // any mails need to be returned or deleted } @@ -5414,8 +5304,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) } while (result->NextRow()); - sLog->outString(">> Processed %u expired mails: %u deleted and %u returned in %u ms", deletedCount + returnedCount, deletedCount, returnedCount, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Processed %u expired mails: %u deleted and %u returned in %u ms", deletedCount + returnedCount, deletedCount, returnedCount, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadQuestAreaTriggers() @@ -5428,8 +5317,7 @@ void ObjectMgr::LoadQuestAreaTriggers() if (!result) { - sLog->outString(">> Loaded 0 quest trigger points. DB table `areatrigger_involvedrelation` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 quest trigger points. DB table `areatrigger_involvedrelation` is empty."); return; } @@ -5447,7 +5335,7 @@ void ObjectMgr::LoadQuestAreaTriggers() AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(trigger_ID); if (!atEntry) { - sLog->outErrorDb("Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", trigger_ID); + sLog->outError(LOG_FILTER_SQL, "Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", trigger_ID); continue; } @@ -5455,13 +5343,13 @@ void ObjectMgr::LoadQuestAreaTriggers() if (!quest) { - sLog->outErrorDb("Table `areatrigger_involvedrelation` has record (id: %u) for not existing quest %u", trigger_ID, quest_ID); + sLog->outError(LOG_FILTER_SQL, "Table `areatrigger_involvedrelation` has record (id: %u) for not existing quest %u", trigger_ID, quest_ID); continue; } if (!quest->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) { - sLog->outErrorDb("Table `areatrigger_involvedrelation` has record (id: %u) for not quest %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Trigger or quest flags must be fixed, quest modified to require objective.", trigger_ID, quest_ID); + sLog->outError(LOG_FILTER_SQL, "Table `areatrigger_involvedrelation` has record (id: %u) for not quest %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Trigger or quest flags must be fixed, quest modified to require objective.", trigger_ID, quest_ID); // this will prevent quest completing without objective const_cast<Quest*>(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT); @@ -5473,8 +5361,7 @@ void ObjectMgr::LoadQuestAreaTriggers() } while (result->NextRow()); - sLog->outString(">> Loaded %u quest trigger points in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quest trigger points in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadTavernAreaTriggers() @@ -5487,8 +5374,7 @@ void ObjectMgr::LoadTavernAreaTriggers() if (!result) { - sLog->outString(">> Loaded 0 tavern triggers. DB table `areatrigger_tavern` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 tavern triggers. DB table `areatrigger_tavern` is empty."); return; } @@ -5505,15 +5391,14 @@ void ObjectMgr::LoadTavernAreaTriggers() AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(Trigger_ID); if (!atEntry) { - sLog->outErrorDb("Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", Trigger_ID); + sLog->outError(LOG_FILTER_SQL, "Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", Trigger_ID); continue; } _tavernAreaTriggerStore.insert(Trigger_ID); } while (result->NextRow()); - sLog->outString(">> Loaded %u tavern triggers in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u tavern triggers in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadAreaTriggerScripts() @@ -5525,8 +5410,7 @@ void ObjectMgr::LoadAreaTriggerScripts() if (!result) { - sLog->outString(">> Loaded 0 areatrigger scripts. DB table `areatrigger_scripts` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 areatrigger scripts. DB table `areatrigger_scripts` is empty."); return; } @@ -5544,14 +5428,13 @@ void ObjectMgr::LoadAreaTriggerScripts() AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(Trigger_ID); if (!atEntry) { - sLog->outErrorDb("Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", Trigger_ID); + sLog->outError(LOG_FILTER_SQL, "Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", Trigger_ID); continue; } _areaTriggerScriptStore[Trigger_ID] = GetScriptId(scriptName); } while (result->NextRow()); - sLog->outString(">> Loaded %u areatrigger scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u areatrigger scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } uint32 ObjectMgr::GetNearestTaxiNode(float x, float y, float z, uint32 mapid, uint32 team) @@ -5646,7 +5529,7 @@ uint32 ObjectMgr::GetTaxiMountDisplayId(uint32 id, uint32 team, bool allowed_alt mount_id = mount_info->GetRandomValidModelId(); if (!mount_id) { - sLog->outErrorDb("No displayid found for the taxi mount with the entry %u! Can't load it!", mount_entry); + sLog->outError(LOG_FILTER_SQL, "No displayid found for the taxi mount with the entry %u! Can't load it!", mount_entry); return false; } } @@ -5669,8 +5552,7 @@ void ObjectMgr::LoadGraveyardZones() if (!result) { - sLog->outString(">> Loaded 0 graveyard-zone links. DB table `game_graveyard_zone` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 graveyard-zone links. DB table `game_graveyard_zone` is empty."); return; } @@ -5689,35 +5571,34 @@ void ObjectMgr::LoadGraveyardZones() WorldSafeLocsEntry const* entry = sWorldSafeLocsStore.LookupEntry(safeLocId); if (!entry) { - sLog->outErrorDb("Table `game_graveyard_zone` has a record for not existing graveyard (WorldSafeLocs.dbc id) %u, skipped.", safeLocId); + sLog->outError(LOG_FILTER_SQL, "Table `game_graveyard_zone` has a record for not existing graveyard (WorldSafeLocs.dbc id) %u, skipped.", safeLocId); continue; } AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(zoneId); if (!areaEntry) { - sLog->outErrorDb("Table `game_graveyard_zone` has a record for not existing zone id (%u), skipped.", zoneId); + sLog->outError(LOG_FILTER_SQL, "Table `game_graveyard_zone` has a record for not existing zone id (%u), skipped.", zoneId); continue; } if (areaEntry->zone != 0) { - sLog->outErrorDb("Table `game_graveyard_zone` has a record for subzone id (%u) instead of zone, skipped.", zoneId); + sLog->outError(LOG_FILTER_SQL, "Table `game_graveyard_zone` has a record for subzone id (%u) instead of zone, skipped.", zoneId); continue; } if (team != 0 && team != HORDE && team != ALLIANCE) { - sLog->outErrorDb("Table `game_graveyard_zone` has a record for non player faction (%u), skipped.", team); + sLog->outError(LOG_FILTER_SQL, "Table `game_graveyard_zone` has a record for non player faction (%u), skipped.", team); continue; } if (!AddGraveYardLink(safeLocId, zoneId, team, false)) - sLog->outErrorDb("Table `game_graveyard_zone` has a duplicate record for Graveyard (ID: %u) and Zone (ID: %u), skipped.", safeLocId, zoneId); + sLog->outError(LOG_FILTER_SQL, "Table `game_graveyard_zone` has a duplicate record for Graveyard (ID: %u) and Zone (ID: %u), skipped.", safeLocId, zoneId); } while (result->NextRow()); - sLog->outString(">> Loaded %u graveyard-zone links in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u graveyard-zone links in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } WorldSafeLocsEntry const* ObjectMgr::GetDefaultGraveYard(uint32 team) @@ -5744,7 +5625,7 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float { if (z > -500) { - sLog->outError("ZoneId not found for map %u coords (%f, %f, %f)", MapId, x, y, z); + sLog->outError(LOG_FILTER_GENERAL, "ZoneId not found for map %u coords (%f, %f, %f)", MapId, x, y, z); return GetDefaultGraveYard(team); } } @@ -5763,7 +5644,7 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float if (graveLow == graveUp && !map->IsBattleArena()) { - sLog->outErrorDb("Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.", zoneId, team); + sLog->outError(LOG_FILTER_SQL, "Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.", zoneId, team); return GetDefaultGraveYard(team); } @@ -5789,7 +5670,7 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float WorldSafeLocsEntry const* entry = sWorldSafeLocsStore.LookupEntry(data.safeLocId); if (!entry) { - sLog->outErrorDb("Table `game_graveyard_zone` has record for not existing graveyard (WorldSafeLocs.dbc id) %u, skipped.", data.safeLocId); + sLog->outError(LOG_FILTER_SQL, "Table `game_graveyard_zone` has record for not existing graveyard (WorldSafeLocs.dbc id) %u, skipped.", data.safeLocId); continue; } @@ -5907,7 +5788,7 @@ void ObjectMgr::RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool GraveYardContainer::iterator graveUp = GraveYardStore.upper_bound(zoneId); if (graveLow == graveUp) { - //sLog->outErrorDb("Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.", zoneId, team); + //sLog->outError(LOG_FILTER_SQL, "Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.", zoneId, team); return; } @@ -5962,8 +5843,7 @@ void ObjectMgr::LoadAreaTriggerTeleports() QueryResult result = WorldDatabase.Query("SELECT id, target_map, target_position_x, target_position_y, target_position_z, target_orientation FROM areatrigger_teleport"); if (!result) { - sLog->outString(">> Loaded 0 area trigger teleport definitions. DB table `areatrigger_teleport` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 area trigger teleport definitions. DB table `areatrigger_teleport` is empty."); return; } @@ -5988,20 +5868,20 @@ void ObjectMgr::LoadAreaTriggerTeleports() AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(Trigger_ID); if (!atEntry) { - sLog->outErrorDb("Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", Trigger_ID); + sLog->outError(LOG_FILTER_SQL, "Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", Trigger_ID); continue; } MapEntry const* mapEntry = sMapStore.LookupEntry(at.target_mapId); if (!mapEntry) { - sLog->outErrorDb("Area trigger (ID:%u) target map (ID: %u) does not exist in `Map.dbc`.", Trigger_ID, at.target_mapId); + sLog->outError(LOG_FILTER_SQL, "Area trigger (ID:%u) target map (ID: %u) does not exist in `Map.dbc`.", Trigger_ID, at.target_mapId); continue; } if (at.target_X == 0 && at.target_Y == 0 && at.target_Z == 0) { - sLog->outErrorDb("Area trigger (ID:%u) target coordinates not provided.", Trigger_ID); + sLog->outError(LOG_FILTER_SQL, "Area trigger (ID:%u) target coordinates not provided.", Trigger_ID); continue; } @@ -6009,8 +5889,7 @@ void ObjectMgr::LoadAreaTriggerTeleports() } while (result->NextRow()); - sLog->outString(">> Loaded %u area trigger teleport definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u area trigger teleport definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadAccessRequirements() @@ -6023,8 +5902,7 @@ void ObjectMgr::LoadAccessRequirements() QueryResult result = WorldDatabase.Query("SELECT mapid, difficulty, level_min, level_max, item, item2, quest_done_A, quest_done_H, completed_achievement, quest_failed_text FROM access_requirement"); if (!result) { - sLog->outString(">> Loaded 0 access requirement definitions. DB table `access_requirement` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 access requirement definitions. DB table `access_requirement` is empty."); return; } @@ -6056,7 +5934,7 @@ void ObjectMgr::LoadAccessRequirements() ItemTemplate const* pProto = GetItemTemplate(ar.item); if (!pProto) { - sLog->outError("Key item %u does not exist for map %u difficulty %u, removing key requirement.", ar.item, mapid, difficulty); + sLog->outError(LOG_FILTER_GENERAL, "Key item %u does not exist for map %u difficulty %u, removing key requirement.", ar.item, mapid, difficulty); ar.item = 0; } } @@ -6066,7 +5944,7 @@ void ObjectMgr::LoadAccessRequirements() ItemTemplate const* pProto = GetItemTemplate(ar.item2); if (!pProto) { - sLog->outError("Second item %u does not exist for map %u difficulty %u, removing key requirement.", ar.item2, mapid, difficulty); + sLog->outError(LOG_FILTER_GENERAL, "Second item %u does not exist for map %u difficulty %u, removing key requirement.", ar.item2, mapid, difficulty); ar.item2 = 0; } } @@ -6075,7 +5953,7 @@ void ObjectMgr::LoadAccessRequirements() { if (!GetQuestTemplate(ar.quest_A)) { - sLog->outErrorDb("Required Alliance Quest %u not exist for map %u difficulty %u, remove quest done requirement.", ar.quest_A, mapid, difficulty); + sLog->outError(LOG_FILTER_SQL, "Required Alliance Quest %u not exist for map %u difficulty %u, remove quest done requirement.", ar.quest_A, mapid, difficulty); ar.quest_A = 0; } } @@ -6084,7 +5962,7 @@ void ObjectMgr::LoadAccessRequirements() { if (!GetQuestTemplate(ar.quest_H)) { - sLog->outErrorDb("Required Horde Quest %u not exist for map %u difficulty %u, remove quest done requirement.", ar.quest_H, mapid, difficulty); + sLog->outError(LOG_FILTER_SQL, "Required Horde Quest %u not exist for map %u difficulty %u, remove quest done requirement.", ar.quest_H, mapid, difficulty); ar.quest_H = 0; } } @@ -6093,7 +5971,7 @@ void ObjectMgr::LoadAccessRequirements() { if (!sAchievementStore.LookupEntry(ar.achievement)) { - sLog->outErrorDb("Required Achievement %u not exist for map %u difficulty %u, remove quest done requirement.", ar.achievement, mapid, difficulty); + sLog->outError(LOG_FILTER_SQL, "Required Achievement %u not exist for map %u difficulty %u, remove quest done requirement.", ar.achievement, mapid, difficulty); ar.achievement = 0; } } @@ -6101,8 +5979,7 @@ void ObjectMgr::LoadAccessRequirements() _accessRequirementStore[requirement_ID] = ar; } while (result->NextRow()); - sLog->outString(">> Loaded %u access requirement definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u access requirement definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } /* @@ -6216,7 +6093,7 @@ uint32 ObjectMgr::GenerateAuctionID() { if (_auctionId >= 0xFFFFFFFE) { - sLog->outError("Auctions ids overflow!! Can't continue, shutting down server. "); + sLog->outError(LOG_FILTER_GENERAL, "Auctions ids overflow!! Can't continue, shutting down server. "); World::StopNow(ERROR_EXIT_CODE); } return _auctionId++; @@ -6226,7 +6103,7 @@ uint64 ObjectMgr::GenerateEquipmentSetGuid() { if (_equipmentSetGuid >= uint64(0xFFFFFFFFFFFFFFFELL)) { - sLog->outError("EquipmentSet guid overflow!! Can't continue, shutting down server. "); + sLog->outError(LOG_FILTER_GENERAL, "EquipmentSet guid overflow!! Can't continue, shutting down server. "); World::StopNow(ERROR_EXIT_CODE); } return _equipmentSetGuid++; @@ -6236,7 +6113,7 @@ uint32 ObjectMgr::GenerateMailID() { if (_mailId >= 0xFFFFFFFE) { - sLog->outError("Mail ids overflow!! Can't continue, shutting down server. "); + sLog->outError(LOG_FILTER_GENERAL, "Mail ids overflow!! Can't continue, shutting down server. "); World::StopNow(ERROR_EXIT_CODE); } return _mailId++; @@ -6247,74 +6124,54 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh) switch (guidhigh) { case HIGHGUID_ITEM: - if (_hiItemGuid >= 0xFFFFFFFE) - { - sLog->outError("Item guid overflow!! Can't continue, shutting down server. "); - World::StopNow(ERROR_EXIT_CODE); - } + { + ASSERT(_hiItemGuid < 0xFFFFFFFE && "Item guid overflow!"); return _hiItemGuid++; + } case HIGHGUID_UNIT: - if (_hiCreatureGuid >= 0x00FFFFFE) - { - sLog->outError("Creature guid overflow!! Can't continue, shutting down server. "); - World::StopNow(ERROR_EXIT_CODE); - } + { + ASSERT(_hiCreatureGuid < 0x00FFFFFE && "Creature guid overflow!"); return _hiCreatureGuid++; + } case HIGHGUID_PET: - if (_hiPetGuid >= 0x00FFFFFE) - { - sLog->outError("Pet guid overflow!! Can't continue, shutting down server. "); - World::StopNow(ERROR_EXIT_CODE); - } + { + ASSERT(_hiPetGuid < 0x00FFFFFE && "Pet guid overflow!"); return _hiPetGuid++; + } case HIGHGUID_VEHICLE: - if (_hiVehicleGuid >= 0x00FFFFFF) - { - sLog->outError("Vehicle guid overflow!! Can't continue, shutting down server. "); - World::StopNow(ERROR_EXIT_CODE); - } + { + ASSERT(_hiVehicleGuid < 0x00FFFFFF && "Vehicle guid overflow!"); return _hiVehicleGuid++; + } case HIGHGUID_PLAYER: - if (_hiCharGuid >= 0xFFFFFFFE) - { - sLog->outError("Players guid overflow!! Can't continue, shutting down server. "); - World::StopNow(ERROR_EXIT_CODE); - } + { + ASSERT(_hiCharGuid < 0xFFFFFFFE && "Player guid overflow!"); return _hiCharGuid++; + } case HIGHGUID_GAMEOBJECT: - if (_hiGoGuid >= 0x00FFFFFE) - { - sLog->outError("Gameobject guid overflow!! Can't continue, shutting down server. "); - World::StopNow(ERROR_EXIT_CODE); - } + { + ASSERT(_hiGoGuid < 0x00FFFFFE && "Gameobject guid overflow!"); return _hiGoGuid++; + } case HIGHGUID_CORPSE: - if (_hiCorpseGuid >= 0xFFFFFFFE) - { - sLog->outError("Corpse guid overflow!! Can't continue, shutting down server. "); - World::StopNow(ERROR_EXIT_CODE); - } + { + ASSERT(_hiCorpseGuid < 0xFFFFFFFE && "Corpse guid overflow!"); return _hiCorpseGuid++; + } case HIGHGUID_DYNAMICOBJECT: - if (_hiDoGuid >= 0xFFFFFFFE) - { - sLog->outError("DynamicObject guid overflow!! Can't continue, shutting down server. "); - World::StopNow(ERROR_EXIT_CODE); - } + { + ASSERT(_hiDoGuid < 0xFFFFFFFE && "DynamicObject guid overflow!"); return _hiDoGuid++; + } case HIGHGUID_MO_TRANSPORT: - if (_hiMoTransGuid >= 0xFFFFFFFE) - { - sLog->outError("MO Transport guid overflow!! Can't continue, shutting down server. "); - World::StopNow(ERROR_EXIT_CODE); - } + { + ASSERT(_hiMoTransGuid < 0xFFFFFFFE && "MO Transport guid overflow!"); return _hiMoTransGuid++; + } default: - ASSERT(0); + ASSERT(false && "ObjectMgr::GenerateLowGuid - Unknown HIGHGUID type"); + return 0; } - - ASSERT(0); - return 0; } void ObjectMgr::LoadGameObjectLocales() @@ -6346,8 +6203,7 @@ void ObjectMgr::LoadGameObjectLocales() AddLocaleString(fields[i + (TOTAL_LOCALES - 1)].GetString(), LocaleConstant(i), data.CastBarCaption); } while (result->NextRow()); - sLog->outString(">> Loaded %lu gameobject locale strings in %u ms", (unsigned long)_gameObjectLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu gameobject locale strings in %u ms", (unsigned long)_gameObjectLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); } inline void CheckGOLockId(GameObjectTemplate const* goInfo, uint32 dataN, uint32 N) @@ -6355,7 +6211,7 @@ inline void CheckGOLockId(GameObjectTemplate const* goInfo, uint32 dataN, uint32 if (sLockStore.LookupEntry(dataN)) return; - sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but lock (Id: %u) not found.", + sLog->outError(LOG_FILTER_SQL, "Gameobject (Entry: %u GoType: %u) have data%d=%u but lock (Id: %u) not found.", goInfo->entry, goInfo->type, N, goInfo->door.lockId, goInfo->door.lockId); } @@ -6364,7 +6220,7 @@ inline void CheckGOLinkedTrapId(GameObjectTemplate const* goInfo, uint32 dataN, if (GameObjectTemplate const* trapInfo = sObjectMgr->GetGameObjectTemplate(dataN)) { if (trapInfo->type != GAMEOBJECT_TYPE_TRAP) - sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but GO (Entry %u) have not GAMEOBJECT_TYPE_TRAP (%u) type.", + sLog->outError(LOG_FILTER_SQL, "Gameobject (Entry: %u GoType: %u) have data%d=%u but GO (Entry %u) have not GAMEOBJECT_TYPE_TRAP (%u) type.", goInfo->entry, goInfo->type, N, dataN, dataN, GAMEOBJECT_TYPE_TRAP); } } @@ -6374,7 +6230,7 @@ inline void CheckGOSpellId(GameObjectTemplate const* goInfo, uint32 dataN, uint3 if (sSpellMgr->GetSpellInfo(dataN)) return; - sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but Spell (Entry %u) not exist.", + sLog->outError(LOG_FILTER_SQL, "Gameobject (Entry: %u GoType: %u) have data%d=%u but Spell (Entry %u) not exist.", goInfo->entry, goInfo->type, N, dataN, dataN); } @@ -6383,7 +6239,7 @@ inline void CheckAndFixGOChairHeightId(GameObjectTemplate const* goInfo, uint32 if (dataN <= (UNIT_STAND_STATE_SIT_HIGH_CHAIR-UNIT_STAND_STATE_SIT_LOW_CHAIR)) return; - sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but correct chair height in range 0..%i.", + sLog->outError(LOG_FILTER_SQL, "Gameobject (Entry: %u GoType: %u) have data%d=%u but correct chair height in range 0..%i.", goInfo->entry, goInfo->type, N, dataN, UNIT_STAND_STATE_SIT_HIGH_CHAIR-UNIT_STAND_STATE_SIT_LOW_CHAIR); // prevent client and server unexpected work @@ -6396,7 +6252,7 @@ inline void CheckGONoDamageImmuneId(GameObjectTemplate* goTemplate, uint32 dataN if (dataN <= 1) return; - sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but expected boolean (0/1) noDamageImmune field value.", goTemplate->entry, goTemplate->type, N, dataN); + sLog->outError(LOG_FILTER_SQL, "Gameobject (Entry: %u GoType: %u) have data%d=%u but expected boolean (0/1) noDamageImmune field value.", goTemplate->entry, goTemplate->type, N, dataN); } inline void CheckGOConsumable(GameObjectTemplate const* goInfo, uint32 dataN, uint32 N) @@ -6405,7 +6261,7 @@ inline void CheckGOConsumable(GameObjectTemplate const* goInfo, uint32 dataN, ui if (dataN <= 1) return; - sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but expected boolean (0/1) consumable field value.", + sLog->outError(LOG_FILTER_SQL, "Gameobject (Entry: %u GoType: %u) have data%d=%u but expected boolean (0/1) consumable field value.", goInfo->entry, goInfo->type, N, dataN); } @@ -6423,8 +6279,7 @@ void ObjectMgr::LoadGameObjectTemplate() if (!result) { - sLog->outString(">> Loaded 0 gameobject definitions. DB table `gameobject_template` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 gameobject definitions. DB table `gameobject_template` is empty."); return; } @@ -6508,7 +6363,7 @@ void ObjectMgr::LoadGameObjectTemplate() if (got.spellFocus.focusId) { if (!sSpellFocusObjectStore.LookupEntry(got.spellFocus.focusId)) - sLog->outErrorDb("GameObject (Entry: %u GoType: %u) have data0=%u but SpellFocus (Id: %u) not exist.", + sLog->outError(LOG_FILTER_SQL, "GameObject (Entry: %u GoType: %u) have data0=%u but SpellFocus (Id: %u) not exist.", entry, got.type, got.spellFocus.focusId, got.spellFocus.focusId); } @@ -6526,7 +6381,7 @@ void ObjectMgr::LoadGameObjectTemplate() if (got.goober.pageId) // pageId { if (!GetPageText(got.goober.pageId)) - sLog->outErrorDb("GameObject (Entry: %u GoType: %u) have data7=%u but PageText (Entry %u) not exist.", + sLog->outError(LOG_FILTER_SQL, "GameObject (Entry: %u GoType: %u) have data7=%u but PageText (Entry %u) not exist.", entry, got.type, got.goober.pageId, got.goober.pageId); } CheckGONoDamageImmuneId(&got, got.goober.noDamageImmune, 11); @@ -6551,7 +6406,7 @@ void ObjectMgr::LoadGameObjectTemplate() if (got.moTransport.taxiPathId) { if (got.moTransport.taxiPathId >= sTaxiPathNodesByPath.size() || sTaxiPathNodesByPath[got.moTransport.taxiPathId].empty()) - sLog->outErrorDb("GameObject (Entry: %u GoType: %u) have data0=%u but TaxiPath (Id: %u) not exist.", + sLog->outError(LOG_FILTER_SQL, "GameObject (Entry: %u GoType: %u) have data0=%u but TaxiPath (Id: %u) not exist.", entry, got.type, got.moTransport.taxiPathId, got.moTransport.taxiPathId); } break; @@ -6593,8 +6448,7 @@ void ObjectMgr::LoadGameObjectTemplate() } while (result->NextRow()); - sLog->outString(">> Loaded %u game object templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u game object templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadExplorationBaseXP() @@ -6605,8 +6459,8 @@ void ObjectMgr::LoadExplorationBaseXP() if (!result) { - sLog->outErrorDb(">> Loaded 0 BaseXP definitions. DB table `exploration_basexp` is empty."); - sLog->outString(); + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 BaseXP definitions. DB table `exploration_basexp` is empty."); + return; } @@ -6622,8 +6476,7 @@ void ObjectMgr::LoadExplorationBaseXP() } while (result->NextRow()); - sLog->outString(">> Loaded %u BaseXP definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u BaseXP definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } uint32 ObjectMgr::GetBaseXP(uint8 level) @@ -6631,7 +6484,7 @@ uint32 ObjectMgr::GetBaseXP(uint8 level) return _baseXPTable[level] ? _baseXPTable[level] : 0; } -uint32 ObjectMgr::GetXPForLevel(uint8 level) +uint32 ObjectMgr::GetXPForLevel(uint8 level) const { if (level < _playerXPperLevel.size()) return _playerXPperLevel[level]; @@ -6646,8 +6499,7 @@ void ObjectMgr::LoadPetNames() if (!result) { - sLog->outString(">> Loaded 0 pet name parts. DB table `pet_name_generation` is empty!"); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 pet name parts. DB table `pet_name_generation` is empty!"); return; } @@ -6667,8 +6519,7 @@ void ObjectMgr::LoadPetNames() } while (result->NextRow()); - sLog->outString(">> Loaded %u pet name parts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u pet name parts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadPetNumber() @@ -6682,8 +6533,7 @@ void ObjectMgr::LoadPetNumber() _hiPetNumber = fields[0].GetUInt32()+1; } - sLog->outString(">> Loaded the max pet number: %d in %u ms", _hiPetNumber-1, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded the max pet number: %d in %u ms", _hiPetNumber-1, GetMSTimeDiffToNow(oldMSTime)); } std::string ObjectMgr::GeneratePetName(uint32 entry) @@ -6716,8 +6566,7 @@ void ObjectMgr::LoadCorpses() PreparedQueryResult result = CharacterDatabase.Query(CharacterDatabase.GetPreparedStatement(CHAR_SEL_CORPSES)); if (!result) { - sLog->outString(">> Loaded 0 corpses. DB table `corpse` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 corpses. DB table `corpse` is empty."); return; } @@ -6729,7 +6578,7 @@ void ObjectMgr::LoadCorpses() CorpseType type = CorpseType(fields[13].GetUInt8()); if (type >= MAX_CORPSE_TYPE) { - sLog->outError("Corpse (guid: %u) have wrong corpse type (%u), not loading.", guid, type); + sLog->outError(LOG_FILTER_GENERAL, "Corpse (guid: %u) have wrong corpse type (%u), not loading.", guid, type); continue; } @@ -6745,8 +6594,7 @@ void ObjectMgr::LoadCorpses() } while (result->NextRow()); - sLog->outString(">> Loaded %u corpses in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u corpses in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadReputationRewardRate() @@ -6760,8 +6608,8 @@ void ObjectMgr::LoadReputationRewardRate() if (!result) { - sLog->outErrorDb(">> Loaded `reputation_reward_rate`, table is empty!"); - sLog->outString(); + sLog->outError(LOG_FILTER_SQL, ">> Loaded `reputation_reward_rate`, table is empty!"); + return; } @@ -6780,25 +6628,25 @@ void ObjectMgr::LoadReputationRewardRate() FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionId); if (!factionEntry) { - sLog->outErrorDb("Faction (faction.dbc) %u does not exist but is used in `reputation_reward_rate`", factionId); + sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u does not exist but is used in `reputation_reward_rate`", factionId); continue; } if (repRate.quest_rate < 0.0f) { - sLog->outErrorDb("Table reputation_reward_rate has quest_rate with invalid rate %f, skipping data for faction %u", repRate.quest_rate, factionId); + sLog->outError(LOG_FILTER_SQL, "Table reputation_reward_rate has quest_rate with invalid rate %f, skipping data for faction %u", repRate.quest_rate, factionId); continue; } if (repRate.creature_rate < 0.0f) { - sLog->outErrorDb("Table reputation_reward_rate has creature_rate with invalid rate %f, skipping data for faction %u", repRate.creature_rate, factionId); + sLog->outError(LOG_FILTER_SQL, "Table reputation_reward_rate has creature_rate with invalid rate %f, skipping data for faction %u", repRate.creature_rate, factionId); continue; } if (repRate.spell_rate < 0.0f) { - sLog->outErrorDb("Table reputation_reward_rate has spell_rate with invalid rate %f, skipping data for faction %u", repRate.spell_rate, factionId); + sLog->outError(LOG_FILTER_SQL, "Table reputation_reward_rate has spell_rate with invalid rate %f, skipping data for faction %u", repRate.spell_rate, factionId); continue; } @@ -6808,8 +6656,7 @@ void ObjectMgr::LoadReputationRewardRate() } while (result->NextRow()); - sLog->outString(">> Loaded %u reputation_reward_rate in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u reputation_reward_rate in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadReputationOnKill() @@ -6829,8 +6676,8 @@ void ObjectMgr::LoadReputationOnKill() if (!result) { - sLog->outErrorDb(">> Loaded 0 creature award reputation definitions. DB table `creature_onkill_reputation` is empty."); - sLog->outString(); + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 creature award reputation definitions. DB table `creature_onkill_reputation` is empty."); + return; } @@ -6853,7 +6700,7 @@ void ObjectMgr::LoadReputationOnKill() if (!GetCreatureTemplate(creature_id)) { - sLog->outErrorDb("Table `creature_onkill_reputation` have data for not existed creature entry (%u), skipped", creature_id); + sLog->outError(LOG_FILTER_SQL, "Table `creature_onkill_reputation` have data for not existed creature entry (%u), skipped", creature_id); continue; } @@ -6862,7 +6709,7 @@ void ObjectMgr::LoadReputationOnKill() FactionEntry const* factionEntry1 = sFactionStore.LookupEntry(repOnKill.RepFaction1); if (!factionEntry1) { - sLog->outErrorDb("Faction (faction.dbc) %u does not exist but is used in `creature_onkill_reputation`", repOnKill.RepFaction1); + sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u does not exist but is used in `creature_onkill_reputation`", repOnKill.RepFaction1); continue; } } @@ -6872,7 +6719,7 @@ void ObjectMgr::LoadReputationOnKill() FactionEntry const* factionEntry2 = sFactionStore.LookupEntry(repOnKill.RepFaction2); if (!factionEntry2) { - sLog->outErrorDb("Faction (faction.dbc) %u does not exist but is used in `creature_onkill_reputation`", repOnKill.RepFaction2); + sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u does not exist but is used in `creature_onkill_reputation`", repOnKill.RepFaction2); continue; } } @@ -6882,8 +6729,7 @@ void ObjectMgr::LoadReputationOnKill() ++count; } while (result->NextRow()); - sLog->outString(">> Loaded %u creature award reputation definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature award reputation definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadReputationSpilloverTemplate() @@ -6897,8 +6743,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate() if (!result) { - sLog->outString(">> Loaded `reputation_spillover_template`, table is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded `reputation_spillover_template`, table is empty."); return; } @@ -6927,13 +6772,13 @@ void ObjectMgr::LoadReputationSpilloverTemplate() if (!factionEntry) { - sLog->outErrorDb("Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", factionId); + sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", factionId); continue; } if (factionEntry->team == 0) { - sLog->outErrorDb("Faction (faction.dbc) %u in `reputation_spillover_template` does not belong to any team, skipping", factionId); + sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u in `reputation_spillover_template` does not belong to any team, skipping", factionId); continue; } @@ -6945,19 +6790,19 @@ void ObjectMgr::LoadReputationSpilloverTemplate() if (!factionSpillover) { - sLog->outErrorDb("Spillover faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template` for faction %u, skipping", repTemplate.faction[i], factionId); + sLog->outError(LOG_FILTER_SQL, "Spillover faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template` for faction %u, skipping", repTemplate.faction[i], factionId); continue; } if (factionSpillover->reputationListID < 0) { - sLog->outErrorDb("Spillover faction (faction.dbc) %u for faction %u in `reputation_spillover_template` can not be listed for client, and then useless, skipping", repTemplate.faction[i], factionId); + sLog->outError(LOG_FILTER_SQL, "Spillover faction (faction.dbc) %u for faction %u in `reputation_spillover_template` can not be listed for client, and then useless, skipping", repTemplate.faction[i], factionId); continue; } if (repTemplate.faction_rank[i] >= MAX_REPUTATION_RANK) { - sLog->outErrorDb("Rank %u used in `reputation_spillover_template` for spillover faction %u is not valid, skipping", repTemplate.faction_rank[i], repTemplate.faction[i]); + sLog->outError(LOG_FILTER_SQL, "Rank %u used in `reputation_spillover_template` for spillover faction %u is not valid, skipping", repTemplate.faction_rank[i], repTemplate.faction[i]); continue; } } @@ -6966,25 +6811,25 @@ void ObjectMgr::LoadReputationSpilloverTemplate() FactionEntry const* factionEntry0 = sFactionStore.LookupEntry(repTemplate.faction[0]); if (repTemplate.faction[0] && !factionEntry0) { - sLog->outErrorDb("Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[0]); + sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[0]); continue; } FactionEntry const* factionEntry1 = sFactionStore.LookupEntry(repTemplate.faction[1]); if (repTemplate.faction[1] && !factionEntry1) { - sLog->outErrorDb("Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[1]); + sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[1]); continue; } FactionEntry const* factionEntry2 = sFactionStore.LookupEntry(repTemplate.faction[2]); if (repTemplate.faction[2] && !factionEntry2) { - sLog->outErrorDb("Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[2]); + sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[2]); continue; } FactionEntry const* factionEntry3 = sFactionStore.LookupEntry(repTemplate.faction[3]); if (repTemplate.faction[3] && !factionEntry3) { - sLog->outErrorDb("Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[3]); + sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[3]); continue; } @@ -6994,8 +6839,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate() } while (result->NextRow()); - sLog->outString(">> Loaded %u reputation_spillover_template in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u reputation_spillover_template in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadPointsOfInterest() @@ -7011,8 +6855,8 @@ void ObjectMgr::LoadPointsOfInterest() if (!result) { - sLog->outErrorDb(">> Loaded 0 Points of Interest definitions. DB table `points_of_interest` is empty."); - sLog->outString(); + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 Points of Interest definitions. DB table `points_of_interest` is empty."); + return; } @@ -7032,7 +6876,7 @@ void ObjectMgr::LoadPointsOfInterest() if (!Trinity::IsValidMapCoord(POI.x, POI.y)) { - sLog->outErrorDb("Table `points_of_interest` (Entry: %u) have invalid coordinates (X: %f Y: %f), ignored.", point_id, POI.x, POI.y); + sLog->outError(LOG_FILTER_SQL, "Table `points_of_interest` (Entry: %u) have invalid coordinates (X: %f Y: %f), ignored.", point_id, POI.x, POI.y); continue; } @@ -7041,8 +6885,7 @@ void ObjectMgr::LoadPointsOfInterest() ++count; } while (result->NextRow()); - sLog->outString(">> Loaded %u Points of Interest definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u Points of Interest definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadQuestPOI() @@ -7058,8 +6901,8 @@ void ObjectMgr::LoadQuestPOI() if (!result) { - sLog->outErrorDb(">> Loaded 0 quest POI definitions. DB table `quest_poi` is empty."); - sLog->outString(); + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 quest POI definitions. DB table `quest_poi` is empty."); + return; } @@ -7113,8 +6956,7 @@ void ObjectMgr::LoadQuestPOI() ++count; } while (result->NextRow()); - sLog->outString(">> Loaded %u quest POI definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quest POI definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadNPCSpellClickSpells() @@ -7127,8 +6969,8 @@ void ObjectMgr::LoadNPCSpellClickSpells() if (!result) { - sLog->outErrorDb(">> Loaded 0 spellclick spells. DB table `npc_spellclick_spells` is empty."); - sLog->outString(); + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 spellclick spells. DB table `npc_spellclick_spells` is empty."); + return; } @@ -7142,7 +6984,7 @@ void ObjectMgr::LoadNPCSpellClickSpells() CreatureTemplate const* cInfo = GetCreatureTemplate(npc_entry); if (!cInfo) { - sLog->outErrorDb("Table npc_spellclick_spells references unknown creature_template %u. Skipping entry.", npc_entry); + sLog->outError(LOG_FILTER_SQL, "Table npc_spellclick_spells references unknown creature_template %u. Skipping entry.", npc_entry); continue; } @@ -7150,13 +6992,13 @@ void ObjectMgr::LoadNPCSpellClickSpells() SpellInfo const* spellinfo = sSpellMgr->GetSpellInfo(spellid); if (!spellinfo) { - sLog->outErrorDb("Table npc_spellclick_spells references unknown spellid %u. Skipping entry.", spellid); + sLog->outError(LOG_FILTER_SQL, "Table npc_spellclick_spells references unknown spellid %u. Skipping entry.", spellid); continue; } uint8 userType = fields[3].GetUInt16(); if (userType >= SPELL_CLICK_USER_MAX) - sLog->outErrorDb("Table npc_spellclick_spells references unknown user type %u. Skipping entry.", uint32(userType)); + sLog->outError(LOG_FILTER_SQL, "Table npc_spellclick_spells references unknown user type %u. Skipping entry.", uint32(userType)); uint8 castFlags = fields[2].GetUInt8(); SpellClickInfo info; @@ -7176,51 +7018,12 @@ void ObjectMgr::LoadNPCSpellClickSpells() { if ((itr->second.npcflag & UNIT_NPC_FLAG_SPELLCLICK) && _spellClickInfoStore.find(itr->second.Entry) == _spellClickInfoStore.end()) { - sLog->outErrorDb("npc_spellclick_spells: Creature template %u has UNIT_NPC_FLAG_SPELLCLICK but no data in spellclick table! Removing flag", itr->second.Entry); + sLog->outError(LOG_FILTER_SQL, "npc_spellclick_spells: Creature template %u has UNIT_NPC_FLAG_SPELLCLICK but no data in spellclick table! Removing flag", itr->second.Entry); const_cast<CreatureTemplate*>(&itr->second)->npcflag &= ~UNIT_NPC_FLAG_SPELLCLICK; } } - sLog->outString(">> Loaded %u spellclick definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); -} - -void ObjectMgr::SaveCreatureRespawnTime(uint32 loguid, uint32 instance, time_t t) -{ - if (!t) - { - // Delete only - RemoveCreatureRespawnTime(loguid, instance); - return; - } - - // This function can be called from various map threads concurrently - { - _creatureRespawnTimesMutex.acquire(); - _creatureRespawnTimes[MAKE_PAIR64(loguid, instance)] = t; - _creatureRespawnTimesMutex.release(); - } - - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CREATURE_RESPAWN); - stmt->setUInt32(0, loguid); - stmt->setUInt32(1, uint32(t)); - stmt->setUInt32(2, instance); - CharacterDatabase.Execute(stmt); -} - -void ObjectMgr::RemoveCreatureRespawnTime(uint32 loguid, uint32 instance) -{ - // This function can be called from various map threads concurrently - { - _creatureRespawnTimesMutex.acquire(); - _creatureRespawnTimes[MAKE_PAIR64(loguid, instance)] = 0; - _creatureRespawnTimesMutex.release(); - } - - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CREATURE_RESPAWN); - stmt->setUInt32(0, loguid); - stmt->setUInt32(1, instance); - CharacterDatabase.Execute(stmt); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spellclick definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::DeleteCreatureData(uint32 guid) @@ -7233,81 +7036,6 @@ void ObjectMgr::DeleteCreatureData(uint32 guid) _creatureDataStore.erase(guid); } -void ObjectMgr::SaveGORespawnTime(uint32 loguid, uint32 instance, time_t t) -{ - if (!t) - { - // Delete only - RemoveGORespawnTime(loguid, instance); - return; - } - - // This function can be called from different map threads concurrently - { - _goRespawnTimesMutex.acquire(); - _goRespawnTimes[MAKE_PAIR64(loguid, instance)] = t; - _goRespawnTimesMutex.release(); - } - - PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GO_RESPAWN); - stmt->setUInt32(0, loguid); - stmt->setUInt64(1, uint64(t)); - stmt->setUInt32(2, instance); - CharacterDatabase.Execute(stmt); -} - -void ObjectMgr::RemoveGORespawnTime(uint32 loguid, uint32 instance) -{ - // This function can be called from different map threads concurrently - { - _goRespawnTimesMutex.acquire(); - _goRespawnTimes[MAKE_PAIR64(loguid, instance)] = 0; - _goRespawnTimesMutex.release(); - } - - PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GO_RESPAWN); - stmt->setUInt32(0, loguid); - stmt->setUInt32(1, instance); - CharacterDatabase.Execute(stmt); -} - -void ObjectMgr::DeleteRespawnTimeForInstance(uint32 instance) -{ - // This function can be called from different map threads concurrently - RespawnTimes::iterator next; - - { - _goRespawnTimesMutex.acquire(); - for (RespawnTimes::iterator itr = _goRespawnTimes.begin(); itr != _goRespawnTimes.end(); itr = next) - { - next = itr; - ++next; - - if (GUID_HIPART(itr->first) == instance) - _goRespawnTimes.erase(itr); - } - _goRespawnTimesMutex.release(); - } - { - _creatureRespawnTimesMutex.acquire(); - for (RespawnTimes::iterator itr = _creatureRespawnTimes.begin(); itr != _creatureRespawnTimes.end(); itr = next) - { - next = itr; - ++next; - - if (GUID_HIPART(itr->first) == instance) - _creatureRespawnTimes.erase(itr); - } - _creatureRespawnTimesMutex.release(); - } - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CREATURE_RESPAWN_BY_INSTANCE); - stmt->setUInt32(0, instance); - CharacterDatabase.Execute(stmt); - stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GO_RESPAWN_BY_INSTANCE); - stmt->setUInt32(0, instance); - CharacterDatabase.Execute(stmt); -} - void ObjectMgr::DeleteGOData(uint32 guid) { // remove mapid*cellid -> guid_set map @@ -7344,8 +7072,8 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map, std::string table, if (!result) { - sLog->outErrorDb(">> Loaded 0 quest relations from `%s`, table is empty.", table.c_str()); - sLog->outString(); + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 quest relations from `%s`, table is empty.", table.c_str()); + return; } @@ -7361,7 +7089,7 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map, std::string table, if (_questTemplates.find(quest) == _questTemplates.end()) { - sLog->outErrorDb("Table `%s`: Quest %u listed for entry %u does not exist.", table.c_str(), quest, id); + sLog->outError(LOG_FILTER_SQL, "Table `%s`: Quest %u listed for entry %u does not exist.", table.c_str(), quest, id); continue; } @@ -7373,8 +7101,7 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map, std::string table, ++count; } while (result->NextRow()); - sLog->outString(">> Loaded %u quest relations from %s in %u ms", count, table.c_str(), GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quest relations from %s in %u ms", count, table.c_str(), GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadGameobjectQuestRelations() @@ -7385,9 +7112,9 @@ void ObjectMgr::LoadGameobjectQuestRelations() { GameObjectTemplate const* goInfo = GetGameObjectTemplate(itr->first); if (!goInfo) - sLog->outErrorDb("Table `gameobject_questrelation` have data for not existed gameobject entry (%u) and existed quest %u", itr->first, itr->second); + sLog->outError(LOG_FILTER_SQL, "Table `gameobject_questrelation` have data for not existed gameobject entry (%u) and existed quest %u", itr->first, itr->second); else if (goInfo->type != GAMEOBJECT_TYPE_QUESTGIVER) - sLog->outErrorDb("Table `gameobject_questrelation` have data gameobject entry (%u) for quest %u, but GO is not GAMEOBJECT_TYPE_QUESTGIVER", itr->first, itr->second); + sLog->outError(LOG_FILTER_SQL, "Table `gameobject_questrelation` have data gameobject entry (%u) for quest %u, but GO is not GAMEOBJECT_TYPE_QUESTGIVER", itr->first, itr->second); } } @@ -7399,9 +7126,9 @@ void ObjectMgr::LoadGameobjectInvolvedRelations() { GameObjectTemplate const* goInfo = GetGameObjectTemplate(itr->first); if (!goInfo) - sLog->outErrorDb("Table `gameobject_involvedrelation` have data for not existed gameobject entry (%u) and existed quest %u", itr->first, itr->second); + sLog->outError(LOG_FILTER_SQL, "Table `gameobject_involvedrelation` have data for not existed gameobject entry (%u) and existed quest %u", itr->first, itr->second); else if (goInfo->type != GAMEOBJECT_TYPE_QUESTGIVER) - sLog->outErrorDb("Table `gameobject_involvedrelation` have data gameobject entry (%u) for quest %u, but GO is not GAMEOBJECT_TYPE_QUESTGIVER", itr->first, itr->second); + sLog->outError(LOG_FILTER_SQL, "Table `gameobject_involvedrelation` have data gameobject entry (%u) for quest %u, but GO is not GAMEOBJECT_TYPE_QUESTGIVER", itr->first, itr->second); } } @@ -7413,9 +7140,9 @@ void ObjectMgr::LoadCreatureQuestRelations() { CreatureTemplate const* cInfo = GetCreatureTemplate(itr->first); if (!cInfo) - sLog->outErrorDb("Table `creature_questrelation` have data for not existed creature entry (%u) and existed quest %u", itr->first, itr->second); + sLog->outError(LOG_FILTER_SQL, "Table `creature_questrelation` have data for not existed creature entry (%u) and existed quest %u", itr->first, itr->second); else if (!(cInfo->npcflag & UNIT_NPC_FLAG_QUESTGIVER)) - sLog->outErrorDb("Table `creature_questrelation` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second); + sLog->outError(LOG_FILTER_SQL, "Table `creature_questrelation` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second); } } @@ -7427,9 +7154,9 @@ void ObjectMgr::LoadCreatureInvolvedRelations() { CreatureTemplate const* cInfo = GetCreatureTemplate(itr->first); if (!cInfo) - sLog->outErrorDb("Table `creature_involvedrelation` have data for not existed creature entry (%u) and existed quest %u", itr->first, itr->second); + sLog->outError(LOG_FILTER_SQL, "Table `creature_involvedrelation` have data for not existed creature entry (%u) and existed quest %u", itr->first, itr->second); else if (!(cInfo->npcflag & UNIT_NPC_FLAG_QUESTGIVER)) - sLog->outErrorDb("Table `creature_involvedrelation` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second); + sLog->outError(LOG_FILTER_SQL, "Table `creature_involvedrelation` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second); } } @@ -7443,8 +7170,7 @@ void ObjectMgr::LoadReservedPlayersNames() if (!result) { - sLog->outString(">> Loaded 0 reserved player names. DB table `reserved_name` is empty!"); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 reserved player names. DB table `reserved_name` is empty!"); return; } @@ -7459,7 +7185,7 @@ void ObjectMgr::LoadReservedPlayersNames() std::wstring wstr; if (!Utf8toWStr (name, wstr)) { - sLog->outError("Table `reserved_name` have invalid name: %s", name.c_str()); + sLog->outError(LOG_FILTER_GENERAL, "Table `reserved_name` have invalid name: %s", name.c_str()); continue; } @@ -7470,8 +7196,7 @@ void ObjectMgr::LoadReservedPlayersNames() } while (result->NextRow()); - sLog->outString(">> Loaded %u reserved player names in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u reserved player names in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } bool ObjectMgr::IsReservedName(const std::string& name) const @@ -7624,8 +7349,7 @@ void ObjectMgr::LoadGameObjectForQuests() if (sObjectMgr->GetGameObjectTemplates()->empty()) { - sLog->outString(">> Loaded 0 GameObjects for quests"); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 GameObjects for quests"); return; } @@ -7673,8 +7397,7 @@ void ObjectMgr::LoadGameObjectForQuests() } } - sLog->outString(">> Loaded %u GameObjects for quests in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u GameObjects for quests in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max_value) @@ -7688,7 +7411,7 @@ bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max { if (end_value >= start_value) { - sLog->outErrorDb("Table '%s' attempt loaded with invalid range (%d - %d), strings not loaded.", table, min_value, max_value); + sLog->outError(LOG_FILTER_SQL, "Table '%s' attempt loaded with invalid range (%d - %d), strings not loaded.", table, min_value, max_value); return false; } @@ -7701,7 +7424,7 @@ bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max { if (start_value >= end_value) { - sLog->outErrorDb("Table '%s' attempt loaded with invalid range (%d - %d), strings not loaded.", table, min_value, max_value); + sLog->outError(LOG_FILTER_SQL, "Table '%s' attempt loaded with invalid range (%d - %d), strings not loaded.", table, min_value, max_value); return false; } } @@ -7720,10 +7443,10 @@ bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max if (!result) { if (min_value == MIN_TRINITY_STRING_ID) // error only in case internal strings - sLog->outErrorDb(">> Loaded 0 trinity strings. DB table `%s` is empty. Cannot continue.", table); + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 trinity strings. DB table `%s` is empty. Cannot continue.", table); else - sLog->outString(">> Loaded 0 string templates. DB table `%s` is empty.", table); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 string templates. DB table `%s` is empty.", table); + return false; } @@ -7737,12 +7460,12 @@ bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max if (entry == 0) { - sLog->outErrorDb("Table `%s` contain reserved entry 0, ignored.", table); + sLog->outError(LOG_FILTER_SQL, "Table `%s` contain reserved entry 0, ignored.", table); continue; } else if (entry < start_value || entry >= end_value) { - sLog->outErrorDb("Table `%s` contain entry %i out of allowed range (%d - %d), ignored.", table, entry, min_value, max_value); + sLog->outError(LOG_FILTER_SQL, "Table `%s` contain entry %i out of allowed range (%d - %d), ignored.", table, entry, min_value, max_value); continue; } @@ -7750,7 +7473,7 @@ bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max if (!data.Content.empty()) { - sLog->outErrorDb("Table `%s` contain data for already loaded entry %i (from another table?), ignored.", table, entry); + sLog->outError(LOG_FILTER_SQL, "Table `%s` contain data for already loaded entry %i (from another table?), ignored.", table, entry); continue; } @@ -7762,11 +7485,10 @@ bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max } while (result->NextRow()); if (min_value == MIN_TRINITY_STRING_ID) - sLog->outString(">> Loaded %u Trinity strings from table %s in %u ms", count, table, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u Trinity strings from table %s in %u ms", count, table, GetMSTimeDiffToNow(oldMSTime)); else - sLog->outString(">> Loaded %u string templates from %s in %u ms", count, table, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u string templates from %s in %u ms", count, table, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); return true; } @@ -7781,9 +7503,9 @@ const char *ObjectMgr::GetTrinityString(int32 entry, LocaleConstant locale_idx) } if (entry > 0) - sLog->outErrorDb("Entry %i not found in `trinity_string` table.", entry); + sLog->outError(LOG_FILTER_SQL, "Entry %i not found in `trinity_string` table.", entry); else - sLog->outErrorDb("Trinity string entry %i not found in DB.", entry); + sLog->outError(LOG_FILTER_SQL, "Trinity string entry %i not found in DB.", entry); return "<error>"; } @@ -7797,8 +7519,8 @@ void ObjectMgr::LoadFishingBaseSkillLevel() if (!result) { - sLog->outErrorDb(">> Loaded 0 areas for fishing base skill level. DB table `skill_fishing_base_level` is empty."); - sLog->outString(); + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 areas for fishing base skill level. DB table `skill_fishing_base_level` is empty."); + return; } @@ -7813,7 +7535,7 @@ void ObjectMgr::LoadFishingBaseSkillLevel() AreaTableEntry const* fArea = GetAreaEntryByAreaID(entry); if (!fArea) { - sLog->outErrorDb("AreaId %u defined in `skill_fishing_base_level` does not exist", entry); + sLog->outError(LOG_FILTER_SQL, "AreaId %u defined in `skill_fishing_base_level` does not exist", entry); continue; } @@ -7822,8 +7544,7 @@ void ObjectMgr::LoadFishingBaseSkillLevel() } while (result->NextRow()); - sLog->outString(">> Loaded %u areas for fishing base skill level in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u areas for fishing base skill level in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } bool ObjectMgr::CheckDeclinedNames(std::wstring w_ownname, DeclinedName const& names) @@ -7906,8 +7627,8 @@ void ObjectMgr::LoadGameTele() if (!result) { - sLog->outErrorDb(">> Loaded 0 GameTeleports. DB table `game_tele` is empty!"); - sLog->outString(); + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 GameTeleports. DB table `game_tele` is empty!"); + return; } @@ -7930,13 +7651,13 @@ void ObjectMgr::LoadGameTele() if (!MapManager::IsValidMapCoord(gt.mapId, gt.position_x, gt.position_y, gt.position_z, gt.orientation)) { - sLog->outErrorDb("Wrong position for id %u (name: %s) in `game_tele` table, ignoring.", id, gt.name.c_str()); + sLog->outError(LOG_FILTER_SQL, "Wrong position for id %u (name: %s) in `game_tele` table, ignoring.", id, gt.name.c_str()); continue; } if (!Utf8toWStr(gt.name, gt.wnameLow)) { - sLog->outErrorDb("Wrong UTF8 name for id %u in `game_tele` table, ignoring.", id); + sLog->outError(LOG_FILTER_SQL, "Wrong UTF8 name for id %u in `game_tele` table, ignoring.", id); continue; } @@ -7948,8 +7669,7 @@ void ObjectMgr::LoadGameTele() } while (result->NextRow()); - sLog->outString(">> Loaded %u GameTeleports in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u GameTeleports in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } GameTele const* ObjectMgr::GetGameTele(const std::string& name) const @@ -8047,8 +7767,8 @@ void ObjectMgr::LoadMailLevelRewards() if (!result) { - sLog->outErrorDb(">> Loaded 0 level dependent mail rewards. DB table `mail_level_reward` is empty."); - sLog->outString(); + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 level dependent mail rewards. DB table `mail_level_reward` is empty."); + return; } @@ -8065,25 +7785,25 @@ void ObjectMgr::LoadMailLevelRewards() if (level > MAX_LEVEL) { - sLog->outErrorDb("Table `mail_level_reward` have data for level %u that more supported by client (%u), ignoring.", level, MAX_LEVEL); + sLog->outError(LOG_FILTER_SQL, "Table `mail_level_reward` have data for level %u that more supported by client (%u), ignoring.", level, MAX_LEVEL); continue; } if (!(raceMask & RACEMASK_ALL_PLAYABLE)) { - sLog->outErrorDb("Table `mail_level_reward` have raceMask (%u) for level %u that not include any player races, ignoring.", raceMask, level); + sLog->outError(LOG_FILTER_SQL, "Table `mail_level_reward` have raceMask (%u) for level %u that not include any player races, ignoring.", raceMask, level); continue; } if (!sMailTemplateStore.LookupEntry(mailTemplateId)) { - sLog->outErrorDb("Table `mail_level_reward` have invalid mailTemplateId (%u) for level %u that invalid not include any player races, ignoring.", mailTemplateId, level); + sLog->outError(LOG_FILTER_SQL, "Table `mail_level_reward` have invalid mailTemplateId (%u) for level %u that invalid not include any player races, ignoring.", mailTemplateId, level); continue; } if (!GetCreatureTemplate(senderEntry)) { - sLog->outErrorDb("Table `mail_level_reward` have not existed sender creature entry (%u) for level %u that invalid not include any player races, ignoring.", senderEntry, level); + sLog->outError(LOG_FILTER_SQL, "Table `mail_level_reward` have not existed sender creature entry (%u) for level %u that invalid not include any player races, ignoring.", senderEntry, level); continue; } @@ -8093,8 +7813,7 @@ void ObjectMgr::LoadMailLevelRewards() } while (result->NextRow()); - sLog->outString(">> Loaded %u level dependent mail rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u level dependent mail rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::AddSpellToTrainer(uint32 entry, uint32 spell, uint32 spellCost, uint32 reqSkill, uint32 reqSkillValue, uint32 reqLevel) @@ -8105,32 +7824,32 @@ void ObjectMgr::AddSpellToTrainer(uint32 entry, uint32 spell, uint32 spellCost, CreatureTemplate const* cInfo = GetCreatureTemplate(entry); if (!cInfo) { - sLog->outErrorDb("Table `npc_trainer` contains an entry for a non-existing creature template (Entry: %u), ignoring", entry); + sLog->outError(LOG_FILTER_SQL, "Table `npc_trainer` contains an entry for a non-existing creature template (Entry: %u), ignoring", entry); return; } if (!(cInfo->npcflag & UNIT_NPC_FLAG_TRAINER)) { - sLog->outErrorDb("Table `npc_trainer` contains an entry for a creature template (Entry: %u) without trainer flag, ignoring", entry); + sLog->outError(LOG_FILTER_SQL, "Table `npc_trainer` contains an entry for a creature template (Entry: %u) without trainer flag, ignoring", entry); return; } SpellInfo const* spellinfo = sSpellMgr->GetSpellInfo(spell); if (!spellinfo) { - sLog->outErrorDb("Table `npc_trainer` contains an entry (Entry: %u) for a non-existing spell (Spell: %u), ignoring", entry, spell); + sLog->outError(LOG_FILTER_SQL, "Table `npc_trainer` contains an entry (Entry: %u) for a non-existing spell (Spell: %u), ignoring", entry, spell); return; } if (!SpellMgr::IsSpellValid(spellinfo)) { - sLog->outErrorDb("Table `npc_trainer` contains an entry (Entry: %u) for a broken spell (Spell: %u), ignoring", entry, spell); + sLog->outError(LOG_FILTER_SQL, "Table `npc_trainer` contains an entry (Entry: %u) for a broken spell (Spell: %u), ignoring", entry, spell); return; } if (GetTalentSpellCost(spell)) { - sLog->outErrorDb("Table `npc_trainer` contains an entry (Entry: %u) for a non-existing spell (Spell: %u) which is a talent, ignoring", entry, spell); + sLog->outError(LOG_FILTER_SQL, "Table `npc_trainer` contains an entry (Entry: %u) for a non-existing spell (Spell: %u) which is a talent, ignoring", entry, spell); return; } @@ -8158,7 +7877,7 @@ void ObjectMgr::AddSpellToTrainer(uint32 entry, uint32 spell, uint32 spellCost, if (spellinfo->Effects[i].TargetA.GetTarget() != 0 && spellinfo->Effects[i].TargetA.GetTarget() != TARGET_UNIT_TARGET_ALLY && spellinfo->Effects[i].TargetA.GetTarget() != TARGET_UNIT_TARGET_ANY && spellinfo->Effects[i].TargetA.GetTarget() != TARGET_UNIT_CASTER) { - sLog->outErrorDb("Table `npc_trainer` has spell %u for trainer entry %u with learn effect which has incorrect target type, ignoring learn effect!", spell, entry); + sLog->outError(LOG_FILTER_SQL, "Table `npc_trainer` has spell %u for trainer entry %u with learn effect which has incorrect target type, ignoring learn effect!", spell, entry); continue; } @@ -8190,8 +7909,8 @@ void ObjectMgr::LoadTrainerSpell() if (!result) { - sLog->outErrorDb(">> Loaded 0 Trainers. DB table `npc_trainer` is empty!"); - sLog->outString(); + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 Trainers. DB table `npc_trainer` is empty!"); + return; } @@ -8214,8 +7933,7 @@ void ObjectMgr::LoadTrainerSpell() } while (result->NextRow()); - sLog->outString(">> Loaded %d Trainers in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %d Trainers in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, std::set<uint32> *skip_vendors) @@ -8271,8 +7989,8 @@ void ObjectMgr::LoadVendors() QueryResult result = WorldDatabase.Query("SELECT entry, item, maxcount, incrtime, ExtendedCost FROM npc_vendor ORDER BY entry, slot ASC"); if (!result) { - sLog->outString(); - sLog->outErrorDb(">> Loaded 0 Vendors. DB table `npc_vendor` is empty!"); + + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 Vendors. DB table `npc_vendor` is empty!"); return; } @@ -8305,8 +8023,7 @@ void ObjectMgr::LoadVendors() } while (result->NextRow()); - sLog->outString(">> Loaded %d Vendors in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %d Vendors in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadGossipMenu() @@ -8319,8 +8036,8 @@ void ObjectMgr::LoadGossipMenu() if (!result) { - sLog->outErrorDb(">> Loaded 0 gossip_menu entries. DB table `gossip_menu` is empty!"); - sLog->outString(); + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 gossip_menu entries. DB table `gossip_menu` is empty!"); + return; } @@ -8337,7 +8054,7 @@ void ObjectMgr::LoadGossipMenu() if (!GetGossipText(gMenu.text_id)) { - sLog->outErrorDb("Table gossip_menu entry %u are using non-existing text_id %u", gMenu.entry, gMenu.text_id); + sLog->outError(LOG_FILTER_SQL, "Table gossip_menu entry %u are using non-existing text_id %u", gMenu.entry, gMenu.text_id); continue; } @@ -8347,8 +8064,7 @@ void ObjectMgr::LoadGossipMenu() } while (result->NextRow()); - sLog->outString(">> Loaded %u gossip_menu entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u gossip_menu entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadGossipMenuItems() @@ -8366,8 +8082,8 @@ void ObjectMgr::LoadGossipMenuItems() if (!result) { - sLog->outErrorDb(">> Loaded 0 gossip_menu_option entries. DB table `gossip_menu_option` is empty!"); - sLog->outString(); + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 gossip_menu_option entries. DB table `gossip_menu_option` is empty!"); + return; } @@ -8393,16 +8109,16 @@ void ObjectMgr::LoadGossipMenuItems() if (gMenuItem.OptionIcon >= GOSSIP_ICON_MAX) { - sLog->outErrorDb("Table gossip_menu_option for menu %u, id %u has unknown icon id %u. Replacing with GOSSIP_ICON_CHAT", gMenuItem.MenuId, gMenuItem.OptionIndex, gMenuItem.OptionIcon); + sLog->outError(LOG_FILTER_SQL, "Table gossip_menu_option for menu %u, id %u has unknown icon id %u. Replacing with GOSSIP_ICON_CHAT", gMenuItem.MenuId, gMenuItem.OptionIndex, gMenuItem.OptionIcon); gMenuItem.OptionIcon = GOSSIP_ICON_CHAT; } if (gMenuItem.OptionType >= GOSSIP_OPTION_MAX) - sLog->outErrorDb("Table gossip_menu_option for menu %u, id %u has unknown option id %u. Option will not be used", gMenuItem.MenuId, gMenuItem.OptionIndex, gMenuItem.OptionType); + sLog->outError(LOG_FILTER_SQL, "Table gossip_menu_option for menu %u, id %u has unknown option id %u. Option will not be used", gMenuItem.MenuId, gMenuItem.OptionIndex, gMenuItem.OptionType); if (gMenuItem.ActionPoiId && !GetPointOfInterest(gMenuItem.ActionPoiId)) { - sLog->outErrorDb("Table gossip_menu_option for menu %u, id %u use non-existing action_poi_id %u, ignoring", gMenuItem.MenuId, gMenuItem.OptionIndex, gMenuItem.ActionPoiId); + sLog->outError(LOG_FILTER_SQL, "Table gossip_menu_option for menu %u, id %u use non-existing action_poi_id %u, ignoring", gMenuItem.MenuId, gMenuItem.OptionIndex, gMenuItem.ActionPoiId); gMenuItem.ActionPoiId = 0; } @@ -8411,8 +8127,7 @@ void ObjectMgr::LoadGossipMenuItems() } while (result->NextRow()); - sLog->outString(">> Loaded %u gossip_menu_option entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u gossip_menu_option entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::AddVendorItem(uint32 entry, uint32 item, int32 maxcount, uint32 incrtime, uint32 extendedCost, bool persist /*= true*/) @@ -8464,7 +8179,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max if (player) ChatHandler(player).SendSysMessage(LANG_COMMAND_VENDORSELECTION); else - sLog->outErrorDb("Table `(game_event_)npc_vendor` have data for not existed creature template (Entry: %u), ignore", vendor_entry); + sLog->outError(LOG_FILTER_SQL, "Table `(game_event_)npc_vendor` have data for not existed creature template (Entry: %u), ignore", vendor_entry); return false; } @@ -8475,7 +8190,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max if (player) ChatHandler(player).SendSysMessage(LANG_COMMAND_VENDORSELECTION); else - sLog->outErrorDb("Table `(game_event_)npc_vendor` have data for not creature template (Entry: %u) without vendor flag, ignore", vendor_entry); + sLog->outError(LOG_FILTER_SQL, "Table `(game_event_)npc_vendor` have data for not creature template (Entry: %u) without vendor flag, ignore", vendor_entry); if (skip_vendors) skip_vendors->insert(vendor_entry); @@ -8488,7 +8203,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max if (player) ChatHandler(player).PSendSysMessage(LANG_ITEM_NOT_FOUND, item_id); else - sLog->outErrorDb("Table `(game_event_)npc_vendor` for Vendor (Entry: %u) have in item list non-existed item (%u), ignore", vendor_entry, item_id); + sLog->outError(LOG_FILTER_SQL, "Table `(game_event_)npc_vendor` for Vendor (Entry: %u) have in item list non-existed item (%u), ignore", vendor_entry, item_id); return false; } @@ -8497,7 +8212,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max if (player) ChatHandler(player).PSendSysMessage(LANG_EXTENDED_COST_NOT_EXIST, ExtendedCost); else - sLog->outErrorDb("Table `(game_event_)npc_vendor` have Item (Entry: %u) with wrong ExtendedCost (%u) for vendor (%u), ignore", item_id, ExtendedCost, vendor_entry); + sLog->outError(LOG_FILTER_SQL, "Table `(game_event_)npc_vendor` have Item (Entry: %u) with wrong ExtendedCost (%u) for vendor (%u), ignore", item_id, ExtendedCost, vendor_entry); return false; } @@ -8506,7 +8221,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max if (player) ChatHandler(player).PSendSysMessage("MaxCount != 0 (%u) but IncrTime == 0", maxcount); else - sLog->outErrorDb("Table `(game_event_)npc_vendor` has `maxcount` (%u) for item %u of vendor (Entry: %u) but `incrtime`=0, ignore", maxcount, item_id, vendor_entry); + sLog->outError(LOG_FILTER_SQL, "Table `(game_event_)npc_vendor` has `maxcount` (%u) for item %u of vendor (Entry: %u) but `incrtime`=0, ignore", maxcount, item_id, vendor_entry); return false; } else if (maxcount == 0 && incrtime > 0) @@ -8514,7 +8229,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max if (player) ChatHandler(player).PSendSysMessage("MaxCount == 0 but IncrTime<>= 0"); else - sLog->outErrorDb("Table `(game_event_)npc_vendor` has `maxcount`=0 for item %u of vendor (Entry: %u) but `incrtime`<>0, ignore", item_id, vendor_entry); + sLog->outError(LOG_FILTER_SQL, "Table `(game_event_)npc_vendor` has `maxcount`=0 for item %u of vendor (Entry: %u) but `incrtime`<>0, ignore", item_id, vendor_entry); return false; } @@ -8527,7 +8242,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max if (player) ChatHandler(player).PSendSysMessage(LANG_ITEM_ALREADY_IN_LIST, item_id, ExtendedCost); else - sLog->outErrorDb("Table `npc_vendor` has duplicate items %u (with extended cost %u) for vendor (Entry: %u), ignoring", item_id, ExtendedCost, vendor_entry); + sLog->outError(LOG_FILTER_SQL, "Table `npc_vendor` has duplicate items %u (with extended cost %u) for vendor (Entry: %u), ignoring", item_id, ExtendedCost, vendor_entry); return false; } @@ -8536,7 +8251,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max if (player) ChatHandler(player).SendSysMessage(LANG_COMMAND_ADDVENDORITEMITEMS); else - sLog->outErrorDb("Table `npc_vendor` has too many items (%u >= %i) for vendor (Entry: %u), ignore", vItems->GetItemCount(), MAX_VENDOR_ITEMS, vendor_entry); + sLog->outError(LOG_FILTER_SQL, "Table `npc_vendor` has too many items (%u >= %i) for vendor (Entry: %u), ignore", vItems->GetItemCount(), MAX_VENDOR_ITEMS, vendor_entry); return false; } @@ -8575,8 +8290,8 @@ void ObjectMgr::LoadScriptNames() if (!result) { - sLog->outString(); - sLog->outErrorDb(">> Loaded empty set of Script Names!"); + + sLog->outError(LOG_FILTER_SQL, ">> Loaded empty set of Script Names!"); return; } @@ -8590,8 +8305,7 @@ void ObjectMgr::LoadScriptNames() while (result->NextRow()); std::sort(_scriptNamesStore.begin(), _scriptNamesStore.end()); - sLog->outString(">> Loaded %d Script Names in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %d Script Names in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } uint32 ObjectMgr::GetScriptId(const char *name) @@ -8623,7 +8337,7 @@ void ObjectMgr::CheckScripts(ScriptsType type, std::set<int32>& ids) case SCRIPT_COMMAND_TALK: { if (!GetTrinityStringLocale (itrM->second.Talk.TextID)) - sLog->outErrorDb("Table `%s` references invalid text id %u from `db_script_string`, script id: %u.", GetScriptsTableNameByType(type).c_str(), itrM->second.Talk.TextID, itrMM->first); + sLog->outError(LOG_FILTER_SQL, "Table `%s` references invalid text id %u from `db_script_string`, script id: %u.", GetScriptsTableNameByType(type).c_str(), itrM->second.Talk.TextID, itrMM->first); if (ids.find(itrM->second.Talk.TextID) != ids.end()) ids.erase(itrM->second.Talk.TextID); @@ -8649,7 +8363,7 @@ void ObjectMgr::LoadDbScriptStrings() CheckScripts(ScriptsType(type), ids); for (std::set<int32>::const_iterator itr = ids.begin(); itr != ids.end(); ++itr) - sLog->outErrorDb("Table `db_script_string` has unused string id %u", *itr); + sLog->outError(LOG_FILTER_SQL, "Table `db_script_string` has unused string id %u", *itr); } bool LoadTrinityStrings(const char* table, int32 start_value, int32 end_value) @@ -8658,7 +8372,7 @@ bool LoadTrinityStrings(const char* table, int32 start_value, int32 end_value) // start/end reversed for negative values if (start_value > MAX_DB_SCRIPT_STRING_ID || end_value >= start_value) { - sLog->outErrorDb("Table '%s' load attempted with range (%d - %d) reserved by Trinity, strings not loaded.", table, start_value, end_value+1); + sLog->outError(LOG_FILTER_SQL, "Table '%s' load attempted with range (%d - %d) reserved by Trinity, strings not loaded.", table, start_value, end_value+1); return false; } @@ -8694,8 +8408,7 @@ void ObjectMgr::LoadCreatureClassLevelStats() if (!result) { - sLog->outString(">> Loaded 0 creature base stats. DB table `creature_classlevelstats` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creature base stats. DB table `creature_classlevelstats` is empty."); return; } @@ -8716,13 +8429,13 @@ void ObjectMgr::LoadCreatureClassLevelStats() stats.BaseArmor = fields[6].GetInt16(); if (!Class || ((1 << (Class - 1)) & CLASSMASK_ALL_CREATURES) == 0) - sLog->outErrorDb("Creature base stats for level %u has invalid class %u", Level, Class); + sLog->outError(LOG_FILTER_SQL, "Creature base stats for level %u has invalid class %u", Level, Class); for (uint8 i = 0; i < MAX_CREATURE_BASE_HP; ++i) { if (stats.BaseHealth[i] < 1) { - sLog->outErrorDb("Creature base stats for class %u, level %u has invalid zero base HP[%u] - set to 1", Class, Level, i); + sLog->outError(LOG_FILTER_SQL, "Creature base stats for class %u, level %u has invalid zero base HP[%u] - set to 1", Class, Level, i); stats.BaseHealth[i] = 1; } } @@ -8739,12 +8452,11 @@ void ObjectMgr::LoadCreatureClassLevelStats() for (uint16 lvl = itr->second.minlevel; lvl <= itr->second.maxlevel; ++lvl) { if (_creatureBaseStatsStore.find(MAKE_PAIR16(lvl, itr->second.unit_class)) == _creatureBaseStatsStore.end()) - sLog->outErrorDb("Missing base stats for creature class %u level %u", itr->second.unit_class, lvl); + sLog->outError(LOG_FILTER_SQL, "Missing base stats for creature class %u level %u", itr->second.unit_class, lvl); } } - sLog->outString(">> Loaded %u creature base stats in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature base stats in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadFactionChangeAchievements() @@ -8755,8 +8467,8 @@ void ObjectMgr::LoadFactionChangeAchievements() if (!result) { - sLog->outErrorDb(">> Loaded 0 faction change achievement pairs. DB table `player_factionchange_achievement` is empty."); - sLog->outString(); + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 faction change achievement pairs. DB table `player_factionchange_achievement` is empty."); + return; } @@ -8770,9 +8482,9 @@ void ObjectMgr::LoadFactionChangeAchievements() uint32 horde = fields[1].GetUInt32(); if (!sAchievementStore.LookupEntry(alliance)) - sLog->outErrorDb("Achievement %u referenced in `player_factionchange_achievement` does not exist, pair skipped!", alliance); + sLog->outError(LOG_FILTER_SQL, "Achievement %u referenced in `player_factionchange_achievement` does not exist, pair skipped!", alliance); else if (!sAchievementStore.LookupEntry(horde)) - sLog->outErrorDb("Achievement %u referenced in `player_factionchange_achievement` does not exist, pair skipped!", horde); + sLog->outError(LOG_FILTER_SQL, "Achievement %u referenced in `player_factionchange_achievement` does not exist, pair skipped!", horde); else FactionChange_Achievements[alliance] = horde; @@ -8780,8 +8492,7 @@ void ObjectMgr::LoadFactionChangeAchievements() } while (result->NextRow()); - sLog->outString(">> Loaded %u faction change achievement pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u faction change achievement pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadFactionChangeItems() @@ -8792,8 +8503,7 @@ void ObjectMgr::LoadFactionChangeItems() if (!result) { - sLog->outString(">> Loaded 0 faction change item pairs. DB table `player_factionchange_items` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 faction change item pairs. DB table `player_factionchange_items` is empty."); return; } @@ -8807,9 +8517,9 @@ void ObjectMgr::LoadFactionChangeItems() uint32 horde = fields[1].GetUInt32(); if (!GetItemTemplate(alliance)) - sLog->outErrorDb("Item %u referenced in `player_factionchange_items` does not exist, pair skipped!", alliance); + sLog->outError(LOG_FILTER_SQL, "Item %u referenced in `player_factionchange_items` does not exist, pair skipped!", alliance); else if (!GetItemTemplate(horde)) - sLog->outErrorDb("Item %u referenced in `player_factionchange_items` does not exist, pair skipped!", horde); + sLog->outError(LOG_FILTER_SQL, "Item %u referenced in `player_factionchange_items` does not exist, pair skipped!", horde); else FactionChange_Items[alliance] = horde; @@ -8817,8 +8527,7 @@ void ObjectMgr::LoadFactionChangeItems() } while (result->NextRow()); - sLog->outString(">> Loaded %u faction change item pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u faction change item pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadFactionChangeSpells() @@ -8829,8 +8538,8 @@ void ObjectMgr::LoadFactionChangeSpells() if (!result) { - sLog->outErrorDb(">> Loaded 0 faction change spell pairs. DB table `player_factionchange_spells` is empty."); - sLog->outString(); + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 faction change spell pairs. DB table `player_factionchange_spells` is empty."); + return; } @@ -8844,9 +8553,9 @@ void ObjectMgr::LoadFactionChangeSpells() uint32 horde = fields[1].GetUInt32(); if (!sSpellMgr->GetSpellInfo(alliance)) - sLog->outErrorDb("Spell %u referenced in `player_factionchange_spells` does not exist, pair skipped!", alliance); + sLog->outError(LOG_FILTER_SQL, "Spell %u referenced in `player_factionchange_spells` does not exist, pair skipped!", alliance); else if (!sSpellMgr->GetSpellInfo(horde)) - sLog->outErrorDb("Spell %u referenced in `player_factionchange_spells` does not exist, pair skipped!", horde); + sLog->outError(LOG_FILTER_SQL, "Spell %u referenced in `player_factionchange_spells` does not exist, pair skipped!", horde); else FactionChange_Spells[alliance] = horde; @@ -8854,8 +8563,7 @@ void ObjectMgr::LoadFactionChangeSpells() } while (result->NextRow()); - sLog->outString(">> Loaded %u faction change spell pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u faction change spell pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadFactionChangeReputations() @@ -8866,8 +8574,7 @@ void ObjectMgr::LoadFactionChangeReputations() if (!result) { - sLog->outString(">> Loaded 0 faction change reputation pairs. DB table `player_factionchange_reputations` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 faction change reputation pairs. DB table `player_factionchange_reputations` is empty."); return; } @@ -8881,9 +8588,9 @@ void ObjectMgr::LoadFactionChangeReputations() uint32 horde = fields[1].GetUInt32(); if (!sFactionStore.LookupEntry(alliance)) - sLog->outErrorDb("Reputation %u referenced in `player_factionchange_reputations` does not exist, pair skipped!", alliance); + sLog->outError(LOG_FILTER_SQL, "Reputation %u referenced in `player_factionchange_reputations` does not exist, pair skipped!", alliance); else if (!sFactionStore.LookupEntry(horde)) - sLog->outErrorDb("Reputation %u referenced in `player_factionchange_reputations` does not exist, pair skipped!", horde); + sLog->outError(LOG_FILTER_SQL, "Reputation %u referenced in `player_factionchange_reputations` does not exist, pair skipped!", horde); else FactionChange_Reputation[alliance] = horde; @@ -8891,8 +8598,7 @@ void ObjectMgr::LoadFactionChangeReputations() } while (result->NextRow()); - sLog->outString(">> Loaded %u faction change reputation pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u faction change reputation pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } GameObjectTemplate const* ObjectMgr::GetGameObjectTemplate(uint32 entry) |