mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-09 22:26:10 +00:00
fix(session): refresh the 30s user-cache after a player's own changes (#239)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user