From 4167ca4f840941b949fd318e4158ecf3cc268647 Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 9 Jun 2009 19:54:46 -0500 Subject: *Do relocation notify in world class and only not do it every update. --HG-- branch : trunk --- src/game/World.cpp | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/game/World.cpp b/src/game/World.cpp index 5ab3c46a036..92453ce1f52 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -1500,7 +1500,7 @@ void World::SetInitialWorldSettings() LoginDatabase.PExecute("INSERT INTO uptime (realmid, starttime, startstring, uptime) VALUES('%u', " UI64FMTD ", '%s', 0)", realmID, uint64(m_startTime), isoDate); - m_timers[WUPDATE_OBJECTS].SetInterval(0); + m_timers[WUPDATE_OBJECTS].SetInterval(IN_MILISECONDS/2); m_timers[WUPDATE_SESSIONS].SetInterval(0); m_timers[WUPDATE_WEATHERS].SetInterval(1*IN_MILISECONDS); m_timers[WUPDATE_AUCTIONS].SetInterval(MINUTE*IN_MILISECONDS); @@ -1698,14 +1698,9 @@ void World::Update(uint32 diff) auctionmgr.Update(); } - RecordTimeDiff(NULL); ///
  • Handle session updates when the timer has passed - if (m_timers[WUPDATE_SESSIONS].Passed()) - { - m_timers[WUPDATE_SESSIONS].Reset(); - - UpdateSessions(diff); - } + RecordTimeDiff(NULL); + UpdateSessions(diff); RecordTimeDiff("UpdateSessions"); ///
  • Handle weather updates when the timer has passed @@ -1754,26 +1749,29 @@ void World::Update(uint32 diff) } ///
  • Handle all other objects - if (m_timers[WUPDATE_OBJECTS].Passed()) + ///- Update objects when the timer has passed (maps, transport, creatures,...) + MapManager::Instance().Update(diff); // As interval = 0 + + if(m_timers[WUPDATE_OBJECTS].Passed()) { m_timers[WUPDATE_OBJECTS].Reset(); - ///- Update objects when the timer has passed (maps, transport, creatures,...) - MapManager::Instance().Update(diff); // As interval = 0 + MapManager::Instance().DoDelayedMovesAndRemoves(); + } + ///- Process necessary scripts + if (!m_scriptSchedule.empty()) + { RecordTimeDiff(NULL); - ///- Process necessary scripts - if (!m_scriptSchedule.empty()) - ScriptsProcess(); + ScriptsProcess(); RecordTimeDiff("UpdateScriptsProcess"); + } - sBattleGroundMgr.Update(diff); - RecordTimeDiff("UpdateBattleGroundMgr"); + sBattleGroundMgr.Update(diff); + RecordTimeDiff("UpdateBattleGroundMgr"); - sOutdoorPvPMgr.Update(diff); - RecordTimeDiff("UpdateOutdoorPvPMgr"); - } + sOutdoorPvPMgr.Update(diff); + RecordTimeDiff("UpdateOutdoorPvPMgr"); - RecordTimeDiff(NULL); // execute callbacks from sql queries that were queued recently UpdateResultQueue(); RecordTimeDiff("UpdateResultQueue"); @@ -1795,10 +1793,6 @@ void World::Update(uint32 diff) m_timers[WUPDATE_EVENTS].Reset(); } - /// - ///- Move all creatures with "delayed move" and remove and delete all objects with "delayed remove" - //MapManager::Instance().DoDelayedMovesAndRemoves(); - // update the instance reset times sInstanceSaveManager.Update(); -- cgit v1.2.3