mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[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:
parent
d8479debbb
commit
54f2f507cf
5 changed files with 36 additions and 8 deletions
|
|
@ -671,7 +671,9 @@ void ObjectMgr::LoadCreatureTemplates()
|
||||||
}
|
}
|
||||||
|
|
||||||
// use below code for 0-checks for unit_class
|
// 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);
|
sLog.outErrorDb("Creature (Entry: %u) has invalid unit_class(%u) for creature_template", cInfo->Entry, cInfo->unit_class);
|
||||||
|
|
||||||
if(cInfo->dmgschool >= MAX_SPELL_SCHOOL)
|
if(cInfo->dmgschool >= MAX_SPELL_SCHOOL)
|
||||||
|
|
@ -2067,12 +2069,13 @@ void ObjectMgr::LoadItemPrototypes()
|
||||||
{
|
{
|
||||||
if (proto->Quality > ITEM_QUALITY_EPIC || proto->Quality < ITEM_QUALITY_UNCOMMON)
|
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;
|
const_cast<ItemPrototype*>(proto)->RequiredDisenchantSkill = -1;
|
||||||
}
|
}
|
||||||
else if (proto->Class != ITEM_CLASS_WEAPON && proto->Class != ITEM_CLASS_ARMOR)
|
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;
|
const_cast<ItemPrototype*>(proto)->RequiredDisenchantSkill = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2095,6 +2098,12 @@ void ObjectMgr::LoadItemPrototypes()
|
||||||
const_cast<ItemPrototype*>(proto)->DisenchantID = 0;
|
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)
|
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.",
|
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);
|
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
|
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);
|
goInfo->id,goInfo->type,N,dataN,dataN);
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void CheckGOSpellId(GameObjectInfo const* goInfo,uint32 dataN,uint32 N)
|
inline void CheckGOSpellId(GameObjectInfo const* goInfo,uint32 dataN,uint32 N)
|
||||||
|
|
|
||||||
|
|
@ -246,6 +246,7 @@ CleanCharacterDB = 1
|
||||||
# LogFilter_TransportMoves
|
# LogFilter_TransportMoves
|
||||||
# LogFilter_VisibilityChanges
|
# LogFilter_VisibilityChanges
|
||||||
# LogFilter_Weather
|
# LogFilter_Weather
|
||||||
|
# LogFilter_DbStrictedCheck
|
||||||
# Log filters (active by default)
|
# Log filters (active by default)
|
||||||
# Default: 1 - not include with any log level
|
# Default: 1 - not include with any log level
|
||||||
# 0 - include in log if log level permit
|
# 0 - include in log if log level permit
|
||||||
|
|
@ -333,6 +334,16 @@ LogFilter_AchievementUpdates = 1
|
||||||
LogFilter_CreatureMoves = 1
|
LogFilter_CreatureMoves = 1
|
||||||
LogFilter_TransportMoves = 1
|
LogFilter_TransportMoves = 1
|
||||||
LogFilter_VisibilityChanges = 1
|
LogFilter_VisibilityChanges = 1
|
||||||
|
LogFilter_Weather = 1
|
||||||
|
LogFilter_DbStrictedCheck = 1
|
||||||
|
LogFilter_PeriodicAffects = 0
|
||||||
|
LogFilter_PlayerMoves = 0
|
||||||
|
LogFilter_SQLText = 0
|
||||||
|
LogFilter_AIAndMovegens = 0
|
||||||
|
LogFilter_PlayerStats = 0
|
||||||
|
LogFilter_Damage = 0
|
||||||
|
LogFilter_Combat = 0
|
||||||
|
LogFilter_SpellCast = 0
|
||||||
WorldLogFile = ""
|
WorldLogFile = ""
|
||||||
WorldLogTimestamp = 0
|
WorldLogTimestamp = 0
|
||||||
DBErrorLogFile = "DBErrors.log"
|
DBErrorLogFile = "DBErrors.log"
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ LogFilterData logFilterData[LOG_FILTER_COUNT] =
|
||||||
{ "damage", "LogFilter_Damage", false },
|
{ "damage", "LogFilter_Damage", false },
|
||||||
{ "combat", "LogFilter_Combat", false },
|
{ "combat", "LogFilter_Combat", false },
|
||||||
{ "spell_cast", "LogFilter_SpellCast", false },
|
{ "spell_cast", "LogFilter_SpellCast", false },
|
||||||
|
{ "db_stricted_check", "LogFilter_DbStrictedCheck", true },
|
||||||
};
|
};
|
||||||
|
|
||||||
enum LogType
|
enum LogType
|
||||||
|
|
|
||||||
|
|
@ -49,9 +49,10 @@ enum LogFilters
|
||||||
LOG_FILTER_DAMAGE = 0x0400, // Direct/Area damage trace
|
LOG_FILTER_DAMAGE = 0x0400, // Direct/Area damage trace
|
||||||
LOG_FILTER_COMBAT = 0x0800, // attack states/roll attack results/etc
|
LOG_FILTER_COMBAT = 0x0800, // attack states/roll attack results/etc
|
||||||
LOG_FILTER_SPELL_CAST = 0x1000, // spell cast/aura apply/spell proc events
|
LOG_FILTER_SPELL_CAST = 0x1000, // spell cast/aura apply/spell proc events
|
||||||
|
LOG_FILTER_DB_STRICTED_CHECK = 0x2000, // stricted DB data checks output (with possible false reports) for DB devs
|
||||||
};
|
};
|
||||||
|
|
||||||
#define LOG_FILTER_COUNT 13
|
#define LOG_FILTER_COUNT 14
|
||||||
|
|
||||||
struct LogFilterData
|
struct LogFilterData
|
||||||
{
|
{
|
||||||
|
|
@ -212,6 +213,13 @@ class Log : public MaNGOS::Singleton<Log, MaNGOS::ClassLevelLockable<Log, ACE_Th
|
||||||
if (sLog.HasLogLevelOrHigher(LOG_LVL_DEBUG) && (sLog.getLogFilter() & (F))==0) \
|
if (sLog.HasLogLevelOrHigher(LOG_LVL_DEBUG) && (sLog.getLogFilter() & (F))==0) \
|
||||||
sLog.outDebug(__VA_ARGS__)
|
sLog.outDebug(__VA_ARGS__)
|
||||||
|
|
||||||
|
#define ERROR_DB_FILTER_LOG(F,...) \
|
||||||
|
if ((sLog.getLogFilter() & (F))==0) \
|
||||||
|
sLog.outErrorDb(__VA_ARGS__)
|
||||||
|
|
||||||
|
#define ERROR_DB_STRICT_LOG(...) \
|
||||||
|
ERROR_DB_FILTER_LOG(LOG_FILTER_DB_STRICTED_CHECK, __VA_ARGS__)
|
||||||
|
|
||||||
// primary for script library
|
// primary for script library
|
||||||
void MANGOS_DLL_SPEC outstring_log(const char * str, ...) ATTR_PRINTF(1,2);
|
void MANGOS_DLL_SPEC outstring_log(const char * str, ...) ATTR_PRINTF(1,2);
|
||||||
void MANGOS_DLL_SPEC detail_log(const char * str, ...) ATTR_PRINTF(1,2);
|
void MANGOS_DLL_SPEC detail_log(const char * str, ...) ATTR_PRINTF(1,2);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10023"
|
#define REVISION_NR "10024"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue