From 5dce7c644f9515b1f08844ec4b8f42497872de61 Mon Sep 17 00:00:00 2001 From: lopar Date: Wed, 28 Oct 2020 00:48:16 +0200 Subject: [PATCH 01/12] =?UTF-8?q?=D0=9C=D0=BE=D0=B6=D0=BD=D0=BE=20=D0=B1?= =?UTF-8?q?=D1=8B=D0=BB=D0=BE=20=D0=BE=D0=B1=D0=BD=D1=83=D0=BB=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20=D1=81=D1=87=D1=91=D1=82=20=D0=BF=D0=BE=D0=BB=D1=83?= =?UTF-8?q?=D1=87=D0=B0=D1=82=D0=B5=D0=BB=D1=8F=20=D0=B4=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D0=B3.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/Bank.php | 45 ++++++++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/classes/Bank.php b/classes/Bank.php index cf8a999..e7fe40b 100644 --- a/classes/Bank.php +++ b/classes/Bank.php @@ -56,14 +56,18 @@ class Bank /** * Пишем банковское событие в лог в БД * - * @param $receiverId - user_id получателя - * @param $amount - * @param $operationType + * @param int $receiverId - user_id получателя + * @param int $amount + * @param string $operationType + * @param int $senderId * * @throws \Krugozor\Database\Mysql\Exception */ - private function bankLogs($receiverId, $amount, $operationType) + private function bankLogs(int $receiverId, int $amount, string $operationType, int $senderId = 0) { + if (!$senderId) { + $senderId = $this->user_id; + } $text = ''; if ($operationType === "sendMoney") { $text = self::LOG_SEND . " Комиссия: " . $this->bankComission($amount); @@ -76,7 +80,7 @@ class Bank } db::c()->query('INSERT INTO `bank_logs` (sender_id, receiver_id, amount, type, text) - VALUES (?i, ?i, ?i, "?s", "?s")', $this->user_id, $receiverId, $amount, $operationType, $text); + VALUES (?i, ?i, ?i, "?s", "?s")', $senderId, $receiverId, $amount, $operationType, $text); } @@ -91,22 +95,25 @@ class Bank */ public function sendMoney(int $receiver, int $amount): void { + $receiverWallet = db::c()->query('SELECT money FROM bank WHERE user_id = ?i', $receiver)->fetch_object(); if ($amount <= 0) { throw new Exception(self::ERROR_WRONG_AMOUNT); } - if (!db::c()->query('SELECT 1 FROM bank WHERE user_id = ?i', $receiver)) { + if (!$receiverWallet) { throw new Exception(self::ERROR_NO_BANK_ACCOUNT); } $amountWithComission = $amount + $this->bankComission($amount); if ($amountWithComission > $this->money) { throw new Exception(self::ERROR_NO_MONEY_IN_BANK_ACCOUNT); } - $this->money -= $amountWithComission; // Снимаем сумму с комиссией у отправителя + $this->money -= $amountWithComission; self::setBankMoney($this->money, $this->user_id); + $this->bankLogs($receiver, $this->money, "sendMoney"); // Отдаём сумму на счёт получателю - self::setBankMoney($amount, $receiver); - $this->bankLogs($receiver, $amount, "sendMoney"); + $receiverWallet->money += $amount; + self::setBankMoney($receiverWallet->money, $receiver); + $this->bankLogs($receiver, $receiverWallet->money, "receiveMoney"); } /** @@ -133,7 +140,7 @@ class Bank // Отдаём сумму на счёт получателю $this->money += $amount; self::setBankMoney($this->money, $this->user_id); - $this->bankLogs(0, $amount, "depositMoney"); + $this->bankLogs(0, $this->money, "depositMoney"); } /** @@ -156,24 +163,28 @@ class Bank // Снимаем сумму с комиссией у отправителя $this->money -= $amountWithComission; self::setBankMoney($this->money, $this->user_id); + $this->bankLogs(0, $this->money, "withdrawMoney"); // Отдаём сумму в кошелёк получателя //todo check it! $this->user->money += $amount; self::setWalletMoney($this->user->money, $this->user_id); - $this->bankLogs(0, $amount, "withdrawMoney"); } /** * Установить количество денег на банковском счету. * - * @param int $amount - сумма. - * @param int $user_id - ID пользователя. + * @param int $amount сумма. + * @param int $user_id ID пользователя. + * @param string $operationType Тип операции. По умолчанию пусто. Если ввести, система запишет событие в банковский лог. * * @throws \Krugozor\Database\Mysql\Exception */ - public static function setBankMoney(int $amount, int $user_id): void + public static function setBankMoney(int $amount, int $user_id, string $operationType = ''): void { - db::c()->query('UPDATE bank SET money = ?i WHERE `id` = ?i', $amount, $user_id); + db::c()->query('UPDATE bank SET money = ?i WHERE user_id = ?i', $amount, $user_id); + if ($operationType) { + (new Bank)->bankLogs(0, $amount, $operationType); + } } /** @@ -188,4 +199,8 @@ class Bank { db::c()->query('UPDATE users SET money = ?i WHERE `id` = ?i', $amount, $user_id); } + + public function getBankMoney() { + return $this->money; + } } \ No newline at end of file From 4251027063c0ee0a3a073146a438890a6b4f669e Mon Sep 17 00:00:00 2001 From: lopar Date: Wed, 28 Oct 2020 00:59:37 +0200 Subject: [PATCH 02/12] =?UTF-8?q?=D0=A1=D0=BC=D0=B5=D0=BD=D0=B0=20=D0=BD?= =?UTF-8?q?=D0=B0=D0=B7=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D1=8F=D1=87=D0=B5?= =?UTF-8?q?=D0=B9=D0=BA=D0=B8=20=D0=B1=D0=B0=D0=B7=D1=8B.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/Bank.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/Bank.php b/classes/Bank.php index e7fe40b..b5c1c37 100644 --- a/classes/Bank.php +++ b/classes/Bank.php @@ -79,7 +79,7 @@ class Bank $text = self::LOG_WITHDRAW . " Комиссия: " . $this->bankComission($amount); } - db::c()->query('INSERT INTO `bank_logs` (sender_id, receiver_id, amount, type, text) + db::c()->query('INSERT INTO `bank_logs` (sender_id, receiver_id, amount_result, type, text) VALUES (?i, ?i, ?i, "?s", "?s")', $senderId, $receiverId, $amount, $operationType, $text); } @@ -183,7 +183,7 @@ class Bank { db::c()->query('UPDATE bank SET money = ?i WHERE user_id = ?i', $amount, $user_id); if ($operationType) { - (new Bank)->bankLogs(0, $amount, $operationType); + (new Bank($user_id))->bankLogs(0, $amount, $operationType); } } From 8a9bb64b534802accceb37366539826e03e8207f Mon Sep 17 00:00:00 2001 From: lopar Date: Wed, 28 Oct 2020 01:41:42 +0200 Subject: [PATCH 03/12] =?UTF-8?q?=D0=91=D0=BE=D0=BB=D0=B5=D0=B5=20=D1=8F?= =?UTF-8?q?=D0=B2=D0=BD=D0=BE=D0=B5=20=D0=B4=D0=BE=D0=BA=D1=83=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=B9=20=D0=B1=D0=B0=D0=BD?= =?UTF-8?q?=D0=BA=D0=B0,=20=D0=BB=D0=BE=D0=B3=D0=B3=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=BE=D0=BB=D1=83=D1=87?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F=20=D1=81=D1=80=D0=B5=D0=B4=D1=81=D1=82?= =?UTF-8?q?=D0=B2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bank.php | 2 +- classes/Bank.php | 56 ++++++++++++++++++++++++++---------------------- config.php | 2 +- 3 files changed, 32 insertions(+), 28 deletions(-) diff --git a/bank.php b/bank.php index aa21297..35572af 100644 --- a/bank.php +++ b/bank.php @@ -87,6 +87,6 @@ Template::header('Банк'); - Комиссия: % от переводимой суммы, но не менее 1 кр. + Комиссия: % от переводимой суммы, но не менее 1 кр. \ No newline at end of file diff --git a/classes/Bank.php b/classes/Bank.php index b5c1c37..b6641e5 100644 --- a/classes/Bank.php +++ b/classes/Bank.php @@ -37,58 +37,60 @@ class Bank } /** - * Комиссия: self::BANK_COMISSION от переводимой суммы, но не менее 1 кр. + * Комиссия: процент от переводимой суммы, но не менее 1 кр. Задаётся в config.php. * - * @param $amount + * @param int $amount сумма. * * @return int */ - private function bankComission($amount) + private function bankCommission(int $amount):int { - $bankComission = round($amount * Config::$bank_comission); - if ($bankComission < 1) { + $bankCommission = round($amount * Config::$bank_commission); + if ($bankCommission < 1) { return 1; } else { - return (int)$bankComission; + return (int)$bankCommission; } } /** * Пишем банковское событие в лог в БД * - * @param int $receiverId - user_id получателя - * @param int $amount - * @param string $operationType - * @param int $senderId + * @param int $receiverId ID получателя. + * @param int $amount сумма. + * @param string $operationType тип банковской операции. + * @param int $senderId ID отправителя (ID игрока, если не указано иное). * + * @return void * @throws \Krugozor\Database\Mysql\Exception */ - private function bankLogs(int $receiverId, int $amount, string $operationType, int $senderId = 0) + private function bankLogs(int $receiverId, int $amount, string $operationType, int $senderId = 0):void { if (!$senderId) { $senderId = $this->user_id; } $text = ''; - if ($operationType === "sendMoney") { - $text = self::LOG_SEND . " Комиссия: " . $this->bankComission($amount); - } elseif ($operationType === "depositMoney") { + if ($operationType == "sendMoney") { + $text = self::LOG_SEND . " Комиссия: " . $this->bankCommission($amount); + } elseif ($operationType == "depositMoney") { $receiverId = $this->user_id; $text = self::LOG_DEPOSIT; - } elseif ($operationType === "withdrawMoney") { + } elseif ($operationType == "withdrawMoney") { $receiverId = $this->user_id; - $text = self::LOG_WITHDRAW . " Комиссия: " . $this->bankComission($amount); + $text = self::LOG_WITHDRAW . " Комиссия: " . $this->bankCommission($amount); + } elseif ($operationType == "receiveMoney") { + $text = self::LOG_RECEIVE; } db::c()->query('INSERT INTO `bank_logs` (sender_id, receiver_id, amount_result, type, text) VALUES (?i, ?i, ?i, "?s", "?s")', $senderId, $receiverId, $amount, $operationType, $text); - } /** - * Перевод денег между бансковскими счетами игроков с банковской комиссией. + * Перевод денег между банковскими счетами игроков с банковской комиссией. * - * @param int $receiver - * @param int $amount + * @param int $receiver ID получателя. + * @param int $amount сумма. * * @return void * @throws \Krugozor\Database\Mysql\Exception @@ -102,7 +104,7 @@ class Bank if (!$receiverWallet) { throw new Exception(self::ERROR_NO_BANK_ACCOUNT); } - $amountWithComission = $amount + $this->bankComission($amount); + $amountWithComission = $amount + $this->bankCommission($amount); if ($amountWithComission > $this->money) { throw new Exception(self::ERROR_NO_MONEY_IN_BANK_ACCOUNT); } @@ -119,7 +121,7 @@ class Bank /** * Пополнение банковского счёта игрока * - * @param int $amount - сумма + * @param int $amount сумма. * * @return void * @throws \Krugozor\Database\Mysql\Exception @@ -146,7 +148,7 @@ class Bank /** * Снятие денег с банковского счёта игрока с банковской комиссией. * - * @param int $amount - сумма + * @param int $amount сумма. * * @return void * @throws \Krugozor\Database\Mysql\Exception @@ -156,7 +158,7 @@ class Bank if ($amount <= 0) { throw new Exception(self::ERROR_WRONG_AMOUNT); } - $amountWithComission = $amount + $this->bankComission($amount); + $amountWithComission = $amount + $this->bankCommission($amount); if ($this->money < $amountWithComission) { throw new Exception(self::ERROR_NO_MONEY_IN_BANK_ACCOUNT); } @@ -177,6 +179,7 @@ class Bank * @param int $user_id ID пользователя. * @param string $operationType Тип операции. По умолчанию пусто. Если ввести, система запишет событие в банковский лог. * + * @return void * @throws \Krugozor\Database\Mysql\Exception */ public static function setBankMoney(int $amount, int $user_id, string $operationType = ''): void @@ -190,9 +193,10 @@ class Bank /** * Установить количество денег на руках. * - * @param int $amount - сумма. - * @param int $user_id - ID пользователя. + * @param int $amount сумма. + * @param int $user_id ID пользователя. * + * @return void * @throws \Krugozor\Database\Mysql\Exception */ public static function setWalletMoney(int $amount, int $user_id): void diff --git a/config.php b/config.php index 2d64487..830caaa 100644 --- a/config.php +++ b/config.php @@ -66,7 +66,7 @@ trait Config public static $clan_register_cost = 10000; //стоимость public static $clan_register_lock = 1; //запрет на регистрацию //Банк - public static $bank_comission = 0.05; //5% + public static $bank_commission = 0.05; //5% // Старая таблица опыта public static $exptable = [ 0 => [0, 0, 0, 0, 0, 20], From c05c3298f10f27cf7ab7cef249f7a6e6b8391965 Mon Sep 17 00:00:00 2001 From: lopar Date: Wed, 28 Oct 2020 01:42:20 +0200 Subject: [PATCH 04/12] =?UTF-8?q?=D0=90=D0=BA=D1=82=D1=83=D0=B0=D0=BB?= =?UTF-8?q?=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D1=8F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/Rooms.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/Rooms.php b/classes/Rooms.php index bc8b1d6..4f6b5d5 100644 --- a/classes/Rooms.php +++ b/classes/Rooms.php @@ -15,9 +15,8 @@ trait Rooms 25 => "Комиссионный магазин", 26 => "Большая парковая улица", 27 => "Почта", - 28 => "Регистратура кланов", 29 => "Банк", - 30 => "Регистратура кланов (мираж)", + 30 => "Регистратура кланов", 31 => "Башня смерти", 32 => "Готический замок", 33 => "Лабиринт хаоса", @@ -38,6 +37,7 @@ trait Rooms 51 => "Парковая улица", 52 => "Квартал Законников", 53 => "Библиотека", + 61 => "Академия", 200 => "Турнир", 401 => "Врата Ада", // БС @@ -185,5 +185,5 @@ trait Rooms 2655 => "Арена Богов", 2601 => "Замковая Площадь", 2702 => "Центральная площадь (мираж)", - ] ?? "Небытие"; + ]; } \ No newline at end of file From 0e73bcb1aea36494c802ad5a39caf39542a62ca1 Mon Sep 17 00:00:00 2001 From: lopar Date: Wed, 28 Oct 2020 01:52:53 +0200 Subject: [PATCH 05/12] =?UTF-8?q?=D0=9D=D0=BE=D0=B2=D1=8B=D0=B9=20=D1=81?= =?UTF-8?q?=D0=BF=D0=BE=D1=81=D0=BE=D0=B1=20=D0=B7=D0=B0=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D1=88=D0=B8=D0=B2=D0=B0=D1=82=D1=8C=20=D0=BA=D0=BE=D0=BD=D1=81?= =?UTF-8?q?=D1=82=D0=B0=D0=BD=D1=82=D1=8B.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/Bank.php | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/classes/Bank.php b/classes/Bank.php index b6641e5..5ef52e7 100644 --- a/classes/Bank.php +++ b/classes/Bank.php @@ -15,10 +15,13 @@ class Bank const ERROR_NO_BANK_ACCOUNT = "Ошибка! Счёта не существует!"; const ERROR_NO_MONEY_IN_BANK_ACCOUNT = "Ошибка! Нет денег на счету!"; const ERROR_WRONG_AMOUNT = "Ошибка! Сумма должна быть положительной!"; - const LOG_SEND = "Банк: Перевод средств на другой счёт."; - const LOG_RECEIVE = "Банк: Получение средств."; - const LOG_DEPOSIT = "Пополнение счёта."; - const LOG_WITHDRAW = "Снятие денег со счёта."; + const LOG = [ + 'sendMoney' => 'Банк: Перевод средств на другой счёт.', + 'receiveMoney' => 'Банк: Получение средств.', + 'depositMoney' => 'Пополнение счёта.', + 'withdrawMoney' => 'Снятие денег со счёта.', + 'clanRegister' => 'Оплата стоимости регистрации клана.', + ]; public function __construct($row) { @@ -43,7 +46,7 @@ class Bank * * @return int */ - private function bankCommission(int $amount):int + private function bankCommission(int $amount): int { $bankCommission = round($amount * Config::$bank_commission); if ($bankCommission < 1) { @@ -56,30 +59,27 @@ class Bank /** * Пишем банковское событие в лог в БД * - * @param int $receiverId ID получателя. - * @param int $amount сумма. + * @param int $receiverId ID получателя. + * @param int $amount сумма. * @param string $operationType тип банковской операции. - * @param int $senderId ID отправителя (ID игрока, если не указано иное). + * @param int $senderId ID отправителя (ID игрока, если не указано иное). * * @return void * @throws \Krugozor\Database\Mysql\Exception */ - private function bankLogs(int $receiverId, int $amount, string $operationType, int $senderId = 0):void + private function bankLogs(int $receiverId, int $amount, string $operationType, int $senderId = 0): void { if (!$senderId) { $senderId = $this->user_id; } - $text = ''; + $text = self::LOG[$operationType]; if ($operationType == "sendMoney") { - $text = self::LOG_SEND . " Комиссия: " . $this->bankCommission($amount); + $text .= " Комиссия: " . $this->bankCommission($amount); } elseif ($operationType == "depositMoney") { $receiverId = $this->user_id; - $text = self::LOG_DEPOSIT; } elseif ($operationType == "withdrawMoney") { $receiverId = $this->user_id; - $text = self::LOG_WITHDRAW . " Комиссия: " . $this->bankCommission($amount); - } elseif ($operationType == "receiveMoney") { - $text = self::LOG_RECEIVE; + $text .= " Комиссия: " . $this->bankCommission($amount); } db::c()->query('INSERT INTO `bank_logs` (sender_id, receiver_id, amount_result, type, text) @@ -90,7 +90,7 @@ class Bank * Перевод денег между банковскими счетами игроков с банковской комиссией. * * @param int $receiver ID получателя. - * @param int $amount сумма. + * @param int $amount сумма. * * @return void * @throws \Krugozor\Database\Mysql\Exception @@ -175,8 +175,8 @@ class Bank /** * Установить количество денег на банковском счету. * - * @param int $amount сумма. - * @param int $user_id ID пользователя. + * @param int $amount сумма. + * @param int $user_id ID пользователя. * @param string $operationType Тип операции. По умолчанию пусто. Если ввести, система запишет событие в банковский лог. * * @return void @@ -193,7 +193,7 @@ class Bank /** * Установить количество денег на руках. * - * @param int $amount сумма. + * @param int $amount сумма. * @param int $user_id ID пользователя. * * @return void @@ -204,7 +204,8 @@ class Bank db::c()->query('UPDATE users SET money = ?i WHERE `id` = ?i', $amount, $user_id); } - public function getBankMoney() { + public function getBankMoney() + { return $this->money; } } \ No newline at end of file From c666e3e8a2e518ebd056a511b9cd42b1ed7d394a Mon Sep 17 00:00:00 2001 From: lopar Date: Wed, 28 Oct 2020 14:31:17 +0200 Subject: [PATCH 06/12] =?UTF-8?q?=D0=92=D1=85=D0=BE=D0=B4=20=D0=B2=20?= =?UTF-8?q?=D1=81=D1=87=D1=91=D1=82=20=D0=BD=D0=B5=20=D0=BD=D1=83=D0=B6?= =?UTF-8?q?=D0=B5=D0=BD=20=D1=82=D0=B0=D0=BA=20=D0=BA=D0=B0=D0=BA=20=D1=81?= =?UTF-8?q?=D1=87=D1=91=D1=82=20=D0=BE=D0=B1=D1=8F=D0=B7=D0=B0=D1=82=D0=B5?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=20=D0=B4=D0=BB=D1=8F=20=D0=B2=D1=81=D0=B5?= =?UTF-8?q?=D1=85=20=D0=B8=20=D0=B7=D0=B0=D0=B2=D0=BE=D0=B4=D0=B8=D1=82?= =?UTF-8?q?=D1=81=D1=8F=20=D0=BF=D1=80=D0=B8=20=D1=80=D0=B5=D0=B3=D0=B8?= =?UTF-8?q?=D1=81=D1=82=D1=80=D0=B0=D1=86=D0=B8=D0=B8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bank.php | 117 ++++++++++++++++++++++++------------------------------- 1 file changed, 51 insertions(+), 66 deletions(-) diff --git a/bank.php b/bank.php index 35572af..ec6afa2 100644 --- a/bank.php +++ b/bank.php @@ -16,77 +16,62 @@ if ($user->battle != 0) { header('location: fbattle.php'); exit; } -const BANK_SESSION_NAME = "bankid"; const SUCCESS = "Успешная операция!"; -$get = urldecode(filter_input(INPUT_SERVER, 'QUERY_STRING')); -if ($get == 'exit') { - $_SESSION[BANK_SESSION_NAME] = null; -} + $bank = new Bank($user->id); $status = ''; -if (isset($_POST['userlogin'])) { - $_SESSION[BANK_SESSION_NAME] = $bank->user_id; +$toid = (int)$_POST['to_id'] ?? 0; +$summa = (int)$_POST['summa'] ?? 0; +$submit = $_POST['action'] ?? ''; +// Зачисление кредитов на счёт. +if ($submit === 'depositMoney' && $summa) { + $bank->depositMoney($summa); + $status = SUCCESS; } -if ($_SESSION[BANK_SESSION_NAME]) { - $toid = (int)$_POST['to_id'] ?? 0; - $summa = (int)$_POST['summa'] ?? 0; - $submit = $_POST['action'] ?? ''; - // Зачисление кредитов на счёт. - if ($submit === 'depositMoney' && $summa) { - $bank->depositMoney($summa); - $status = SUCCESS; - } - // Снятие кредитов со счёта. - if ($submit === 'withdrawMoney' && $summa) { - $bank->withdrawMoney($summa); - $status = SUCCESS; - } - // Перевод кредитов на другой счёт. - if ($submit === 'sendMoney' && $summa && $toid) { - $bank->sendMoney($toid, $summa); - $status = SUCCESS; - } - unset($submit, $summa, $toid); +// Снятие кредитов со счёта. +if ($submit === 'withdrawMoney' && $summa) { + $bank->withdrawMoney($summa); + $status = SUCCESS; } +// Перевод кредитов на другой счёт. +if ($submit === 'sendMoney' && $summa && $toid) { + $bank->sendMoney($toid, $summa); + $status = SUCCESS; +} +unset($submit, $summa, $toid); + Template::header('Банк'); ?> - - -

Банк

- - ← выйти из банка -
- -

← выйти из счёта

-
-
- Cчет №user_id ?> - На счету: money ?> -
- На руках: -
-
- Работа со счётом -
- - - -
-
- - - -
-
-
- Перевод кредитов -
- -
- - -
- Комиссия: % от переводимой суммы, но не менее 1 кр. -
- \ No newline at end of file + + + +
+
+ На счету: getMoney() ?> +
+ На руках: money ?> +
+
+ Работа со счётом +
+ + + +
+
+ + + +
+
+
+ Перевод кредитов +
+ +
+ + +
+ Комиссия: % от переводимой суммы, но не менее 1 кр. +
From ff1afa7a7a260e202e1e4d804db974c4009b4784 Mon Sep 17 00:00:00 2001 From: lopar Date: Wed, 28 Oct 2020 14:32:14 +0200 Subject: [PATCH 07/12] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D0=BD=D0=B0=D1=8F=20`money`=20=D0=B1=D0=BE=D0=BB=D0=B5?= =?UTF-8?q?=D0=B5=20=D0=BD=D0=B5=D0=B4=D0=BE=D1=81=D1=82=D1=83=D0=BF=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=B8=D0=B7=D0=B2=D0=BD=D0=B5,=20=D0=B2=D1=8B=D0=B7?= =?UTF-8?q?=D1=8B=D0=B2=D0=B0=D0=B5=D1=82=D1=81=D1=8F=20=D1=87=D0=B5=D1=80?= =?UTF-8?q?=D0=B5=D0=B7=20=D0=B3=D0=B5=D1=82=D1=82=D0=B5=D1=80=20=D0=B8=20?= =?UTF-8?q?=D1=81=D0=B5=D1=82=D1=82=D0=B5=D1=80.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/Bank.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/classes/Bank.php b/classes/Bank.php index 5ef52e7..81a1a42 100644 --- a/classes/Bank.php +++ b/classes/Bank.php @@ -8,7 +8,7 @@ class Bank { public $user_id; - public $money; + private $money; private $user; const ERROR_NO_MONEY_IN_WALLET = "Ошибка! Нет денег в кошельке!"; @@ -204,8 +204,13 @@ class Bank db::c()->query('UPDATE users SET money = ?i WHERE `id` = ?i', $amount, $user_id); } - public function getBankMoney() + public function getMoney() { return $this->money; } + + public function setMoney($amount) + { + $this->money = $amount; + } } \ No newline at end of file From 687e65f251f32e24968b7b9a238ec6747e42035b Mon Sep 17 00:00:00 2001 From: lopar Date: Wed, 28 Oct 2020 14:32:57 +0200 Subject: [PATCH 08/12] =?UTF-8?q?=D0=A4=D1=83=D0=BD=D0=BA=D1=86=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=B7=D0=B0=D0=B3=D0=BE=D0=BB=D0=BE=D0=B2=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BB=D0=BE=D0=BA=D0=B0=D1=86=D0=B8=D0=B8=20=D0=B8=20?= =?UTF-8?q?=D0=BA=D0=BD=D0=BE=D0=BF=D0=BA=D0=B8=20=D0=B2=D1=8B=D1=85=D0=BE?= =?UTF-8?q?=D0=B4=D0=B0=20=D0=BD=D0=B0=20=D1=83=D0=BB=D0=B8=D1=86=D1=83.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/Template.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/classes/Template.php b/classes/Template.php index 2c0801a..2d9b418 100644 --- a/classes/Template.php +++ b/classes/Template.php @@ -32,4 +32,19 @@ HTML_HEADER; } return $head; } + + /** + * @param string $buildingName название здания + * @param string $streetName служебное название улицы на которой стоит здание для кнопки возврата. + * @return string + */ + public static function buildingTop(string $buildingName, string $streetName): void + { + echo << + + +

$buildingName

+HTML; + } } \ No newline at end of file From 6d9f314e1bee6a748d2652870af43f918f8da828 Mon Sep 17 00:00:00 2001 From: lopar Date: Wed, 28 Oct 2020 14:33:50 +0200 Subject: [PATCH 09/12] =?UTF-8?q?=D0=9E=D0=B1=D1=80=D0=B0=D1=89=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BA=20=D0=B1=D0=B0=D0=BD=D0=BA=D0=BE?= =?UTF-8?q?=D0=B2=D1=81=D0=BA=D0=B8=D0=BC=20=D1=81=D1=80=D0=B5=D0=B4=D1=81?= =?UTF-8?q?=D1=82=D0=B2=D0=B0=D0=BC=20=D1=87=D0=B5=D1=80=D0=B5=D0=B7=20?= =?UTF-8?q?=D0=B3=D0=B5=D1=82=D1=82=D0=B5=D1=80.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/UserInfo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/UserInfo.php b/classes/UserInfo.php index eb5c774..abef12e 100644 --- a/classes/UserInfo.php +++ b/classes/UserInfo.php @@ -77,7 +77,7 @@ class UserInfo extends User $this->experience . '
' . $this->free_stat_points . '
' . $this->money . '
' . - $this->Bank->money; + $this->Bank->getMoney(); } $nameString = ''; if ($this->align) { @@ -139,7 +139,7 @@ class UserInfo extends User if ($this->watcherIsAdmin) { $this->Bank = new Bank($this->id); $infoString = '
ИД Игрока: %s
ИД Комнаты: %s
Деньги: %s
Деньги в банке: %s
Опыт: %s
Нераспределённые очки: %s
Текущая сессия: %s
'; - echo sprintf($infoString, $this->id, $this->room, $this->money, $this->Bank->money, $this->experience, $this->free_stat_points, $this->session_id); + echo sprintf($infoString, $this->id, $this->room, $this->money, $this->Bank->getMoney(), $this->experience, $this->free_stat_points, $this->session_id); } $this->UserLogs = new UserLogModel($this->id); echo '
Личное дело
'; From f1b9ce6a45ed8fbcc3557d3a074a51ef41acf229 Mon Sep 17 00:00:00 2001 From: lopar Date: Wed, 28 Oct 2020 15:04:29 +0200 Subject: [PATCH 10/12] =?UTF-8?q?=D0=A0=D0=B0=D0=B1=D0=BE=D1=87=D0=B0?= =?UTF-8?q?=D1=8F=20=D0=B7=D0=B0=D1=8F=D0=B2=D0=BA=D0=B0=20=D0=BD=D0=B0=20?= =?UTF-8?q?=D1=80=D0=B5=D0=B3=D0=B8=D1=81=D1=82=D1=80=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D1=8E=20=D0=BA=D0=BB=D0=B0=D0=BD=D0=B0.=20=D0=A0=D0=B0=D0=B1?= =?UTF-8?q?=D0=BE=D1=87=D0=B0=D1=8F=20=D1=80=D0=B5=D0=B3=D0=B8=D1=81=D1=82?= =?UTF-8?q?=D1=80=D0=B0=D1=82=D1=83=D1=80=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- clan_create.php | 132 +++++++++++++++++++++++------------------------ classes/City.php | 2 +- 2 files changed, 66 insertions(+), 68 deletions(-) diff --git a/clan_create.php b/clan_create.php index a2d1540..2ad6aad 100644 --- a/clan_create.php +++ b/clan_create.php @@ -10,23 +10,26 @@ if ($user->room != 30) { header("Location: main.php"); exit; } -$klanName = $_POST['klanname'] ?? ''; -$klanAbbr = $_POST['klanabbr'] ?? ''; -$klanDescr = $_POST['klandescr'] ?? ''; +$userClan = db::c()->query('SELECT short_name, full_name, info FROM clans where owner_id = ?i', $user->id)->fetch_object(); +$clanFullName = $_POST['clan_full_name'] ?? ''; +$clanShortName = $_POST['clan_short_name'] ?? ''; +$clanInfo = $_POST['clan_info'] ?? ''; +$userBank = new Bank($user->id); +if ($clanFullName && $clanShortName && $clanInfo && !$userClan) { -if ($klanName && $klanAbbr && $klanDescr) { - - $eff = db::c()->query('SELECT 1 FROM `effects` WHERE `owner` = ?i AND `type` = 20', $user->id); - $name_check = db::c()->query('SELECT 1 FROM `clans` WHERE `name` = "?s" OR `short` = "?s"', 111, 333); + $eff = db::c()->query('SELECT 1 FROM users_effects WHERE type = 20 AND owner_id = ?i', $user->id); + $name_check = db::c()->query('SELECT owner_id FROM clans WHERE full_name = "?s" OR short_name = "?s"', $clanFullName, $clanShortName); $errorMessage = []; - + if (Config::$clan_register_lock) { + $errorMessage[10] = 'Регистрация кланов закрыта!
'; + } if ($user->align) { $errorMessage[0] = 'Вы уже имеете направленность!.
'; } if ($user->clan) { $errorMessage[1] = 'Вы уже состоите в клане!.
'; } - if (Config::$clan_register_cost >= $user->money) { + if (Config::$clan_register_cost >= $userBank->getMoney()) { $errorMessage[2] = 'Не хватает денег на регистрацию клана.
'; } if (!$eff) { @@ -35,67 +38,62 @@ if ($klanName && $klanAbbr && $klanDescr) { if (!$name_check) { $errorMessage[4] = 'Клан с такими данными уже существует.
'; } - - if (!$errorMessage && !Config::$clan_register_lock) { -// db::c()->query('INSERT INTO `reg_klan` (owner, name, abr, descr) VALUES (?i,"?s","?s","?s")', -// $user->id, $klanName, $klanAbbr, $klanDescr); - $user->money -= Config::$clan_register_cost; - Bank::setBankMoney($user->money, $user->id); - echo 'Заявка на регистрацию клана подана.'; - err('Проверки пройдены, но клан регистрировать пока нельзя!'); + if (!$errorMessage || $user->admin) { + try { + db::c()->query('INSERT INTO clans (owner_id, full_name, short_name, info) VALUES (?i,"?s","?s","?s")', $user->id, $clanFullName, $clanShortName, $clanInfo); + $userBank->setMoney($userBank->getMoney() - Config::$clan_register_cost); + Bank::setBankMoney($userBank->getMoney(), $user->id, 'clanRegister'); + // Заглушка для отображения данных по только что зарегистрированному клану, когда запрос в базу в начале файла ещё не проходит. + $userClan = new stdClass(); + $userClan->full_name = $clanFullName; + $userClan->short_name = $clanShortName; + $userClan->info = $clanInfo; + unset($clanShortName, $clanFullName, $clanInfo); + echo 'Заявка на регистрацию клана подана.'; + } catch (Throwable $exception) { + echo '
Ошибка записи в базу!
' . $exception . '
'; + } } else { foreach ($errorMessage as $error) { echo sprintf('%s', $error); } } } -Template::header('Регистратура кланов'); -?> - -

