[10024] New LogFilter_DbStrictedCheck filter for DB devs

It's enable by default (prevent show related output) but
in disbled case allow show useful for DB developers different
more stricted DB check output at server loading, including

* Absent GO trap template referecned in some another GO template
* Not set (0) unit class in creature_template
* Absent disenchanting loot for items marked as disanchantble

This all cases can or hard fixed in one step or show false cases y different reasons.
That why filter active by default.
This commit is contained in:
VladimirMangos 2010-06-03 14:28:13 +04:00
parent d8479debbb
commit 54f2f507cf
5 changed files with 36 additions and 8 deletions

View file

@ -671,7 +671,9 @@ void ObjectMgr::LoadCreatureTemplates()
}
// use below code for 0-checks for unit_class
if (/*!cInfo->unit_class ||*/cInfo->unit_class && ((1 << (cInfo->unit_class-1)) & CLASSMASK_ALL_CREATURES) == 0)
if (!cInfo->unit_class)
ERROR_DB_STRICT_LOG("Creature (Entry: %u) not has proper unit_class(%u) for creature_template", cInfo->Entry, cInfo->unit_class);
else if (((1 << (cInfo->unit_class-1)) & CLASSMASK_ALL_CREATURES) == 0)
sLog.outErrorDb("Creature (Entry: %u) has invalid unit_class(%u) for creature_template", cInfo->Entry, cInfo->unit_class);
if(cInfo->dmgschool >= MAX_SPELL_SCHOOL)
@ -2067,12 +2069,13 @@ void ObjectMgr::LoadItemPrototypes()
{
if (proto->Quality > ITEM_QUALITY_EPIC || proto->Quality < ITEM_QUALITY_UNCOMMON)
{
sLog.outErrorDb("Item (Entry: %u) has unexpected RequiredDisenchantSkill (%u) for non-disenchantable quality (%u), reset it.",i,proto->RequiredDisenchantSkill,proto->Quality);
ERROR_DB_STRICT_LOG("Item (Entry: %u) has unexpected RequiredDisenchantSkill (%u) for non-disenchantable quality (%u), reset it.",i,proto->RequiredDisenchantSkill,proto->Quality);
const_cast<ItemPrototype*>(proto)->RequiredDisenchantSkill = -1;
}
else if (proto->Class != ITEM_CLASS_WEAPON && proto->Class != ITEM_CLASS_ARMOR)
{
sLog.outErrorDb("Item (Entry: %u) has unexpected RequiredDisenchantSkill (%u) for non-disenchantable item class (%u), reset it.",i,proto->RequiredDisenchantSkill,proto->Class);
// some wrong data in wdb for unused items
ERROR_DB_STRICT_LOG("Item (Entry: %u) has unexpected RequiredDisenchantSkill (%u) for non-disenchantable item class (%u), reset it.",i,proto->RequiredDisenchantSkill,proto->Class);
const_cast<ItemPrototype*>(proto)->RequiredDisenchantSkill = -1;
}
}
@ -2095,6 +2098,12 @@ void ObjectMgr::LoadItemPrototypes()
const_cast<ItemPrototype*>(proto)->DisenchantID = 0;
}
}
else
{
// lot DB cases
if (proto->RequiredDisenchantSkill >= 0)
ERROR_DB_STRICT_LOG("Item (Entry: %u) marked as disenchantable by RequiredDisenchantSkill, but not have disenchanting loot id.",i);
}
if(proto->FoodType >= MAX_PET_DIET)
{
@ -5930,11 +5939,10 @@ inline void CheckGOLinkedTrapId(GameObjectInfo const* goInfo,uint32 dataN,uint32
sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but GO (Entry %u) have not GAMEOBJECT_TYPE_TRAP (%u) type.",
goInfo->id,goInfo->type,N,dataN,dataN,GAMEOBJECT_TYPE_TRAP);
}
/* disable check for while (too many error reports baout not existed in trap templates
else
sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but trap GO (Entry %u) not exist in `gameobject_template`.",
// too many error reports about not existed trap templates
ERROR_DB_STRICT_LOG("Gameobject (Entry: %u GoType: %u) have data%d=%u but trap GO (Entry %u) not exist in `gameobject_template`.",
goInfo->id,goInfo->type,N,dataN,dataN);
*/
}
inline void CheckGOSpellId(GameObjectInfo const* goInfo,uint32 dataN,uint32 N)