1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-17 10:52:46 +00:00

Improve server time sync

Prevents cheating with time based puzzles (pellets) and ensures the KI time
stays somewhat correct. The server time will be reset on the plNetMessage
received after the user changes their system clock. That might take a bit,
but it's better than nothing.
This commit is contained in:
2012-03-04 21:10:34 -05:00
parent a753532f77
commit 638259e749
3 changed files with 13 additions and 4 deletions

View File

@ -506,9 +506,10 @@ void plNetClientMgr::UpdateServerTimeOffset(plNetMessage* msg)
}
}
void plNetClientMgr::ResetServerTimeOffset()
void plNetClientMgr::ResetServerTimeOffset(bool delayed)
{
fServerTimeOffset = 0;
if (!delayed)
fServerTimeOffset = 0;
fTimeSamples = 0;
fLastTimeUpdate = 0;
}

View File

@ -383,7 +383,7 @@ public:
void StoreSDLState(const plStateDataRecord* sdRec, const plUoid& uoid, uint32_t sendFlags, uint32_t writeOptions);
void UpdateServerTimeOffset(plNetMessage* msg);
void ResetServerTimeOffset();
void ResetServerTimeOffset(bool delayed=false);
private:
plNetClientComm fNetClientComm;