Отказ от алиаса die в пользу exit, более явная проверка на наличие сессии. Некоторые проверки входа теперь проверяют объекты, а не массив.

This commit is contained in:
Igor Barkov (iwork)
2020-09-30 15:01:33 +03:00
parent 02dc4582dc
commit a08ce17a40
179 changed files with 883 additions and 582 deletions
+5 -5
View File
@@ -237,7 +237,7 @@ class fbattle
// ставим статус битвы на "нет битвы"
$this->status = 0;
//header ("Location:main.php");
//die();
//exit;
//$this->return = 5;
//return $this->return;
}
@@ -414,7 +414,7 @@ class fbattle
// обновить битку
$this->update_battle();
header("Location: " . $_SERVER['PHP_SELF'] . "");
die();
exit;
}
} else {
return false;
@@ -1701,7 +1701,7 @@ class fbattle
}
if (in_array($user['room'], Config::$caverooms)) {
if (in_array($user->room, Config::$caverooms)) {
$location = mysql_fetch_array(mysql_query("SELECT `x`, `y`, `dir` FROM `caveparties` WHERE `user` = '" . $this->user['id'] . "' LIMIT 1"));
if ($location['dir'] == 0) {
@@ -1790,13 +1790,13 @@ class fbattle
// выносим хп-ку и выходим из боя
mysql_query('UPDATE `battle` SET `t1hist` = \'' . implode(", ", $nks1hist) . '\', `t2hist` = \'' . implode(", ", $nks2hist) . '\' WHERE `id` = ' . $this->battle_data['id'] . ' ;');
addch("<a href=logs.php?log=" . $this->battle_data['id'] . " target=_blank>Поединок</a> между <B>" . $rr . "</B> закончен. ", $user['room']);
addch("<a href=logs.php?log=" . $this->battle_data['id'] . " target=_blank>Поединок</a> между <B>" . $rr . "</B> закончен. ", $user->room);
mysql_query('UPDATE `battle` SET `exp` = \'' . serialize($this->exp) . '\' WHERE `id` = ' . $this->battle_data['id'] . ' ;');
mysql_query("DELETE FROM `bots` WHERE `battle` = {$this->user['battle']};");
mysql_query("UPDATE users SET `battle` =0, `fullhptime` = " . time() . " WHERE `battle` = {$this->user['battle']}");
echo mysql_error();
unset($this->battle);
//header("Location: fbattle.php"); die();
//header("Location: fbattle.php"); exit;
return true;
// =================================================================
}