fix(session): refresh the 30s user-cache after a player's own changes (#239)

This commit is contained in:
Ferywir
2026-06-18 13:59:44 +02:00
committed by GitHub
parent cdc736839e
commit 1b978470c6
9 changed files with 45 additions and 0 deletions
+4
View File
@@ -1760,6 +1760,10 @@ class Building {
$session->gold = $newgold;
$_SESSION['gold'] = $newgold;
// Invalidate the 30s session user-cache (see Session::PopulateVar); the gold
// write is absolute ($session->gold - $spent), so a stale cache would revert
// the balance next request and could allow a double-spend.
unset($_SESSION['cache_user_' . ($_SESSION['username'] ?? '')]);
}
// un singur query