Рефакторинг

This commit is contained in:
2023-06-11 14:51:42 +03:00
parent 2440ad3cc1
commit 0668d3de5f
2 changed files with 40 additions and 33 deletions
+18 -13
View File
@@ -46,6 +46,7 @@ if (!defined('GAME_VERSION')) {
use Core\{Config, Database, Db};
use DarksLight2\Training\TrainingManager;
use User\ItemsModel;
use User\UserIp;
function var_info($vars, $d = false)
@@ -70,9 +71,8 @@ $code = PassGen::intCode(); //для ссылок вида ?rnd=XXXXXX, врод
//$training_manager = TrainingManager::getInstance($u->info['id']);
/** Восстанавливаем всем ботам, которые не в бою здоровье до максимума. */
Db::exec(
'update stats set hpNow = hpAll, mpNow = mpAll
where id in (select id from users where bot = 2 and battle = 0)'
Db::sql(
'update stats set hpNow = hpAll, mpNow = mpAll where id in (select id from users where bot = 2 and battle = 0)'
);
if ($u->info['banned'] > 0) {
@@ -138,7 +138,7 @@ if (!isset($_GET['mAjax']) && !isset($_GET['ajaxHostel'])) {
$act = -2;
$act2 = 0;
$u->stats = $u->getStats($u->info['id'], 0);
$u->aves = \User\ItemsModel::inventoryWeightAndItemQuantity();
$u->aves = ItemsModel::inventoryWeightAndItemQuantity();
if (!isset($u->stats['act'])) {
$u->stats['act'] = 0;
}
@@ -365,7 +365,7 @@ if ($magic->youuse > 0) {
//Получение статов
if ($act != -2) {
$u->stats = $u->getStats($u->info['id'], 0, 1);
$u->aves = \User\ItemsModel::inventoryWeightAndItemQuantity();
$u->aves = ItemsModel::inventoryWeightAndItemQuantity();
if (!isset($sleep['id'])) {
$act2 = $u->testItems($u->info['id'], $u->stats, 0);
}
@@ -433,12 +433,10 @@ if (isset($_GET['security']) && !isset($u->tfer['id']) && $trololo == 1) {
} else {
if (isset($_GET['talk']) && !isset($u->tfer['id'])) {
echo "
<script>
let elem = document.getElementById('se-pre-con');
elem.parentNode.removeChild(elem);
</script>
";
echo "<script>
let elem = document.getElementById('se-pre-con');
elem.parentNode.removeChild(elem);
</script>";
if ($u->info['dnow'] > 0) {
$d = new Dungeon;
$d->start();
@@ -532,11 +530,11 @@ foreach ($sp as $pl) {
//выдаем предмет
$glid = 1;
if ($pl['data'] == '0') {
\User\ItemsModel::addItem(
ItemsModel::addItem(
$pl['item_id'], $u->info['id'], '|from_loc_id=' . $pl['id'] . '|from_loc=' . $u->info['room']
);
} else {
\User\ItemsModel::addItem(
ItemsModel::addItem(
$pl['item_id'], $u->info['id'],
'|from_loc_id=' . $pl['id'] . '|from_loc=' . $u->info['room'] . '|' . $pl['data']
);
@@ -594,3 +592,10 @@ echo '<script>top.myexpLineTop27(' . $u->info['exp'] . ',' . $spl . ');' . $tjs
$(".se-pre-con").fadeOut(100);
});
</script>
<!--<script src="//ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>-->
<!--<script>-->
<!-- $(window).load(function() {-->
<!-- $(".se-pre-con").fadeOut("slow");-->
<!-- })-->
<!--</script>-->