Auto-trigger locked-files restoration exactly at the 60s deadline

Previously the restore check only ran lazily on a player's next
message, so files could stay wrongly-removed for an arbitrary amount
of time after the window expired. The frontend now schedules a
setTimeout (using the server-provided deadline, mirroring the terminal
lock's reveal timer) that pings the backend right at the deadline so
the check runs promptly regardless of player activity. Restored via
data-files-removal-deadline on page load too, so a refresh mid-window
doesn't lose the timer.
This commit is contained in:
Frank
2026-07-11 17:45:08 +02:00
parent e6ba469ef9
commit eee6c3a369
4 changed files with 79 additions and 6 deletions
+2
View File
@@ -160,12 +160,14 @@ final class GameController extends AbstractController
$screen = $player ? $player->getScreen() : 0;
$session_id = $session->getId();
$lock = $player ? $gameResponseService->getPublicLockState($player) : null;
$filesRemovalDeadline = $gameResponseService->getPublicLockedFilesDeadline($session);
return $this->render('game/index.html.twig', [
'session' => $session,
'screen' => $screen,
'session_id' => $session_id,
'lock' => $lock,
'filesRemovalDeadline' => $filesRemovalDeadline,
]);
}