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/MiscHandler.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/MiscHandler.cpp')
-rw-r--r-- | src/game/MiscHandler.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index c9692b2ebef..2608f60dcb8 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -48,6 +48,7 @@ #include "Vehicle.h" #include "CreatureAI.h" #include "DBCEnums.h" +#include "TimeMgr.h" void WorldSession::HandleRepopRequestOpcode( WorldPacket & recv_data ) { @@ -382,7 +383,7 @@ void WorldSession::HandleLogoutRequestOpcode( WorldPacket & /*recv_data*/ ) data << uint32(0); data << uint8(0); SendPacket( &data ); - LogoutRequest(time(NULL)); + LogoutRequest(sGameTime.GetGameTime()); } void WorldSession::HandlePlayerLogoutOpcode( WorldPacket & /*recv_data*/ ) @@ -442,7 +443,7 @@ void WorldSession::HandleTogglePvP( WorldPacket & recv_data ) else { if(!GetPlayer()->pvpInfo.inHostileArea && GetPlayer()->IsPvP()) - GetPlayer()->pvpInfo.endTimer = time(NULL); // start toggle-off + GetPlayer()->pvpInfo.endTimer = sGameTime.GetGameTime(); // start toggle-off } //if(OutdoorPvP * pvp = _player->GetOutdoorPvP()) @@ -733,7 +734,7 @@ void WorldSession::HandleReclaimCorpseOpcode(WorldPacket &recv_data) return; // prevent resurrect before 30-sec delay after body release not finished - if(corpse->GetGhostTime() + GetPlayer()->GetCorpseReclaimDelay(corpse->GetType()==CORPSE_RESURRECTABLE_PVP) > time(NULL)) + if(corpse->GetGhostTime() + GetPlayer()->GetCorpseReclaimDelay(corpse->GetType()==CORPSE_RESURRECTABLE_PVP) > sGameTime.GetGameTime()) return; if (!corpse->IsWithinDistInMap(GetPlayer(), CORPSE_RECLAIM_RADIUS, true)) @@ -867,7 +868,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) { // set resting flag we are in the inn GetPlayer()->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING); - GetPlayer()->InnEnter(time(NULL), atEntry->mapid, atEntry->x, atEntry->y, atEntry->z); + GetPlayer()->InnEnter(sGameTime.GetGameTime(), atEntry->mapid, atEntry->x, atEntry->y, atEntry->z); GetPlayer()->SetRestType(REST_TYPE_IN_TAVERN); if(sWorld.IsFFAPvPRealm()) @@ -1621,6 +1622,6 @@ void WorldSession::HandleWorldStateUITimerUpdate(WorldPacket& recv_data) sLog.outDebug("WORLD: CMSG_WORLD_STATE_UI_TIMER_UPDATE"); WorldPacket data(SMSG_WORLD_STATE_UI_TIMER_UPDATE, 4); - data << uint32(time(NULL)); + data << uint32(sGameTime.GetGameTime()); SendPacket(&data); } |