aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/MiscHandler.cpp
diff options
context:
space:
mode:
authorxinef1 <w.szyszko2@gmail.com>2017-03-02 02:19:25 +0100
committerariel- <ariel-@users.noreply.github.com>2017-03-01 22:19:25 -0300
commit7567cafec84080d26ea513242a1f540a823b8f9d (patch)
treef6f37a7cc4d06db0dbb0e08a01f8a18cf47ac955 /src/server/game/Handlers/MiscHandler.cpp
parent7011aabb56f061fc889ec42ce32b7605ceb35b53 (diff)
Ensure that all actions are compared to fixed point in time (ie. world update start) (#18910)
- Actions will not be dependent on processing moment - Increased GameObjects cooldown resolution to milliseconds, fixes arming time of traps to be exactly one second and not something from range (1000, 1999) - Created GameTime namespace and UpdateTime class and moved there some code out of world
Diffstat (limited to 'src/server/game/Handlers/MiscHandler.cpp')
-rw-r--r--src/server/game/Handlers/MiscHandler.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp
index daf6dea438b..3f408be545a 100644
--- a/src/server/game/Handlers/MiscHandler.cpp
+++ b/src/server/game/Handlers/MiscHandler.cpp
@@ -23,6 +23,7 @@
#include "Opcodes.h"
#include "Log.h"
#include "Player.h"
+#include "GameTime.h"
#include "GossipDef.h"
#include "World.h"
#include "ObjectMgr.h"
@@ -1253,7 +1254,7 @@ void WorldSession::HandleTimeSyncResp(WorldPacket& recvData)
TC_LOG_DEBUG("network", "Time sync received: counter %u, client ticks %u, time since last sync %u", counter, clientTicks, clientTicks - _player->m_timeSyncClient);
- uint32 ourTicks = clientTicks + (getMSTime() - _player->m_timeSyncServer);
+ uint32 ourTicks = clientTicks + (GameTime::GetGameTimeMS() - _player->m_timeSyncServer);
// diff should be small
TC_LOG_DEBUG("network", "Our ticks: %u, diff %u, latency %u", ourTicks, ourTicks - clientTicks, GetLatency());