PHP Fatal error: Uncaught PDOException: SQLSTATE[HY093]: Invalid parameter number

This commit is contained in:
Ivor Barhansky 2023-08-30 17:58:56 +03:00
parent 0e832dbbc2
commit be5779ff27
2 changed files with 2137 additions and 2299 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,10 @@
<?php
use Core\Db;
echo "
<script language='JavaScript'>
var elem = document.getElementById('se-pre-con');
<script>
let elem = document.getElementById('se-pre-con');
elem.parentNode.removeChild(elem);
</script>
";
@ -10,25 +13,27 @@ if (!defined('GAME')) {
}
if ($u->room['file'] == 'dungeon') {
$pd = [1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0, 9 => 0, //передняя стенка, в 2-х шагах
if ($u->room['file'] != 'dungeon') {
return;
}
$pd = [1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0, 9 => 0, //передняя стенка, в 2-х шагах
10 => 0, 11 => 0, 12 => 0, 13 => 0, 14 => 0, 15 => 0, 16 => 0, 17 => 0, 18 => 0, 19 => 0, 20 => 0, 21 => 0, 22 => 0, 23 => 0, /* Растояние: 1 шаг */
24 => 0, //стена прямо слева от персонажа (1)
25 => 0, //стена прямо справа от персонажа (1)
26 => 0, //стена прямо перед персонажем (1)
27 => 0, //стена слева от персонажа (1)
28 => 0 //стена справа от персонажа (1)
];
28 => 0, //стена справа от персонажа (1)
];
if (isset($_POST['go_to_admin']) && $u->info['admin'] == 1 && $u->info['login'] == 'Crowley') {
if (isset($_POST['go_to_admin']) && $u->info['admin'] == 1 && $u->info['login'] == 'Crowley') {
mysql_query('UPDATE `stats` SET `x` = "' . round((int)$_POST['g__x']) . '", `y` = "' . round((int)$_POST['g__y']) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
if ($_POST['g__restorebot']) {
mysql_query('UPDATE `dungeon_bots` SET `delete` = "0" WHERE `dn` = "' . $u->info['dnow'] . '" AND `delete` = 1 LIMIT 50');
}
header('Location: /main.php');
}
}
if (isset($_GET['back'])) {
if (isset($_GET['back'])) {
$dp = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_now` WHERE `id` = "' . $u->info['dnow'] . '" LIMIT 1'));
$dp = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_map` WHERE `id_dng` = "' . $dp['id2'] . '" AND `x` = "' . $u->info['x'] . '" AND `y` ="' . $u->info['y'] . '" LIMIT 1'));
if ($dp['file'] != '0') {
@ -44,168 +49,45 @@ if ($u->room['file'] == 'dungeon') {
}
}
unset($dp);
}
}
$d = new Dungeon;
$d->start();
$d = new Dungeon;
if (!isset($d->info['id'])) {
if (!isset($d->info['id'])) {
$_GET['exitd'] = true;
}
}
$dies = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `dungeon_actions` WHERE `uid` = "' . $u->info['id'] . '" AND `dn` = "' . $u->info['dnow'] . '" AND `vars` = "die" LIMIT 1'));
$dies = $dies[0];
$dies = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `dungeon_actions` WHERE `uid` = "' . $u->info['id'] . '" AND `dn` = "' . $u->info['dnow'] . '" AND `vars` = "die" LIMIT 1'));
$dies = $dies[0];
if ($dies >= 3) {
if ($dies >= 3) {
$_GET['exitd'] = true;
}
}
$d->point = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_map` WHERE `id_dng` = "' . $d->info['id2'] . '" AND `x` = "' . $u->info['x'] . '" AND `y` ="' . $u->info['y'] . '" LIMIT 1'));
$d->initPoint($u->info['x'], $u->info['y']);
if (!isset($d->point['id'])) {
if (!isset($d->point['id'])) {
$d->point['css'] = 'css';
}
}
if (isset($_GET['new_leader'])) {
if (isset($_GET['new_leader'])) {
echo $d->n_lead($_GET['new_leader'], $u->info['id']);
}
}
if (isset($_GET['go_from_psh'])) {
if (isset($_GET['go_from_psh'])) {
echo $d->go_to_hell($_GET['go_from_psh'], $u->info['id']);
}
}
if ($u->info['dnow'] == 0) {
if ($u->info['dnow'] == 0) {
//выкидываем из пещеры
die('Ошибки инициализации');
} else {
if ($d->info['id2'] == 15) {
//
$sb = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `uid` = "' . $u->info['id'] . '" AND `delete` = 0 AND `item_id` = 4910 LIMIT 1'));
//
if (isset($_GET['atackpuck'])) {
//Атакуем!
$shbtu = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`battle` FROM `users` WHERE `id` = "' . mysql_real_escape_string($_GET['atackpuck']) . '" LIMIT 1'));
if (isset($shbtu['id'])) {
$shbts = mysql_fetch_array(mysql_query('SELECT `id`,`x`,`y`,`dnow` FROM `stats` WHERE `id` = "' . $shbtu['id'] . '" LIMIT 1'));
if ($shbts['dnow'] == $u->info['dnow']) {
$tm11 = mysql_fetch_array(mysql_query('SELECT * FROM `katok_now` WHERE `clone` = "' . $u->info['id'] . '" LIMIT 1'));
$tm22 = mysql_fetch_array(mysql_query('SELECT * FROM `katok_now` WHERE `clone` = "' . $shbtu['id'] . '" LIMIT 1'));
if ($tm11['team'] == $tm22['team']) {
$d->error = 'Вы не можете атаковать игрока из своей команды!';
} elseif ($shbts['x'] == $u->info['x'] || $shbts['x'] == $u->info['x'] - 1 || $shbts['x'] == $u->info['x'] + 1) {
if ($shbts['x'] == $u->info['x'] || $shbts['x'] == $u->info['x'] - 1 || $shbts['x'] == $u->info['x'] + 1) {
//
if ($shbtu['battle'] > 0) {
$d->error = 'Вмешиваемся в бой против &quot;' . $shbtu['login'] . '&quot;!';
} else {
$d->error = 'Атакуем &quot;' . $shbtu['login'] . '&quot; прямо сейчас!';
}
//
} else {
$d->error = '&quot;' . $shbtu['login'] . '&quot; находится далеко от вас для паса!';
}
} else {
$d->error = '&quot;' . $shbtu['login'] . '&quot; находится далеко от вас для паса!';
}
} else {
$d->error = 'Игрок не найден на хоккейном поле...';
}
} else {
$d->error = 'Игрок не найден на хоккейном поле!';
}
} elseif (isset($_GET['addpuck']) && isset($sb['id'])) {
//Передаем шайбу
$shbtu = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`battle` FROM `users` WHERE `id` = "' . mysql_real_escape_string($_GET['addpuck']) . '" LIMIT 1'));
if (isset($shbtu['id'])) {
$shbts = mysql_fetch_array(mysql_query('SELECT `id`,`x`,`y`,`dnow` FROM `stats` WHERE `id` = "' . $shbtu['id'] . '" LIMIT 1'));
if ($shbts['dnow'] == $u->info['dnow']) {
$tm11 = mysql_fetch_array(mysql_query('SELECT * FROM `katok_now` WHERE `clone` = "' . $u->info['id'] . '" LIMIT 1'));
$tm22 = mysql_fetch_array(mysql_query('SELECT * FROM `katok_now` WHERE `clone` = "' . $shbtu['id'] . '" LIMIT 1'));
if ($tm11['team'] != $tm22['team']) {
$d->error = 'Вы не можете дать пас сопернику!';
} elseif ($shbts['x'] == $u->info['x'] || $shbts['x'] == $u->info['x'] - 1 || $shbts['x'] == $u->info['x'] + 1) {
if ($shbts['x'] == $u->info['x'] || $shbts['x'] == $u->info['x'] - 1 || $shbts['x'] == $u->info['x'] + 1) {
//
if ($shbtu['battle'] > 0) {
$d->error = '&quot;' . $shbtu['login'] . '&quot; находится в конфликте с соперником!';
} else {
mysql_query('UPDATE `items_users` SET `uid` = "' . $shbtu['id'] . '" WHERE `id` = "' . $sb['id'] . '" LIMIT 1');
unset($sb);
$d->error = '&quot;' . $shbtu['login'] . '&quot; получает пас и ведёт шайбу!';
$d->sys_chat('<b>' . $u->info['login'] . '</b> передаем пас игроку <b>' . $shbtu['login'] . '</b>!');
}
//
} else {
$d->error = '&quot;' . $shbtu['login'] . '&quot; находится далеко от вас для паса!';
}
} else {
$d->error = '&quot;' . $shbtu['login'] . '&quot; находится далеко от вас для паса!';
}
} else {
$d->error = 'Игрок не найден на хоккейном поле...';
}
} else {
$d->error = 'Игрок не найден на хоккейном поле!';
}
}
//Каток
$tm1win = mysql_fetch_array(mysql_query('SELECT SUM(`win`) FROM `katok_now` WHERE `team` = 1'));
$tm2win = mysql_fetch_array(mysql_query('SELECT SUM(`win`) FROM `katok_now` WHERE `team` = 2'));
$tm1win = 0 + $tm1win[0];
$tm2win = 0 + $tm2win[0];
$tmwin = 0;
if ($tm1win >= 2) {
$tmwin = 1;
} elseif ($tm2win >= 2) {
$tmwin = 2;
}
if ($tmwin > 0) {
$sp = mysql_query('SELECT * FROM `katok_now`');
while ($pl = mysql_fetch_array($sp)) {
//Портируем персонажа обратно
mysql_query('UPDATE `users` SET `inUser` = 0, `room` = 409 WHERE `inUser` = "' . $pl['clone'] . '" LIMIT 1');
//Удаляем текущего бота и инвентарь
mysql_query('DELETE FROM `users` WHERE `id` = "' . $pl['clone'] . '" LIMIT 1');
mysql_query('DELETE FROM `stats` WHERE `id` = "' . $pl['clone'] . '" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `uid` = "' . $pl['clone'] . '"');
mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $pl['clone'] . '"');
//
mysql_query('DELETE FROM `katok_now` WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
//
}
header('location: /main.php');
die('Матч закончился! Победила команда №' . $tmwin . '');
}
}
} else {
if ($d->info['bsid'] == 0 && $d->info['id2'] != 106 && isset($_GET['exitd'])) {
//Удаляем обьекты и т.д. из старых пещер
$rb = 321; // Магический портал
if ($u->info['room'] == 304) {
$rb = 209; // Вход в ледяную пещеру
} elseif ($u->info['room'] == 396) {
$rb = 321; // Канализация (Ангелс)
} elseif ($u->info['room'] == 398) {
$rb = 321; // Все пещеры
} elseif ($d->info['id2'] == 3) {
$rb = 321; // Вход в Катакомбы
} elseif ($d->info['id2'] == 1) {
$rb = 321; // Вход в Канализацию
} elseif ($d->info['id2'] == 13) {
$rb = 321; // Гора Легиона
} elseif ($d->info['id2'] == 12) {
$rb = 321; // Вход в Пещеру Тысячи Проклятий
} elseif ($d->info['id2'] == 101) {
$rb = 321; // Вход в Бездну
} elseif ($d->info['id2'] == 444) {
$rb = 321; // Вход в Бездну
} elseif ($d->info['id2'] == 104) {
$rb = 2; // Вход в Шахты (зал воинов)
}
$sp = mysql_query('SELECT * FROM `dungeon_now` WHERE `time_finish` = "0" LIMIT 50');
while ($pl = mysql_fetch_array($sp)) {
$cn = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dnow` = "' . $pl['id'] . '" LIMIT 1'));
@ -257,9 +139,9 @@ if ($u->room['file'] == 'dungeon') {
echo '<script type="text/javascript">window.location.href="main.php";</script>';
die();
}
}
}
if ($d->point['fileadd'] == 1 && $d->point['file'] != '0' && $d->point['file'] != '') {
if ($d->point['fileadd'] == 1 && $d->point['file'] != '0' && $d->point['file'] != '') {
$file = explode('=', $d->point['file']);
if (file_exists('modules_data/location/' . $file[0])) {
$information = '';
@ -272,9 +154,9 @@ if ($u->room['file'] == 'dungeon') {
echo '<br><br><center>Локация &quot;' . str_replace('.php', '', $file[0]) . '&quot; не определена, вернуться <a href="main.php?rnd=' . $code . '">назад</a></center>';
mysql_query('UPDATE `stats` SET `x` = "' . $file[1] . '",`y` = "' . $file[2] . '",`s` = "' . $file[3] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
}
}
}
if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] != '') {
if ($d->point['fileadd'] == 0 && $d->point['file'] != '0' && $d->point['file'] != '') {
$file = explode('=', $d->point['file']);
if (file_exists('modules_data/location/' . $file[0])) {
require_once('modules_data/location/' . $file[0]);
@ -285,7 +167,7 @@ if ($u->room['file'] == 'dungeon') {
echo '<br><br><center>Локация &quot;' . str_replace('.php', '', $file[0]) . '&quot; не определена, вернуться <a href="main.php?rnd=' . $code . '">назад</a></center>';
mysql_query('UPDATE `stats` SET `x` = "' . $file[1] . '",`y` = "' . $file[2] . '",`s` = "' . $file[3] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
}
} else {
} else {
?>
<script type="text/javascript" src="js/jquery.js"></script>
<script>
@ -323,7 +205,7 @@ if ($u->room['file'] == 'dungeon') {
$u->info['s'] = 3(назад)
$u->info['s'] = 4(право)
*/
stor =<?= $u->info['s'];?>;
stor = <?= $u->info['s'];?>;
bott = 0;
if (stor == 1) {
<?php
@ -749,54 +631,23 @@ if ($u->room['file'] == 'dungeon') {
function goToLoca(id, ttl) {
if (tgo < 1) {
/*$.ajax({
url: "main.php?go="+id+"&rnd=<?=$code;?>&ajax=1",
success: function(html) {
$("body").html(html);
}
});*/
// console.log(document.getElementById("divWindowImg"))
location.href = `/main.php?go=${id}&rnd=<?=$code;?>`;
// console.log()
} else {
// здесь тогда, когда нажал повторно на кнопку вперед/назад во время загрузки
// console.log("старт")
gotoup777 = id;
gotext777 = ttl;
}
}
function takeObj(objId) {
/*$.ajax({
url: "main.php?take_obj="+objId+"&rnd=<?=$code;?>&ajax=1",
cache: false,
success: function(html) {
$("body").html(html);
}
});*/
location.href = "/main.php?take_obj=" + objId + "&rnd=<?=$code;?>";
}
function takeItem(itemId) {
/*$.ajax({
url: "main.php?take="+itemId+"&rnd=<?=$code;?>&ajax=1",
cache: false,
success: function(html) {
$("body").html(html);
}
});*/
location.href = "/main.php?take=" + itemId + "&rnd=<?=$code;?>";
}
function Fast(look) {
/*$.ajax({
url: "main.php?look="+look+"&rnd=<?=$code;?>&ajax=1",
cache: false,
success: function(html) {
$("body").html(html);
}
});*/
location.href = "/main.php?look=" + look + "&rnd=<?=$code;?>";
}
@ -817,7 +668,6 @@ if ($u->room['file'] == 'dungeon') {
if (tgo > 0) {
tgo -= 1;
// console.log("старт после")
setTimeout('locGoLineDng()', 100);
} else {
if (gotoup777 > 0) {
@ -858,15 +708,15 @@ if ($u->room['file'] == 'dungeon') {
max-width: 120px;
min-width: 30px;
min-height: 55px;
border: 0px solid;
padding: 0px;
margin: 0px;
border: 0;
padding: 0;
margin: 0;
}
.dObj {
border: 0px solid;
padding: 0px;
margin: 0px;
border: 0;
padding: 0;
margin: 0;
}
.test1 {
@ -879,7 +729,7 @@ if ($u->room['file'] == 'dungeon') {
z-index: 1000;
}
</style>
<div id="deMenu" class="hintDm" style="display:none;z-index:5000px;"></div>
<div id="deMenu" class="hintDm" style="display:none;z-index:5000;"></div>
<div style="margin-right:1px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
@ -906,9 +756,6 @@ if ($u->room['file'] == 'dungeon') {
if ($dies > 0) {
echo '<H4>Кол-во смертей: ' . $dies . '</H4>';
}
/*if($dies > 3) {
mysql_query('UPDATE `users` set `room` = "321" WHERE `id` = "'.$u->info['id'].'" LIMIT1 ');
}*/
} else {
if ($d->info['id2'] != 15) {
//Живые участники и архивариусы
@ -944,11 +791,11 @@ if ($u->room['file'] == 'dungeon') {
$xrz = $r;
}
$r = '<table style="display:inline-block;" border="0" cellspacing="0" cellpadding="0" height="10"><tr><td valign="middle" width="120" style="padding-top:12px">
<div style="position:relative;"><div id="vhp-1234600000' . $pl['id'] . '" title="Выполнение задания" align="left" class="seehp" style="position:absolute; top:-10px; width:120px; height:10px; z-index:12;"> ' . $xrz . '/' . $r . '</div>
<div title="Выполнение задания" class="hpborder" style="position:absolute; top:-10px; width:120px; height:9px; z-index:13;"><img src="//img.new-combats.tech/1x1.gif" height="9" width="1"></div>
<div class="hp_3 senohp" style="height:9px; width:120px; position:absolute; top:-10px; z-index:11;" id="lhp-1234600000' . $pl['id'] . '"><img src="//img.new-combats.tech/1x1.gif" height="9" width="1"></div>
<div title="Выполнение задания" class="hp_none" style="position:absolute; top:-10px; width:120px; height:10px; z-index:10;"><img src="//img.new-combats.tech/1x1.gif" height="10"></div>
</div></td></tr></table><br><script>top.startHpRegen("main",-1234600000' . $pl['id'] . ',' . $xrz . ',' . $r . ',0,0,0,0,0,0,1);</script>';
<div style="position:relative;"><div id="vhp-1234600000' . $pl['id'] . '" title="Выполнение задания" align="left" class="seehp" style="position:absolute; top:-10px; width:120px; height:10px; z-index:12;"> ' . $xrz . '/' . $r . '</div>
<div title="Выполнение задания" class="hpborder" style="position:absolute; top:-10px; width:120px; height:9px; z-index:13;"><img src="//img.new-combats.tech/1x1.gif" height="9" width="1"></div>
<div class="hp_3 senohp" style="height:9px; width:120px; position:absolute; top:-10px; z-index:11;" id="lhp-1234600000' . $pl['id'] . '"><img src="//img.new-combats.tech/1x1.gif" height="9" width="1"></div>
<div title="Выполнение задания" class="hp_none" style="position:absolute; top:-10px; width:120px; height:10px; z-index:10;"><img src="//img.new-combats.tech/1x1.gif" height="10"></div>
</div></td></tr></table><br><script>top.startHpRegen("main",-1234600000' . $pl['id'] . ',' . $xrz . ',' . $r . ',0,0,0,0,0,0,1)</script>';
$qsee .= '<small>Задание: &nbsp; ' . $pl['info'] . ' ' . $r . '</small><br>';
}
@ -961,11 +808,6 @@ if ($u->room['file'] == 'dungeon') {
echo $d->information;
} ?></div>
</div>
<?php
if ($u->info['admin'] > 0) {
#echo $d->genObjects();
}
?>
</td>
<td width="530" height="260" valign="top"
style="background-image:url(//img.new-combats.tech/maze_layer.jpg); background-repeat:no-repeat;">
@ -1067,11 +909,12 @@ if ($u->room['file'] == 'dungeon') {
$sb1 = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_obj` WHERE `name` LIKE "%Шайба%" AND `dn` = "' . $d->info['id'] . '" LIMIT 1'));
$sb1 = Db::getRow('select x, y from dungeon_obj where name like ? and dn = ? limit 1', ['%Шайба%', $d->info['id']]);
while($pl = mysql_fetch_array($sp)) {
$css = '"background-image":"url(//img.new-combats.tech/fon555.png)",';
$j = 0;
while ($j <= 4) {
while ($j < 4) {
if ($pl['st'][$j] == 1) {
$css .= '"border-' . $rzn[$j] . '":"1px solid #303030",';
} else {
@ -1080,7 +923,7 @@ if ($u->room['file'] == 'dungeon') {
$j++;
}
if( $sb1['x'] == $pl['x'] && $sb1['y'] == $pl['y'] ) {
if(!empty($sb1) && $sb1['x'] == $pl['x'] && $sb1['y'] == $pl['y'] ) {
echo '$("#min_' . $pl['x'] . '_' . $pl['y'] . '").html("<img class=\"u_rot' . $u->info['s'] . '\" title=\"Шайба!\" style=\"margin:2px 3px 3px 2px;background-image:url(//img.new-combats.tech/i/move/shb.gif)\" src=\"//img.new-combats.tech/1x1.gif\" width=\"7\" height=\"7\">");';
}elseif ($u->info['x'] == $pl['x'] && $u->info['y'] == $pl['y']) {
if ($d->info['id2'] == 15) {
@ -1257,7 +1100,7 @@ if ($u->room['file'] == 'dungeon') {
class="<?php if ($pd[23] == 1) {
echo 'RightSide1_0';
} ?>">
<div sid="0_1l"
<div id="0_1l"
class="<?php if ($pd[24] == 1) {
echo 'LeftFront0_1';
} ?>">
@ -1343,7 +1186,7 @@ if ($u->room['file'] == 'dungeon') {
success: function(html) {
$("body").html(html);
}
});*/
});*/
location.href = "/main.php";
});
@ -1354,7 +1197,7 @@ if ($u->room['file'] == 'dungeon') {
success: function(html) {
$("body").html(html);
}
});*/
});*/
location.href = "/main.php?look=1&rnd=<?=$code;?>";
});
@ -1365,7 +1208,7 @@ if ($u->room['file'] == 'dungeon') {
success: function(html) {
$("body").html(html);
}
});*/
});*/
location.href = "/main.php?look=2&rnd=<?=$code;?>";
});
@ -1375,8 +1218,6 @@ if ($u->room['file'] == 'dungeon') {
<?php
if ($u->info['admin'] == 1) {
echo '<form method="POST">X - <input type="text" name="g__x" autocomplete="off" value="' . $u->info['x'] . '" size="4" /> Y - <input type="text" name="g__y" autocomplete="off" value="' . $u->info['y'] . '" size="4" /> <input type="submit" value="Перейти" name="go_to_admin" /><br/><input id="restorbot" type="checkbox" name="g__restorebot" autocomplete="off" /> <label for="restorbot">Восстановить павших ботов </label></form><br>
S:' . $u->info['s'] . '';
S:' . $u->info['s'];
}
?>
<?php }
} ?>
}