aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/World
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/World')
-rw-r--r--src/server/game/World/World.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index 7182d976c09..a60cd591993 100644
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -152,7 +152,7 @@ World::World()
_guidWarn = false;
_guidAlert = false;
_warnDiff = 0;
- _warnShutdownTime = time(nullptr);
+ _warnShutdownTime = GameTime::GetGameTime();
}
/// World destructor
@@ -419,7 +419,7 @@ bool World::HasRecentlyDisconnected(WorldSession* session)
{
for (DisconnectMap::iterator i = m_disconnects.begin(); i != m_disconnects.end();)
{
- if (difftime(i->second, time(nullptr)) < tolerance)
+ if (difftime(i->second, GameTime::GetGameTime()) < tolerance)
{
if (i->first == session->GetAccountId())
return true;
@@ -1641,7 +1641,7 @@ void World::SetInitialWorldSettings()
uint32 startupBegin = getMSTime();
///- Initialize the random number generator
- srand((unsigned int)time(nullptr));
+ srand((unsigned int)GameTime::GetGameTime());
///- Initialize detour memory management
dtAllocSetCustom(dtCustomAlloc, dtCustomFree);
@@ -2581,7 +2581,7 @@ void World::Update(uint32 diff)
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_OLD_LOGS);
stmt->setUInt32(0, sWorld->getIntConfig(CONFIG_LOGDB_CLEARTIME));
- stmt->setUInt32(1, uint32(time(nullptr)));
+ stmt->setUInt32(1, uint32(GameTime::GetGameTime()));
stmt->setUInt32(2, realm.Id.Realm);
LoginDatabase.Execute(stmt);
@@ -3220,7 +3220,7 @@ void World::UpdateSessions(uint32 diff)
if (!pSession->Update(diff, updater)) // As interval = 0
{
if (!RemoveQueuedPlayer(itr->second) && itr->second && getIntConfig(CONFIG_INTERVAL_DISCONNECT_TOLERANCE))
- m_disconnects[itr->second->GetAccountId()] = time(nullptr);
+ m_disconnects[itr->second->GetAccountId()] = GameTime::GetGameTime();
RemoveQueuedPlayer(pSession);
m_sessions.erase(itr);
delete pSession;
@@ -3308,7 +3308,7 @@ void World::_UpdateRealmCharCount(PreparedQueryResult resultCharCount)
void World::InitWeeklyQuestResetTime()
{
time_t wstime = uint64(sWorld->getWorldState(WS_WEEKLY_QUEST_RESET_TIME));
- time_t curtime = time(nullptr);
+ time_t curtime = GameTime::GetGameTime();
m_NextWeeklyQuestReset = wstime < curtime ? curtime : time_t(wstime);
}
@@ -3327,7 +3327,7 @@ void World::InitDailyQuestResetTime(bool loading)
}
// FIX ME: client not show day start time
- time_t curTime = time(nullptr);
+ time_t curTime = GameTime::GetGameTime();
tm localTm;
localtime_r(&curTime, &localTm);
localTm.tm_hour = getIntConfig(CONFIG_DAILY_QUEST_RESET_TIME_HOUR);
@@ -3350,7 +3350,7 @@ void World::InitDailyQuestResetTime(bool loading)
void World::InitMonthlyQuestResetTime()
{
time_t wstime = uint64(sWorld->getWorldState(WS_MONTHLY_QUEST_RESET_TIME));
- time_t curtime = time(nullptr);
+ time_t curtime = GameTime::GetGameTime();
m_NextMonthlyQuestReset = wstime < curtime ? curtime : time_t(wstime);
}
@@ -3358,10 +3358,10 @@ void World::InitRandomBGResetTime()
{
time_t bgtime = sWorld->getWorldState(WS_BG_DAILY_RESET_TIME);
if (!bgtime)
- m_NextRandomBGReset = time(nullptr); // game time not yet init
+ m_NextRandomBGReset = GameTime::GetGameTime(); // game time not yet init
// generate time by config
- time_t curTime = time(nullptr);
+ time_t curTime = GameTime::GetGameTime();
tm localTm;
localtime_r(&curTime, &localTm);
localTm.tm_hour = getIntConfig(CONFIG_RANDOM_BG_RESET_HOUR);
@@ -3386,10 +3386,10 @@ void World::InitGuildResetTime()
{
time_t gtime = getWorldState(WS_GUILD_DAILY_RESET_TIME);
if (!gtime)
- m_NextGuildReset = time(nullptr); // game time not yet init
+ m_NextGuildReset = GameTime::GetGameTime(); // game time not yet init
// generate time by config
- time_t curTime = time(nullptr);
+ time_t curTime = GameTime::GetGameTime();
tm localTm;
localtime_r(&curTime, &localTm);
localTm.tm_hour = getIntConfig(CONFIG_GUILD_RESET_HOUR);
@@ -3414,10 +3414,10 @@ void World::InitCurrencyResetTime()
{
time_t currencytime = sWorld->getWorldState(WS_CURRENCY_RESET_TIME);
if (!currencytime)
- m_NextCurrencyReset = time(nullptr); // game time not yet init
+ m_NextCurrencyReset = GameTime::GetGameTime(); // game time not yet init
// generate time by config
- time_t curTime = time(nullptr);
+ time_t curTime = GameTime::GetGameTime();
tm localTm;
localtime_r(&curTime, &localTm);
@@ -3520,7 +3520,7 @@ void World::ResetMonthlyQuests()
itr->second->GetPlayer()->ResetMonthlyQuestStatus();
// generate time
- time_t curTime = time(nullptr);
+ time_t curTime = GameTime::GetGameTime();
tm localTm;
localtime_r(&curTime, &localTm);