Refactor GameEngine files

fix some GameEngine bugs and new improovements
This commit is contained in:
novgorodschi catalin
2026-07-20 07:09:06 +03:00
parent 94a7a1c245
commit 8db3032293
11 changed files with 951 additions and 1002 deletions
+11 -2
View File
@@ -432,10 +432,19 @@ class Profile {
private function removeSitter($get) {
global $database, $session;
// UM-W1: validam type in {1,2} inainte de a-l folosi in numele coloanei
// (sit1/sit2). DB escapeaza campul, deci nu era injectabil, dar un type
// invalid ar fi tintit o coloana inexistenta.
$type = isset($get['type']) ? (int)$get['type'] : 0;
if ($type !== 1 && $type !== 2) {
header("Location: spieler.php?s=" . $get['s']);
exit;
}
if ($get['a'] == $session->checker) {
if ($session->userinfo['sit' . $get['type']] == $get['id']) {
$database->updateUserField($session->uid, "sit" . $get['type'], 0, 1);
if ($session->userinfo['sit' . $type] == $get['id']) {
$database->updateUserField($session->uid, "sit" . $type, 0, 1);
// Invalidate the 30s session user-cache (see Session::PopulateVar) so the
// removed sitter disappears immediately, without a re-login.
unset($_SESSION['cache_user_' . ($_SESSION['username'] ?? '')]);