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:
@ -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 :
|
||||
|
Reference in New Issue
Block a user