From ca27ce5e3774cd9e44f61edb343e81d2b242a188 Mon Sep 17 00:00:00 2001 From: Kitzunu <24550914+Kitzunu@users.noreply.github.com> Date: Mon, 31 May 2021 16:51:34 +0200 Subject: [PATCH] fix(Script/Command): Build (#6159) * fix(Script/Command): Build * codestyle ci is weird * Update MovementHandler.cpp * Update cs_server.cpp * Update cs_server.cpp --- src/server/game/Handlers/MovementHandler.cpp | 20 ++++++++------------ src/server/scripts/Commands/cs_server.cpp | 9 +++++---- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index 6d54409ad..ac5cec69c 100644 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -200,7 +200,6 @@ void WorldSession::HandleMoveWorldportAck() } } - bool allowMount = !mEntry->IsDungeon() || mEntry->IsBattlegroundOrArena(); if (mInstance) { @@ -605,7 +604,6 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket& recvData) } // continue parse packet - recvData >> unk1; // counter or moveEvent MovementInfo movementInfo; @@ -613,7 +611,6 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket& recvData) ReadMovementInfo(recvData, &movementInfo); recvData >> newspeed; - /*----------------*/ // client ACK send one packet for mounted/run case and need skip all except last from its // in other cases anti-cheat check can be fail in false case @@ -894,16 +891,15 @@ void WorldSession::HandleTimeSyncResp(WorldPacket& recvData) uint32 roundTripDuration = getMSTimeDiff(serverTimeAtSent, recvData.GetReceivedTime()); uint32 lagDelay = roundTripDuration / 2; - /* - clockDelta = serverTime - clientTime - where - serverTime: time that was displayed on the clock of the SERVER at the moment when the client processed the SMSG_TIME_SYNC_REQUEST packet. - clientTime: time that was displayed on the clock of the CLIENT at the moment when the client processed the SMSG_TIME_SYNC_REQUEST packet. + // clockDelta = serverTime - clientTime + // where + // serverTime: time that was displayed on the clock of the SERVER at the moment when the client processed the SMSG_TIME_SYNC_REQUEST packet. + // clientTime: time that was displayed on the clock of the CLIENT at the moment when the client processed the SMSG_TIME_SYNC_REQUEST packet. + + // Once clockDelta has been computed, we can compute the time of an event on server clock when we know the time of that same event on the client clock, + // using the following relation: + // serverTime = clockDelta + clientTime - Once clockDelta has been computed, we can compute the time of an event on server clock when we know the time of that same event on the client clock, - using the following relation: - serverTime = clockDelta + clientTime - */ int64 clockDelta = (int64)serverTimeAtSent + (int64)lagDelay - (int64)clientTimestamp; _timeSyncClockDeltaQueue.put(std::pair(clockDelta, roundTripDuration)); ComputeNewClockDelta(); diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp index 50dea79c5..19671938c 100644 --- a/src/server/scripts/Commands/cs_server.cpp +++ b/src/server/scripts/Commands/cs_server.cpp @@ -15,15 +15,16 @@ EndScriptData */ #include "Chat.h" #include "Config.h" #include "GitRevision.h" -#include "VMapManager2.h" -#include "VMapFactory.h" #include "Language.h" +#include "MySQLThreading.h" #include "ObjectAccessor.h" #include "Player.h" #include "Realm.h" #include "ScriptMgr.h" #include "ServerMotd.h" #include "StringConvert.h" +#include "VMapFactory.h" +#include "VMapManager2.h" #include #include #include @@ -109,9 +110,9 @@ public: dbPort = (*res)[0].GetUInt16(); if (dbPort) - dbPortOutput = acore::StringFormat("Realmlist (Realm Id: %u) configured in port %" PRIu16, realm.Id.Realm, dbPort); + dbPortOutput = Acore::StringFormat("Realmlist (Realm Id: %u) configured in port %" PRIu16, realm.Id.Realm, dbPort); else - dbPortOutput = acore::StringFormat("Realm Id: %u not found in `realmlist` table. Please check your setup", realm.Id.Realm); + dbPortOutput = Acore::StringFormat("Realm Id: %u not found in `realmlist` table. Please check your setup", realm.Id.Realm); } handler->PSendSysMessage("%s", GitRevision::GetFullVersion());