Регистратура кланов

- ← выйти из регистратуры -admin) { - $clanreg = []; - $clanPremoderationList = [] - - //$clanPremoderationList = db::c()->query('SELECT * FROM clans WHERE approved = 0'); - foreach ($clanPremoderationList->fetch_object() as $clan) { - echo sprintf('
%s %s
%s
', $clan->date, $clan->name, $clan->owner); - } - //$clanreg = db::c()->query('SELECT `date`,`name`,`abbr`,`owner`,`descr` FROM `reg_klan`')->fetch_assoc(); - echo ''; - while ($clanreg_row = $clanreg) { - echo " - - - - - - "; - } - echo '
", $clanreg_row['date'], "", $clanreg_row['name'], "", $clanreg_row['abbr'], "", Nick::id($clanreg_row['owner'])->full(), "", nl2br($clanreg_row['descr']), "
'; -} -?> -Для регистрации клана необходимо иметь: -
    -
  1. Проверку на чистоту. -
  2. 10000 кредитов на банковском счёте. -
-Поле информации не обазательное. Но его содержимое может серьёзно повысить шансы на регистрацию клана.
-Заявку на регистрацию подает глава клана. -
-
- Заявка на регистрацию - -
-
-
- -
-
\ No newline at end of file +Template::header(Rooms::$roomNames[30]); +Template::buildingTop(Rooms::$roomNames[30], 'strah'); +if ($userClan): ?> +
+
+ Заявка на регистрацию + +
+
+
+ +
+
+ +
+
+
+ Заявка на регистрацию + +
+
+
+ +
+
+
+
+ Для регистрации клана необходимо иметь: +
    +
  1. Проверку на чистоту. У вас её нет. +
  2. 10000 кредитов на банковском счёте. У вас на счету getMoney() ?>. +
+ Поле информации не обазательное. Но его содержимое может серьёзно повысить шансы на регистрацию клана.
+ Заявку на регистрацию подает глава клана. +
+ \ No newline at end of file diff --git a/classes/City.php b/classes/City.php index 67e2005..db25c92 100644 --- a/classes/City.php +++ b/classes/City.php @@ -26,7 +26,7 @@ class City self::showBuilding(4, "cap_arr_left", 258, 21, self::$roomNames[20]) . self::showBuilding(5, "spring_cap_bank", 180, 485, self::$roomNames[29]) . self::showBuilding(13, "spring_cap_flowershop", 220, 613, self::$roomNames[34]) . - self::showBuilding(14, "spring_cap_registratura", 170, 113, self::$roomNames[28]) . + self::showBuilding(14, "spring_cap_registratura", 170, 113, self::$roomNames[30]) . self::showBuilding(16, "spring_cap_tower", 5, 315, self::$roomNames[31]) . '
'; } elseif ($id === 26) { From d38d62c5b539778fc8937e457c01ec120e0b407d Mon Sep 17 00:00:00 2001 From: lopar Date: Wed, 28 Oct 2020 22:21:08 +0200 Subject: [PATCH 11/12] =?UTF-8?q?=D0=91=D1=83=D0=B4=D1=8C=20=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D0=BA=D0=BB=D1=8F=D1=82=20=D1=82=D0=BE=D1=82=20=D0=B4?= =?UTF-8?q?=D0=B5=D0=BD=D1=8C,=20=D0=BA=D0=BE=D0=B3=D0=B4=D0=B0=20=D1=8F?= =?UTF-8?q?=20=D1=80=D0=B5=D1=88=D0=B8=D0=BB=20=D0=B2=D0=B2=D0=B5=D1=81?= =?UTF-8?q?=D1=82=D0=B8=20=D0=BD=D0=B5=D0=B9=D0=BC=D1=81=D0=BF=D0=B5=D0=B9?= =?UTF-8?q?=D1=81=D1=8B...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/admin.php | 10 +- admin/edit_user.php | 2 +- akadem.php | 2 +- aren_of_angels.php | 2 +- bank.php | 44 +++++---- buttons.php | 4 +- c_forest.php | 2 +- c_haos.php | 2 +- c_haos_in.php | 2 +- c_park.php | 2 +- canalizaciya.php | 2 +- cave.php | 2 +- ch.php | 2 +- chat.php | 2 +- city.php | 92 +++++++++---------- clan.php | 2 +- clan_castle.php | 2 +- clan_create.php | 6 +- clans.php | 2 +- classes/{ => Battles}/Bank.php | 73 +++++++++------ classes/{ => Battles}/City.php | 1 + classes/{ => Battles}/DressedItems.php | 2 +- classes/{ => Battles}/InventoryItem.php | 2 +- classes/{ => Battles}/Item.php | 2 +- .../Battles/Magic}/CureInjury.php | 11 ++- classes/{ => Battles/Magic}/Magic.php | 2 +- classes/{magic => Battles/Magic}/attack.php | 2 +- .../Battles/Models}/EffectsModel.php | 6 +- .../Battles/Models}/PresentsModel.php | 10 +- .../Battles/Models}/UserLogModel.php | 4 +- classes/{ => Battles}/Nick.php | 2 +- classes/{ => Battles}/Rooms.php | 1 + classes/{ => Battles}/ShopItem.php | 2 +- classes/{ => Battles}/Template.php | 2 +- classes/{ => Battles}/Travel.php | 8 +- classes/{ => Battles}/User.php | 16 ++-- classes/{ => Battles}/UserEffects.php | 2 +- classes/{ => Battles}/UserInfo.php | 10 +- classes/{cave => Cave}/CaveBots.php | 0 classes/{cave => Cave}/CaveItems.php | 0 classes/{cave => Cave}/lose.php | 0 classes/{cave => Cave}/win.php | 0 {Database => classes/Database}/Exception.php | 0 {Database => classes/Database}/Mysql.php | 0 {Database => classes/Database}/Statement.php | 0 {Database => classes/Database}/battles.sql | 0 {Database => classes/Database}/db.php | 0 comission.php | 4 +- config.php | 27 +++--- enter.php | 2 +- enter_cave.php | 2 +- fbattle.php | 6 +- fight.php | 4 +- forest.php | 2 +- forum.php | 4 +- functions.php | 4 +- game.php | 2 +- game2.php | 2 +- gotzamok.php | 2 +- group_arena.php | 2 +- hell.php | 2 +- hostel.php | 4 +- hostel_room.php | 2 +- index.php | 4 +- inf.php | 6 +- lab.php | 2 +- lab2.php | 2 +- lab_enter.php | 2 +- labirint.php | 2 +- library.php | 2 +- logs.php | 2 +- magic/Healing.php | 4 +- magic/elem_ally_air.php | 2 +- magic/elem_ally_earth.php | 2 +- magic/elem_ally_fire.php | 2 +- magic/elem_ally_water.php | 2 +- magic/elem_foe_air.php | 2 +- magic/elem_foe_fire.php | 2 +- magic/elem_foe_water.php | 2 +- magic/elikbroni.php | 2 +- magic/elikurona.php | 2 +- magic/ident.php | 2 +- magic/incmagic.php | 4 +- magic/luck.php | 2 +- magic/sleep15.php | 2 +- magic/sleep30.php | 2 +- magic/stop.php | 2 +- magic/stop_200.php | 2 +- magic/wis_air_def1.php | 2 +- magic/wis_air_def2.php | 2 +- magic/wis_air_def3.php | 2 +- magic/wis_air_h1.php | 2 +- magic/wis_air_m1.php | 2 +- magic/wis_air_m2.php | 2 +- magic/wis_air_m3.php | 2 +- magic/wis_air_o1.php | 2 +- magic/wis_air_o2.php | 2 +- magic/wis_air_o3.php | 2 +- magic/wis_air_t1.php | 2 +- magic/wis_air_t2.php | 2 +- magic/wis_air_t3.php | 2 +- magic/wis_earth_def1.php | 2 +- magic/wis_earth_def2.php | 2 +- magic/wis_earth_def3.php | 2 +- magic/wis_earth_g1.php | 2 +- magic/wis_earth_g2.php | 2 +- magic/wis_earth_g3.php | 2 +- magic/wis_earth_k1.php | 2 +- magic/wis_earth_k2.php | 2 +- magic/wis_earth_k3.php | 2 +- magic/wis_earth_m1.php | 2 +- magic/wis_earth_m2.php | 2 +- magic/wis_earth_m3.php | 2 +- magic/wis_fire_def1.php | 2 +- magic/wis_fire_def2.php | 2 +- magic/wis_fire_def3.php | 2 +- magic/wis_fire_i1.php | 2 +- magic/wis_fire_i2.php | 2 +- magic/wis_fire_i3.php | 2 +- magic/wis_fire_p1.php | 2 +- magic/wis_fire_p2.php | 2 +- magic/wis_fire_p3.php | 2 +- magic/wis_fire_v1.php | 2 +- magic/wis_fire_v2.php | 2 +- magic/wis_fire_v3.php | 2 +- magic/wis_water_ch1.php | 2 +- magic/wis_water_ch2.php | 2 +- magic/wis_water_ch3.php | 2 +- magic/wis_water_def1.php | 2 +- magic/wis_water_def2.php | 2 +- magic/wis_water_def3.php | 2 +- magic/wis_water_o1.php | 2 +- magic/wis_water_o2.php | 2 +- magic/wis_water_o3.php | 2 +- magic/wis_water_tr1.php | 2 +- magic/wis_water_tr2.php | 2 +- magic/wis_water_tr3.php | 2 +- magic/zz.php | 2 +- main.php | 12 +-- module_quest.php | 2 +- podzem_dialog.php | 6 +- post.php | 4 +- presents.php | 4 +- quest_room.php | 2 +- register.php | 2 +- rememberpassword.php | 2 +- repair.php | 2 +- shop.php | 6 +- top_menu.php | 4 +- tournament.php | 2 +- tower.php | 2 +- towerin.php | 2 +- towerlog.php | 2 +- towerstamp.php | 2 +- ul_clans.php | 4 +- user_abilities.php | 4 +- user_anketa.php | 2 +- vxod.php | 2 +- zayavka.php | 2 +- 159 files changed, 339 insertions(+), 304 deletions(-) rename classes/{ => Battles}/Bank.php (72%) rename classes/{ => Battles}/City.php (99%) rename classes/{ => Battles}/DressedItems.php (99%) rename classes/{ => Battles}/InventoryItem.php (98%) rename classes/{ => Battles}/Item.php (99%) rename {magic => classes/Battles/Magic}/CureInjury.php (79%) rename classes/{ => Battles/Magic}/Magic.php (97%) rename classes/{magic => Battles/Magic}/attack.php (96%) rename {models => classes/Battles/Models}/EffectsModel.php (72%) rename {models => classes/Battles/Models}/PresentsModel.php (51%) rename {models => classes/Battles/Models}/UserLogModel.php (63%) rename classes/{ => Battles}/Nick.php (99%) rename classes/{ => Battles}/Rooms.php (99%) rename classes/{ => Battles}/ShopItem.php (99%) rename classes/{ => Battles}/Template.php (98%) rename classes/{ => Battles}/Travel.php (88%) rename classes/{ => Battles}/User.php (91%) rename classes/{ => Battles}/UserEffects.php (99%) rename classes/{ => Battles}/UserInfo.php (95%) rename classes/{cave => Cave}/CaveBots.php (100%) rename classes/{cave => Cave}/CaveItems.php (100%) rename classes/{cave => Cave}/lose.php (100%) rename classes/{cave => Cave}/win.php (100%) rename {Database => classes/Database}/Exception.php (100%) rename {Database => classes/Database}/Mysql.php (100%) rename {Database => classes/Database}/Statement.php (100%) rename {Database => classes/Database}/battles.sql (100%) rename {Database => classes/Database}/db.php (100%) diff --git a/admin/admin.php b/admin/admin.php index 1dd3b24..60d88ee 100644 --- a/admin/admin.php +++ b/admin/admin.php @@ -7,7 +7,7 @@ session_start(); //require_once '../functions.php'; -$user = new User($_SESSION['uid']); +$user = new \Battles\User($_SESSION['uid']); if (!$user->admin) { header("HTTP/1.0 404 Not Found"); exit; @@ -65,7 +65,7 @@ if ($_POST['ali']) { //Что делает эта штука? } $aligns = db::c()->query('SELECT `img`,`align`,`name` FROM `aligns` ORDER BY `align`'); -Template::header('ᐰdminка'); +\Battles\Template::header('ᐰdminка'); ?>
@@ -554,7 +554,7 @@ foreach ($moj as $k => $v) { $magic_name = "Лечение"; break; case "al_neut_power": - $script_name = "RunMagicSelf"; + $script_name = "RunmagicSelf"; $magic_name = "Сила нейтралитета"; break; case "ct1": @@ -733,7 +733,7 @@ echo ""; - + @@ -960,7 +960,7 @@ if ($_POST['login'] && $_POST['krest']) { Hint3Closed = false; } - function RunMagicSelf(title, magic, name) { + function RunmagicSelf(title, magic, name) { document.all("hint3").innerHTML = '
' + title + 'x
' + '
' + 'Использовать возможность "Сила Нейтралитета?"
' + diff --git a/admin/edit_user.php b/admin/edit_user.php index 01cce2b..7439908 100644 --- a/admin/edit_user.php +++ b/admin/edit_user.php @@ -45,7 +45,7 @@ if ($del) { } db::c()->query('DELETE FROM `inventory` WHERE `id` = ?i', $del); } -Template::header('ᐰdminка инвентаря'); +\Battles\Template::header('ᐰdminка инвентаря'); ?>

Администрирование инвентаря

diff --git a/akadem.php b/akadem.php index 6854393..5621241 100644 --- a/akadem.php +++ b/akadem.php @@ -79,7 +79,7 @@ if ($get == 'exit') { db::c()->query('UPDATE `users`,`online` SET `users`.`room` = 2702, `online`.`room` = 2702 WHERE `users`.`id` = ?i AND `online`.`id` = ?i', $user->id, $user->id); header('Location: city.php'); } -Template::header('Академия'); +\Battles\Template::header('Академия'); ?>
diff --git a/aren_of_angels.php b/aren_of_angels.php index d174cda..5bb5531 100644 --- a/aren_of_angels.php +++ b/aren_of_angels.php @@ -126,7 +126,7 @@ if (isset($_GET['append'])) { } } } -Template::header('Арена Ангелов'); +\Battles\Template::header('Арена Ангелов'); ?>