Замена устаревшей функции addToDelo() на GameLogs::addUserLog.

This commit is contained in:
Igor Barkov (iwork)
2021-01-27 17:19:05 +02:00
parent 4f8140a6c6
commit a1c052f585
6 changed files with 78 additions and 73 deletions
+16 -8
View File
@@ -1,4 +1,12 @@
<?php
use Battles\DressedItems;
use Battles\GameLogs;
use Battles\InventoryItem;
use Battles\Template;
use Battles\Travel;
use Battles\UserInfo;
ob_start("ob_gzhandler");
session_start();
$get = filter_input(INPUT_SERVER, 'QUERY_STRING');
@@ -26,13 +34,13 @@ $ids = $_GET['ids'] ?? null;
$setShadow = $_POST['setshadow'] ?? null;
$edit = $_GET['edit'] ?? null;
// Подготавливаем отображение инфы и предметов.
$userInfo = new \Battles\UserInfo($user->id);
$getItemsBonuses = new \Battles\DressedItems($_SESSION['uid']);
$userInfo = new UserInfo($user->id);
$getItemsBonuses = new DressedItems($_SESSION['uid']);
$data_query = 'SELECT * FROM inventory WHERE owner_id = ?i AND dressed_slot = 0 AND on_sale = 0';
$data = db::c()->query($data_query, $_SESSION['uid']);
$iteminfo = [];
while ($row = $data->fetch_assoc()) {
$iteminfo[] = new \Battles\InventoryItem($row);
$iteminfo[] = new InventoryItem($row);
}
//Обработчики нажатий на кнопки.
@@ -64,7 +72,7 @@ if ($edit === null) {
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: ' . \Battles\Travel::$roomFileName[$user->room]);
header('location: ' . Travel::$roomFileName[$user->room]);
exit();
}
}
@@ -247,7 +255,7 @@ if ($mfs && $ids) {
}
}
if ($setShadow) {
\Battles\Template::header('Образ персонажа');
Template::header('Образ персонажа');
?>
<div style="text-align: right;">
<input type=button value="Вернуться" onClick="location.href='main.php?edit=<?= mt_rand() ?>';" class="button">
@@ -298,7 +306,7 @@ if ($edit) {
addOnePoint($upm, 'mastery');
}
if ($drop) {
$items = new \Battles\DressedItems($_SESSION['uid']);
$items = new DressedItems($_SESSION['uid']);
$items->undressItem($drop);
}
//Пока что одеваем предмет отсюда.
@@ -311,7 +319,7 @@ if ($edit) {
$q = $q->fetch_assoc();
if (empty($q['dressed'])) {
destructitem($q['id']);
addToDelo($user->login . " выбросил предмет " . $q['name'] . " id:(cap" . $q['id'] . ")");
GameLogs::addUserLog($user->id, $user->login . " выбросил предмет " . $q['name'] . " id:(cap" . $q['id'] . ")");
err('Предмет ' . $q['name'] . ' выброшен.');
} else {
err('Ошибка: нельзя выбросить одетый предмет!');
@@ -327,7 +335,7 @@ if ($edit) {
undressall($_SESSION['uid']);
}
}
\Battles\Template::header('Игра');
Template::header('Игра');
?>
<script src="js/funcs.js"></script>
<script>