aboutsummaryrefslogtreecommitdiff
path: root/src/game/InstanceSaveMgr.cpp
diff options
context:
space:
mode:
authorn0n4m3 <none@none>2009-12-23 08:04:10 +0100
committern0n4m3 <none@none>2009-12-23 08:04:10 +0100
commit3fe0bc52541d8cdf4fa992d9b8b3101cde5848f0 (patch)
treebe5871dc19f69f4555d9ffa7c57e5d964b8e60e0 /src/game/InstanceSaveMgr.cpp
parent7ea2510980d4b1c96f0341e9c8b9d5784862dc72 (diff)
Replaced time(NULL) on sGameTime.GetGameTime() this is used for better performance.
Original Timer.h divided into 2 parts. Shared project has no need to know about GameTime Singleton. 2 Identical structures with different types are now replaced with one generic templated structure and 2 typedefs. --HG-- branch : trunk
Diffstat (limited to 'src/game/InstanceSaveMgr.cpp')
-rw-r--r--src/game/InstanceSaveMgr.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/game/InstanceSaveMgr.cpp b/src/game/InstanceSaveMgr.cpp
index a60df7c4f91..3c432d6cba6 100644
--- a/src/game/InstanceSaveMgr.cpp
+++ b/src/game/InstanceSaveMgr.cpp
@@ -31,7 +31,6 @@
#include "MapManager.h"
#include "MapInstanced.h"
#include "InstanceSaveMgr.h"
-#include "Timer.h"
#include "GridNotifiersImpl.h"
#include "Config/ConfigEnv.h"
#include "Transports.h"
@@ -39,6 +38,7 @@
#include "World.h"
#include "Group.h"
#include "InstanceData.h"
+#include "TimeMgr.h"
#include "ProgressBar.h"
#include "Policies/Singleton.h"
#include "Policies/SingletonImp.h"
@@ -109,7 +109,7 @@ InstanceSave* InstanceSaveManager::AddInstanceSave(uint32 mapId, uint32 instance
resetTime = GetResetTimeFor(mapId,difficulty);
else
{
- resetTime = time(NULL) + 2 * HOUR;
+ resetTime = sGameTime.GetGameTime() + 2 * HOUR;
// normally this will be removed soon after in InstanceMap::Add, prevent error
ScheduleReset(true, resetTime, InstResetEvent(0, mapId, difficulty, instanceId));
}
@@ -259,7 +259,7 @@ void InstanceSaveManager::_DelHelper(DatabaseType &db, const char *fields, const
void InstanceSaveManager::CleanupInstances()
{
- uint64 now = (uint64)time(NULL);
+ uint64 now = (uint64)sGameTime.GetGameTime();
barGoLink bar(2);
bar.step();
@@ -406,7 +406,7 @@ void InstanceSaveManager::PackInstances()
void InstanceSaveManager::LoadResetTimes()
{
- time_t now = time(NULL);
+ time_t now = sGameTime.GetGameTime();
time_t today = (now / DAY) * DAY;
// NOTE: Use DirectPExecute for tables that will be queried later
@@ -571,7 +571,7 @@ void InstanceSaveManager::ScheduleReset(bool add, time_t time, InstResetEvent ev
void InstanceSaveManager::Update()
{
- time_t now = time(NULL), t;
+ time_t now = sGameTime.GetGameTime(), t;
while(!m_resetTimeQueue.empty() && (t = m_resetTimeQueue.begin()->first) < now)
{
InstResetEvent &event = m_resetTimeQueue.begin()->second;
@@ -643,7 +643,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b
if (!mapEntry->Instanceable())
return;
- uint64 now = (uint64)time(NULL);
+ uint64 now = (uint64)sGameTime.GetGameTime();
if(!warn)
{