Отказ от алиаса 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
+6 -6
View File
@@ -1,5 +1,5 @@
<?php
if ($user['room'] == 20) {
if ($user->room == 20) {
//нападение
$us = mysql_fetch_array(mysql_query("SELECT *,(select `id` from `online` WHERE `real_time` >= " . (time() - 60) . " AND `id` = users.`id`) as `online` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
@@ -18,7 +18,7 @@ if ($user['room'] == 20) {
echo "Вы ожидаете поединка...";
} elseif ($user['klan'] != '' && ($user['klan'] == $us['klan'])) {
echo "Чтите честь ваших сокланов.";
} elseif ($user['room'] != $us['room']) {
} elseif ($user->room != $us['room']) {
echo "Персонаж в другой комнате!";
} elseif ($us['level'] < 3) {
echo "Нельзя напасть на персонажа ниже 3 уровня! Даже ночью, даже на Центральной площади...";
@@ -61,7 +61,7 @@ if ($user['room'] == 20) {
} else {
$ttt = 1;
}
addch("<b>" . Nick::id($user['id'])->short() . "</b> вмешался в <a href=logs.php?log=" . $id . " target=_blank>поединок »»</a>. ", $user['room']);
addch("<b>" . Nick::id($user['id'])->short() . "</b> вмешался в <a href=logs.php?log=" . $id . " target=_blank>поединок »»</a>. ", $user->room);
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].'');
@@ -71,7 +71,7 @@ if ($user['room'] == 20) {
mysql_query("UPDATE users SET `battle` =" . $jert['battle'] . ",`zayavka`=0,`hit`=0,`parry`=0,`krit`=0,`counter`=0,`hp2`=0 WHERE `id`= " . $user['id']);
header("Location:fbattle.php");
//die("<script>location.href='fbattle.php';</script>");
//exit("<script>location.href='fbattle.php';</script>");
} else {
// начинаем бой
//$bet=1;
@@ -125,7 +125,7 @@ if ($user['room'] == 20) {
$rr = "<b>" . Nick::id($user['id'])->full(1) . "</b> и <b>" . Nick::id($jert['id'])->full(1) . "</b>";
addch("<a href=logs.php?log=" . $id . " target=_blank>Бой</a> между <B><b>" . Nick::id($user['id'])->short() . "</b> и <b>" . Nick::id($jert['id'])->short() . "</b> начался. ", $user['room']);
addch("<a href=logs.php?log=" . $id . " target=_blank>Бой</a> между <B><b>" . Nick::id($user['id'])->short() . "</b> и <b>" . Nick::id($jert['id'])->short() . "</b> начался. ", $user->room);
//mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}',"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>");
@@ -144,7 +144,7 @@ if ($user['room'] == 20) {
fwrite($btfl, '{[=' . $user['id'] . '=]}');
fclose($btfl);
}
die("<script>location.href='fbattle.php';</script>");
exit("<script>location.href='fbattle.php';</script>");
}
} else {
echo 'Мазохист?...';