diff options
-rw-r--r-- | src/game/ChatHandler.cpp | 2 | ||||
-rw-r--r-- | src/game/CreatureGroups.h | 2 | ||||
-rw-r--r-- | src/game/MapManager.cpp | 6 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 2 | ||||
-rw-r--r-- | src/game/World.cpp | 16 | ||||
-rw-r--r-- | src/game/World.h | 2 | ||||
-rw-r--r-- | src/game/debugcmds.cpp | 2 |
7 files changed, 22 insertions, 10 deletions
diff --git a/src/game/ChatHandler.cpp b/src/game/ChatHandler.cpp index 3752d7db6cc..4f399c5bbf8 100644 --- a/src/game/ChatHandler.cpp +++ b/src/game/ChatHandler.cpp @@ -587,4 +587,4 @@ void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recv_data ) void WorldSession::HandleChannelDeclineInvite(WorldPacket &recvPacket) { sLog.outDebug("Opcode %u", recvPacket.GetOpcode()); -}
\ No newline at end of file +} diff --git a/src/game/CreatureGroups.h b/src/game/CreatureGroups.h index 3b864ef1073..0f4474106de 100644 --- a/src/game/CreatureGroups.h +++ b/src/game/CreatureGroups.h @@ -63,4 +63,4 @@ extern UNORDERED_MAP<uint32, FormationMember*> CreatureGroupMap; #define formation_mgr Trinity::Singleton<CreatureGroupManager>::Instance() -#endif
\ No newline at end of file +#endif diff --git a/src/game/MapManager.cpp b/src/game/MapManager.cpp index 26279cb76ec..933dbf9a9b5 100644 --- a/src/game/MapManager.cpp +++ b/src/game/MapManager.cpp @@ -246,17 +246,23 @@ MapManager::Update(time_t diff) if( !i_timer.Passed() ) return; + sWorld.RecordTimeDiff(NULL); ObjectAccessor::Instance().UpdatePlayers(i_timer.GetCurrent()); + sWorld.RecordTimeDiff("UpdatePlayers"); + for(MapMapType::iterator iter=i_maps.begin(); iter != i_maps.end(); ++iter) { checkAndCorrectGridStatesArray(); // debugging code, should be deleted some day iter->second->Update(i_timer.GetCurrent()); + sLog.outDebugInLine("Difftime Map %u ", iter->second->GetId()); + sWorld.RecordTimeDiff("UpdateMap"); } ObjectAccessor::Instance().Update(i_timer.GetCurrent()); for (TransportSet::iterator iter = m_Transports.begin(); iter != m_Transports.end(); ++iter) (*iter)->Update(i_timer.GetCurrent()); + sWorld.RecordTimeDiff("UpdateTransports"); i_timer.SetCurrent(0); } diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 845914a3e4d..1198b807e8b 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -6363,4 +6363,4 @@ void Spell::EffectRedirectThreat(uint32 /*i*/) { if(unitTarget) m_caster->SetReducedThreatPercent((uint32)damage, unitTarget->GetGUID()); -}
\ No newline at end of file +} diff --git a/src/game/World.cpp b/src/game/World.cpp index ee40587e1bf..90bee222176 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -1422,6 +1422,11 @@ void World::RecordTimeDiff(const char *text) { if(m_updateTimeCount != 1) return; + if(!text) + { + m_currentTime = getMSTime(); + return; + } sLog.outDebugInLine("Difftime "); sLog.outDebugInLine(text); uint32 thisTime = getMSTime(); @@ -1440,7 +1445,6 @@ void World::Update(time_t diff) sLog.outString("Update time diff: %u. Players online: %u.", m_updateTimeSum / m_updateTimeCount, GetActiveSessionCount()); m_updateTimeSum = m_updateTime; m_updateTimeCount = 1; - m_currentTime = getMSTime(); } else { @@ -1527,8 +1531,8 @@ void World::Update(time_t diff) } } } - RecordTimeDiff("UpdateAuction"); + RecordTimeDiff(NULL); /// <li> Handle session updates when the timer has passed if (m_timers[WUPDATE_SESSIONS].Passed()) { @@ -1568,7 +1572,6 @@ void World::Update(time_t diff) m_timers[WUPDATE_UPTIME].Reset(); WorldDatabase.PExecute("UPDATE uptime SET uptime = %d, maxplayers = %d WHERE starttime = " I64FMTD, tmpDiff, maxClientsNum, uint64(m_startTime)); } - RecordTimeDiff("UpdateWeatherAndUptime"); /// <li> Handle all other objects if (m_timers[WUPDATE_OBJECTS].Passed()) @@ -1577,16 +1580,20 @@ void World::Update(time_t diff) ///- Update objects when the timer has passed (maps, transport, creatures,...) MapManager::Instance().Update(diff); // As interval = 0 + RecordTimeDiff(NULL); ///- Process necessary scripts if (!m_scriptSchedule.empty()) ScriptsProcess(); + RecordTimeDiff("UpdateScriptsProcess"); sBattleGroundMgr.Update(diff); + RecordTimeDiff("UpdateBattleGroundMgr"); sOutdoorPvPMgr.Update(diff); + RecordTimeDiff("UpdateOutdoorPvPMgr"); } - RecordTimeDiff("UpdateMaps"); + RecordTimeDiff(NULL); // execute callbacks from sql queries that were queued recently UpdateResultQueue(); RecordTimeDiff("UpdateResultQueue"); @@ -1617,7 +1624,6 @@ void World::Update(time_t diff) // And last, but not least handle the issued cli commands ProcessCliCommands(); - RecordTimeDiff("UpdateRemainingThings"); } void World::ForceGameEventUpdate() diff --git a/src/game/World.h b/src/game/World.h index 3bf979b7cac..732b6d05812 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -517,6 +517,7 @@ class World void SetScriptsVersion(char const* version) { m_ScriptsVersion = version ? version : "unknown scripting library"; } char const* GetScriptsVersion() { return m_ScriptsVersion.c_str(); } + void RecordTimeDiff(const char * text); protected: void _UpdateGameTime(); void ScriptsProcess(); @@ -539,7 +540,6 @@ class World uint32 m_updateTime, m_updateTimeSum; uint32 m_updateTimeCount; uint32 m_currentTime; - void RecordTimeDiff(const char * text); typedef UNORDERED_MAP<uint32, Weather*> WeatherMap; WeatherMap m_weathers; diff --git a/src/game/debugcmds.cpp b/src/game/debugcmds.cpp index 878c4f5a711..daa8a2f8fa3 100644 --- a/src/game/debugcmds.cpp +++ b/src/game/debugcmds.cpp @@ -569,4 +569,4 @@ bool ChatHandler::HandleDebugHostilRefList(const char * /*args*/) } SendSysMessage("End of hostil reference list."); return true; -}
\ No newline at end of file +} |