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:
@@ -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,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user