Core/Misc: Replace time(NULL) with GameTime::GetGameTime()
(ported commit: 12701cb0c6c45eb105ad449eb9a56e76d84d691e)
This commit is contained in:
1 parent
ba38f74816
commit
5fe3a1f7f9
68 files changed
+335
-259
No files matched your search
@@ -28,6 +28,7 @@
|
||||
#include "Common.h"
|
||||
#include "Config.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "GameTime.h"
|
||||
#include "Group.h"
|
||||
#include "Guild.h"
|
||||
#include "GuildMgr.h"
|
||||
@@ -242,13 +243,13 @@ void WorldSession::SendPacket(WorldPacket const* packet, bool forced /*= false*/
|
||||
static uint64 sendPacketCount = 0;
|
||||
static uint64 sendPacketBytes = 0;
|
||||
|
||||
static time_t firstTime = time(nullptr);
|
||||
static time_t firstTime = GameTime::GetGameTime();
|
||||
static time_t lastTime = firstTime; // next 60 secs start time
|
||||
|
||||
static uint64 sendLastPacketCount = 0;
|
||||
static uint64 sendLastPacketBytes = 0;
|
||||
|
||||
time_t cur_time = time(nullptr);
|
||||
time_t cur_time = GameTime::GetGameTime();
|
||||
|
||||
if ((cur_time - lastTime) < 60)
|
||||
{
|
||||
@@ -319,7 +320,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
|
||||
bool deletePacket = true;
|
||||
std::vector<WorldPacket*> requeuePackets;
|
||||
uint32 processedPackets = 0;
|
||||
time_t currentTime = time(nullptr);
|
||||
time_t currentTime = GameTime::GetGameTime();
|
||||
|
||||
while (m_Socket && _recvQueue.next(packet, updater))
|
||||
{
|
||||
@@ -455,9 +456,8 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
|
||||
//logout procedure should happen only in World::UpdateSessions() method!!!
|
||||
if (updater.ProcessUnsafe())
|
||||
{
|
||||
time_t currTime = time(nullptr);
|
||||
///- If necessary, log the player out
|
||||
if (ShouldLogOut(currTime) && !m_playerLoading)
|
||||
if (ShouldLogOut(currentTime) && !m_playerLoading)
|
||||
LogoutPlayer(true);
|
||||
|
||||
if (m_Socket && GetPlayer() && _warden)
|
||||
@@ -810,7 +810,7 @@ void WorldSession::SetAccountData(AccountDataType type, time_t tm, std::string c
|
||||
void WorldSession::SendAccountDataTimes(uint32 mask)
|
||||
{
|
||||
WorldPacket data(SMSG_ACCOUNT_DATA_TIMES, 4 + 1 + 4 + NUM_ACCOUNT_DATA_TYPES * 4);
|
||||
data << uint32(time(nullptr)); // Server time
|
||||
data << uint32(GameTime::GetGameTime()); // Server time
|
||||
data << uint8(1);
|
||||
data << uint32(mask); // type mask
|
||||
for (uint32 i = 0; i < NUM_ACCOUNT_DATA_TYPES; ++i)
|
||||
|
||||
Reference in new issue
Block a user