From 0ccc2d1af52e82505f80304d5974bb2b10d40946 Mon Sep 17 00:00:00 2001 From: lopar Date: Mon, 1 Feb 2021 21:20:23 +0200 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D1=87=D0=B5=D0=BC-=D1=82=D0=BE=20?= =?UTF-8?q?=D0=B8=D0=BD=D0=BA=D0=B0=D0=BF=D1=81=D1=83=D0=BB=D0=B8=D1=80?= =?UTF-8?q?=D0=B5=D0=BC.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/admin.php | 2 +- admin/edit_user.php | 4 +- c_forest.php | 2 +- canalizaciya.php | 2 +- canalization_mod.php | 2 +- cave.php | 40 +++++----- ch.php | 20 ++--- chats.php | 4 +- city.php | 110 +++++++++++++------------- clan_castle.php | 6 +- clan_create.php | 2 +- classes/Battles/User.php | 58 +++++++------- classes/Cave/lose.php | 8 +- classes/Cave/win.php | 4 +- classes/Tournament.php | 2 +- classes/battle_new.class.php | 4 +- classes/quests_class.php | 2 +- cronjobs/cron_bots_battle.php | 4 +- enter_cave.php | 24 +++--- forest.php | 2 +- functions.php | 30 +++---- gotzamok.php | 36 ++++----- lab.php | 36 ++++----- lab2.php | 36 ++++----- lab_enter.php | 4 +- magic/attack.php | 6 +- magic/attack_blood.php | 6 +- magic/attack_t.php | 6 +- magic/attackbot.php | 2 +- magic/attackk.php | 6 +- magic/attackk_close.php | 4 +- magic/attackk_open.php | 4 +- magic/battack.php | 6 +- magic/bexit.php | 2 +- magic/brat.php | 6 +- magic/cityattack.php | 8 +- magic/cpattack.php | 6 +- magic/defence.php | 2 +- magic/devastate.php | 2 +- magic/eattack.php | 6 +- magic/ebattack.php | 6 +- magic/elikbroni.php | 2 +- magic/elikurona.php | 2 +- magic/fist_def.php | 2 +- magic/luck.php | 2 +- magic/pers_blood.php | 6 +- magic/stop.php | 4 +- magic/stop_200.php | 4 +- magic/usability_klan/attack.php | 6 +- magic/usability_klan/attack_blood.php | 6 +- magic/usability_user/attack.php | 6 +- magic/usability_user/attack_blood.php | 6 +- magic/vampir.php | 6 +- magic/zz.php | 2 +- main.php | 60 +++++++------- podzem/edit_podzem.php | 2 +- quest_room.php | 2 +- tournament.php | 2 +- towerin.php | 62 +++++++-------- towerstamp.php | 2 +- ul_clans.php | 2 +- user_abilities.php | 6 +- vxod.php | 2 +- zayavka.php | 69 ++++++++-------- 64 files changed, 393 insertions(+), 392 deletions(-) diff --git a/admin/admin.php b/admin/admin.php index 84e2626..cc02dad 100644 --- a/admin/admin.php +++ b/admin/admin.php @@ -15,7 +15,7 @@ use Battles\Template; use Battles\User; $user = $user ?? new User($_SESSION['uid']); -if (!$user->admin) { +if (!$user->getAdmin()) { header("HTTP/1.0 404 Not Found"); exit; } diff --git a/admin/edit_user.php b/admin/edit_user.php index 7439908..280e8eb 100644 --- a/admin/edit_user.php +++ b/admin/edit_user.php @@ -7,8 +7,8 @@ session_start(); require_once "../functions.php"; - -if (!$user->admin) { +$user = $user ?? new User($_SESSION['uid']); +if (!$user->getAdmin()) { header("HTTP/1.0 404 Not Found"); exit; } diff --git a/c_forest.php b/c_forest.php index 495126f..2025bf2 100644 --- a/c_forest.php +++ b/c_forest.php @@ -1,7 +1,7 @@ room == 51) { +if ($user->getRoom() == 51) { header('location: city.php'); exit; } diff --git a/canalizaciya.php b/canalizaciya.php index e27d828..59078c8 100644 --- a/canalizaciya.php +++ b/canalizaciya.php @@ -6,7 +6,7 @@ use Battles\User; session_start(); require_once "functions.php"; $user = $user ?? new User($_SESSION['uid']); -if ($user->room == 403) { +if ($user->getRoom() == 403) { include "startpodzemel.php"; if ($_GET['act'] == "cexit") { $das = mysql_query("select glava,glav_id from `labirint` where user_id='" . $user['id'] . "'"); diff --git a/canalization_mod.php b/canalization_mod.php index 9919160..d7d310f 100644 --- a/canalization_mod.php +++ b/canalization_mod.php @@ -1,5 +1,5 @@ room == 403) { +if ($user->getRoom() == 403) { $s = db::c()->query('SELECT * FROM podzem2 WHERE name= "?s"', $mir['name'])->fetch_assoc(); $rooms[0] = ""; diff --git a/cave.php b/cave.php index e25dc21..f9c5986 100644 --- a/cave.php +++ b/cave.php @@ -287,15 +287,15 @@ function makedeath() { global $user, $floor, $loses, $x, $y, $dir; $cavedata = Config::$cavedata ?? []; - if (!isset($cavedata[$user->room]['x' . $floor])) { + if (!isset($cavedata[$user->getRoom()]['x' . $floor])) { $floor = 1; loadmap(); } - mysql_query("UPDATE `caveparties` SET `floor` = $floor, `x` = '" . $cavedata[$user->room]['x' . $floor] . "', `y` = '" . $cavedata[$user->room]['y' . $floor] . "', `dir` = '" . $cavedata[$user->room]['dir' . $floor] . "', `loses` = (`loses`+1) WHERE `user` = '$user[id]' LIMIT 1"); + mysql_query("UPDATE `caveparties` SET `floor` = $floor, `x` = '" . $cavedata[$user->getRoom()]['x' . $floor] . "', `y` = '" . $cavedata[$user->getRoom()]['y' . $floor] . "', `dir` = '" . $cavedata[$user->getRoom()]['dir' . $floor] . "', `loses` = (`loses`+1) WHERE `user` = '$user[id]' LIMIT 1"); mysql_query('UPDATE `users` SET `hp` = 1 WHERE `id` = "' . $user['id'] . '" LIMIT 1'); - $x = $cavedata[$user->room]['x' . $floor]; - $y = $cavedata[$user->room]['y' . $floor]; - $dir = $cavedata[$user->room]['dir' . $floor]; + $x = $cavedata[$user->getRoom()]['x' . $floor]; + $y = $cavedata[$user->getRoom()]['y' . $floor]; + $dir = $cavedata[$user->getRoom()]['dir' . $floor]; updparties(); $loses++; } @@ -466,7 +466,7 @@ while ($rec = mysql_fetch_assoc($r)) { $party[] = $rec; } -if ($user->room == 621) { +if ($user->getRoom() == 621) { $base = "/underdesigns/alchcave"; } @@ -547,8 +547,8 @@ if ($_GET['useitem']) { $ty = $y + 1; } if (@$_GET['useitem']) { - if (file_exists("underground/objects/$user->room.php")) { - include "underground/objects/$user->room.php"; + if (file_exists("underground/objects/$user->getRoom().php")) { + include "underground/objects/$user->getRoom().php"; } } @@ -644,7 +644,7 @@ if ($wander && !isset($_GET['attack'])) { $ty = $v['y'] + 2; } - if ($user->room == 74 || $user->room == 76) { + if ($user->getRoom() == 74 || $user->getRoom() == 76) { if (strpos($map[$ty][$tx], 's/') !== false && !@$mapbots[$ty][$tx]) { break; } @@ -712,8 +712,8 @@ if ($moved && (substr($map[$y * 2][$x * 2], 0, 1) === "e" || substr($map[$y * 2] $tx = $x; $ty = $y; $tmp = explode("/", $map[$y * 2][$x * 2]); - if (file_exists("underground/events/$user->room.php")) { - include("underground/events/$user->room.php"); + if (file_exists("underground/events/$user->getRoom().php")) { + include("underground/events/$user->getRoom().php"); } } @@ -738,7 +738,7 @@ if ($ambushes[$y * 2][$x * 2 - 2] && $map[$y * 2][$x * 2 - 1] == 0) { if ($ax && $ay && $user['hp'] > 0) { $cavedata = Config::$cavedata ?? []; - if (!($cavedata[$user->room]['x' . $floor] == $x && $cavedata[$user->room]['y' . $floor] == $y)) { + if (!($cavedata[$user->getRoom()]['x' . $floor] == $x && $cavedata[$user->getRoom()]['y' . $floor] == $y)) { if ($ax < $x) { $dir1 = 0; } elseif ($ax > $x) { @@ -902,7 +902,7 @@ if (@$_GET['exit']) { } } mysql_query("DELETE FROM `inventory` WHERE `owner` = '$user[id]' AND `foronetrip` = 1"); - gotoroom($user->room - 1); + gotoroom($user->getRoom() - 1); } $standingon = $map[$y * 2][$x * 2]; @@ -1470,9 +1470,9 @@ function drawmap($map1, $players, $x, $y, $direction) $ret .= drawobject2($aMap[$yy][$xx], $x, $y); } - $rrm = $user->room; + $rrm = $user->getRoom(); - if (isset($dialogs[CaveBots::$bots[$data[1]]]) && (CaveBots::$bots[$data[1]] == 11147 && $user->room == 74)) { + if (isset($dialogs[CaveBots::$bots[$data[1]]]) && (CaveBots::$bots[$data[1]] == 11147 && $user->getRoom() == 74)) { $ret .= " 1 ? " ($cnt)" : "") . "\" " . ($y == 1 && $x == 3 ? "onclick=\"speakattackmenu(event);\"" : "") . " width=\"" . $imgdata[$x][$y]["wd"] . "\" height=\"" . $imgdata[$x][$y]["ht"] . "\" src=\"/i/dungeon/mobs/$rrm/$bot.gif\" style=\"position: absolute; left: " . $imgdata[$x][$y]["x"][$bn] . "px; top: " . $imgdata[$x][$y]["y"] . "px;" . ($x == 3 && $y == 1 ? "cursor: pointer;" : "") . ($x == 3 ? "z-index: " . (99 - ($y * 5)) . ";" : "") . "\" />"; } else { $ret .= " 1 ? " ($cnt)" : "") . "\" " . ($y == 1 && $x == 3 ? " onclick=\"document.location.href='cave.php?attack=1';\"" : "") . " width=\"" . $imgdata[$x][$y]["wd"] . "\" height=\"" . $imgdata[$x][$y]["ht"] . "\" src=\"/i/dungeon/mobs/$rrm/$bot.gif\" style=\"position: absolute; left: " . $imgdata[$x][$y]["x"][$bn] . "px; top: " . $imgdata[$x][$y]["y"] . "px;" . ($x == 3 && $y == 1 ? "cursor: pointer;" : "") . ($x == 3 ? "z-index: " . (99 - ($y * 5)) . ";" : "") . "\" />"; @@ -1562,7 +1562,7 @@ function drawmap($map1, $players, $x, $y, $direction) $left = $imgdata[$x][$y]["x"][1]; $top = $imgdata[$x][$y]["y"] + $ht; } - $rrm = $user->room; + $rrm = $user->getRoom(); if (!isset($imgmap[$obj])) { $ret .= " @@ -1607,7 +1607,7 @@ function drawmap($map1, $players, $x, $y, $direction) $left = $imgdata[$x][$y]["x"][1]; $top = $imgdata[$x][$y]["y"] + $ht; } - $rrm = $user->room; + $rrm = $user->getRoom(); if (!isset($imgmap[$obj])) { $ret .= " " . ($y == 1 && $x == 3 ? "" : "") . " @@ -1768,7 +1768,7 @@ function drawmap($map1, $players, $x, $y, $direction) } $objInWall = explode('/', $map[3][$wall]); if ($objInWall[1] == "o") { - if ($user->room == 83 && !(!$direction && (($x == 13 && $y == 4) || ($x == 12 && $y == 4)))) { // исключение 2-ух клеток в комнате 82 + if ($user->getRoom() == 83 && !(!$direction && (($x == 13 && $y == 4) || ($x == 12 && $y == 4)))) { // исключение 2-ух клеток в комнате 82 $ret .= drawobject('//' . $objInWall[2], 3, $i); } } @@ -1991,10 +1991,10 @@ progress_update();
room - 1)), 0, 0)); + $dMap = unserialize(mysql_result(mysql_query("SELECT `map` FROM `cavemaps` WHERE `floor` = $floor AND `room` = " . ($user->getRoom() - 1)), 0, 0)); $cPlace = $dMap[$y * 2][$x * 2]; $tmp = explode("/", $cPlace); - if ($user->room == 621) { + if ($user->getRoom() == 621) { if ($floor == 1) { echo 'Проклятый Рудник, 1 этаж'; } elseif ($floor == 2) { diff --git a/ch.php b/ch.php index 8868786..52b5950 100644 --- a/ch.php +++ b/ch.php @@ -4,12 +4,12 @@ use Battles\Template; session_start(); require_once 'functions.php'; - +$user = $user ?? new User($_SESSION['uid']); db::c()->query('UPDATE `online` SET `real_time` = ?i WHERE `id` = ?i', time(), $u->i()['id']); if (isset($_GET['online']) && $_GET['online'] != null) { if ($_GET['room'] && (int)$_GET['room'] < 500) { - $user->room = (int)$_GET['room']; + $user->setRoom($_GET['room']); } if ($u->i()['caveleader'] > 0) { $data = db::c()->query(' @@ -35,13 +35,13 @@ if (isset($_GET['online']) && $_GET['online'] != null) { ORDER BY `u`.`login` '); - $ttl = "" . $rooms[$user->room] . " (" . mysql_num_rows($data) . ")"; + $ttl = "" . $rooms[$user->getRoom()] . " (" . mysql_num_rows($data) . ")"; $ch1 = '_active'; $ch2 = '_passive'; $ch3 = '_passive'; $ch4 = '_passive'; $ch5 = '_passive'; - } elseif ($user->room == 760) { + } elseif ($user->getRoom() == 760) { $forest = db::c()->query('SELECT `id`, `room`, `time`, `user`, `data` FROM `forest` WHERE `user` = "' . $user['id'] . '" LIMIT 1')->fetch_assoc(); $sp = db::c()->query('SELECT `id`, `room`, `user` FROM `forest` WHERE `room` = "' . $forest['room'] . '"'); while ($pl = $sp->fetch_assoc()) { @@ -100,18 +100,18 @@ if (isset($_GET['online']) && $_GET['online'] != null) { WHERE `o`.`id` = `u`.`id` AND (`o`.`date` >= ' . (time() - 90) . ' OR `u`.`in_tower` = 1) AND - `o`.`room` = "' . $user->room . '" + `o`.`room` = "' . $user->getRoom() . '" ORDER BY `u`.`login` '); - $ttl = "" . $rooms[$user->room] . " (" . mysql_num_rows($data) . ")"; + $ttl = "" . $rooms[$user->getRoom()] . " (" . mysql_num_rows($data) . ")"; $ch1 = '_active'; $ch2 = '_passive'; $ch3 = '_passive'; $ch4 = '_passive'; $ch5 = '_passive'; } - Template::header(sprintf('%s (%s)', $rooms[$user->room], mysql_num_rows($data))); + Template::header(sprintf('%s (%s)', $rooms[$user->getRoom()], mysql_num_rows($data))); ?> "; @@ -308,7 +308,7 @@ if (in_array($user->room, Config::$canalenters)) { } $den = mysql_query("SELECT `id` FROM `vxodd` WHERE `glav_id` = '" . $_GET['naw_id'] . "'"); - if (mysql_num_rows($den) >= (in_array($user->room + 1, Config::$caverooms) ? 5 : 4)) { + if (mysql_num_rows($den) >= (in_array($user->getRoom() + 1, Config::$caverooms) ? 5 : 4)) { echo ""; exit(); } @@ -356,7 +356,7 @@ if (in_array($user->room, Config::$canalenters)) { } if ($_GET['start']) { - if (in_array($user->room + 1, Config::$caverooms)) { + if (in_array($user->getRoom() + 1, Config::$caverooms)) { $nc = 1; $locs = []; } @@ -378,8 +378,8 @@ if (in_array($user->room, Config::$canalenters)) { mysql_query("update `users` SET `money` = (`money-$nana[fee]) WHERE `id` = '$esth[id]' LIMIT 1"); $user['money'] += $nana['fee']; $esth['money'] -= $nana['fee']; - adddelo($user['id'], "Персонаж $user[login] получил $nana[fee] кр. за поход по локации \"" . $rooms[$user->room + 1] . "\" от персонажа $esth[login] ($user[money]).", 1); - adddelo($esth['id'], "Персонаж $esth[login] заплатил $nana[fee] кр. за поход по локации \"" . $rooms[$user->room + 1] . "\" персонажу $user[login] ($esth[money]).", 1); + adddelo($user['id'], "Персонаж $user[login] получил $nana[fee] кр. за поход по локации \"" . $rooms[$user->getRoom() + 1] . "\" от персонажа $esth[login] ($user[money]).", 1); + adddelo($esth['id'], "Персонаж $esth[login] заплатил $nana[fee] кр. за поход по локации \"" . $rooms[$user->getRoom() + 1] . "\" персонажу $user[login] ($esth[money]).", 1); } if ($esth['level'] > $level) { $level = $esth['level']; @@ -392,12 +392,12 @@ if (in_array($user->room, Config::$canalenters)) { $vrem = 30 * 60 + time(); $cavedata = Config::$cavedata ?? []; - mysql_query("INSERT INTO `caveparties` SET `user` = '$esth[id]', `leader` = '$user[id]', `login` = '$esth[login]', `shadow` = '0.png', `x` = '" . $cavedata[$user->room + 1]['x1'] . "', `y` = '" . $cavedata[$user->room + 1]['y1'] . "', `dir` = '" . $cavedata[$user->room + 1]['dir1'] . "', `floor` = 1"); - mysql_query("UPDATE `users`, `online` SET " . ($nc ? "`users`.`caveleader` = '$user[id]', " : "") . " `users`.`room` = '" . ($user->room + 1) . "', `online`.`room` = '" . ($user->room + 1) . "' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '" . $esth['id'] . "'"); + mysql_query("INSERT INTO `caveparties` SET `user` = '$esth[id]', `leader` = '$user[id]', `login` = '$esth[login]', `shadow` = '0.png', `x` = '" . $cavedata[$user->getRoom() + 1]['x1'] . "', `y` = '" . $cavedata[$user->getRoom() + 1]['y1'] . "', `dir` = '" . $cavedata[$user->getRoom() + 1]['dir1'] . "', `floor` = 1"); + mysql_query("UPDATE `users`, `online` SET " . ($nc ? "`users`.`caveleader` = '$user[id]', " : "") . " `users`.`room` = '" . ($user->getRoom() + 1) . "', `online`.`room` = '" . ($user->getRoom() + 1) . "' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '" . $esth['id'] . "'"); } if ($nc) { - $r = mysql_query("SELECT * FROM `cavemaps` WHERE `room` = '$user->room'"); + $r = mysql_query("SELECT * FROM `cavemaps` WHERE `room` = '$user->getRoom()'"); while ($rec = mysql_fetch_assoc($r)) { $map = unserialize($rec['map']); foreach ($map as $k => $v) { diff --git a/forest.php b/forest.php index bd68de2..e51ac64 100644 --- a/forest.php +++ b/forest.php @@ -7,7 +7,7 @@ if (empty($_SESSION['uid'])) { exit; } require_once "functions.php"; -if ($user->room == 51) { +if ($user->getRoom() == 51) { header('location: city.php'); exit; } diff --git a/functions.php b/functions.php index 5e61270..3c9a77d 100644 --- a/functions.php +++ b/functions.php @@ -17,7 +17,7 @@ if (empty($_SESSION['uid'])) { $user = new User($_SESSION['uid']); } -if ($user->getId() && $user->block) { +if ($user->getId() && $user->getBlock()) { exit('user blocked!'); } @@ -54,12 +54,12 @@ $fbattleCheckFiles = [ 'zayavka.php', ]; //Может просто отовсюду? О_о -if ($user->battle && in_array(pathinfo(debug_backtrace()[0]['file'])['basename'], $fbattleCheckFiles)) { +if ($user->getBattle() && in_array(pathinfo(debug_backtrace()[0]['file'])['basename'], $fbattleCheckFiles)) { header('location: fbattle.php'); exit; } $towerinCheckFiles = ['main.php', 'city.php', 'tower.php']; -if ($user->in_tower && in_array(pathinfo(debug_backtrace()[0]['file'])['basename'], $towerinCheckFiles)) { +if ($user->getInTower() && in_array(pathinfo(debug_backtrace()[0]['file'])['basename'], $towerinCheckFiles)) { header('location: towerin.php'); exit; } @@ -67,8 +67,8 @@ $roomsCheck = [22, 23, 25, 27, 29, 30, 31, 37, 38, 39, 40, 41, 45, 53, 61, 401, // Если я в одной из этих комнат, // [И] Имя файла который инклюдит файл с проверкой не совпадает с именем файла локации в которой я нахожусь // [И] Номер комнаты который я пытаюсь открыть есть в списке проверяемых -if (in_array($user->room, $roomsCheck) - && pathinfo(debug_backtrace()[0]['file'])['basename'] != Travel::$roomFileName[$user->room] +if (in_array($user->getRoom(), $roomsCheck) + && pathinfo(debug_backtrace()[0]['file'])['basename'] != Travel::$roomFileName[$user->getRoom()] && in_array(array_search(pathinfo(debug_backtrace()[0]['file'])['basename'], Travel::$roomFileName), $roomsCheck)) { header('location: main.php'); exit; @@ -77,7 +77,7 @@ if (in_array($user->room, $roomsCheck) $ip = filter_input(INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP); if (isset($_GET['goto']) && isset($_GET['tStamp']) && isset($_GET['vcode']) && $_GET['vcode'] == md5(sha1($_GET['goto'] . $_GET['tStamp']))) { db::c()->query('UPDATE `users`,`online` SET `users`.`room` = ?i, `online`.`room` = ?i WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $_GET['goto'], $_GET['goto'], $_SESSION['uid']); - $user->room = intval($_GET['goto']); + $user->setRoom(intval($_GET['goto'])); } function createbot($bot, $login = "") @@ -289,9 +289,9 @@ function echoscroll($slot) { global $user; $all_magic = 0; - if ($user->battle) { + if ($user->getBattle()) { $script = 'fbattle'; - $bat = db::c()->query('SELECT `magic` FROM `battle` WHERE `id` = ?i', $user->battle)->fetch_assoc(); + $bat = db::c()->query('SELECT `magic` FROM `battle` WHERE `id` = ?i', $user->getBattle())->fetch_assoc(); $all_magic = unserialize($bat['magic']); } else { $script = 'main'; @@ -792,7 +792,7 @@ function usemagic($id, $target) { global $user; $row = db::c()->query('SELECT * FROM `inventory` WHERE `owner` = ?i AND id = ?i', $user->getId(), $id)->fetch_assoc_array(); - $bat = db::c()->query('SELECT * FROM `battle` WHERE `id` = ?i', $user->battle)->fetch_assoc_array(); + $bat = db::c()->query('SELECT * FROM `battle` WHERE `id` = ?i', $user->getBattle())->fetch_assoc_array(); $all_magic = unserialize($bat['magic']); $charge = 0; $magic = db::c()->query('SELECT * FROM `magic` WHERE `id` = ?i', $row['magic'])->fetch_assoc_array(); @@ -859,8 +859,8 @@ function usemagic($id, $target) $charge = 0; } //ограничение по кол-ву за ход - if ($user->battle > 0) { - $bat = db::c()->query('SELECT * FROM `battle` WHERE `id` = ?i', $user->battle)->fetch_assoc_array(); + if ($user->getBattle()) { + $bat = db::c()->query('SELECT * FROM `battle` WHERE `id` = ?i', $user->getBattle())->fetch_assoc_array(); } if ($bat['magic'] == '') { $all_magic = []; @@ -868,7 +868,7 @@ function usemagic($id, $target) $all_magic = unserialize($bat['magic']); } $all_magic[$user->getId()] += $charge; - db::c()->query('UPDATE `battle` SET `magic`= "?s" WHERE id = ?i', serialize($all_magic), $user->battle); + db::c()->query('UPDATE `battle` SET `magic`= "?s" WHERE id = ?i', serialize($all_magic), $user->getBattle()); } } return false; @@ -878,7 +878,7 @@ function addch($text, $room = 0) { global $user; if ($room == 0) { - $room = $user->room; + $room = $user->getRoom(); } if ($fp = @fopen("tmp/chat.txt", "a")) { //открытие flock($fp, LOCK_EX); //БЛОКИРОВКА ФАЙЛА @@ -894,7 +894,7 @@ function addchp($text, $who, $room = 0) { global $user; if ($room == 0) { - $room = $user->room; + $room = $user->getRoom(); } $fp = fopen("tmp/chat.txt", "a"); //открытие flock($fp, LOCK_EX); //БЛОКИРОВКА ФАЙЛА @@ -942,7 +942,7 @@ function get_meshok() { global $user; $itemsWeight = db::c()->query('SELECT SUM(weight) AS all_weight FROM `inventory` WHERE owner_id = ?i AND on_sale = 0', $_SESSION['uid'])->fetch_assoc(); - return ($user->strength * 4 + $itemsWeight['all_weight']); + return ($user->getStrength() * 4 + $itemsWeight['all_weight']); } /** diff --git a/gotzamok.php b/gotzamok.php index a76bc53..0fadc47 100644 --- a/gotzamok.php +++ b/gotzamok.php @@ -8,29 +8,29 @@ $castleOwners = db::c()->query('SELECT * FROM `clans` WHERE `short` = (SELECT * if ($castleOwners['id'] == $user['klan']) { // если мой клан if ($_GET['goto'] == 'arsenal') { - $user->room = 38; + $user->setRoom(38); } if ($_GET['goto'] == 'home') { - $user->room = 37; + $user->setRoom(37); } if ($_GET['goto'] == 'dvor') { - $user->room = 39; + $user->setRoom(39); } if ($_GET['goto'] == 'master') { - $user->room = 40; + $user->setRoom(40); } if ($_GET['goto'] == 'rest') { - $user->room = 41; + $user->setRoom(41); } if (in_array($_GET['goto'], ['arsenal', 'home', 'dvor', 'master', 'rest'])) { - db::c()->query('UPDATE `users`,`online` SET `users`.`room` = ?i,`online`.`room` = ?i WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $user->room, $user->room, $_SESSION['uid']); + db::c()->query('UPDATE `users`,`online` SET `users`.`room` = ?i,`online`.`room` = ?i WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $user->getRoom(), $user->getRoom(), $user->getId()); header('location: gotzamok.php'); } else { $status = 'В этом замке нет такого места!'; } } -switch ($user->room) { +switch ($user->getRoom()) { case '37' : $backgroundImage = '689_small_550.jpg'; break; @@ -39,8 +39,8 @@ switch ($user->room) { break; } -if ($user->room == 38) { - $glava = db::c()->query('SELECT `glava` FROM `clans` WHERE `short` = "?s"', $user['klan'])->fetch_assoc(); +if ($user->getRoom() == 38) { + $glava = db::c()->query('SELECT owner_id FROM `clans` WHERE `short` = "?s"', $user['klan'])->fetch_assoc(); // возврат шмотки if ($_GET['back']) { $item = db::c()->query('SELECT * FROM `gotzam_arsenal` WHERE `id` = ?i', $_GET['back'])->fetch_assoc(); @@ -63,7 +63,7 @@ if ($user->room == 38) { } } -if ($user->room == 40) { +if ($user->getRoom() == 40) { $at = db::c()->query('SELECT * FROM `variables` WHERE `var` = "?s"', 'gotzam_att')->fetch_assoc(); $def = db::c()->query('SELECT * FROM `variables` WHERE `var` = "?s"', 'gotzam_def')->fetch_assoc(); @@ -107,32 +107,32 @@ if ($castleOwners['id'] == $user['klan']) { ?> - room == 37): ?> + getRoom() == 37): ?>
- room == 38): ?> + getRoom() == 38): ?>
- room == 39): ?> + getRoom() == 39): ?>
- room == 40): ?> + getRoom() == 40): ?>
- room == 41): ?> + getRoom() == 41): ?>
- room == 38): ?> + getRoom() == 38): ?>

Арсенал

@@ -175,7 +175,7 @@ if ($castleOwners['id'] == $user['klan']) { ?> room == 40): ?> + if ($user->getRoom() == 40): ?>

Мастерские

Здесь вы можете улучшить оборонные способности вашего замка. @@ -192,7 +192,7 @@ if ($castleOwners['id'] == $user['klan']) { ?>
room == 41): ?> + if ($user->getRoom() == 41): ?>

Комнаты отдыха

Посиди в тишине, внутри стен. Тут нет врагов. Тут спокойно. diff --git a/lab.php b/lab.php index 13db79f..58a40e0 100644 --- a/lab.php +++ b/lab.php @@ -18,7 +18,7 @@ $u_res = mysql_fetch_array(mysql_query("select * from `lab_user` where `id_user` room) . "';")); +$room = mysql_fetch_array(mysql_query("SELECT * FROM `lab_rooms` WHERE `id` = '" . mysql_real_escape_string($user->getRoom()) . "';")); if ($_GET['healall'] == 1) { $cost = $_GET['cost']; @@ -124,7 +124,7 @@ if ($_GET['mobkill'] == 1) { } $rand_hp1 = rand(1, 10); $rand_hp = $rand_hp1 * $user['level']; - $bot = mysql_fetch_array(mysql_query("select * from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->room . "' LIMIT 1")); + $bot = mysql_fetch_array(mysql_query("select * from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->getRoom() . "' LIMIT 1")); $hels = $bot['bot_hp'] - $rand_hp; if ($hels < 0) { echo "Вы убили моба!
"; @@ -135,11 +135,11 @@ if ($_GET['mobkill'] == 1) { echo "Вы получили 1 записку!
"; Mysql_query("update `lab_user` set `zad" . $u_res['zadanie'] . "_kol`=`zad" . $u_res['zadanie'] . "_kol`+'1' where `id_user`='" . $user['id'] . "'"); } - mysql_query("delete from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->room . "' LIMIT 1"); + mysql_query("delete from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->getRoom() . "' LIMIT 1"); //если просто убивалка } else { Mysql_query("update `lab_user` set `zad" . $u_res['zadanie'] . "_kol`=`zad" . $u_res['zadanie'] . "_kol`+'1' where `id_user`='" . $user['id'] . "'"); - mysql_query("delete from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->room . "' LIMIT 1"); + mysql_query("delete from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->getRoom() . "' LIMIT 1"); } } else { echo "Вы отняли у моба -" . $rand_hp . " HP!
"; @@ -177,7 +177,7 @@ if ($_GET['exit'] && $room['exit'] == 1) { if ($_GET['get']) { $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($_GET['get']) . "' AND `id_user`='" . $user['id'] . "';")); - if ($data['id_room'] == $user->room) { + if ($data['id_room'] == $user->getRoom()) { switch ($data['type']) { case 1: @@ -241,13 +241,13 @@ if ($_GET['get']) { if ($_GET['drop']) { $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_tmp` WHERE `id` = '" . mysql_real_escape_string($_GET['drop']) . "' AND `id_user`='" . $user['id'] . "';")); mysql_query("DELETE FROM `lab_tmp` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;"); - mysql_query("INSERT INTO `lab_inv` (`id_room`,`type`,`value`,`id_user`) values ('" . mysql_real_escape_string($user->room) . "','" . mysql_real_escape_string($data['type']) . "','" . mysql_real_escape_string($data['value']) . "','" . mysql_real_escape_string($user['id']) . "');"); + mysql_query("INSERT INTO `lab_inv` (`id_room`,`type`,`value`,`id_user`) values ('" . mysql_real_escape_string($user->getRoom()) . "','" . mysql_real_escape_string($data['type']) . "','" . mysql_real_escape_string($data['value']) . "','" . mysql_real_escape_string($user['id']) . "');"); unset($data); } if ($_GET['nal1']) { $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '" . mysql_real_escape_string($_GET['nal1']) . "' AND `id_user`='" . $user['id'] . "';")); - if ($data['id_room'] == $user->room) { + if ($data['id_room'] == $user->getRoom()) { $sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='1';")); mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='1';"); mysql_query("UPDATE `users` SET `money` = `money`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); @@ -259,7 +259,7 @@ if ($_GET['nal1']) { if ($_GET['nal2']) { $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '" . mysql_real_escape_string($_GET['nal2']) . "' AND `id_user`='" . $user['id'] . "';")); - if ($data['id_room'] == $user->room) { + if ($data['id_room'] == $user->getRoom()) { $sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='3';")); mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='3';"); mysql_query("UPDATE `users` SET `doblest` = `doblest`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); @@ -271,7 +271,7 @@ if ($_GET['nal2']) { if ($_GET['nal3']) { $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '" . mysql_real_escape_string($_GET['nal3']) . "' AND `id_user`='" . $user['id'] . "';")); - if ($data['id_room'] == $user->room) { + if ($data['id_room'] == $user->getRoom()) { $sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='8';")); mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='8';"); mysql_query("UPDATE `bank` SET `ekr` = `ekr`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); @@ -283,7 +283,7 @@ if ($_GET['nal3']) { if ($_GET['nal4']) { $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '" . mysql_real_escape_string($_GET['nal4']) . "' AND `id_user`='" . $user['id'] . "';")); - if ($data['id_room'] == $user->room) { + if ($data['id_room'] == $user->getRoom()) { $sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='9';")); mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='9';"); mysql_query("UPDATE `users` SET `exp` = `exp`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); @@ -299,28 +299,28 @@ if ($_GET['go']) { switch ($_GET['go']) { case "p1": mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p1']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); - $user->room = $room['p1']; + $user->setRoom($room['p1']); $_SESSION['time'] = time(); break; case "p2": mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p2']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); - $user->room = $room['p2']; + $user->setRoom($room['p2']); $_SESSION['time'] = time(); break; case "p3": mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p3']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); - $user->room = $room['p3']; + $user->setRoom($room['p3']); $_SESSION['time'] = time(); break; case "p4": mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p4']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); - $user->room = $room['p4']; + $user->setRoom($room['p4']); $_SESSION['time'] = time(); break; } } -$room = mysql_fetch_array(mysql_query("SELECT * FROM `lab_rooms` WHERE `id` = '" . mysql_real_escape_string($user->room) . "';")); +$room = mysql_fetch_array(mysql_query("SELECT * FROM `lab_rooms` WHERE `id` = '" . mysql_real_escape_string($user->getRoom()) . "';")); if ($user['hp'] <= 0) { mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '" . $user['id'] . "'"); @@ -335,12 +335,12 @@ if ($user['hp'] <= 0) { } -$data = mysql_query("SELECT * FROM `lab_inv` WHERE `id_room` = '" . mysql_real_escape_string($user->room) . "' AND `id_user`='" . $user['id'] . "';"); +$data = mysql_query("SELECT * FROM `lab_inv` WHERE `id_room` = '" . mysql_real_escape_string($user->getRoom()) . "' AND `id_user`='" . $user['id'] . "';"); $data2 = mysql_query("SELECT * FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "';"); $data3 = mysql_query("SELECT * FROM `users` WHERE `lab` = 1 AND `room` = '" . mysql_real_escape_string($room['id']) . "';"); $data4 = mysql_query("SELECT * FROM `lab_bots` WHERE `id_room` = '" . mysql_real_escape_string($room['id']) . "' AND `id_user`='" . $user['id'] . "';"); -$roow = mysql_fetch_array(mysql_query("SELECT * FROM `lab_trap` WHERE `id_room` = '" . mysql_real_escape_string($user->room) . "' AND `id_user`='" . $user['id'] . "';")); +$roow = mysql_fetch_array(mysql_query("SELECT * FROM `lab_trap` WHERE `id_room` = '" . mysql_real_escape_string($user->getRoom()) . "' AND `id_user`='" . $user['id'] . "';")); if ($roow[0]) { $msg .= 'В комнате была установлена ловушка...
'; @@ -390,7 +390,7 @@ for ($i = 0; $i < mysql_num_rows($log); $i++) { } -echo "" . $room['name'] . " (" . $user->room . ")"; +echo "" . $room['name'] . " (" . $user->getRoom() . ")"; echo " "; $u_lab = mysql_query("select `login` from `users` where `lab`='1' and `bot`!='1'"); $u_lab_kol = mysql_num_rows($u_lab); diff --git a/lab2.php b/lab2.php index 395a970..f03e7e1 100644 --- a/lab2.php +++ b/lab2.php @@ -16,7 +16,7 @@ $u_res = mysql_fetch_array(mysql_query("select * from `lab_user` where `id_user` setTimeout("document.all['b1'].disabled=false;document.all['b2'].disabled=false;document.all['b3'].disabled=false;document.all['b4'].disabled=false;", 000); room) . "';")); +$room = mysql_fetch_array(mysql_query("SELECT * FROM `lab_rooms` WHERE `id` = '" . mysql_real_escape_string($user->getRoom()) . "';")); if ($_GET['healall'] == 1) { $cost = $_GET['cost']; @@ -122,7 +122,7 @@ if ($_GET['mobkill'] == 1) { } $rand_hp1 = rand(1, 10); $rand_hp = $rand_hp1 * $user['level']; - $bot = mysql_fetch_array(mysql_query("select * from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->room . "' LIMIT 1")); + $bot = mysql_fetch_array(mysql_query("select * from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->getRoom() . "' LIMIT 1")); $hels = $bot['bot_hp'] - $rand_hp; if ($hels < 0) { echo "Вы убили моба!
"; @@ -133,11 +133,11 @@ if ($_GET['mobkill'] == 1) { echo "Вы получили 1 записку!
"; Mysql_query("update `lab_user` set `zad" . $u_res['zadanie'] . "_kol`=`zad" . $u_res['zadanie'] . "_kol`+'1' where `id_user`='" . $user['id'] . "'"); } - mysql_query("delete from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->room . "' LIMIT 1"); + mysql_query("delete from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->getRoom() . "' LIMIT 1"); //если просто убивалка } else { Mysql_query("update `lab_user` set `zad" . $u_res['zadanie'] . "_kol`=`zad" . $u_res['zadanie'] . "_kol`+'1' where `id_user`='" . $user['id'] . "'"); - mysql_query("delete from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->room . "' LIMIT 1"); + mysql_query("delete from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->getRoom() . "' LIMIT 1"); } } else { echo "Вы отняли у моба -" . $rand_hp . " HP!
"; @@ -175,7 +175,7 @@ if ($_GET['exit'] && $room['exit'] == 1) { if ($_GET['get']) { $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($_GET['get']) . "' AND `id_user`='" . $user['id'] . "';")); - if ($data['id_room'] == $user->room) { + if ($data['id_room'] == $user->getRoom()) { switch ($data['type']) { case 1: @@ -239,13 +239,13 @@ if ($_GET['get']) { if ($_GET['drop']) { $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_tmp` WHERE `id` = '" . mysql_real_escape_string($_GET['drop']) . "' AND `id_user`='" . $user['id'] . "';")); mysql_query("DELETE FROM `lab_tmp` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;"); - mysql_query("INSERT INTO `lab_inv` (`id_room`,`type`,`value`,`id_user`) values ('" . mysql_real_escape_string($user->room) . "','" . mysql_real_escape_string($data['type']) . "','" . mysql_real_escape_string($data['value']) . "','" . mysql_real_escape_string($user['id']) . "');"); + mysql_query("INSERT INTO `lab_inv` (`id_room`,`type`,`value`,`id_user`) values ('" . mysql_real_escape_string($user->getRoom()) . "','" . mysql_real_escape_string($data['type']) . "','" . mysql_real_escape_string($data['value']) . "','" . mysql_real_escape_string($user['id']) . "');"); unset($data); } if ($_GET['nal1']) { $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '" . mysql_real_escape_string($_GET['nal1']) . "' AND `id_user`='" . $user['id'] . "';")); - if ($data['id_room'] == $user->room) { + if ($data['id_room'] == $user->getRoom()) { $sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='1';")); mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='1';"); mysql_query("UPDATE `users` SET `money` = `money`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); @@ -257,7 +257,7 @@ if ($_GET['nal1']) { if ($_GET['nal2']) { $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '" . mysql_real_escape_string($_GET['nal2']) . "' AND `id_user`='" . $user['id'] . "';")); - if ($data['id_room'] == $user->room) { + if ($data['id_room'] == $user->getRoom()) { $sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='3';")); mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='3';"); mysql_query("UPDATE `users` SET `patriotizm` = `patriotizm`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); @@ -269,7 +269,7 @@ if ($_GET['nal2']) { if ($_GET['nal3']) { $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '" . mysql_real_escape_string($_GET['nal3']) . "' AND `id_user`='" . $user['id'] . "';")); - if ($data['id_room'] == $user->room) { + if ($data['id_room'] == $user->getRoom()) { $sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='8';")); mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='8';"); mysql_query("UPDATE `bank` SET `ekr` = `ekr`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); @@ -281,7 +281,7 @@ if ($_GET['nal3']) { if ($_GET['nal4']) { $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '" . mysql_real_escape_string($_GET['nal4']) . "' AND `id_user`='" . $user['id'] . "';")); - if ($data['id_room'] == $user->room) { + if ($data['id_room'] == $user->getRoom()) { $sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='9';")); mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='9';"); mysql_query("UPDATE `users` SET `exp` = `exp`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); @@ -297,28 +297,28 @@ if ($_GET['go']) { switch ($_GET['go']) { case "p1": mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p1']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); - $user->room = $room['p1']; + $user->setRoom($room['p1']); $_SESSION['time'] = time(); break; case "p2": mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p2']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); - $user->room = $room['p2']; + $user->setRoom($room['p2']); $_SESSION['time'] = time(); break; case "p3": mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p3']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); - $user->room = $room['p3']; + $user->setRoom($room['p3']); $_SESSION['time'] = time(); break; case "p4": mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p4']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';"); - $user->room = $room['p4']; + $user->setRoom($room['p4']); $_SESSION['time'] = time(); break; } } -$room = mysql_fetch_array(mysql_query("SELECT * FROM `lab_rooms` WHERE `id` = '" . mysql_real_escape_string($user->room) . "';")); +$room = mysql_fetch_array(mysql_query("SELECT * FROM `lab_rooms` WHERE `id` = '" . mysql_real_escape_string($user->getRoom()) . "';")); if ($user['hp'] <= 0) { mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '" . $user['id'] . "'"); @@ -333,12 +333,12 @@ if ($user['hp'] <= 0) { } -$data = mysql_query("SELECT * FROM `lab_inv` WHERE `id_room` = '" . mysql_real_escape_string($user->room) . "' AND `id_user`='" . $user['id'] . "';"); +$data = mysql_query("SELECT * FROM `lab_inv` WHERE `id_room` = '" . mysql_real_escape_string($user->getRoom()) . "' AND `id_user`='" . $user['id'] . "';"); $data2 = mysql_query("SELECT * FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "';"); $data3 = mysql_query("SELECT * FROM `users` WHERE `lab` = 1 AND `room` = '" . mysql_real_escape_string($room['id']) . "';"); $data4 = mysql_query("SELECT * FROM `lab_bots` WHERE `id_room` = '" . mysql_real_escape_string($room['id']) . "' AND `id_user`='" . $user['id'] . "';"); -$roow = mysql_fetch_array(mysql_query("SELECT * FROM `lab_trap` WHERE `id_room` = '" . mysql_real_escape_string($user->room) . "' AND `id_user`='" . $user['id'] . "';")); +$roow = mysql_fetch_array(mysql_query("SELECT * FROM `lab_trap` WHERE `id_room` = '" . mysql_real_escape_string($user->getRoom()) . "' AND `id_user`='" . $user['id'] . "';")); if ($roow[0]) { $msg .= 'В комнате была установлена ловушка...
'; @@ -388,7 +388,7 @@ for ($i = 0; $i < mysql_num_rows($log); $i++) { } -echo "" . $room['name'] . " (" . $user->room . ")"; +echo "" . $room['name'] . " (" . $user->getRoom() . ")"; echo " "; $u_lab = mysql_query("select `login` from `users` where `lab`='1' and `bot`!='1'"); $u_lab_kol = mysql_num_rows($u_lab); diff --git a/lab_enter.php b/lab_enter.php index e2bfabd..bbfc7ad 100644 --- a/lab_enter.php +++ b/lab_enter.php @@ -308,7 +308,7 @@ Template::header('Вход в Лабиринты');
admin) { + if ($user->getAdmin()) { mysql_query('UPDATE `laba_zv` SET `com` = "" WHERE `id` = "' . (int)$_GET['del_com'] . '" LIMIT 1'); $re = 'Комментарий удалён'; } else { @@ -400,7 +400,7 @@ while ($pl = mysql_fetch_array($sp)) { } $userszv = ltrim($userszv, ', '); if ($pl['com'] != '') { - if ($user->admin) { + if ($user->getAdmin()) { $del = '
Удалить комментарий'; } else { $del = ''; diff --git a/magic/attack.php b/magic/attack.php index acf1ff1..9dc94f6 100644 --- a/magic/attack.php +++ b/magic/attack.php @@ -36,7 +36,7 @@ if ($user['battle'] > 0) { echo "Персонаж тяжело травмирован..."; } elseif ($user['klan'] != '' && ($user['klan'] == $us['klan'])) { echo "Чтите честь ваших сокланов."; -} elseif ($user->room != $us['room']) { +} elseif ($user->getRoom() != $us['room']) { echo "Персонаж в другой комнате!"; } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] ==603 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] ==45) { echo "Нападения в этой локации запрещены!"; @@ -95,7 +95,7 @@ if ($user['battle'] > 0) { } else { $ttt = 1; } - addch ("".Nick::id($user['id'])->short()." вмешался в поединок »». ",$user->room); + addch ("".Nick::id($user['id'])->short()." вмешался в поединок »». ",$user->getRoom()); //mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\''.date("H:i").' '.nick::id($user['id'])->short().' вмешался в поединок!
\') WHERE `id` = '.$jert['battle'].''); @@ -158,7 +158,7 @@ if ($user['battle'] > 0) { $rr = "".Nick::id($user['id'])->full(1)." и ".Nick::id($jert['id'])->full(1).""; - addch ("Бой между ".Nick::id($user['id'])->short()." и ".Nick::id($jert['id'])->short()." начался. ",$user->room); + addch ("Бой между ".Nick::id($user['id'])->short()." и ".Nick::id($jert['id'])->short()." начался. ",$user->getRoom()); //mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}',"Часы показывали ".date("Y.m.d H.i").", когда ".$rr." бросили вызов друг другу.
"); diff --git a/magic/attack_blood.php b/magic/attack_blood.php index 7eea3c6..8742215 100644 --- a/magic/attack_blood.php +++ b/magic/attack_blood.php @@ -32,7 +32,7 @@ if($vip['bloodattack'] <= 0) { echo "Персонаж тяжело травмирован..."; } elseif($user['klan'] != '' && ($user['klan'] == $us['klan'])) { echo "Чтите честь ваших сокланов."; -} elseif($user->room != $us['room']) { +} elseif($user->getRoom() != $us['room']) { echo "Персонаж в другой комнате!"; } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] == 45) { echo "Нападения в этой локации запрещены!"; @@ -82,7 +82,7 @@ if($vip['bloodattack'] <= 0) { $ttt = 1; } - addch("".$los." вмешался в поединок »».", $user->room); + addch("".$los." вмешался в поединок »».", $user->getRoom()); if($user['invis'] == 1) { $lod = 'невидимка'; } else { $lod = Nick::id($user['id'])->short(); } addlog($jert['battle'], ''.date("H:i").' '.$lod.' вмешался в поединок!
'); mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'` = CONCAT(`t'.$ttt.'`,\';'.$user['id'].'\'), `blood` = 1 WHERE `id` = "'.$jert['battle'].'" LIMIT 1'); @@ -121,7 +121,7 @@ if($vip['bloodattack'] <= 0) { $ld = Nick::id($user['id'])->full(1); $lds = Nick::id($user['id'])->short(); $rr = "".$ld." и ".Nick::id($jert['id'])->full(1).""; - addch("Бой между ".$lds." и ".Nick::id($jert['id'])->short()." начался.", $user->room); + addch("Бой между ".$lds." и ".Nick::id($jert['id'])->short()." начался.", $user->getRoom()); addlog($id, "Часы показывали ".date("Y.m.d H.i").", когда ".$rr." бросили вызов друг другу.
"); mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$user['id']} OR `id` = {$jert['id']}"); header("Location: fbattle.php"); diff --git a/magic/attack_t.php b/magic/attack_t.php index c9553e5..52b0377 100644 --- a/magic/attack_t.php +++ b/magic/attack_t.php @@ -39,7 +39,7 @@ elseif (!$us['online']) { echo "Чтите честь ваших сокланов."; } elseif ($user['align'] >1 && $user['align'] <2 && $us['align'] >1 && $us['align'] <2) { echo "Чтите честь братьев."; -} elseif ($user->room != $us['room']) { +} elseif ($user->getRoom() != $us['room']) { echo "Персонаж в другой комнате!"; } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] ==45) { echo "Нападения в этой локации запрещены!"; @@ -106,7 +106,7 @@ elseif (!$us['online']) { } else { $ttt = 1; } - addch ("".Nick::id($user['id'])->short()." вмешался в поединок »». ",$user->room); + addch ("".Nick::id($user['id'])->short()." вмешался в поединок »». ",$user->getRoom()); //mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\''.date("H:i").' '.nick::id($user['id'])->short().' вмешался в поединок!
\') WHERE `id` = '.$jert['battle'].''); @@ -169,7 +169,7 @@ elseif (!$us['online']) { $rr = "".Nick::id($user['id'])->full(1)." и ".Nick::id($jert['id'])->full(1).""; - addch ("Бой между ".Nick::id($user['id'])->short()." и ".Nick::id($jert['id'])->short()." начался. ",$user->room); + addch ("Бой между ".Nick::id($user['id'])->short()." и ".Nick::id($jert['id'])->short()." начался. ",$user->getRoom()); //mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали ".date("Y.m.d H.i").", когда ".$rr." бросили вызов друг другу.
');"); addlog($id,"Часы показывали ".date("Y.m.d H.i").", когда ".$rr." бросили вызов друг другу.
"); diff --git a/magic/attackbot.php b/magic/attackbot.php index 57d6cb0..2273213 100644 --- a/magic/attackbot.php +++ b/magic/attackbot.php @@ -61,7 +61,7 @@ if ($user['battle'] > 0) { } else { $ttt = 1; } - addch ("".Nick::id($user['id'])->short()." вмешался в поединок »». ",$user->room); + addch ("".Nick::id($user['id'])->short()." вмешался в поединок »». ",$user->getRoom()); //mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\''.date("H:i").' '.nick::id($user['id'])->short().' вмешался в поединок!
\') WHERE `id` = '.$jert['battle'].''); diff --git a/magic/attackk.php b/magic/attackk.php index 06b131a..a4ac153 100644 --- a/magic/attackk.php +++ b/magic/attackk.php @@ -32,7 +32,7 @@ if ($user['battle'] > 0) { echo "Персонаж под защитой от нападений ..."; } elseif ($owntravma['id'] && !$us['battle']) { echo "Персонаж тяжело травмирован..."; -} elseif ($user->room != $us['room']) { +} elseif ($user->getRoom() != $us['room']) { echo "Персонаж в другой комнате!"; } elseif ($us['level'] < 1) { echo "Новички находятся под защитой Мироздателя!"; @@ -81,7 +81,7 @@ if ($user['battle'] > 0) { } else { $ttt = 1; } - addch("" . Nick::id($user['id'])->short() . " вмешался в поединок »». ", $user->room); + addch("" . Nick::id($user['id'])->short() . " вмешался в поединок »». ", $user->getRoom()); //mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\''.date("H:i").' '.nick::id($user['id'])->short().' вмешался в поединок!
\') WHERE `id` = '.$jert['battle'].''); @@ -146,7 +146,7 @@ if ($user['battle'] > 0) { $rr = "" . Nick::id($user['id'])->full(1) . " и " . Nick::id($jert['id'])->full(1) . ""; - addch("Бой между " . Nick::id($user['id'])->short() . " и " . Nick::id($jert['id'])->short() . " начался. ", $user->room); + addch("Бой между " . Nick::id($user['id'])->short() . " и " . Nick::id($jert['id'])->short() . " начался. ", $user->getRoom()); //mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}',"Часы показывали ".date("Y.m.d H.i").", когда ".$rr." бросили вызов друг другу.
"); diff --git a/magic/attackk_close.php b/magic/attackk_close.php index 7db87e6..4211c78 100644 --- a/magic/attackk_close.php +++ b/magic/attackk_close.php @@ -39,7 +39,7 @@ elseif (!$us['online']) { echo "Персонаж под защитой от нападений ..."; } elseif ($owntravma['id'] && !$us['battle']) { echo "Персонаж тяжело травмирован..."; -} elseif ($user->room != $us['room']) { +} elseif ($user->getRoom() != $us['room']) { echo "Персонаж в другой комнате!"; } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] ==45) { echo "Нападения в этой локации запрещены!"; @@ -133,7 +133,7 @@ elseif (!$us['online']) { $rr = "".Nick::id($user['id'])->full(1)." и ".Nick::id($jert['id'])->full(1).""; - addch ("Бой между ".Nick::id($user['id'])->short()." и ".Nick::id($jert['id'])->short()." начался. ",$user->room); + addch ("Бой между ".Nick::id($user['id'])->short()." и ".Nick::id($jert['id'])->short()." начался. ",$user->getRoom()); //mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}',"Часы показывали ".date("Y.m.d H.i").", когда ".$rr." бросили вызов друг другу.
"); diff --git a/magic/attackk_open.php b/magic/attackk_open.php index 372e0a7..4fee63f 100644 --- a/magic/attackk_open.php +++ b/magic/attackk_open.php @@ -39,7 +39,7 @@ if ($user['battle'] > 0) { echo "Вы ожидаете поединка..."; } elseif ($owntravma['id'] && !$us['battle']) { echo "Персонаж тяжело травмирован..."; -} elseif ($user->room != $us['room']) { +} elseif ($user->getRoom() != $us['room']) { echo "Персонаж в другой комнате!"; } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] ==45) { echo "Нападения в этой локации запрещены!"; @@ -133,7 +133,7 @@ if ($user['battle'] > 0) { $rr = "".Nick::id($user['id'])->full(1)." и ".Nick::id($jert['id'])->full(1).""; - addch ("Бой между ".Nick::id($user['id'])->short()." и ".Nick::id($jert['id'])->short()." начался. ",$user->room); + addch ("Бой между ".Nick::id($user['id'])->short()." и ".Nick::id($jert['id'])->short()." начался. ",$user->getRoom()); //mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}',"Часы показывали ".date("Y.m.d H.i").", когда ".$rr." бросили вызов друг другу.
"); diff --git a/magic/battack.php b/magic/battack.php index a5d137b..60b77ae 100644 --- a/magic/battack.php +++ b/magic/battack.php @@ -39,7 +39,7 @@ elseif (!$us['online']) { echo "Чтите честь ваших сокланов."; } elseif ($user['align'] >1 && $user['align'] <2 && $us['align'] >1 && $us['align'] <2) { echo "Чтите честь братьев."; -} elseif ($user->room != $us['room']) { +} elseif ($user->getRoom() != $us['room']) { echo "Персонаж в другой комнате!"; } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] ==45) { echo "Нападения в этой локации запрещены!"; @@ -106,7 +106,7 @@ elseif (!$us['online']) { } else { $ttt = 1; } - addch ("".Nick::id($user['id'])->short()." вмешался в поединок »». ",$user->room); + addch ("".Nick::id($user['id'])->short()." вмешался в поединок »». ",$user->getRoom()); //mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\''.date("H:i").' '.nick::id($user['id'])->short().' вмешался в поединок!
\') WHERE `id` = '.$jert['battle'].''); @@ -169,7 +169,7 @@ elseif (!$us['online']) { $rr = "".Nick::id($user['id'])->full(1)." и ".Nick::id($jert['id'])->full(1).""; - addch ("Бой между ".Nick::id($user['id'])->short()." и ".Nick::id($jert['id'])->short()." начался. ",$user->room); + addch ("Бой между ".Nick::id($user['id'])->short()." и ".Nick::id($jert['id'])->short()." начался. ",$user->getRoom()); //mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали ".date("Y.m.d H.i").", когда ".$rr." бросили вызов друг другу.
');"); addlog($id,"Часы показывали ".date("Y.m.d H.i").", когда ".$rr." бросили вызов друг другу.
"); diff --git a/magic/bexit.php b/magic/bexit.php index 577d4bc..8190e2d 100644 --- a/magic/bexit.php +++ b/magic/bexit.php @@ -9,7 +9,7 @@ $raid_t = mysql_fetch_array(mysql_query("SELECT * FROM variables WHERE var='raid if ($user['battle'] == 0) { echo "Это боевая магия..."; -} elseif ($user->room == 600 || $user->room == 601 || $user->room == 602 || $us['room'] == 43 || $us['room'] == 45) { +} elseif ($user->getRoom() == 600 || $user->getRoom() == 601 || $user->getRoom() == 602 || $us['room'] == 43 || $us['room'] == 45) { echo "В этой локации выход из боя запрещен!"; } elseif ($user['battle'] == $raid_t['value']) { echo "Вы защищаете весь город, а не только себя. Победа или смерть!"; diff --git a/magic/brat.php b/magic/brat.php index d9d0936..2838264 100644 --- a/magic/brat.php +++ b/magic/brat.php @@ -24,7 +24,7 @@ elseif ($user['zayavka'] > 0) { } elseif ($us['align']!=3) { echo "Персонаж не с темной склонностью!"; -} elseif ($user->room != $us['room']) { +} elseif ($user->getRoom() != $us['room']) { echo "Персонаж в другой комнате!"; } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] ==45) { echo "Нападения в этой локации запрещены!"; @@ -78,7 +78,7 @@ elseif ($user['zayavka'] > 0) { } else { $ttt = 2; } - addch ("".Nick::id($user['id'])->short()." вмешался в поединок »». ",$user->room); + addch ("".Nick::id($user['id'])->short()." вмешался в поединок »». ",$user->getRoom()); //mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\''.date("H:i").' '.nick::id($user['id'])->short().' вмешался в поединок!
\') WHERE `id` = '.$jert['battle'].''); @@ -142,7 +142,7 @@ elseif ($user['zayavka'] > 0) { $rr = "".Nick::id($user['id'])->full(1)." и ".Nick::id($jert['id'])->full(1).""; - addch ("Бой между ".Nick::id($user['id'])->short()." и ".Nick::id($jert['id'])->short()." начался. ",$user->room); + addch ("Бой между ".Nick::id($user['id'])->short()." и ".Nick::id($jert['id'])->short()." начался. ",$user->getRoom()); //mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}',"Часы показывали ".date("Y.m.d H.i").", когда ".$rr." бросили вызов друг другу.
"); diff --git a/magic/cityattack.php b/magic/cityattack.php index 9206970..4c0a7c3 100644 --- a/magic/cityattack.php +++ b/magic/cityattack.php @@ -1,5 +1,5 @@ room == 20) { +if ($user->getRoom() == 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->getRoom() != $us['room']) { echo "Персонаж в другой комнате!"; } elseif ($us['level'] < 3) { echo "Нельзя напасть на персонажа ниже 3 уровня! Даже ночью, даже на Центральной площади..."; @@ -61,7 +61,7 @@ if ($user->room == 20) { } else { $ttt = 1; } - addch("" . Nick::id($user['id'])->short() . " вмешался в поединок »». ", $user->room); + addch("" . Nick::id($user['id'])->short() . " вмешался в поединок »». ", $user->getRoom()); //mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\''.date("H:i").' '.nick::id($user['id'])->short().' вмешался в поединок!
\') WHERE `id` = '.$jert['battle'].''); @@ -125,7 +125,7 @@ if ($user->room == 20) { $rr = "" . Nick::id($user['id'])->full(1) . " и " . Nick::id($jert['id'])->full(1) . ""; - addch("Бой между " . Nick::id($user['id'])->short() . " и " . Nick::id($jert['id'])->short() . " начался. ", $user->room); + addch("Бой между " . Nick::id($user['id'])->short() . " и " . Nick::id($jert['id'])->short() . " начался. ", $user->getRoom()); //mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}',"Часы показывали ".date("Y.m.d H.i").", когда ".$rr." бросили вызов друг другу.
"); diff --git a/magic/cpattack.php b/magic/cpattack.php index 47f53d6..9059c4d 100644 --- a/magic/cpattack.php +++ b/magic/cpattack.php @@ -51,7 +51,7 @@ elseif (!$us['online']) { echo "Вы ожидаете поединка..."; } elseif ($owntravma['id'] && !$us['battle']) { echo "Персонаж тяжело травмирован..."; -} elseif ($user->room != $us['room']) { +} elseif ($user->getRoom() != $us['room']) { echo "Персонаж в другой комнате!"; } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] ==45) { echo "Нападения в этой локации запрещены!"; @@ -106,7 +106,7 @@ elseif (!$us['online']) { } else { $ttt = 1; } - addch ("".Nick::id($user['id'])->short()." вмешался в поединок »». ",$user->room); + addch ("".Nick::id($user['id'])->short()." вмешался в поединок »». ",$user->getRoom()); //mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\''.date("H:i").' '.nick::id($user['id'])->short().' вмешался в поединок!
\') WHERE `id` = '.$jert['battle'].''); @@ -169,7 +169,7 @@ elseif (!$us['online']) { $rr = "".Nick::id($user['id'])->full(1)." и ".Nick::id($jert['id'])->full(1).""; - addch ("Бой между ".Nick::id($user['id'])->short()." и ".Nick::id($jert['id'])->short()." начался. ",$user->room); + addch ("Бой между ".Nick::id($user['id'])->short()." и ".Nick::id($jert['id'])->short()." начался. ",$user->getRoom()); //mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали ".date("Y.m.d H.i").", когда ".$rr." бросили вызов друг другу.
');"); diff --git a/magic/defence.php b/magic/defence.php index 4a989fd..9c7e040 100644 --- a/magic/defence.php +++ b/magic/defence.php @@ -13,7 +13,7 @@ if ($user['battle'] > 0) {echo "Не в бою...";} elseif ($user['level'] < 4) { echo "Вашего уровня не достаточно для использования этого заклинания!"; } elseif ($us['level'] < 4) { echo "Запрещено применять на персонажей до 4 уровня!"; } elseif ($effect['time']) {echo "На персонаже уже есть заклятие Защита от Оружия"; } -elseif ($user->room != $us['room']) { echo "Персонаж в другой комнате!"; } +elseif ($user->getRoom() != $us['room']) { echo "Персонаж в другой комнате!"; } elseif (!$us['online']) {echo "Персонаж не в игре!";} elseif (rand(1,100) < $int) { diff --git a/magic/devastate.php b/magic/devastate.php index 0dbbb65..bef799f 100644 --- a/magic/devastate.php +++ b/magic/devastate.php @@ -14,7 +14,7 @@ if ($user['battle'] > 0) {echo "Не в бою...";} elseif ($user['level'] < 4) { echo "Вашего уровня не достаточно для использования этого заклинания!"; } elseif ($us['level'] < 4) { echo "Запрещено применять на персонажей до 4 уровня!"; } elseif ($effect['time']) {echo "На персонаже уже есть заклятие Сокрушение"; } -elseif ($user->room != $us['room']) { echo "Персонаж в другой комнате!"; } +elseif ($user->getRoom() != $us['room']) { echo "Персонаж в другой комнате!"; } elseif (!$us['online']) {echo "Персонаж не в игре!";} elseif (rand(1,100) < $int) { diff --git a/magic/eattack.php b/magic/eattack.php index b14f2cd..e055bba 100644 --- a/magic/eattack.php +++ b/magic/eattack.php @@ -46,7 +46,7 @@ elseif ($user['zayavka'] > 0) { echo "Чтите честь ваших сокланов."; } elseif ($user['align'] >1 && $user['align'] <2 && $us['align'] >1 && $us['align'] <2) { echo "Чтите честь братьев."; -} elseif ($user->room != $us['room']) { +} elseif ($user->getRoom() != $us['room']) { echo "Персонаж в другой комнате!"; } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] ==45) { echo "Нападения в этой локации запрещены!"; @@ -111,7 +111,7 @@ elseif ($user['zayavka'] > 0) { } else { $ttt = 1; } - addch ("".Nick::id($user['id'])->short()." вмешался в поединок »». ",$user->room); + addch ("".Nick::id($user['id'])->short()." вмешался в поединок »». ",$user->getRoom()); //mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\''.date("H:i").' '.nick::id($user['id'])->short().' вмешался в поединок!
\') WHERE `id` = '.$jert['battle'].''); @@ -182,7 +182,7 @@ $outok=1; $rr = "".Nick::id($user['id'])->full(1)." и ".Nick::id($jert['id'])->full(1).""; - addch ("Бой между ".Nick::id($user['id'])->short()." и ".Nick::id($jert['id'])->short()." начался. ",$user->room); + addch ("Бой между ".Nick::id($user['id'])->short()." и ".Nick::id($jert['id'])->short()." начался. ",$user->getRoom()); //mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали ".date("Y.m.d H.i").", когда ".$rr." бросили вызов друг другу.
');"); diff --git a/magic/ebattack.php b/magic/ebattack.php index a05bd3c..0ff0873 100644 --- a/magic/ebattack.php +++ b/magic/ebattack.php @@ -46,7 +46,7 @@ elseif ($user['zayavka'] > 0) { echo "Чтите честь ваших сокланов."; } elseif ($user['align'] >1 && $user['align'] <2 && $us['align'] >1 && $us['align'] <2) { echo "Чтите честь братьев."; -} elseif ($user->room != $us['room']) { +} elseif ($user->getRoom() != $us['room']) { echo "Персонаж в другой комнате!"; } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] ==45) { echo "Нападения в этой локации запрещены!"; @@ -111,7 +111,7 @@ elseif ($user['zayavka'] > 0) { } else { $ttt = 1; } - addch ("".Nick::id($user['id'])->short()." вмешался в поединок »». ",$user->room); + addch ("".Nick::id($user['id'])->short()." вмешался в поединок »». ",$user->getRoom()); //mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\''.date("H:i").' '.nick::id($user['id'])->short().' вмешался в поединок!
\') WHERE `id` = '.$jert['battle'].''); @@ -182,7 +182,7 @@ $outok=1; $rr = "".Nick::id($user['id'])->full(1)." и ".Nick::id($jert['id'])->full(1).""; - addch ("Бой между ".Nick::id($user['id'])->short()." и ".Nick::id($jert['id'])->short()." начался. ",$user->room); + addch ("Бой между ".Nick::id($user['id'])->short()." и ".Nick::id($jert['id'])->short()." начался. ",$user->getRoom()); //mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали ".date("Y.m.d H.i").", когда ".$rr." бросили вызов друг другу.
');"); addlog($id,"Часы показывали ".date("Y.m.d H.i").", когда ".$rr." бросили вызов друг другу.
"); diff --git a/magic/elikbroni.php b/magic/elikbroni.php index fa5f26b..383d5ab 100644 --- a/magic/elikbroni.php +++ b/magic/elikbroni.php @@ -12,7 +12,7 @@ else {$int=0;} if ($user['battle'] > 0) {echo "РќРµ РІ Р±РѕСЋ...";} elseif ($user['level'] < 0) { echo "Вашего СѓСЂРѕРІРЅСЏ РЅРµ достаточно для использования этого заклинания!"; } elseif ($effect['time']) {echo "РќР° персонаже уже есть заклятие Эликсир Р±СЂРѕРЅРё +5"; } -elseif ($user->room != $us['room']) { echo "Персонаж РІ РґСЂСѓРіРѕР№ комнате!"; } +elseif ($user->getRoom() != $us['room']) { echo "Персонаж РІ РґСЂСѓРіРѕР№ комнате!"; } elseif (!$us['online']) {echo "Персонаж РЅРµ РІ РёРіСЂРµ!";} elseif (rand(0,100) < $int) { diff --git a/magic/elikurona.php b/magic/elikurona.php index 086e31e..5afc161 100644 --- a/magic/elikurona.php +++ b/magic/elikurona.php @@ -12,7 +12,7 @@ if ($user['battle'] > 0) {echo "РќРµ РІ Р±РѕСЋ...";} elseif ($user['level'] < 0) { echo "Вашего СѓСЂРѕРІРЅСЏ РЅРµ достаточно для использования этого заклинания!"; } elseif ($effect['time']) {echo "РќР° персонаже уже есть заклятие Эликсир СѓСЂРѕРЅР° +3"; } - elseif ($user->room != $us['room']) { echo "Персонаж РІ РґСЂСѓРіРѕР№ комнате!"; } + elseif ($user->getRoom() != $us['room']) { echo "Персонаж РІ РґСЂСѓРіРѕР№ комнате!"; } elseif (!$us['online']) {echo "Персонаж РЅРµ РІ РёРіСЂРµ!";} elseif (rand(0,100) < $int) { diff --git a/magic/fist_def.php b/magic/fist_def.php index 8e50093..531edc4 100644 --- a/magic/fist_def.php +++ b/magic/fist_def.php @@ -7,7 +7,7 @@ $int=101; if ($user['battle'] > 0) {echo "Не в бою...";} elseif ($effect['time']) {echo "На персонаже уже есть заклятие Защита от кулачного нападения"; } -elseif ($user->room != $us['room']) { echo "Персонаж в другой комнате!"; } +elseif ($user->getRoom() != $us['room']) { echo "Персонаж в другой комнате!"; } elseif (!$us['online']) {echo "Персонаж не в игре!";} elseif (rand(1,100) < $int) { diff --git a/magic/luck.php b/magic/luck.php index 49ba4ea..f53373d 100644 --- a/magic/luck.php +++ b/magic/luck.php @@ -33,7 +33,7 @@ if ($user['battle'] > 0) {echo "Не в бою...";} elseif ($user['level'] < 4) { echo "Вашего уровня не достаточно для использования этого заклинания!"; } elseif ($us['level'] < 4) { echo "Запрещено применять на персонажей до 4 уровня!"; } elseif ($effect['time']) {echo "На персонаже уже есть заклятие Удача"; } -elseif ($user->room != $us['room']) { echo "Персонаж в другой комнате!"; } +elseif ($user->getRoom() != $us['room']) { echo "Персонаж в другой комнате!"; } elseif (!$us['online']) {echo "Персонаж не в игре!";} elseif (rand(1,100) < $int) { diff --git a/magic/pers_blood.php b/magic/pers_blood.php index 317bb13..ba285b0 100644 --- a/magic/pers_blood.php +++ b/magic/pers_blood.php @@ -25,7 +25,7 @@ if($vip['pers_attack'] <= 0) { echo "Персонаж тяжело травмирован..."; } elseif($user['klan'] != '' && ($user['klan'] == $us['klan'])) { echo "Чтите честь ваших сокланов."; -} elseif($user->room != $us['room']) { +} elseif($user->getRoom() != $us['room']) { echo "Персонаж в другой комнате!"; } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] == 45) { echo "Нападения в этой локации запрещены!"; @@ -76,7 +76,7 @@ if($vip['pers_attack'] <= 0) { $ttt = 1; } - addch("".$los." вмешался в поединок »».", $user->room); + addch("".$los." вмешался в поединок »».", $user->getRoom()); if($user['invis'] == 1) { $lod = 'невидимка'; } else { $lod = Nick::id($user['id'])->short(); } addlog($jert['battle'], ''.date("H:i").' '.$lod.' вмешался в поединок!
'); mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'` = CONCAT(`t'.$ttt.'`,\';'.$user['id'].'\'), `blood` = 1 WHERE `id` = "'.$jert['battle'].'" LIMIT 1'); @@ -115,7 +115,7 @@ if($vip['pers_attack'] <= 0) { $ld = Nick::id($user['id'])->full(1); $lds = Nick::id($user['id'])->short(); $rr = "".$ld." и ".Nick::id($jert['id'])->full(1).""; - addch("Бой между ".$lds." и ".Nick::id($jert['id'])->short()." начался.", $user->room); + addch("Бой между ".$lds." и ".Nick::id($jert['id'])->short()." начался.", $user->getRoom()); addlog($id, "Часы показывали ".date("Y.m.d H.i").", когда ".$rr." бросили вызов друг другу.
"); mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$user['id']} OR `id` = {$jert['id']}"); header("Location: fbattle.php"); diff --git a/magic/stop.php b/magic/stop.php index 355a42e..c402462 100644 --- a/magic/stop.php +++ b/magic/stop.php @@ -6,7 +6,7 @@ if (empty($_SESSION['uid'])) { if ($user['invis'] == 1) { $user['login'] = 'невидимка'; } -if (($user->room > 2000) && ($user->room < 2100)) { +if (($user->getRoom() > 2000) && ($user->getRoom() < 2100)) { echo "Не в Проходе..."; } else { $magictime = (time() + 10 * 60); @@ -18,7 +18,7 @@ if (($user->room > 2000) && ($user->room < 2100)) { echo "На персонаже \"$target\" уже есть путы "; } else { - if ($tar['room'] == $user->room) { + if ($tar['room'] == $user->getRoom()) { if (mysql_query("INSERT INTO `effects` (`owner`,`name`,`time`,`type`) values ('" . $tar['id'] . "','Путы','$magictime',10);")) { $ldtarget = $target; diff --git a/magic/stop_200.php b/magic/stop_200.php index 8d7586e..2d6cba0 100644 --- a/magic/stop_200.php +++ b/magic/stop_200.php @@ -7,7 +7,7 @@ if (empty($_SESSION['uid'])) { if ($user['invis'] == 1) { $user['login'] = 'невидимка'; } -if (($user->room > 2000) && ($user->room < 2100)) { +if (($user->getRoom() > 2000) && ($user->getRoom() < 2100)) { echo "Не в Проходе..."; } else { $magictime = (time() + 10 * 60 * 10); @@ -19,7 +19,7 @@ if (($user->room > 2000) && ($user->room < 2100)) { echo "На персонаже \"$target\" уже есть путы "; } else { - if ($tar['room'] == $user->room) { + if ($tar['room'] == $user->getRoom()) { if (mysql_query("INSERT INTO `effects` (`owner`,`name`,`time`,`type`) values ('" . $tar['id'] . "','Паралич','$magictime',10);")) { $ldtarget = $target; diff --git a/magic/usability_klan/attack.php b/magic/usability_klan/attack.php index 067a153..ae1ed9e 100644 --- a/magic/usability_klan/attack.php +++ b/magic/usability_klan/attack.php @@ -32,7 +32,7 @@ if($vip['attack'] <= 0) { echo "Персонаж тяжело травмирован..."; } elseif($user['klan'] != '' && ($user['klan'] == $us['klan'])) { echo "Чтите честь ваших сокланов."; -} elseif($user->room != $us['room']) { +} elseif($user->getRoom() != $us['room']) { echo "Персонаж в другой комнате!"; } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] == 45) { echo "Нападения в этой локации запрещены!"; @@ -83,7 +83,7 @@ if($vip['attack'] <= 0) { $ttt = 1; } - addch("".$los." вмешался в поединок »».", $user->room); + addch("".$los." вмешался в поединок »».", $user->getRoom()); if($user['invis'] == 1) { $lod = 'невидимка'; } else { $lod = Nick::id($user['id'])->short(); } addlog($jert['battle'], ''.date("H:i").' '.$lod.' вмешался в поединок!
'); mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'` = CONCAT(`t'.$ttt.'`,\';'.$user['id'].'\') WHERE `id` = "'.$jert['battle'].'" LIMIT 1'); @@ -122,7 +122,7 @@ if($vip['attack'] <= 0) { $ld = Nick::id($user['id'])->full(1); $lds = Nick::id($user['id'])->short(); $rr = "".$ld." и ".Nick::id($jert['id'])->full(1).""; - addch("Бой между ".$lds." и ".Nick::id($jert['id'])->short()." начался.", $user->room); + addch("Бой между ".$lds." и ".Nick::id($jert['id'])->short()." начался.", $user->getRoom()); addlog($id, "Часы показывали ".date("Y.m.d H.i").", когда ".$rr." бросили вызов друг другу.
"); mysql_query("UPDATE users SET `battle` = {$id},`zayavka`=0 WHERE `id`= {$user['id']} OR `id` = {$jert['id']}"); header("Location: fbattle.php"); diff --git a/magic/usability_klan/attack_blood.php b/magic/usability_klan/attack_blood.php index 24b3834..4e2b1a6 100644 --- a/magic/usability_klan/attack_blood.php +++ b/magic/usability_klan/attack_blood.php @@ -32,7 +32,7 @@ if($vip['bloodattack'] <= 0) { echo "Персонаж тяжело травмирован..."; } elseif($user['klan'] != '' && ($user['klan'] == $us['klan'])) { echo "Чтите честь ваших сокланов."; -} elseif($user->room != $us['room']) { +} elseif($user->getRoom() != $us['room']) { echo "Персонаж в другой комнате!"; } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] == 45) { echo "Нападения в этой локации запрещены!"; @@ -83,7 +83,7 @@ if($vip['bloodattack'] <= 0) { $ttt = 1; } - addch("".$los." вмешался в поединок »».", $user->room); + addch("".$los." вмешался в поединок »».", $user->getRoom()); if($user['invis'] == 1) { $lod = 'невидимка'; } else { $lod = Nick::id($user['id'])->short(); } addlog($jert['battle'], ''.date("H:i").' '.$lod.' вмешался в поединок!
'); mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'` = CONCAT(`t'.$ttt.'`,\';'.$user['id'].'\'), `blood` = 1 WHERE `id` = "'.$jert['battle'].'" LIMIT 1'); @@ -122,7 +122,7 @@ if($vip['bloodattack'] <= 0) { $ld = Nick::id($user['id'])->full(1); $lds = Nick::id($user['id'])->short(); $rr = "".$ld." и ".Nick::id($jert['id'])->full(1).""; - addch("Бой между ".$lds." и ".Nick::id($jert['id'])->short()." начался.", $user->room); + addch("Бой между ".$lds." и ".Nick::id($jert['id'])->short()." начался.", $user->getRoom()); addlog($id, "Часы показывали ".date("Y.m.d H.i").", когда ".$rr." бросили вызов друг другу.
"); mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$user['id']} OR `id` = {$jert['id']}"); header("Location: fbattle.php"); diff --git a/magic/usability_user/attack.php b/magic/usability_user/attack.php index 9357538..f2f17f5 100644 --- a/magic/usability_user/attack.php +++ b/magic/usability_user/attack.php @@ -32,7 +32,7 @@ if($vip['attack'] <= 0) { echo "Персонаж тяжело травмирован..."; } elseif($user['klan'] != '' && ($user['klan'] == $us['klan'])) { echo "Чтите честь ваших сокланов."; -} elseif($user->room != $us['room']) { +} elseif($user->getRoom() != $us['room']) { echo "Персонаж в другой комнате!"; } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] == 45) { echo "Нападения в этой локации запрещены!"; @@ -83,7 +83,7 @@ if($vip['attack'] <= 0) { $ttt = 1; } - addch("".$los." вмешался в поединок »».", $user->room); + addch("".$los." вмешался в поединок »».", $user->getRoom()); if($user['invis'] == 1) { $lod = 'невидимка'; } else { $lod = Nick::id($user['id'])->short(); } addlog($jert['battle'], ''.date("H:i").' '.$lod.' вмешался в поединок!
'); mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'` = CONCAT(`t'.$ttt.'`,\';'.$user['id'].'\') WHERE `id` = "'.$jert['battle'].'" LIMIT 1'); @@ -122,7 +122,7 @@ if($vip['attack'] <= 0) { $ld = Nick::id($user['id'])->full(1); if($user['invis'] == 1) { $lds = 'невидимка'; } else { $lds = Nick::id($user['id'])->short(); } $rr = "".$ld." и ".Nick::id($jert['id'])->full(1).""; - addch("Бой между ".$lds." и ".Nick::id($jert['id'])->short()." начался.", $user->room); + addch("Бой между ".$lds." и ".Nick::id($jert['id'])->short()." начался.", $user->getRoom()); addlog($id, "Часы показывали ".date("Y.m.d H.i").", когда ".$rr." бросили вызов друг другу.
"); mysql_query("UPDATE users SET `battle` = {$id},`zayavka`=0 WHERE `id`= {$user['id']} OR `id` = {$jert['id']}"); header("Location: fbattle.php"); diff --git a/magic/usability_user/attack_blood.php b/magic/usability_user/attack_blood.php index 4ca2891..ff73615 100644 --- a/magic/usability_user/attack_blood.php +++ b/magic/usability_user/attack_blood.php @@ -32,7 +32,7 @@ if($vip['bloodattack'] <= 0) { echo "Персонаж тяжело травмирован..."; } elseif($user['klan'] != '' && ($user['klan'] == $us['klan'])) { echo "Чтите честь ваших сокланов."; -} elseif($user->room != $us['room']) { +} elseif($user->getRoom() != $us['room']) { echo "Персонаж в другой комнате!"; } elseif ($us['room'] == 31 || $us['room'] == 46 || $us['room'] == 47 || $us['room'] == 48 || $us['room'] == 49 ||$us['room'] == 600 || $us['room'] == 601 || $us['room'] == 45 || $us['room'] == 602 || $us['room'] == 43 || $us['room'] == 45) { echo "Нападения в этой локации запрещены!"; @@ -83,7 +83,7 @@ if($vip['bloodattack'] <= 0) { $ttt = 1; } - addch("".$los." вмешался в поединок »».", $user->room); + addch("".$los." вмешался в поединок »».", $user->getRoom()); if($user['invis'] == 1) { $lod = 'невидимка'; } else { $lod = Nick::id($user['id'])->short(); } addlog($jert['battle'], ''.date("H:i").' '.$lod.' вмешался в поединок!
'); mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'` = CONCAT(`t'.$ttt.'`,\';'.$user['id'].'\'), `blood` = 1 WHERE `id` = "'.$jert['battle'].'" LIMIT 1'); @@ -122,7 +122,7 @@ if($vip['bloodattack'] <= 0) { $ld = Nick::id($user['id'])->full(1); $lds = Nick::id($user['id'])->short(); $rr = "".$ld." и ".Nick::id($jert['id'])->full(1).""; - addch("Бой между ".$lds." и ".Nick::id($jert['id'])->short()." начался.", $user->room); + addch("Бой между ".$lds." и ".Nick::id($jert['id'])->short()." начался.", $user->getRoom()); addlog($id, "Часы показывали ".date("Y.m.d H.i").", когда ".$rr." бросили вызов друг другу.
"); mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$user['id']} OR `id` = {$jert['id']}"); header("Location: fbattle.php"); diff --git a/magic/vampir.php b/magic/vampir.php index b6736bc..a244746 100644 --- a/magic/vampir.php +++ b/magic/vampir.php @@ -57,11 +57,11 @@ if ($user['battle'] > 0) { echo "Нельзя укусить новичка, они защищены Мироздателем!"; } elseif ($us['align'] > 2 && $us['align'] < 3) { echo "Вы решили укусить Ангела? ;)"; - } elseif ($user->room != $us['room']) { + } elseif ($user->getRoom() != $us['room']) { echo "Персонаж находится в другой комнате.)"; } elseif ($user['battle']) { echo "Не в бою..."; - } elseif ($user->room == 31) { + } elseif ($user->getRoom() == 31) { echo "Нельзя укусить в этой комнате!"; } elseif (((int)date("H") < 22) && ((int)date("H") >= 6)) { echo "Вампиры кусают только по ночам"; @@ -151,7 +151,7 @@ if ($user['battle'] > 0) { // создаем лог $rr = "" . Nick::id($user['id'])->full(1) . " и " . Nick::id($us['id'])->full(1) . ""; - addch("Бой между " . Nick::id($user['id'])->short() . " и " . Nick::id($us['id'])->short() . " начался. ", $user->room); + addch("Бой между " . Nick::id($user['id'])->short() . " и " . Nick::id($us['id'])->short() . " начался. ", $user->getRoom()); //mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали ".date("Y.m.d H.i").", когда ".$rr." бросили вызов друг другу.
');"); addlog($id, 'Часы показывали ' . date("Y.m.d H.i") . ', когда ' . $rr . ' бросили вызов друг другу.
'); diff --git a/magic/zz.php b/magic/zz.php index 379ce1f..3bf89f1 100644 --- a/magic/zz.php +++ b/magic/zz.php @@ -15,7 +15,7 @@ elseif ($user['level'] < $magic_need['nlevel']) { echo "ВашегРelseif ($user['mgray'] < $magic_need['ngray']) { echo "РќРµ достаточно владения Серой магией для использования этого заклинания!"; } elseif ($user['intel'] < $magic_need['nintel']) { echo "Вашего интеллекта РЅРµ достаточно для использования этого заклинания!"; } elseif ($effect['time']) {echo "РќР° персонаже уже есть заклятие Микстура жизненных СЃРёР»"; } -elseif ($user->room != $us['room']) { echo "Персонаж РІ РґСЂСѓРіРѕР№ комнате!"; } +elseif ($user->getRoom() != $us['room']) { echo "Персонаж РІ РґСЂСѓРіРѕР№ комнате!"; } elseif (!$us['online']) {echo "Персонаж РЅРµ РІ РёРіСЂРµ!";} elseif (rand(1,100) < $int) { diff --git a/main.php b/main.php index 93c125e..91173ed 100644 --- a/main.php +++ b/main.php @@ -44,7 +44,7 @@ while ($row = $data->fetch_assoc()) { } //Обработчики нажатий на кнопки. -if ($_POST['battlefield'] ?? 0 && $user->room == 1) { +if ($_POST['battlefield'] ?? 0 && $user->getRoom() == 1) { header('Location: zayavka.php'); exit(); } @@ -52,11 +52,11 @@ if ($_POST['module_quest'] ?? 0) { header('Location: module_quest.php'); exit(); } -if ($_POST['move_inside'] ?? 0 && $user->room == 20) { +if ($_POST['move_inside'] ?? 0 && $user->getRoom() == 20) { header('Location: main.php?goto=arena'); exit(); } -if ($_POST['move_outside'] ?? 0 && $user->room == 1) { +if ($_POST['move_outside'] ?? 0 && $user->getRoom() == 1) { header('Location: main.php?goto=plo'); exit(); } @@ -67,12 +67,12 @@ if ($_POST['main_page'] ?? 0) { if ($edit === null) { /* === проверяем соответствие комнаты и скрипта === */ - if (in_array($user->room, [20, 21, 26, 48, 51, 52, 651, 2655, 2601, 2701, 2702, 2111])) { + if (in_array($user->getRoom(), [20, 21, 26, 48, 51, 52, 651, 2655, 2601, 2701, 2702, 2111])) { header('Location: city.php'); exit(); } - if (in_array($user->room, [22, 23, 25, 27, 29, 30, 31, 34, 45, 53, 61, 402, 403, 600, 601, 602, 603, 620, 621, 650, 660, 661, 662, 666, 760, 1051, 1052, 1055])) { - header('location: ' . Travel::$roomFileName[$user->room]); + if (in_array($user->getRoom(), [22, 23, 25, 27, 29, 30, 31, 34, 45, 53, 61, 402, 403, 600, 601, 602, 603, 620, 621, 650, 660, 661, 662, 666, 760, 1051, 1052, 1055])) { + header('location: ' . Travel::$roomFileName[$user->getRoom()]); exit(); } } @@ -174,7 +174,7 @@ if ($goto) { $eff = db::c()->query('SELECT 1 FROM `users_effects` WHERE `owner_id` = ?i AND (`type` = 14 OR `type` = 13)', $user->getId()); //(масса: getItemsWeight() . '/' . $user->strength * 4 - if ($d['sum_weight'] > $user->strength * 4 && $goto) { + if ($d['sum_weight'] > $user->getStrength() * 4 && $goto) { err('У вас переполнен рюкзак, вы не можете передвигаться...'); $imove = false; } @@ -182,15 +182,15 @@ if ($goto) { err('У вас тяжелая травма, вы не можете передвигатся...'); $imove = false; } - if ($goto == 'plo' && !$user->zayavka && $imove && $user->room != 20) { - db::c()->query('UPDATE users, online SET users.room = 20, online.room = 20 WHERE online.user_id = users.id AND online.user_id = ?i', $_SESSION['uid']); + if ($goto == 'plo' && !$user->getZayavka() && $imove && $user->getRoom() != 20) { + db::c()->query('UPDATE users, online SET users.room = 20, online.room = 20 WHERE online.user_id = users.id AND online.user_id = ?i', $user->getId()); header('Location: city.php'); exit("Топ-топ-топ..."); } else { err('Подали заявку на бой и убегаете из клуба? Нехорошо...'); } - if ($goto == 'arena' && $user->room == 20 && $imove) { - db::c()->query('UPDATE users, online SET users.room = 1, online.room = 1 WHERE online.user_id = users.id AND online.user_id = ?i', $_SESSION['uid']); + if ($goto == 'arena' && $user->getRoom() == 20 && $imove) { + db::c()->query('UPDATE users, online SET users.room = 1, online.room = 1 WHERE online.user_id = users.id AND online.user_id = ?i', $user->getId()); header('Location: main.php'); exit("Топ-топ-топ..."); } @@ -216,7 +216,7 @@ function setShadow($image) } } -if ($obraz && ($user->shadow == 'g0.gif' || $user->shadow == 'man0.gif')) { +if ($obraz && ($user->getShadow() == 'g0.gif' || $user->getShadow() == 'man0.gif')) { setShadow($obraz); } @@ -379,7 +379,7 @@ Template::header('Игра');

Уровень: getLevel() ?> -
Опыт: experience ?> +
Опыт: getExperience() ?>
Побед: ??
Поражений: ??
Ничьих: ?? @@ -389,21 +389,21 @@ Template::header('Игра');
- Сила: free_stat_points ? $user->getStat('strength', 1) . '(' . strval($user->strength + $getItemsBonuses->getStrengthBonus()) . ')' : $user->strength + $getItemsBonuses->getStrengthBonus()) ?> + Сила: getFreeStatPoints() ? $user->getStat('strength', 1) . '(' . strval($user->getStrength() + $getItemsBonuses->getStrengthBonus()) . ')' : $user->getStrength() + $getItemsBonuses->getStrengthBonus()) ?>
- Ловкость: free_stat_points ? $user->getStat('dexterity', 1) . '(' . strval($user->dexterity + $getItemsBonuses->getDexterityBonus()) . ')' : $user->dexterity + $getItemsBonuses->getDexterityBonus()) ?> + Ловкость: getFreeStatPoints() ? $user->getStat('dexterity', 1) . '(' . strval($user->getDexterity() + $getItemsBonuses->getDexterityBonus()) . ')' : $user->getDexterity() + $getItemsBonuses->getDexterityBonus()) ?>
- Интуиция: free_stat_points ? $user->getStat('intuition', 1) . '(' . strval($user->intuition + $getItemsBonuses->getIntuitionBonus()) . ')' : $user->intuition + $getItemsBonuses->getIntuitionBonus()) ?> + Интуиция: getFreeStatPoints() ? $user->getStat('intuition', 1) . '(' . strval($user->getIntuition() + $getItemsBonuses->getIntuitionBonus()) . ')' : $user->getIntuition() + $getItemsBonuses->getIntuitionBonus()) ?>
- Выносливость: free_stat_points ? $user->getStat('endurance', 1) . '(' . strval($user->endurance + $getItemsBonuses->getEnduranceBonus()) . ')' : $user->endurance + $getItemsBonuses->getEnduranceBonus()) ?> + Выносливость: getFreeStatPoints() ? $user->getStat('endurance', 1) . '(' . strval($user->getEndurance() + $getItemsBonuses->getEnduranceBonus()) . ')' : $user->getEndurance() + $getItemsBonuses->getEnduranceBonus()) ?>
- Интеллект: free_stat_points ? $user->getStat('intelligence', 1) . '(' . strval($user->intelligence + $getItemsBonuses->getIntelliganceBonus()) . ')' : $user->intelligence + $getItemsBonuses->getIntelliganceBonus()) ?> + Интеллект: getFreeStatPoints() ? $user->getStat('intelligence', 1) . '(' . strval($user->getIntelligence() + $getItemsBonuses->getIntelliganceBonus()) . ')' : $user->getIntelligence() + $getItemsBonuses->getIntelliganceBonus()) ?>
- Мудрость: free_stat_points ? $user->getStat('wisdom', 1) . '(' . strval($user->wisdom + $getItemsBonuses->getWisdomBonus()) . ')' : $user->wisdom + $getItemsBonuses->getWisdomBonus()) ?> + Мудрость: getFreeStatPoints() ? $user->getStat('wisdom', 1) . '(' . strval($user->getWisdom() + $getItemsBonuses->getWisdomBonus()) . ')' : $user->getWisdom() + $getItemsBonuses->getWisdomBonus()) ?>
- free_stat_points): ?> + getFreeStatPoints()): ?> Возможных - увеличений: free_stat_points ?>
+ увеличений: getFreeStatPoints() ?>

Здоровье: getHealth() ?>
@@ -411,31 +411,31 @@ Template::header('Игра'); Уворот: getEvasionBonus() ?>
Точность: getAccuracyBonus() ?>
Шанс крита: getCriticalsBonus() ?>
- Урон: minDamage + $getItemsBonuses->getMinPhysDamage() ?> - - maxDamage + $getItemsBonuses->getMaxPhysDamage() ?>
+ Урон: getMinDamage() + $getItemsBonuses->getMinPhysDamage() ?> + - getMaxDamage() + $getItemsBonuses->getMaxPhysDamage() ?>

Защита от огня: ??
Защита от воды: ??
Защита от вохдуха: ??
Защита от земли: ??
Защита от яда: ??
- Броня головы: headArmor ?>
- Броня корпуса: chestArmor ?>
- Броня ног: legArmor ?>
+ Броня головы: getHeadArmor() ?>
+ Броня корпуса: getChestArmor() ?>
+ Броня ног: getLegArmor() ?>
- shadow == '0.gif' || $user->admin == 1): ?> + getShadow() == '0.gif' || $user->getAdmin() == 1): ?>
- room == 20): ?> + getRoom() == 20): ?> - room == 1): ?> + getRoom() == 1): ?> @@ -446,7 +446,7 @@ Template::header('Игра');
battle) { header('location: fbattle.php'); exit; } + if ($user->getBattle()) { header('location: fbattle.php'); exit; } include "../config.php"; $user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;")); if ($user['admin']) { diff --git a/quest_room.php b/quest_room.php index cdbc07a..56b0ead 100644 --- a/quest_room.php +++ b/quest_room.php @@ -60,7 +60,7 @@ if (!empty($q->error)) { Template::header('Памятник'); ?>
- getLevel() < 5 || $user->admin) && $user->health < $user->maxHealth): ?> + getLevel() < 5 || $user->getAdmin()) && $user->getHealth() < $user->getMaxHealth()): ?> diff --git a/tournament.php b/tournament.php index 2c76008..3993cd1 100644 --- a/tournament.php +++ b/tournament.php @@ -43,7 +43,7 @@ if (mktime() >= ($dateD[0] + 10)) { $Tournament->ShowTournirFinaliats(); ?> - admin) { ?> + getAdmin()) { ?>
diff --git a/towerin.php b/towerin.php index f02e833..a358828 100644 --- a/towerin.php +++ b/towerin.php @@ -78,14 +78,14 @@ $kol_pl = mysql_num_rows(mysql_query("SELECT `id` FROM `users` WHERE `bot` = 0 a $tur_data = mysql_fetch_array(mysql_query("SELECT * FROM `deztow_turnir` WHERE `active` = TRUE")); if ($_GET['give']) { - $obj = mysql_fetch_array(mysql_query("SELECT * FROM `deztow_items` WHERE `id` = '" . mysql_real_escape_string($_GET['give']) . "' and `room` = '" . $user->room . "' LIMIT 1")); + $obj = mysql_fetch_array(mysql_query("SELECT * FROM `deztow_items` WHERE `id` = '" . mysql_real_escape_string($_GET['give']) . "' and `room` = '" . $user->getRoom() . "' LIMIT 1")); if ($obj) { if ($_SESSION['timei'] - time() <= 0) { $_SESSION['timei'] = (time() + 3); $dress = mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE `id` = '" . $obj['iteam_id'] . "' LIMIT 1")); if (isset($dress['id'])) { mysql_query("INSERT INTO `inventory` (`bs`, `prototype`, `owner`, `name`, `type`, `massa`, `cost`, `img`, `maxdur`, `isrep`, `gsila`, `glovk`, `ginta`, `gintel`, `ghp`, `gnoj`, `gtopor`, `gdubina`, `gmech`, `gfire`, `gwater`, `gair`, `gearth`, `glight`, `ggray`, `gdark`, `needident`, `nsila`, `nlovk`, `ninta`, `nintel`, `nmudra`, `nvinos`, `nnoj`, `ntopor`, `ndubina`, `nmech`, `nfire`, `nwater`, `nair`, `nearth`, `nlight`, `ngray`, `ndark`, `mfkrit`, `mfakrit`, `mfuvorot`, `mfauvorot`, `bron1`, `bron2`, `bron3`, `bron4`, `maxu`, `minu`, `magic`, `nlevel`, `nalign`, `dategoden`, `goden`, `otdel`, `koll`) VALUES ('1', '{$dress['id']}', '{$user['id']}', '{$dress['name']}', '{$dress['type']}', '{$dress['massa']}', '{$dress['cost']}', '{$dress['img']}', '{$dress['maxdur']}', '{$dress['isrep']}', '{$dress['gsila']}', '{$dress['glovk']}', '{$dress['ginta']}', '{$dress['gintel']}', '{$dress['ghp']}', '{$dress['gnoj']}', '{$dress['gtopor']}', '{$dress['gdubina']}', '{$dress['gmech']}', '{$dress['gfire']}', '{$dress['gwater']}', '{$dress['gair']}', '{$dress['gearth']}', '{$dress['glight']}', '{$dress['ggray']}', '{$dress['gdark']}', '{$dress['needident']}', '{$dress['nsila']}', '{$dress['nlovk']}', '{$dress['ninta']}', '{$dress['nintel']}', '{$dress['nmudra']}', '{$dress['nvinos']}', '{$dress['nnoj']}', '{$dress['ntopor']}', '{$dress['ndubina']}', '{$dress['nmech']}', '{$dress['nfire']}', '{$dress['nwater']}', '{$dress['nair']}', '{$dress['nearth']}', '{$dress['nlight']}', '{$dress['ngray']}', '{$dress['ndark']}', '{$dress['mfkrit']}', '{$dress['mfakrit']}', '{$dress['mfuvorot']}', '{$dress['mfauvorot']}', '{$dress['bron1']}', '{$dress['bron3']}', '{$dress['bron2']}', '{$dress['bron4']}', '{$dress['maxu']}', '{$dress['minu']}', '{$dress['magic']}', '{$dress['nlevel']}', '{$dress['nalign']}', '" . (($dress['goden']) ? ($dress['goden'] * 24 * 60 * 60 + time()) : "") . "', '{$dress['goden']}', '{$dress['razdel']}', '{$dress['koll']}')"); - mysql_query("DELETE FROM `deztow_items` WHERE `id` = '" . mysql_real_escape_string($_GET['give']) . "' and `room` = '" . $user->room . "' LIMIT 1"); + mysql_query("DELETE FROM `deztow_items` WHERE `id` = '" . mysql_real_escape_string($_GET['give']) . "' and `room` = '" . $user->getRoom() . "' LIMIT 1"); } else { echo 'Предмет не найден. Сообщите Администрации данный код #' . $obj['iteam_id'] . '#'; } @@ -99,7 +99,7 @@ if ($_GET['give']) { if ($_POST['attack']) { $jert = mysql_fetch_array(mysql_query("SELECT `id`, `login`, `room`, `battle`, `hp` FROM `users` WHERE `login` = '" . mysql_real_escape_string($_POST['attack']) . "' LIMIT 1")); - if ($jert['room'] == $user->room && $jert['id'] != $user['id']) { + if ($jert['room'] == $user->getRoom() && $jert['id'] != $user['id']) { if ($jert['id'] == 233 || $jert['id'] == 234 || $jert['id'] == 235) { $arha = mysql_fetch_array(mysql_query('SELECT * FROM `bots` WHERE `prototype` = "' . $jert['id'] . '" LIMIT 1')); if (isset($arha['id'])) { @@ -129,7 +129,7 @@ if ($_POST['attack']) { $ttt = 1; $ttt2 = 2; } - addch("" . Nick::id($user['id'])->short() . " вмешался в поединок »».", $user->room); + addch("" . Nick::id($user['id'])->short() . " вмешался в поединок »».", $user->getRoom()); addlog($jert['battle'], '' . date("H:i") . ' ' . Nick::id($user['id'])->short() . ' вмешался в поединок!
'); mysql_query('UPDATE `battle` SET `teams` = \'' . serialize($battle) . '\', `t' . $ttt . '` = CONCAT(`t' . $ttt . '`,\';' . $user['id'] . '\'), `to' . $ttt . '` = \'' . time() . '\', `to' . $ttt2 . '` = \'' . (time() - 1) . '\' WHERE `id` = "' . $jert['battle'] . '" LIMIT 1'); mysql_query("UPDATE `users` SET `battle` = '" . $jert['battle'] . "', `zayavka` = 0 WHERE `id` = '" . $user['id'] . "' LIMIT 1"); @@ -155,7 +155,7 @@ if ($_POST['attack']) { } $rr = "" . Nick::id($user['id'])->full(1) . " и " . Nick::id($jert['id'])->full(1) . ""; - addch("" . Nick::id($user['id'])->short() . " , применив магию нападения, внезапно напал на " . Nick::id($jert['id'])->short() . ".", $user->room); + addch("" . Nick::id($user['id'])->short() . " , применив магию нападения, внезапно напал на " . Nick::id($jert['id'])->short() . ".", $user->getRoom()); addlog($id, "Часы показывали " . date("Y.m.d H.i") . ", когда " . $rr . " бросили вызов друг другу.
"); mysql_query("UPDATE `users` SET `battle` = {$id}, `zayavka` = 0 WHERE (`id` = {$user['id']} OR `id` = {$jert['id']})"); mysql_query('UPDATE `deztow_turnir` SET `log` = CONCAT(`log`,\'' . "" . date("d.m.y H:i") . " " . Nick::id($user['id'])->full(1) . " напал на " . Nick::id($jert['id'])->full(1) . " завязался бой »»
" . '\') WHERE `active` = TRUE LIMIT 1'); @@ -167,22 +167,22 @@ if ($_POST['attack']) { } $_GET['path'] = (int)$_GET['path']; -if ($rhar[$user->room][$_GET['path']] > 0 && $_GET['path'] < 5 && $_GET['path'] > 0 && ($_SESSION['time'] <= time())) { +if ($rhar[$user->getRoom()][$_GET['path']] > 0 && $_GET['path'] < 5 && $_GET['path'] > 0 && ($_SESSION['time'] <= time())) { $rr = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `type` = 10 AND `owner` = {$user['id']} LIMIT 1")); if (!isset($rr['id'])) { - $list = mysql_query("SELECT `id`, `room`, `login` FROM `users` WHERE `room` = '" . $user->room . "' AND `in_tower` = 1"); + $list = mysql_query("SELECT `id`, `room`, `login` FROM `users` WHERE `room` = '" . $user->getRoom() . "' AND `in_tower` = 1"); while ($u = mysql_fetch_array($list)) { if ($u['id'] != $user['id']) { - addchp('Внимание! ' . $user['login'] . ' отправился в ' . $rooms[$rhar[$user->room][$_GET['path']]] . '.', '{[]}' . $u['login'] . '{[]}'); + addchp('Внимание! ' . $user['login'] . ' отправился в ' . $rooms[$rhar[$user->getRoom()][$_GET['path']]] . '.', '{[]}' . $u['login'] . '{[]}'); } } - $list = mysql_query("SELECT `id`, `room`, `login` FROM `users` WHERE `room` = '" . $rhar[$user->room][$_GET['path']] . "' AND `in_tower` = 1"); + $list = mysql_query("SELECT `id`, `room`, `login` FROM `users` WHERE `room` = '" . $rhar[$user->getRoom()][$_GET['path']] . "' AND `in_tower` = 1"); while ($u = mysql_fetch_array($list)) { addchp('Внимание! ' . $user['login'] . ' вошел в комнату.', '{[]}' . $u['login'] . '{[]}'); } - mysql_query("UPDATE `users`, `online` SET `users`.`room` = '" . $rhar[$user->room][$_GET['path']] . "', `online`.`room` = '" . $rhar[$user->room][$_GET['path']] . "' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$user['id']}'"); - $_SESSION['time'] = (time() + $rhar[$rhar[$user->room][$_GET['path']]][0]); + mysql_query("UPDATE `users`, `online` SET `users`.`room` = '" . $rhar[$user->getRoom()][$_GET['path']] . "', `online`.`room` = '" . $rhar[$user->getRoom()][$_GET['path']] . "' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$user['id']}'"); + $_SESSION['time'] = (time() + $rhar[$rhar[$user->getRoom()][$_GET['path']]][0]); header('Location: towerin.php'); } else { err('Вы парализованы и не можете двигаться...'); @@ -229,7 +229,7 @@ if (($kol_pl + $ls) < 2 && ($tur_data['start_time'] + 60) <= time()) { undressall($user['id']); $rep = mysql_query("SELECT * FROM `inventory` WHERE `owner` = '" . $user['id'] . "' AND `bs` = 1"); while ($r = mysql_fetch_array($rep)) { - mysql_query("INSERT `deztow_items` (`iteam_id`, `name`, `img`, `room`) VALUES ('" . $r['prototype'] . "', '" . $r['name'] . "', '" . $r['img'] . "', '" . $user->room . "');"); + mysql_query("INSERT `deztow_items` (`iteam_id`, `name`, `img`, `room`) VALUES ('" . $r['prototype'] . "', '" . $r['name'] . "', '" . $r['img'] . "', '" . $user->getRoom() . "');"); } mysql_query("DELETE FROM `inventory` WHERE `owner` = '" . $user['id'] . "' AND `bs` = 1"); $tec = mysql_fetch_array(mysql_query("SELECT * FROM `deztow_realchars` WHERE `owner` = '{$user['id']}'")); @@ -302,7 +302,7 @@ if ($user['hp'] <= 0) {
- @@ -312,7 +312,7 @@ if ($user['hp'] <= 0) { room . "';"); + $its = mysql_query("SELECT * FROM `deztow_items` WHERE `room` = '" . $user->getRoom() . "';"); if (mysql_num_rows($its) > 0) { echo '

В комнате разбросаны вещи:

'; } @@ -462,7 +462,7 @@ if ($user['hp'] <= 0) {
@@ -541,15 +541,15 @@ if ($user['hp'] <= 0) { @@ -594,15 +594,15 @@ if ($user['hp'] <= 0) {
Рюкзак - (масса: strength * 4 ?>) + (масса: getStrength() * 4 ?>)
battle() ?>room]; ?>    + getRoom()]; ?>    Напасть на...
+ src="i/tower/getRoom()) ?>.jpg" alt="" border="1"/>
- room][4]]) { + getRoom()][4]]) { echo 'id="m7"'; } ?> href="?rnd=0.817371946556865&path=4">getRoom()][4]]) { echo 'i'; } ?>.gif" width="21" height="20" border="0" - oroom][4]]) { + ogetRoom()][4]]) { echo 'i'; - } ?>nmousemove="fastshow2('room][4]] ?>');" + } ?>nmousemove="fastshow2('getRoom()][4]] ?>');" onmouseout="hideshow();"/>
- room][1]]) { + getRoom()][1]]) { echo 'id="m1"'; } ?> href="?rnd=0.817371946556865&path=1">getRoom()][1]]) { echo 'i'; } ?>.gif" width="19" height="22" border="0" - room][1]]) { + getRoom()][1]]) { echo 'i'; - } ?>onmousemove="fastshow2('room][1]] ?>');" + } ?>onmousemove="fastshow2('getRoom()][1]] ?>');" onmouseout="hideshow();"/>
- room][3]]) { + getRoom()][3]]) { echo 'id="m5"'; } ?> href="?rnd=0.817371946556865&path=3">getRoom()][3]]) { echo 'i'; } ?>.gif" width="19" height="22" border="0" - room][3]]) { + getRoom()][3]]) { echo 'i'; - } ?>onmousemove="fastshow2('room][3]] ?>');" + } ?>onmousemove="fastshow2('getRoom()][3]] ?>');" onmouseout="hideshow();"/>
@@ -623,15 +623,15 @@ if ($user['hp'] <= 0) { room][2]]) { + onclick="return check('m3');" getRoom()][2]]) { echo 'id="m3"'; } ?> href="?rnd=0.817371946556865&path=2">getRoom()][2]]) { echo 'i'; } ?>.gif" width="22" height="21" border="0" - room][2]]) { + getRoom()][2]]) { echo 'i'; - } ?>onmousemove="fastshow2('room][2]] ?>');" + } ?>onmousemove="fastshow2('getRoom()][2]] ?>');" onmouseout="hideshow();"/> diff --git a/towerstamp.php b/towerstamp.php index a096f81..1eac2cb 100644 --- a/towerstamp.php +++ b/towerstamp.php @@ -2,7 +2,7 @@ session_start(); require_once "functions.php"; $effect = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = '{$user['id']}' LIMIT 1")); -if ($user->room != 31) { +if ($user->getRoom() != 31) { exit('Для распределения статов необходимо находиться в прихожей "Башни смерти"'); } if (isset($effect['id'])) { diff --git a/ul_clans.php b/ul_clans.php index 5099a7c..cbadb0c 100644 --- a/ul_clans.php +++ b/ul_clans.php @@ -2,7 +2,7 @@ session_start(); require_once "config.php"; $user = new \Battles\User($_SESSION['uid']); -if ($_GET['id'] && $user->admin) { +if ($_GET['id'] && $user->getAdmin()) { echo "Пробуем перейти на выбранную замковую улицу..."; $_SESSION["klan"] = $_GET['klan']; $a = $_GET['klan']; diff --git a/user_abilities.php b/user_abilities.php index 43b454c..ae622ef 100644 --- a/user_abilities.php +++ b/user_abilities.php @@ -12,13 +12,13 @@ use Battles\User; session_start(); require_once 'functions.php'; $user = $user ?? new User($_SESSION['uid']); -if (!empty($_GET['teleport']) && $user->admin == 1) { +if (!empty($_GET['teleport']) && $user->getAdmin() == 1) { db::c()->query('UPDATE `users`,`online` SET `users`.`room` = 20,`online`.`room` = 20 WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $_SESSION['uid']); } # ORDEN PHP -if ($user->admin) { +if ($user->getAdmin()) { $abil = db::c()->query('SELECT abil FROM users WHERE id = ?i', $user->getId())->fetch_assoc(); $abil = unserialize($abil['abil']); switch ($_POST['use']) { @@ -449,7 +449,7 @@ $bank = db::c()->query('SELECT `ekr` FROM `bank` WHERE `id` = ?i ', $_SESSION['u Template::header('user_abilities'); ?>
- admin == 1): ?> + getAdmin() == 1): ?> diff --git a/vxod.php b/vxod.php index c799557..eead655 100644 --- a/vxod.php +++ b/vxod.php @@ -11,7 +11,7 @@ if ($user->getLevel() < 4 && $user->getLevel() > 10) { exit; } -if ($user->room == 403) { +if ($user->getRoom() == 403) { header('Location: canalizaciya.php'); exit; } diff --git a/zayavka.php b/zayavka.php index 8cffc8e..88bad11 100644 --- a/zayavka.php +++ b/zayavka.php @@ -1,5 +1,6 @@ admin == 1) { +if ($do == "clear" && $user->getAdmin() == 1) { db::c()->query('UPDATE `zayavka` SET `coment` = "?s" WHERE `id` = ?i', 'Вырезано цензурой!', $_GET['zid']); } -if (!empty($_GET['del']) && $user->admin == 1) { //удаление заявки на бой. +if (!empty($_GET['del']) && $user->getAdmin() == 1) { //удаление заявки на бой. $zayavka = db::c()->query('SELECT `id` FROM `zayavka` WHERE `id` = ?i', $_GET['zid'])->fetch_assoc(); if (isset($zayavka['id'])) { db::c()->query('UPDATE `users` SET `zayavka` = 0 WHERE `zayavka` = ?i', $zayavka['id']); @@ -635,7 +636,7 @@ Template::header('zayavka'); room != 1 && $get != 'current') { + if ($user->getRoom() != 1 && $get != 'current') { exit('В этой комнате невозможно подавать заявки!'); } if (!$get) { @@ -655,19 +656,19 @@ Template::header('zayavka'); } if (!empty($_POST['back'])) { unlink("/tmp/zayavka/" . $user->getId() . ".txt"); - echo $zay->delzayavka($user->getId(), $user->zayavka, 2, 0); + echo $zay->delzayavka($user->getId(), $user->getZayavka(), 2, 0); } if (!empty($_POST['back2'])) { - $z = $zay->getlist(2, null, $user->zayavka); + $z = $zay->getlist(2, null, $user->getZayavka()); AddChatSystem('Внимание!' . Nick::id($user->getId())->short() . ' отозвал заявку.'); - echo $zay->delteam($user->getId(), $user->zayavka, 2); + echo $zay->delteam($user->getId(), $user->getZayavka(), 2); } if (!empty($_POST['cansel'])) { - $z = $zay->getlist(2, null, $user->zayavka); - echo $zay->delteam($z[$user->zayavka]['team2'][0], $user->zayavka, 2); + $z = $zay->getlist(2, null, $user->getZayavka()); + echo $zay->delteam($z[$user->getZayavka()]['team2'][0], $user->getZayavka(), 2); AddChatSystem('Внимание!' . Nick::id($user->getId())->short() . ' отказался от поединка.'); } - if (!empty($_POST['confirm2']) && empty($user->zayavka)) { + if (!empty($_POST['confirm2']) && empty($user->getZayavka())) { $z = $zay->getlist(2, null, $_REQUEST['gocombat']); $toper = db::c()->query('SELECT `klan` FROM `users` WHERE `id` = ?i', $z[$_REQUEST['gocombat']]['team1'][0])->fetch_assoc(); if ($user->getClan() != $toper['klan'] || !$user->getClan()) { @@ -677,7 +678,7 @@ Template::header('zayavka'); echo "
Ожидаем подтверждения боя. "; } if (!empty($_POST['gofi'])) { - $zay->battlestart($user->getId(), $user->zayavka, 2); + $zay->battlestart($user->getId(), $user->getZayavka(), 2); } echo "
"; echo '
'; @@ -700,23 +701,23 @@ Template::header('zayavka'); getlist(2, null, $user->zayavka); + $z = $zay->getlist(2, null, $user->getZayavka()); if ($zay->user_status($user->getId()) == 1) { - if (count($z[$user->zayavka]['team2']) > 0) { - echo "Внимание! " . Nick::id($z[$user->zayavka]['team2'][0])->full(1) . " принял заявку на бой, нужно отказать или принять вызов. "; + if (count($z[$user->getZayavka()]['team2']) > 0) { + echo "Внимание! " . Nick::id($z[$user->getZayavka()]['team2'][0])->full(1) . " принял заявку на бой, нужно отказать или принять вызов. "; } else { - if ($z[$user->zayavka]['level'] == 2) { + if ($z[$user->getZayavka()]['level'] == 2) { echo "Заявка на бой подана, ожидаем противника. "; $Path = "/tmp/zayavka/" . $user->getId() . ".txt"; $f = fopen($Path, "r"); $timeFigth = fread($f, filesize($Path)); fclose($f); if ($timeFigth < time() && ($user->getLevel() <= 14)) { - if ($get == 'trainstart' && $user->health > $user->maxHealth * 0.33 && ($user->getLevel() <= 7 || $user->admin == 1)) { + if ($get == 'trainstart' && $user->getHealth() > $user->getMaxHealth() * 0.33 && ($user->getLevel() <= 7 || $user->getAdmin() == 1)) { unlink("/tmp/zayavka/" . $user->id . ".txt"); - $zay->delzayavka($user->id, $user->zayavka, 2, 0); + $zay->delzayavka($user->id, $user->getZayavka(), 2, 0); - mysql_query("INSERT INTO `bots` (`name`, `prototype`, `battle`, `hp`) values ('" . $user->getLogin() . " (Клон 1)','" . $user->id . "','','" . $user->maxHealth . "');"); + mysql_query("INSERT INTO `bots` (`name`, `prototype`, `battle`, `hp`) values ('" . $user->getLogin() . " (Клон 1)','" . $user->getId() . "','','" . $user->getMaxHealth() . "');"); $bot = mysql_insert_id(); $teams = []; @@ -742,7 +743,7 @@ Template::header('zayavka'); $timeFigth = fread($f, filesize($Path)); fclose($f); - if ($user->admin == 1) { + if ($user->getAdmin() == 1) { echo " или "; } @@ -750,7 +751,7 @@ Template::header('zayavka'); } } } - if ($zay->user_status($user->id) == 2 && $z[$user->zayavka]['level'] == 2) { + if ($zay->user_status($user->id) == 2 && $z[$user->getZayavka()]['level'] == 2) { echo "Ожидаем подтверждения боя. "; } echo '

Показывать заявки
моего уровня
все
'; @@ -766,9 +767,9 @@ Template::header('zayavka'); if ($get == 'group') { if ($zay->user_status($user->id) != 0) { - $z = $zay->getlist(4, null, $user->zayavka); - if ($z[$user->zayavka]['level'] == 4) { - $battleStartTime = round(($z[$user->zayavka]['start'] - time()) / 60, 1); + $z = $zay->getlist(4, null, $user->getZayavka()); + if ($z[$user->getZayavka()]['level'] == 4) { + $battleStartTime = round(($z[$user->getZayavka()]['start'] - time()) / 60, 1); echo "
Ожидаем начала группового боя...
Бой начнется через: $battleStartTime мин.
"; } } else { ?> @@ -840,7 +841,7 @@ Template::header('zayavka'); zayavka)) { +if (!empty($_POST['goconfirm']) && empty($user->getZayavka())) { echo '
'; $z = $zay->getlist(4, null, $_POST['gocombat']); echo "Ожидаем начала группового боя...
Бой начнется через: " . round(($z[$_POST['gocombat']]['start'] - time()) / 60, 1) . " мин."; @@ -880,14 +881,14 @@ if (!empty($_POST['goconfirm']) && empty($user->zayavka)) { echo ""; -if (!empty($_POST['confirm1']) && !empty($_POST['gocombat']) && empty($user->zayavka)) { +if (!empty($_POST['confirm1']) && !empty($_POST['gocombat']) && empty($user->getZayavka())) { echo $zay->addteam(1, 4); } -if (!empty($_POST['confirm2']) && $_POST['gocombat'] && empty($user->zayavka)) { +if (!empty($_POST['confirm2']) && $_POST['gocombat'] && empty($user->getZayavka())) { echo $zay->addteam(2, 4); } -if (!empty($_POST['open']) && empty($user->zayavka)) { +if (!empty($_POST['open']) && empty($user->getZayavka())) { switch ($_POST['levellogin1']) { default: case 0 : //любой @@ -915,8 +916,8 @@ if (!empty($_POST['open']) && empty($user->zayavka)) { $max1 = $user->getLevel(); break; case 6 : //мой уровень +/- 1 - $min1 = (int)$user->getLevel() - 1; - $max1 = (int)$user->getLevel() + 1; + $min1 = $user->getLevel() - 1; + $max1 = $user->getLevel() + 1; break; case 99 : // кланы $min1 = 99; @@ -950,8 +951,8 @@ if (!empty($_POST['open']) && empty($user->zayavka)) { $max1 = $user->getLevel(); break; case 6 : //мой уровень +/- 1 - $min1 = (int)$user->getLevel() - 1; - $max1 = (int)$user->getLevel() + 1; + $min1 = $user->getLevel() - 1; + $max1 = $user->getLevel() + 1; break; case 99 : // кланы $min1 = 99; @@ -998,7 +999,7 @@ echo 'zayavka)) { + if (!empty($_POST['open']) && empty($user->getZayavka())) { switch ($_POST['levellogin1']) { default: case 0 : @@ -1030,9 +1031,9 @@ if ($get == 'haos') { echo 'Хаотичный бой - разновидность группового, где группы формируются автоматически. Бой не начнется, если собралось меньше 4-х человек. '; } if ($zay->user_status($user->id)) { - $z = $zay->getlist(5, null, $user->zayavka); - if ($z[$user->zayavka]['level'] == 5) { - echo "Ожидаем начала группового боя...
Бой начнется через: " . round(($z[$user->zayavka]['start'] - time()) / 60, 1) . " мин."; + $z = $zay->getlist(5, null, $user->getZayavka()); + if ($z[$user->getZayavka()]['level'] == 5) { + echo "Ожидаем начала группового боя...
Бой начнется через: " . round(($z[$user->getZayavka()]['start'] - time()) / 60, 1) . " мин."; } } echo '

Показывать заявки
моего уровня
все
';