Ensure that all actions are compared to fixed point in time (ie. world update start)
Port From (https://github.com/TrinityCore/TrinityCore/commit/60663d1374beef3103f4787152654034fa4a8897)
This commit is contained in:
@@ -663,7 +663,7 @@ namespace Game
|
||||
|
||||
AccountDataTimes accountDataTimes = new AccountDataTimes();
|
||||
accountDataTimes.PlayerGuid = playerGuid;
|
||||
accountDataTimes.ServerTime = (uint)Global.WorldMgr.GetGameTime();
|
||||
accountDataTimes.ServerTime = (uint)GameTime.GetGameTime();
|
||||
for (AccountDataTypes i = 0; i < AccountDataTypes.Max; ++i)
|
||||
accountDataTimes.AccountTimes[(int)i] = (uint)GetAccountData(i).Time;
|
||||
|
||||
@@ -759,7 +759,7 @@ namespace Game
|
||||
stmt.AddValue(0, GetAccountId());
|
||||
DB.Login.Execute(stmt);
|
||||
|
||||
pCurrChar.SetInGameTime(Time.GetMSTime());
|
||||
pCurrChar.SetInGameTime(GameTime.GetGameTimeMS());
|
||||
|
||||
// announce group about member online (must be after add to player list to receive announce to self)
|
||||
Group group = pCurrChar.GetGroup();
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace Game
|
||||
if (store.HasRecord(record.RecordID))
|
||||
{
|
||||
dbReply.Allow = true;
|
||||
dbReply.Timestamp = (uint)Global.WorldMgr.GetGameTime();
|
||||
dbReply.Timestamp = (uint)GameTime.GetGameTime();
|
||||
store.WriteRecord(record.RecordID, GetSessionDbcLocale(), dbReply.Data);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -146,7 +146,7 @@ namespace Game
|
||||
plrMover.SetInWater(!plrMover.IsInWater() || plrMover.GetMap().IsUnderWater(plrMover.GetPhaseShift(), movementInfo.Pos.posX, movementInfo.Pos.posY, movementInfo.Pos.posZ));
|
||||
}
|
||||
|
||||
uint mstime = Time.GetMSTime();
|
||||
uint mstime = GameTime.GetGameTimeMS();
|
||||
|
||||
if (m_clientTimeDelay == 0)
|
||||
m_clientTimeDelay = mstime - movementInfo.Time;
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace Game
|
||||
|
||||
Log.outDebug(LogFilter.Network, "Time sync received: counter {0}, client ticks {1}, time since last sync {2}", packet.SequenceIndex, packet.ClientTime, packet.ClientTime - _player.m_timeSyncClient);
|
||||
|
||||
uint ourTicks = packet.ClientTime + (Time.GetMSTime() - _player.m_timeSyncServer);
|
||||
uint ourTicks = packet.ClientTime + (GameTime.GetGameTimeMS() - _player.m_timeSyncServer);
|
||||
|
||||
// diff should be small
|
||||
Log.outDebug(LogFilter.Network, "Our ticks: {0}, diff {1}, latency {2}", ourTicks, ourTicks - packet.ClientTime, GetLatency());
|
||||
|
||||
Reference in New Issue
Block a user