2
3
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-14 14:37:41 +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

@ -366,7 +366,15 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
static uint32_t keyState=0;
// Handle messages
switch (message) {
switch (message) {
case WM_TIMECHANGE:
// To prevent cheating and keep things better synchronized,
// we will completely re-eval the offsets on the next NetMsg we
// get from the server
if (plNetClientMgr* nc = plNetClientMgr::GetInstance())
nc->ResetServerTimeOffset(true);
break;
case WM_KEYDOWN :
case WM_LBUTTONDOWN :
case WM_RBUTTONDOWN :