diff options
| author | n0n4m3 <none@none> | 2009-12-23 08:04:10 +0100 |
|---|---|---|
| committer | n0n4m3 <none@none> | 2009-12-23 08:04:10 +0100 |
| commit | 3fe0bc52541d8cdf4fa992d9b8b3101cde5848f0 (patch) | |
| tree | be5871dc19f69f4555d9ffa7c57e5d964b8e60e0 /src/game/WorldSession.cpp | |
| parent | 7ea2510980d4b1c96f0341e9c8b9d5784862dc72 (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/WorldSession.cpp')
| -rw-r--r-- | src/game/WorldSession.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/game/WorldSession.cpp b/src/game/WorldSession.cpp index 569c8fade62..bb7950de222 100644 --- a/src/game/WorldSession.cpp +++ b/src/game/WorldSession.cpp @@ -39,6 +39,7 @@ #include "OutdoorPvPMgr.h" #include "MapManager.h" #include "SocialMgr.h" +#include "TimeMgr.h" #include "zlib/zlib.h" #include "ScriptCalls.h" @@ -106,13 +107,13 @@ void WorldSession::SendPacket(WorldPacket const* packet) static uint64 sendPacketCount = 0; static uint64 sendPacketBytes = 0; - static time_t firstTime = time(NULL); + static time_t firstTime = sGameTime.GetGameTime(); static time_t lastTime = firstTime; // next 60 secs start time static uint64 sendLastPacketCount = 0; static uint64 sendLastPacketBytes = 0; - time_t cur_time = time(NULL); + time_t cur_time = sGameTime.GetGameTime(); if((cur_time - lastTime) < 60) { @@ -281,7 +282,7 @@ bool WorldSession::Update(uint32 /*diff*/) } ///- If necessary, log the player out - time_t currTime = time(NULL); + time_t currTime = sGameTime.GetGameTime(); if (!m_Socket || (ShouldLogOut(currTime) && !m_playerLoading)) LogoutPlayer(true); @@ -658,7 +659,7 @@ void WorldSession::SetAccountData(AccountDataType type, time_t time_, std::strin void WorldSession::SendAccountDataTimes(uint32 mask) { WorldPacket data( SMSG_ACCOUNT_DATA_TIMES, 4+1+4+8*4 ); // changed in WotLK - data << uint32(time(NULL)); // unix time of something + data << uint32(sGameTime.GetGameTime()); // unix time of something data << uint8(1); data << uint32(mask); // type mask for(uint32 i = 0; i < NUM_ACCOUNT_DATA_TYPES; ++i) |
