неиспользуемые функции
This commit is contained in:
parent
bc4b59764d
commit
e207903020
@ -14,7 +14,7 @@ if (isset($_SESSION['uid'])) {
|
||||
}
|
||||
|
||||
if (isset($user['id']) && $user['block'] == 1) {
|
||||
die();
|
||||
die('user blocked!');
|
||||
}
|
||||
|
||||
// ???
|
||||
@ -43,24 +43,6 @@ function createbot($bot, $login = "")
|
||||
}
|
||||
}
|
||||
|
||||
function getuserdata($id = 0)
|
||||
{
|
||||
if (!$id) {$id = isset($_SESSION['uid']) ? $_SESSION['uid'] : null;} // Хорошее решение проверок, кстати.
|
||||
if (!$id) {return [];}
|
||||
$rec = db::c()->query('SELECT `hp`, `maxhp`, `fullhptime`, `battle` FROM `users` WHERE `id` = "?s"', $id)->fetch_assoc();
|
||||
if ($rec['hp'] < $rec['maxhp'] && time() > $rec['fullhptime'] && !$rec['battle'] && ($rec['hp'] > 0)) {
|
||||
// regenhp($rec, 0);
|
||||
if ($rec['hp'] == $rec['maxhp']) {
|
||||
$rec['hp']--;
|
||||
}
|
||||
}
|
||||
return $rec;
|
||||
}
|
||||
|
||||
if (!isset($user)) {
|
||||
$user = getuserdata();
|
||||
}
|
||||
|
||||
$var_map = [
|
||||
'cell_1' => 'Березовая роща', 'cell_2' => 'Березовая просека', 'cell_3' => 'Тёмный угол', 'cell_4' => 'Мрачная опушка',
|
||||
'cell_5' => 'Тёмное урочище', 'cell_6' => 'Бурелом', 'cell_7' => 'Старая ива', 'cell_8' => 'Разнолесье',
|
||||
@ -68,15 +50,16 @@ $var_map = [
|
||||
'cell_13' => 'Ясная поляна', 'cell_14' => 'Заросший тракт', 'cell_15' => 'Смутный ельник', 'cell_16' => 'Сосновый бор',
|
||||
'cell_17' => 'Тихоход', 'cell_18' => 'Сосновый гай', 'cell_19' => 'Смешаный лес', 'cell_20' => 'Темная поляна',
|
||||
'cell_21' => 'Осенний угол', 'cell_22' => 'Грибное место', 'cell_23' => 'Опушка', 'cell_24' => 'Рыжий лес',
|
||||
'cell_25' => 'Полесье'
|
||||
'cell_25' => 'Полесье',
|
||||
];
|
||||
|
||||
function get_out($u){
|
||||
function get_out($u)
|
||||
{
|
||||
$pers = db::c()->query('SELECT * FROM users WHERE id = ?i', $u)->fetch_assoc_array();
|
||||
undressall($pers['id']);
|
||||
db::c()->query('UPDATE inventory SET owner = ?i WHERE owner = ?i', $pers['id'], $pers['id'] + _BOTSEPARATOR_);
|
||||
###
|
||||
$row = db::c()->query('SELECT * FROM `effects` WHERE `owner` = ?i',$pers['id'] + _BOTSEPARATOR_);
|
||||
$row = db::c()->query('SELECT * FROM `effects` WHERE `owner` = ?i', $pers['id'] + _BOTSEPARATOR_);
|
||||
$travm = [11, 12, 13, 14];
|
||||
while ($efs = $row->fetch_assoc()) {
|
||||
if (in_array($efs['type'], $travm)) {
|
||||
@ -189,8 +172,9 @@ function level_up($uid)
|
||||
}
|
||||
|
||||
######## FIXME ВЕЧНЫЕ 12-ТКИ!!!!!!!!!!!!
|
||||
if (isset($_SESSION['uid']))
|
||||
if (isset($_SESSION['uid'])) {
|
||||
$in_user = db::c()->query('SELECT `id`, `exp`, `nextup`, `level` FROM `users` WHERE `id` = ?i', $_SESSION['uid'])->fetch_assoc();
|
||||
}
|
||||
if (isset($in_user['id']) && ($in_user['exp'] >= $in_user['nextup']) && $in_user['level'] < 13) {
|
||||
level_up($in_user['id']);
|
||||
}
|
||||
@ -460,7 +444,7 @@ function show_eff_inf($u, $type)
|
||||
216 => "magic/wis_air_def2.gif", 217 => "magic/wis_air_def3.gif", 218 => "magic/wis_earth_def1.gif", 219 => "magic/wis_earth_def2.gif",
|
||||
220 => "magic/wis_earth_def3.gif", 221 => "magic/wis_fire_def1.gif", 222 => "magic/wis_fire_def2.gif", 223 => "magic/wis_fire_def3.gif",
|
||||
224 => "magic/wis_water_def1.gif", 225 => "magic/wis_water_def2.gif", 226 => "magic/wis_water_def3.gif", 227 => "magic/attack_defence.gif",
|
||||
1022 => "sh/hidden.gif"
|
||||
1022 => "sh/hidden.gif",
|
||||
];
|
||||
$r = '';
|
||||
$and = '';
|
||||
@ -2112,7 +2096,7 @@ function addOnePoint($name, $param = null)
|
||||
'mearth' => 'Магия земли',
|
||||
'mlight' => 'Магия света',
|
||||
'mgray' => 'Магия серости',
|
||||
'mdark' => 'Магия тьмы'
|
||||
'mdark' => 'Магия тьмы',
|
||||
];
|
||||
if ($param == 'stat' and in_array($name, $allowed_stats)) {
|
||||
db::c()->query('UPDATE `users` SET ?f = ?f + 1, `stats` = `stats` - 1 WHERE `id` = ?i', $name, $name, $_SESSION['uid']);
|
||||
|
Loading…
Reference in New Issue
Block a user