Fix Auth on server also some fixes and cleanups. Big thx to TOM_RUS.

--HG--
branch : trunk
This commit is contained in:
n0n4m3
2010-04-11 11:11:32 +04:00
parent 36e13c1d1c
commit 8db7c06e6b
19 changed files with 104 additions and 55 deletions

View File

@@ -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*/)