diff --git a/classes/Battles/Nick.php b/classes/Battles/Nick.php index c5f4242..09c5d52 100644 --- a/classes/Battles/Nick.php +++ b/classes/Battles/Nick.php @@ -1,5 +1,6 @@ align)) { return sprintf('', $this->align); @@ -28,7 +29,7 @@ class Nick extends User * Отображение иконки клана. * @return string */ - private function getClan() + private function getClan():string { if (isset($this->clan)) { return sprintf('', $this->clan); @@ -51,12 +52,11 @@ class Nick extends User /** * Возвращает строку со склонностью, кланом, логином, уровнем, ссылкой на профиль. * - * @param int $showInvisibility - По умолчанию 0. Выбрать 1, если надо отображать невидимый статус. + * @param int $showInvisibility отображать логин даже если персонаж невидимка. * * @return string - * @throws \Krugozor\Database\Mysql\Exception */ - public function full($showInvisibility = 0) + public function full($showInvisibility = 0):string { if ($showInvisibility && $this->getInvisibilityStatus()) { return 'невидимка'; @@ -66,12 +66,12 @@ class Nick extends User /** * Возвращает строку с логином или невидимым статусом. + * @param int $showInvisibility отображать логин даже если персонаж невидимка. * @return string - * @throws \Krugozor\Database\Mysql\Exception */ - public function short() + public function short($showInvisibility = 0):string { - if ($this->getInvisibilityStatus()) { + if ($showInvisibility && $this->getInvisibilityStatus()) { return 'невидимка'; } else { return htmlspecialchars($this->login); @@ -82,7 +82,7 @@ class Nick extends User * Возвращает строку со склонностью, кланом, логином, уровнем, ссылкой на профиль, здоровьем. * @return string */ - public function battle() + public function battle():string { return $this->getAlign().$this->getClan().sprintf('%s [%s] HP _hp_/_maxhp_', $this->login, $this->level, $this->login); } @@ -93,7 +93,7 @@ class Nick extends User * * @return string */ - public function battleShort($textstyle) + public function battleShort($textstyle):string { if ($this->getInvisibilityStatus()) { return 'невидимка'; diff --git a/post.php b/post.php index 0ff6dbb..db76b1d 100644 --- a/post.php +++ b/post.php @@ -1,7 +1,15 @@ money -= 1; Bank::setWalletMoney($user->money, $user->id); db::c()->query('UPDATE `inventory` SET owner_id = ?i WHERE item_id= ?i AND owner_id = ?i', $receiverId, $sendItemId, $_SESSION['uid']); - $statusMessage = 'Предмет "' . $res['name'] . '" передан персонажу ' . $receiverId; + $statusMessage = 'Предмет "' . $res['name'] . '" передан персонажу ' . Nick::id($receiverId)->short(1); + $receiverLogMessage = 'Получен предмет "' . $res['name'] . '" от персонажа ' . Nick::id($_SESSION['uid'])->short(1); db::c()->query('INSERT INTO `telegraph` (`receiver`,`text`) VALUES (?i,"?s")', $receiverId, 'Почтовый перевод: ' . $res['name'] . ' от персонажа ' . $user['login'] . '.'); + // Пишем в лог отправителю. + GameLogs::addUserLog($_SESSION['uid'], $statusMessage, 'почта'); + // Пишем в лог получателю. + GameLogs::addUserLog($receiverId, $receiverLogMessage, 'почта'); } } $queryItems = db::c()->query('SELECT * FROM inventory WHERE dressed_slot = 0 AND on_sale = 0 AND owner_id = ?i', $user->id); while ($row = $queryItems->fetch_assoc()) { - $iteminfo[] = new \Battles\InventoryItem($row); + $iteminfo[] = new InventoryItem($row); } } } -\Battles\Template::header('Почта'); +Template::header('Почта'); ?> -
- -
-

Почта

-
-Услуги почты платные: 1 кредит. +
+ +
+

Почта

+
+ Услуги почты платные: 1 кредит. Получатель: full() ?> Сменить @@ -78,11 +91,10 @@ if ($_SESSION['receiverName']) { - - - + - - - getNumRows())): ?> + + + getNumRows())): ?> - - +
Передача предметовПередача предметов +
printImage(); ?> @@ -91,20 +103,15 @@ if ($_SESSION['receiverName']) { - printInfo(); ?> -
Нечего передавать...
Нечего передавать...
- -