aboutsummaryrefslogtreecommitdiff
path: root/src/game/World.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-01-06 15:48:42 -0600
committermegamage <none@none>2009-01-06 15:48:42 -0600
commitbacbd4a782ca3681a587d8529a57ba3523bf65df (patch)
tree05bf8d6c56686c80c2afffcb60eefc4aaab63699 /src/game/World.cpp
parent290a187592d28cbfd9639ded43663077711f3379 (diff)
*Update difftime record.
--HG-- branch : trunk
Diffstat (limited to 'src/game/World.cpp')
-rw-r--r--src/game/World.cpp16
1 files changed, 11 insertions, 5 deletions
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()