mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-01 06:37:12 +01:00
Fix Auth on server also some fixes and cleanups. Big thx to TOM_RUS.
--HG-- branch : trunk
This commit is contained in:
@@ -1443,13 +1443,20 @@ void WorldSession::HandleTimeSyncResp(WorldPacket & recv_data)
|
||||
{
|
||||
sLog.outDebug("CMSG_TIME_SYNC_RESP");
|
||||
|
||||
uint32 counter, time_;
|
||||
recv_data >> counter >> time_;
|
||||
uint32 counter, clientTicks;
|
||||
recv_data >> counter >> clientTicks;
|
||||
|
||||
// time_ seems always more than getMSTime()
|
||||
uint32 diff = getMSTimeDiff(getMSTime(),time_);
|
||||
if (counter != _player->m_timeSyncCounter - 1)
|
||||
sLog.outDebug("Wrong time sync counter from player %s (cheater?)", _player->GetName());
|
||||
|
||||
sLog.outDebug("response sent: counter %u, time %u (HEX: %X), ms. time %u, diff %u", counter, time_, time_, getMSTime(), diff);
|
||||
sLog.outDebug("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);
|
||||
|
||||
// diff should be small
|
||||
sLog.outDebug("Our ticks: %u, diff %u, latency %u", ourTicks, ourTicks - clientTicks, GetLatency());
|
||||
|
||||
_player->m_timeSyncClient = clientTicks;
|
||||
}
|
||||
|
||||
void WorldSession::HandleResetInstancesOpcode(WorldPacket & /*recv_data*/)
|
||||
|
||||
Reference in New Issue
Block a user