diff options
| author | leak <none@none> | 2010-12-19 17:06:33 +0100 |
|---|---|---|
| committer | leak <none@none> | 2010-12-19 17:06:33 +0100 |
| commit | fd694cd2324a7e2d61d833a78024b68fd3605053 (patch) | |
| tree | 2fb48411eb25ff627b56786b66c96dd646a30651 /src/server/game/Conditions | |
| parent | 9c35e10444b24848e0a909c46727ac2a312ab5de (diff) | |
Streamlining loading functions for server startup
- Added a couple of timer outputs
- Improved code consistency between loading functions
- Progess bars should look and behave similar on all OS now (sLog.outString() is not needed anymore to replace the progress bar in log files)
--HG--
branch : trunk
Diffstat (limited to 'src/server/game/Conditions')
| -rwxr-xr-x | src/server/game/Conditions/ConditionMgr.cpp | 14 | ||||
| -rwxr-xr-x | src/server/game/Conditions/DisableMgr.cpp | 13 |
2 files changed, 16 insertions, 11 deletions
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 17fa9a6caa9..99e77e65408 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -348,6 +348,8 @@ ConditionList ConditionMgr::GetConditionsForVehicleSpell(uint32 creatureID, uint void ConditionMgr::LoadConditions(bool isReload) { + uint32 oldMSTime = getMSTime(); + Clean(); //must clear all custom handled cases (groupped types) before reload @@ -374,21 +376,21 @@ void ConditionMgr::LoadConditions(bool isReload) sObjectMgr.LoadGossipMenuItems(); } - uint32 count = 0; - QueryResult result = WorldDatabase.Query("SELECT SourceTypeOrReferenceId, SourceGroup, SourceEntry, ElseGroup, ConditionTypeOrReference, ConditionValue1, ConditionValue2, ConditionValue3, ErrorTextId, ScriptName FROM conditions"); + + QueryResult result = WorldDatabase.Query("SELECT SourceTypeOrReferenceId, SourceGroup, SourceEntry, ElseGroup, ConditionTypeOrReference," + " ConditionValue1, ConditionValue2, ConditionValue3, ErrorTextId, ScriptName FROM conditions"); if (!result) { barGoLink bar(1); - bar.step(); - + sLog.outErrorDb(">> Loaded 0 conditions. DB table `groups` is empty!"); sLog.outString(); - sLog.outErrorDb(">> Loaded `conditions`, table is empty!"); return; } barGoLink bar(result->GetRowCount()); + uint32 count = 0; do { @@ -576,8 +578,8 @@ void ConditionMgr::LoadConditions(bool isReload) } while (result->NextRow()); + sLog.outString(">> Loaded %u conditions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); sLog.outString(); - sLog.outString(">> Loaded %u conditions", count); } bool ConditionMgr::addToLootTemplate(Condition* cond, LootTemplate* loot) diff --git a/src/server/game/Conditions/DisableMgr.cpp b/src/server/game/Conditions/DisableMgr.cpp index 51e7df69552..17004b3f6a3 100755 --- a/src/server/game/Conditions/DisableMgr.cpp +++ b/src/server/game/Conditions/DisableMgr.cpp @@ -36,6 +36,8 @@ DisableMgr::~DisableMgr() void DisableMgr::LoadDisables() { + uint32 oldMSTime = getMSTime(); + // reload case for (DisableMap::iterator itr = m_DisableMap.begin(); itr != m_DisableMap.end(); ++itr) itr->second.clear(); @@ -50,9 +52,8 @@ void DisableMgr::LoadDisables() { barGoLink bar(1); bar.step(); - + sLog.outString(">> Loaded 0 disables. DB table `disables` is empty!"); sLog.outString(); - sLog.outString(">> Loaded %u disables", total_count); return; } @@ -182,19 +183,21 @@ void DisableMgr::LoadDisables() } while (result->NextRow()); + sLog.outString(">> Loaded %u disables in %u ms", total_count, GetMSTimeDiffToNow(oldMSTime)); sLog.outString(); - sLog.outString(">> Loaded %u disables.", total_count); } void DisableMgr::CheckQuestDisables() { + uint32 oldMSTime = getMSTime(); + uint32 count = m_DisableMap[DISABLE_TYPE_QUEST].size(); if (!count) { barGoLink bar(1); bar.step(); + sLog.outString(">> Checked 0 quest disables."); sLog.outString(); - sLog.outString(">> Done."); return; } @@ -215,8 +218,8 @@ void DisableMgr::CheckQuestDisables() ++itr; } + sLog.outString(">> Checked %u quest disables in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); sLog.outString(); - sLog.outString(">> Done."); } bool DisableMgr::IsDisabledFor(DisableType type, uint32 entry, Unit const* pUnit) |
