From f7ee3a340f90f468dc5c53c9f2a5b5b58edc2d8b Mon Sep 17 00:00:00 2001 From: catloversg <152669316+catloversg@users.noreply.github.com> Date: Wed, 30 Oct 2024 18:15:43 +0700 Subject: [PATCH] MISC: Remove or change popup shown when system clock moved backward (#1739) --- src/engine.tsx | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/engine.tsx b/src/engine.tsx index 3bc0fe9f6..6366f05da 100644 --- a/src/engine.tsx +++ b/src/engine.tsx @@ -63,15 +63,6 @@ declare global { }; } -// Only show warning if the time diff is greater than this value. -const thresholdOfTimeDiffForShowingWarningAboutSystemClock = CONSTANTS.MillisecondsPerFiveMinutes; - -function showWarningAboutSystemClock(timeDiff: number) { - AlertEvents.emit( - `Warning: The system clock moved backward: ${convertTimeMsToTimeElapsedString(Math.abs(timeDiff))}.`, - ); -} - export const GameCycleEvents = new EventEmitter<[]>(); /** Game engine. Handles the main game loop. */ @@ -274,12 +265,6 @@ const Engine: { const lastUpdate = Player.lastUpdate; let timeOffline = Engine._lastUpdate - lastUpdate; if (timeOffline < 0) { - if (Math.abs(timeOffline) > thresholdOfTimeDiffForShowingWarningAboutSystemClock) { - const timeDiff = timeOffline; - setTimeout(() => { - showWarningAboutSystemClock(timeDiff); - }, 250); - } timeOffline = 0; } const numCyclesOffline = Math.floor(timeOffline / CONSTANTS.MilliPerCycle); @@ -430,9 +415,6 @@ const Engine: { const _thisUpdate = new Date().getTime(); let diff = _thisUpdate - Engine._lastUpdate; if (diff < 0) { - if (Math.abs(diff) > thresholdOfTimeDiffForShowingWarningAboutSystemClock) { - showWarningAboutSystemClock(diff); - } diff = 0; Engine._lastUpdate = _thisUpdate; Player.lastUpdate = _thisUpdate;