From fd694cd2324a7e2d61d833a78024b68fd3605053 Mon Sep 17 00:00:00 2001 From: leak Date: Sun, 19 Dec 2010 17:06:33 +0100 Subject: 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 --- src/server/game/Texts/CreatureTextMgr.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/server/game/Texts') diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp index 1445e5bed32..17bf02939b4 100755 --- a/src/server/game/Texts/CreatureTextMgr.cpp +++ b/src/server/game/Texts/CreatureTextMgr.cpp @@ -24,6 +24,8 @@ void CreatureTextMgr::LoadCreatureTexts() { + uint32 oldMSTime = getMSTime(); + mTextMap.clear(); // for reload case mTextRepeatMap.clear(); //reset all currently used temp texts @@ -34,14 +36,14 @@ void CreatureTextMgr::LoadCreatureTexts() { barGoLink bar(1); bar.step(); + sLog.outString(">> Loaded 0 ceature texts. DB table `creature_texts` is empty."); sLog.outString(); - sLog.outString(">> Loaded 0 Creature Texts. DB table `creature_texts` is empty."); return; } barGoLink bar(result->GetRowCount()); - uint32 TextCount = 0; - uint32 CreatureCount = 0; + uint32 textCount = 0; + uint32 creatureCount = 0; do { @@ -88,7 +90,7 @@ void CreatureTextMgr::LoadCreatureTexts() //entry not yet added, add empty TextHolder (list of groups) if (mTextMap.find(temp.entry) == mTextMap.end()) { - ++CreatureCount; + ++creatureCount; CreatureTextHolder TextHolder; mTextMap[temp.entry] = TextHolder; } @@ -101,11 +103,11 @@ void CreatureTextMgr::LoadCreatureTexts() //add the text into our entry's group mTextMap[temp.entry][temp.group].push_back(temp); - ++TextCount; + ++textCount; } while (result->NextRow()); + sLog.outString(">> Loaded %u creature texts for %u creatures in %u ms", textCount, creatureCount, GetMSTimeDiffToNow(oldMSTime)); sLog.outString(); - sLog.outString(">> Loaded %u Creature Texts for %u Creatures.", TextCount, CreatureCount); } uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, uint64 whisperGuid, ChatType msgtype, Language language, TextRange range, uint32 sound, Team team, bool gmOnly, Player* srcPlr) -- cgit v1.2.3