Чистка устаревшего.

This commit is contained in:
Igor Barkov (iwork) 2019-09-17 17:37:44 +03:00
parent 7ecaf3ae7e
commit a5ca490d92
2 changed files with 61 additions and 87 deletions

View File

@ -1389,17 +1389,16 @@ function showpersout($pas = 0) //FIXME Сделать по человеческ
}
?>
<TABLE cellspacing=0 cellpadding=0>
<table class="allzeroes">
<tr>
<TD colspan=3 width=100%>
<TD colspan=3>
<?= setHP($user['hp'], $user['maxhp']) ?>
</td>
</tr>
<?
if (($user['level'] > 3) && !$pas) { ?>
<?php if (($user['level'] > 3) && !$pas): ?>
<TR>
<TD colspan=3>
<?
<?php
echoscroll('m1');
echoscroll('m2');
echoscroll('m3');
@ -1410,7 +1409,7 @@ function showpersout($pas = 0) //FIXME Сделать по человеческ
</TR>
<TR>
<TD colspan=3>
<?
<?php
echoscroll('m6');
echoscroll('m7');
echoscroll('m8');
@ -1419,11 +1418,10 @@ function showpersout($pas = 0) //FIXME Сделать по человеческ
?>
</TD>
</TR>
<?
} ?>
<? endif; ?>
<TR>
<TD width=62 valign=top>
<TABLE width=100% cellspacing=0 cellpadding=0>
<TD style="width: 62px;">
<TABLE class="allzeroes">
<TR>
<TD><?php
if ($user['sergi'] > 0) {
@ -1503,7 +1501,7 @@ function showpersout($pas = 0) //FIXME Сделать по человеческ
</TR>
<TR>
<TD>
<TABLE cellspacing=0 cellpadding=0>
<TABLE class="allzeroes">
<tr>
<td><?php
if ($user['r1'] > 0) {
@ -1548,10 +1546,10 @@ function showpersout($pas = 0) //FIXME Сделать по человеческ
</TR>
</TABLE>
</TD>
<TD valign=top><img src="i/shadow/<?= $user['shadow'] ?>" width=76 height=209 alt="<?= $user['login'] ?>">
<TD><img src="i/shadow/<?= $user['shadow'] ?>" width=76 height=209 alt="<?= $user['login'] ?>">
</TD>
<TD width=62 valign=top>
<TABLE width=100% cellspacing=0 cellpadding=0>
<TD style="width: 62px;">
<TABLE class="allzeroes">
<TR>
<TD><?php
if ($user['helm'] > 0) {
@ -1613,8 +1611,8 @@ function showpersout($pas = 0) //FIXME Сделать по человеческ
</TABLE>
</TD>
</TR>
</TABLE>
<TABLE cellPadding=0 cellSpacing=0 width="100%">
</table>
<TABLE class="allzeroes">
<TBODY>
<?
if (!$pas) {
@ -1734,27 +1732,6 @@ function plusorminus($n, $shownum = 1)
}
}
function showitem2()
{
/**
* Проверяем одевается ли предмет
*/
function isWereable()
{
if (
(empty($row['nsila']) OR $user['sila'] >= $row['nsila']) AND
(empty($row['nlovk']) OR $user['lovk'] >= $row['nlovk']) AND
(empty($row['ninta']) OR $user['inta'] >= $row['ninta']) AND
(empty($row['nvinos']) OR $user['vinos'] >= $row['nvinos']) AND
(empty($row['nintel']) OR $user['intel'] >= $row['nintel']) AND
(empty($row['nmudra']) OR $user['mudra'] >= $row['nmudra']) AND
(empty($row['nlevel']) OR $user['level'] >= $row['nlevel']) AND
(empty($row['nalign']) OR $user['align'] >= $row['nalign'])
) return true; else return false;
}
}
function undressall($id)
{
for ($i = 1; $i <= 26; $i++) {
@ -1764,7 +1741,6 @@ function undressall($id)
function dropitemid($slot, $id)
{
$user = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "' . $id . '" LIMIT 1'));
switch ($slot) {
case 1:
$slot1 = 'sergi';
@ -1839,14 +1815,14 @@ function dropitemid($slot, $id)
$slot1 = '';
break;
}
if (mysql_query('UPDATE `users`, `inventory` SET `users`.`' . $slot1 . '` = 0, `inventory`.`dressed` = 0, `users`.`sila` = `users`.`sila` - `inventory`.`gsila`, `users`.`lovk` = `users`.`lovk` - `inventory`.`glovk`, `users`.`inta` = `users`.`inta` - `inventory`.`ginta`, `users`.`intel` = `users`.`intel` - `inventory`.`gintel`, `users`.`maxhp` = `users`.`maxhp` - `inventory`.`ghp`, `users`.`noj` = `users`.`noj` - `inventory`.`gnoj`, `users`.`topor` = `users`.`topor` - `inventory`.`gtopor`, `users`.`dubina` = `users`.`dubina` - `inventory`.`gdubina`, `users`.`mec` = `users`.`mec` - `inventory`.`gmech`, `users`.`mfire` = `users`.`mfire` - `inventory`.`gfire`, `users`.`mwater` = `users`.`mwater` - `inventory`.`gwater`, `users`.`mair` = `users`.`mair` - `inventory`.`gair`, `users`.`mearth` = `users`.`mearth` - `inventory`.`gearth`, `users`.`mlight` = `users`.`mlight` - `inventory`.`glight`, `users`.`mgray` = `users`.`mgray` - `inventory`.`ggray`, `users`.`mdark` = `users`.`mdark` - `inventory`.`gdark`, `users`.`fkrit` = `users`.`fkrit` - `inventory`.`mfkrit`, `users`.`fakrit` = `users`.`fakrit` - `inventory`.`mfakrit`, `users`.`fuvorot` = `users`.`fuvorot` - `inventory`.`mfuvorot`, `users`.`fauvorot` = `users`.`fauvorot` - `inventory`.`mfauvorot`, `users`.`ubron1` = `users`.`ubron1` - `inventory`.`bron1`, `users`.`ubron2` = `users`.`ubron2` - `inventory`.`bron2`, `users`.`ubron3` = `users`.`ubron3` - `inventory`.`bron3`, `users`.`ubron4` = `users`.`ubron4` - `inventory`.`bron4`, `users`.`uminu` = `users`.`uminu` - `inventory`.`minu`, `users`.`umaxu` = `users`.`umaxu` - `inventory`.`maxu` WHERE `inventory`.`id` = `users`.`' . $slot1 . '` AND `inventory`.`dressed` = 1 AND `inventory`.`owner` = "' . $user['id'] . '" AND `users`.`id` = "' . $user['id'] . '"')) {
mysql_query("UPDATE `users` SET `hp` = `maxhp`, `fullhptime` = " . time() . " WHERE `hp` > `maxhp` AND `id` = '{$id}' LIMIT 1");
if ($id == $user['id']) {
$checkid = db::c()->query('SELECT 1 FROM `users` WHERE `id` = ?i', $id);
if ($checkid->getNumRows()) {
if (mysql_query('UPDATE `users`, `inventory` SET `users`.`' . $slot1 . '` = 0, `inventory`.`dressed` = 0, `users`.`sila` = `users`.`sila` - `inventory`.`gsila`, `users`.`lovk` = `users`.`lovk` - `inventory`.`glovk`, `users`.`inta` = `users`.`inta` - `inventory`.`ginta`, `users`.`intel` = `users`.`intel` - `inventory`.`gintel`, `users`.`maxhp` = `users`.`maxhp` - `inventory`.`ghp`, `users`.`noj` = `users`.`noj` - `inventory`.`gnoj`, `users`.`topor` = `users`.`topor` - `inventory`.`gtopor`, `users`.`dubina` = `users`.`dubina` - `inventory`.`gdubina`, `users`.`mec` = `users`.`mec` - `inventory`.`gmech`, `users`.`mfire` = `users`.`mfire` - `inventory`.`gfire`, `users`.`mwater` = `users`.`mwater` - `inventory`.`gwater`, `users`.`mair` = `users`.`mair` - `inventory`.`gair`, `users`.`mearth` = `users`.`mearth` - `inventory`.`gearth`, `users`.`mlight` = `users`.`mlight` - `inventory`.`glight`, `users`.`mgray` = `users`.`mgray` - `inventory`.`ggray`, `users`.`mdark` = `users`.`mdark` - `inventory`.`gdark`, `users`.`fkrit` = `users`.`fkrit` - `inventory`.`mfkrit`, `users`.`fakrit` = `users`.`fakrit` - `inventory`.`mfakrit`, `users`.`fuvorot` = `users`.`fuvorot` - `inventory`.`mfuvorot`, `users`.`fauvorot` = `users`.`fauvorot` - `inventory`.`mfauvorot`, `users`.`ubron1` = `users`.`ubron1` - `inventory`.`bron1`, `users`.`ubron2` = `users`.`ubron2` - `inventory`.`bron2`, `users`.`ubron3` = `users`.`ubron3` - `inventory`.`bron3`, `users`.`ubron4` = `users`.`ubron4` - `inventory`.`bron4`, `users`.`uminu` = `users`.`uminu` - `inventory`.`minu`, `users`.`umaxu` = `users`.`umaxu` - `inventory`.`maxu` WHERE `inventory`.`id` = `users`.`' . $slot1 . '` AND `inventory`.`dressed` = 1 AND `inventory`.`owner` = "' . $id . '" AND `users`.`id` = "' . $id . '"')) {
db::c()->query('UPDATE `users` SET `hp` = `maxhp`, `fullhptime` = ?i WHERE `hp` > `maxhp` AND `id` = ?i', time(), $id);
$user[$slot1] = 0;
}
return true;
}
} else return false;
}
// снять предмет
@ -2507,6 +2483,7 @@ function deltravma($id)
/**
* @param $name
* @param $text
*
* @throws \Krugozor\Database\Mysql\Exception
*/
function telegraph($userId, $text)
@ -2670,7 +2647,6 @@ function addToDelo($message, $user_id = 0, $type = 1)
}
/**
* Апаем стат или мастерство на единицу.
*
@ -2716,5 +2692,5 @@ function addOnePoint($name, $param = null)
function checkIntInRange($int, $min = 1, $max = PHP_INT_MAX)
{
return (int)filter_var($int, FILTER_VALIDATE_INT, ['options' => ['min_range' => $min,'max_range' => $max]]);
return (int)filter_var($int, FILTER_VALIDATE_INT, ['options' => ['min_range' => $min, 'max_range' => $max]]);
}

View File

@ -280,6 +280,36 @@ function dressitem($id)
}
}
// Входим и выходим если можем.
if (isset($_GET['goto'])) {
$imove = true;
$d = db::c()->query('SELECT SUM(`massa`) AS `summ` FROM `inventory` WHERE `owner` = ?i AND `dressed` = 0 AND `setsale` = 0', $user['id'])->fetch_assoc();
$eff = db::c()->query('SELECT `id` FROM `effects` WHERE `owner` = ?i AND (`type` = 14 OR `type` = 13) LIMIT 1', $user['id'])->fetch_assoc();
if ($d['summ'] > get_meshok() && $_GET['got']) {
err('У вас переполнен рюкзак, вы не можете передвигаться...');
$imove = false;
}
if (isset($eff['id']) && $_GET['got']) {
err('У вас тяжелая травма, вы не можете передвигатся...');
$imove = false;
}
if ($_GET['goto'] == 'plo' AND !empty($user['zayavka']) AND $imove === true) {
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = 20,`online`.`room` = 20 WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $_SESSION['uid']);
header('Location: city.php');
die("<i>Топ-топ-топ...</i>");
} else err('Подали заявку на бой и убегаете из клуба? Нехорошо...');
if ($_GET['goto'] == 'arena' AND $user['room'] === 20 AND $imove === true) {
db::c()->query('UPDATE `users`, `online` SET `users`.`room` = 1, `online`.`room` = 1 WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $_SESSION['uid']);
header('Location: main.php');
die("<i>Топ-топ-топ...</i>");
}
}
if (isset($_GET['use'])) {
usemagic($_GET['use'], $_POST['target']);
}
/**
* Отображение персонажа в main.php
*
@ -651,10 +681,11 @@ if (isset($_GET['modif_mf'])) {
if (input::post('setshadow')) {
?>
<html>
<html lang="ru">
<head>
<link rel=stylesheet href="css/main.css">
<meta charset="utf-8">
<title></title>
</head>
<body>
<table width=100%>
@ -1350,9 +1381,8 @@ if (input::get('edit')) {
die();
}
?>
<HTML>
<HTML lang="ru">
<HEAD>
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/btn.css">
@ -1424,42 +1454,10 @@ if (input::get('edit')) {
TimerOn = tkHP < maxHP ? setTimeout("setHPlocal()", delay * 100) : -1
}
</script>
<title></title>
</HEAD>
<body onLoad="<?= topsethp(); ?>">
<?php
// Входим и выходим если можем.
if (isset($_GET['goto'])) {
$imove = true;
$d = db::c()->query('SELECT SUM(`massa`) AS `summ` FROM `inventory` WHERE `owner` = ?i AND `dressed` = 0 AND `setsale` = 0', $user['id'])->fetch_assoc();
$eff = db::c()->query('SELECT `id` FROM `effects` WHERE `owner` = ?i AND (`type` = 14 OR `type` = 13) LIMIT 1', $user['id'])->fetch_assoc();
if ($d['summ'] > get_meshok() && $_GET['got']) {
err('У вас переполнен рюкзак, вы не можете передвигаться...');
$imove = false;
}
if (isset($eff['id']) && $_GET['got']) {
err('У вас тяжелая травма, вы не можете передвигатся...');
$imove = false;
}
if ($_GET['goto'] == 'plo' AND !empty($user['zayavka']) AND $imove === true) {
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = 20,`online`.`room` = 20 WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $_SESSION['uid']);
header('Location: city.php');
die("<i>Топ-топ-топ...</i>");
} else err('Подали заявку на бой и убегаете из клуба? Нехорошо...');
if ($_GET['goto'] == 'arena' AND $user['room'] === 20 AND $imove === true) {
db::c()->query('UPDATE `users`, `online` SET `users`.`room` = 1, `online`.`room` = 1 WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $_SESSION['uid']);
header('Location: main.php');
die("<i>Топ-топ-топ...</i>");
}
}
if (isset($_GET['use'])) {
usemagic($_GET['use'], $_POST['target']);
}
$online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time() - 60));
?>
<?php $online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time() - 60)); ?>
<div id=hint3 class=ahint></div>
<table class="allzeroes">
<tr>