mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-16 21:20:01 -04:00
Core/Movement: Add time synchronisation (#18189)
(cherry picked from commit 975f1e364a)
This commit is contained in:
@@ -468,6 +468,9 @@ WorldSocket::ReadDataHandlerResult WorldSocket::ReadDataHandler()
|
||||
/* fallthrough */
|
||||
default:
|
||||
{
|
||||
if (opcode == CMSG_TIME_SYNC_RESPONSE)
|
||||
packet.SetReceiveTime(std::chrono::steady_clock::now());
|
||||
|
||||
sessionGuard.lock();
|
||||
|
||||
LogOpcodeText(opcode, sessionGuard);
|
||||
@@ -1035,10 +1038,7 @@ bool WorldSocket::HandlePing(WorldPackets::Auth::Ping& ping)
|
||||
std::lock_guard<std::mutex> sessionGuard(_worldSessionLock);
|
||||
|
||||
if (_worldSession)
|
||||
{
|
||||
_worldSession->SetLatency(ping.Latency);
|
||||
_worldSession->ResetClientTimeDelay();
|
||||
}
|
||||
else
|
||||
{
|
||||
TC_LOG_ERROR("network", "WorldSocket::HandlePing: peer sent CMSG_PING, but is not authenticated or got recently kicked, address = %s", GetRemoteIpAddress().to_string().c_str());
|
||||
|
||||
Reference in New Issue
Block a user