diff --git a/.htaccess b/.htaccess index 68b70a2b..91a71035 100644 --- a/.htaccess +++ b/.htaccess @@ -1,86 +1,89 @@ DefaultLanguage ru - - -Options -Indexes -Options -MultiViews -RewriteEngine On - -RewriteCond %{HTTP:VIA} !^$ [OR] -RewriteCond %{HTTP:FORWARDED} !^$ [OR] -RewriteCond %{HTTP:USERAGENT_VIA} !^$ [OR] -RewriteCond %{HTTP:X_FORWARDED_FOR} !^$ [OR] -RewriteCond %{HTTP:PROXY_CONNECTION} !^$ [OR] -RewriteCond %{HTTP:XPROXY_CONNECTION} !^$ [OR] -RewriteCond %{HTTP:HTTP_PC_REMOTE_ADDR} !^$ [OR] -RewriteCond %{HTTP:HTTP_CLIENT_IP} !^$ -RewriteRule (.+) https://new-combats.tech/proxy/ - -RewriteBase / -RewriteCond %{ENV:REDIRECT} !^yes$ -RewriteRule ruletka.pl ruletka.php [L] -RewriteRule bandit.pl bandit.php [L] -RewriteRule blackjack.pl blackjack.php [L] -RewriteRule casino/SWFP.pl casino/SWFP.php [L] -RewriteCond %{ENV:REDIRECT} !^yes$ -RewriteRule ^r([0-9]+)/?$ /register.php?ref=$1 [L] - -RewriteRule ^settings/?$ /settings.php [L] - -RewriteRule ^info/(.*)/?$ /inf.php?$1 [L] - -RewriteRule ^rating_pers/?$ /reting_pers.php [L] -RewriteRule ^rating_pers/(.*)/?$ /reting_pers.php?$1 [L] - -RewriteRule ^rating_clans/?$ /reting_clans.php [L] -RewriteRule ^rating_clans/(.*)/?$ /reting_clans.php?$1 [L] - -RewriteRule ^clan/(.*)/?$ /clans_inf.php?$1 [L] -RewriteRule ^clan/?$ /clans_inf.php [L] - -RewriteRule ^ruins/(.*)/?$ /ruins.php?$1 [L] -RewriteRule ^ruins/?$ /ruins.php [L] - -RewriteRule ^news/(.*)/?$ /n/$1 [R=301,L] -RewriteRule ^news/?$ /n [R=301,L] - -RewriteRule ^n/(.*)/?$ /news_script/index.php?$1 [L] -RewriteRule ^n/?$ /news_script/index.php [L] - -RewriteRule ^forum/(.*)/?$ /forum_script/index.php?$1 [L] -RewriteRule ^forum/?$ /forum_script/index.php [L] - -RewriteRule ^shadow/(.*)/?$ /obraz.php?$1 [L] -RewriteRule ^shadow/?$ /obraz.php [L] - -RewriteRule ^dress/(.*)/?$ /dress.php?$1 [L] -RewriteRule ^dress/?$ /dress.php [L] - -RewriteRule ^monitoring/(.*)/?$ /hmonitor.php?$1 [L] -RewriteRule ^monitoring/?$ /hmonitor.php [L] - -RewriteRule ^rating/(.*)/?$ /rating_script/index.php?$1 [L] -RewriteRule ^rating/?$ /rating_script/index.php [L] - -RewriteRule ^item/(.*)/?$ /items_info.php?$1 [L] -RewriteRule ^item/?$ /items_info.php [L] -RewriteRule ^repass/?$ /repass.php [L] - -RewriteRule ^mail/(.*)/?$ /mailconf.php?$1 [L] - -RewriteRule ^register/?$ /register.php [L] - -RewriteRule ^reg/?$ /register.php [L] - -RewriteRule ^enter/?$ /enter.php [L] - -RewriteRule ^bk/?$ /buttons.php [L] - -RewriteRule ^mobile/?$ /main_mobile.php [L] - -RewriteRule ^btl([0-9]+)/?$ /jx/battle/refresh$1.php [L] -RewriteRule ^/n/?$ /news_script/index.php [L] -RewriteCond %{REQUEST_FILENAME} !-f -RewriteCond %{REQUEST_FILENAME} !-d -RewriteRule . /index.php [L] + + Header always set X-Content-Type-Options nosniff + + + + Options -Indexes + Options -MultiViews + RewriteEngine On + + RewriteCond %{HTTP:VIA} !^$ [OR] + RewriteCond %{HTTP:FORWARDED} !^$ [OR] + RewriteCond %{HTTP:USERAGENT_VIA} !^$ [OR] + RewriteCond %{HTTP:X_FORWARDED_FOR} !^$ [OR] + RewriteCond %{HTTP:PROXY_CONNECTION} !^$ [OR] + RewriteCond %{HTTP:XPROXY_CONNECTION} !^$ [OR] + RewriteCond %{HTTP:HTTP_PC_REMOTE_ADDR} !^$ [OR] + RewriteCond %{HTTP:HTTP_CLIENT_IP} !^$ + RewriteRule (.+) https://new-combats.tech/proxy/ + + RewriteBase / + RewriteCond %{ENV:REDIRECT} !^yes$ + RewriteRule ruletka.pl ruletka.php [L] + RewriteRule bandit.pl bandit.php [L] + RewriteRule blackjack.pl blackjack.php [L] + RewriteRule casino/SWFP.pl casino/SWFP.php [L] + RewriteCond %{ENV:REDIRECT} !^yes$ + RewriteRule ^r([0-9]+)/?$ /register.php?ref=$1 [L] + + RewriteRule ^settings/?$ /settings.php [L] + + RewriteRule ^info/(.*)/?$ /inf.php?$1 [L] + + RewriteRule ^rating_pers/?$ /reting_pers.php [L] + RewriteRule ^rating_pers/(.*)/?$ /reting_pers.php?$1 [L] + + RewriteRule ^rating_clans/?$ /reting_clans.php [L] + RewriteRule ^rating_clans/(.*)/?$ /reting_clans.php?$1 [L] + + RewriteRule ^clan/(.*)/?$ /clans_inf.php?$1 [L] + RewriteRule ^clan/?$ /clans_inf.php [L] + + RewriteRule ^ruins/(.*)/?$ /ruins.php?$1 [L] + RewriteRule ^ruins/?$ /ruins.php [L] + + RewriteRule ^news/(.*)/?$ /n/$1 [R=301,L] + RewriteRule ^news/?$ /n [R=301,L] + + RewriteRule ^n/(.*)/?$ /news_script/index.php?$1 [L] + RewriteRule ^n/?$ /news_script/index.php [L] + + RewriteRule ^forum/(.*)/?$ /forum_script/index.php?$1 [L] + RewriteRule ^forum/?$ /forum_script/index.php [L] + + RewriteRule ^shadow/(.*)/?$ /obraz.php?$1 [L] + RewriteRule ^shadow/?$ /obraz.php [L] + + RewriteRule ^dress/(.*)/?$ /dress.php?$1 [L] + RewriteRule ^dress/?$ /dress.php [L] + + RewriteRule ^monitoring/(.*)/?$ /hmonitor.php?$1 [L] + RewriteRule ^monitoring/?$ /hmonitor.php [L] + + RewriteRule ^rating/(.*)/?$ /rating_script/index.php?$1 [L] + RewriteRule ^rating/?$ /rating_script/index.php [L] + + RewriteRule ^item/(.*)/?$ /items_info.php?$1 [L] + RewriteRule ^item/?$ /items_info.php [L] + RewriteRule ^repass/?$ /repass.php [L] + + RewriteRule ^mail/(.*)/?$ /mailconf.php?$1 [L] + + RewriteRule ^register/?$ /register.php [L] + + RewriteRule ^reg/?$ /register.php [L] + + RewriteRule ^enter/?$ /enter.php [L] + + RewriteRule ^bk/?$ /buttons.php [L] + + RewriteRule ^mobile/?$ /main_mobile.php [L] + + RewriteRule ^btl([0-9]+)/?$ /jx/battle/refresh$1.php [L] + RewriteRule ^/n/?$ /news_script/index.php [L] + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule . /index.php [L] diff --git a/_incl_data/class/Battle.php b/_incl_data/class/Battle.php index b1fd3c76..e7d1a92e 100644 --- a/_incl_data/class/Battle.php +++ b/_incl_data/class/Battle.php @@ -462,6 +462,7 @@ class Battle $st = $this->stats[$this->uids[$id]]; $itm = $this->stats[$this->uids[$id]]['items']; $eff = $this->stats[$this->uids[$id]]['effects']; + $i = 0; $img = Config::img(); @@ -470,171 +471,175 @@ class Battle $armor3 = '
Броня пояса: '; $armor4 = '
Броня ног: '; - if ($u->info['seff'] < 1) { - # Передаётся в js, переносы строк всё ломают! - $ef = <<info['seff'] < 1) { + # Передаётся в js, переносы строк всё ломают! + $ef = << HTML; - while ($i != -1) { - $nseef = 0; - if ( - $this->users[$this->uids[$ur['id']]]['id'] != $u->info['id'] && - $ur['id'] != 0 && $this->stats[$this->uids[$ur['id']]]['seeAllEff'] != 1 - ) { - $nseef = 1; - if (isset($eff[$i]['v1']) && $eff[$i]['v1'] == 'priem') { - $eff[$i]['priem'] = Db::getRow('select * from priems where id = ?', [$eff[$i]['v2']]); + while ($i != -1) { + $nseef = 0; + if ( + $this->users[$this->uids[$ur['id']]]['id'] != $u->info['id'] && + $ur['id'] != 0 && $this->stats[$this->uids[$ur['id']]]['seeAllEff'] != 1 + ) { + $nseef = 1; + if (isset($eff[$i]['v1']) && $eff[$i]['v1'] == 'priem') { + $eff[$i]['priem'] = Db::getRow('select * from priems where id = ?', [$eff[$i]['v2']]); + } + if (isset($eff[$i]['priem']['id']) && $eff[$i]['priem']['neg'] == 1) { + $nseef = 0; + } } - if (isset($eff[$i]['priem']['id']) && $eff[$i]['priem']['neg'] == 1) { - $nseef = 0; - } - } - if (isset($eff[$i]) && $eff[$i] != 'delete') { - if ($nseef == 0) { - $ei = '' . $eff[$i]['name'] . ''; - if ($eff[$i]['x'] > 1) { - $ei .= ' x' . $eff[$i]['x'] . ' '; - } - - $ei .= match ($eff[$i]['type1']) { - 1, 2, 3, 4, 5, 6 => ' (Эликсир)', - 7, 8, 9, 10, 16 => ' (Заклятие)', - 14 => ' (Прием)', - 15 => ' (Изучение)', - 17 => ' (Проклятие)', - 18, 19 => ' (Травма)', - 20 => ' (Пристрастие)', - 22 => ' (Ожидание)', - default => ' (Эффект)' - }; - - $ei .= '
'; - - $time_still = ($eff[$i]['timeUse'] + ($eff[$i]['timeAce'] - $eff[$i]['timeUse']) + $eff[$i]['actionTime']); - if ($eff[$i]['timeAce'] == 0) { - $time_still += $eff[$i]['timeUse']; - } - $time_still -= time(); - if ($eff[$i]['bp'] == 0 && $eff[$i]['timeUse'] != 77) { - if ($eff[$i]['type1'] != 13) { - $ei .= 'Осталось: ' . Conversion::secondsToTimeout($time_still); + if (isset($eff[$i]) && $eff[$i] != 'delete') { + if ($nseef == 0) { + $ei = '' . $eff[$i]['name'] . ''; + if ($eff[$i]['x'] > 1) { + $ei .= ' x' . $eff[$i]['x'] . ' '; } - } else { - if ($eff[$i]['timeUse'] != 77 && $eff[$i]['hod'] < 1) { - $ei .= 'Осталось: ' . Conversion::secondsToTimeout($time_still); - } elseif ($eff[$i]['hod'] >= 0) { - $ei .= 'Зарядов: ' . $eff[$i]['hod']; + + $ei .= match ($eff[$i]['type1']) { + 1, 2, 3, 4, 5, 6 => ' (Эликсир)', + 7, 8, 9, 10, 16 => ' (Заклятие)', + 14 => ' (Прием)', + 15 => ' (Изучение)', + 17 => ' (Проклятие)', + 18, 19 => ' (Травма)', + 20 => ' (Пристрастие)', + 22 => ' (Ожидание)', + default => ' (Эффект)' + }; + + $ei .= '
'; + + $time_still = ($eff[$i]['timeUse'] + ($eff[$i]['timeAce'] - $eff[$i]['timeUse']) + $eff[$i]['actionTime']); + if ($eff[$i]['timeAce'] == 0) { + $time_still += $eff[$i]['timeUse']; } - } - - if ($eff[$i]['user_use'] != '') { - $str = '
Автор: %s'; - if ($this->users[$this->uids[$eff[$i]['user_use']]]['login2'] != '') { - $ei .= sprintf($str, $this->users[$this->uids[$eff[$i]['user_use']]]['login2']); - } elseif ($this->users[$this->uids[$eff[$i]['user_use']]]['login'] != '') { - $ei .= sprintf($str, $this->users[$this->uids[$eff[$i]['user_use']]]['login']); - } - unset($str); - } - - //Действие эффекта - $tr = ''; - - $x = 0; - $ed = Conversion::dataStringToArray($eff[$i]['data']); - while ($x < count($this->statnames->sysBonusNames)) { - $n = $this->statnames->sysBonusNames[$x]; - if (isset($ed['add_' . $n]) && $n != 'pog') { - $z = ''; - if ($ed['add_' . $n] > 0) { - $z = '+'; + $time_still -= time(); + if ($eff[$i]['bp'] == 0 && $eff[$i]['timeUse'] != 77) { + if ($eff[$i]['type1'] != 13) { + $ei .= 'Осталось: ' . Conversion::secondsToTimeout($time_still); } - $tr .= '
' . $this->statnames->bonusNames[$n] . ': ' . $z . $ed['add_' . $n]; - } - $x++; - } - - if (isset($ed['add_mib1']) && $ed['add_mib1'] != 0) { - if ($ed['add_mab1'] != 0) { - $tr .= $armor1 . $ed['add_mib1'] . '-' . $ed['add_mab1']; } else { - $m1l = $ed['add_mib1']; - if ($m1l > 0) { - $m1l = '+' . $m1l; + if ($eff[$i]['timeUse'] != 77 && $eff[$i]['hod'] < 1) { + $ei .= 'Осталось: ' . Conversion::secondsToTimeout($time_still); + } elseif ($eff[$i]['hod'] >= 0) { + $ei .= 'Зарядов: ' . $eff[$i]['hod']; } - $tr .= $armor1 . $m1l; } - } - if (isset($ed['add_mib2']) && $ed['add_mib2'] != 0) { - if ($ed['add_mab2'] != 0) { - $tr .= $armor2 . $ed['add_mib2'] . '-' . $ed['add_mab2']; - } else { - $m1l = $ed['add_mib2']; - if ($m1l > 0) { - $m1l = '+' . $m1l; - } - $tr .= $armor2 . $m1l; - } - } - if (isset($ed['add_mib3']) && $ed['add_mib3'] != 0) { - if ($ed['add_mab3'] != 0) { - $tr .= $armor3 . $ed['add_mib3'] . '-' . $ed['add_mab3']; - } else { - $m1l = $ed['add_mib3']; - if ($m1l > 0) { - $m1l = '+' . $m1l; - } - $tr .= $armor3 . $m1l; - } - } - if (isset($ed['add_mib4']) && $ed['add_mib4'] != 0) { - if ($ed['add_mab4'] != 0) { - $tr .= $armor4 . $ed['add_mib4'] . '-' . $ed['add_mab4']; - } else { - $m1l = $ed['add_mib4']; - if ($m1l > 0) { - $m1l = '+' . $m1l; - } - $tr .= $armor4 . $m1l; - } - } - $efix = 0; - if (isset($ed['add_pog2']) && $ed['add_pog2'] > 0) { - $efix = $ed['add_pog2']; - } - if (isset($ed['add_pog'])) { - $tr .= '
Магический барьер способен поглотить еще ' . $ed['add_pog'] . ' ед. урона'; - } - if (isset($ed['add_pog2'])) { - $tr .= '
Магический барьер способен поглотить еще ' . $ed['add_pog2'] . ' ед. урона (' . $ed['add_pog2p'] . '%)'; - } + if ($eff[$i]['user_use'] != '') { + $str = '
Автор: %s'; + if ($this->users[$this->uids[$eff[$i]['user_use']]]['login2'] != '') { + $ei .= sprintf($str, $this->users[$this->uids[$eff[$i]['user_use']]]['login2']); + } elseif ($this->users[$this->uids[$eff[$i]['user_use']]]['login'] != '') { + $ei .= sprintf($str, $this->users[$this->uids[$eff[$i]['user_use']]]['login']); + } + unset($str); + } - if ($tr != '') { - $ei .= $tr; - } - if ($eff[$i]['info'] != '') { - $ei .= '
Информация:
' . $eff[$i]['info']; - } + //Действие эффекта + $tr = ''; - $efcol = $eff[$i]['x']; - $efimg = $eff[$i]['img']; - $ef .= <<statnames->sysBonusNames)) { + $n = $this->statnames->sysBonusNames[$x]; + if (isset($ed['add_' . $n]) && $n != 'pog') { + $z = ''; + if ($ed['add_' . $n] > 0) { + $z = '+'; + } + $tr .= '
' . $this->statnames->bonusNames[$n] . ': ' . $z . $ed['add_' . $n]; + } + $x++; + } + + if (isset($ed['add_mib1']) && $ed['add_mib1'] != 0) { + if ($ed['add_mab1'] != 0) { + $tr .= $armor1 . $ed['add_mib1'] . '-' . $ed['add_mab1']; + } else { + $m1l = $ed['add_mib1']; + if ($m1l > 0) { + $m1l = '+' . $m1l; + } + $tr .= $armor1 . $m1l; + } + } + if (isset($ed['add_mib2']) && $ed['add_mib2'] != 0) { + if ($ed['add_mab2'] != 0) { + $tr .= $armor2 . $ed['add_mib2'] . '-' . $ed['add_mab2']; + } else { + $m1l = $ed['add_mib2']; + if ($m1l > 0) { + $m1l = '+' . $m1l; + } + $tr .= $armor2 . $m1l; + } + } + if (isset($ed['add_mib3']) && $ed['add_mib3'] != 0) { + if ($ed['add_mab3'] != 0) { + $tr .= $armor3 . $ed['add_mib3'] . '-' . $ed['add_mab3']; + } else { + $m1l = $ed['add_mib3']; + if ($m1l > 0) { + $m1l = '+' . $m1l; + } + $tr .= $armor3 . $m1l; + } + } + if (isset($ed['add_mib4']) && $ed['add_mib4'] != 0) { + if ($ed['add_mab4'] != 0) { + $tr .= $armor4 . $ed['add_mib4'] . '-' . $ed['add_mab4']; + } else { + $m1l = $ed['add_mib4']; + if ($m1l > 0) { + $m1l = '+' . $m1l; + } + $tr .= $armor4 . $m1l; + } + } + + $efix = 0; + if (isset($ed['add_pog2']) && $ed['add_pog2'] > 0) { + $efix = $ed['add_pog2']; + } + if (isset($ed['add_pog'])) { + $tr .= '
Магический барьер способен поглотить еще ' . $ed['add_pog'] . ' ед. урона'; + } + if (isset($ed['add_pog2'])) { + $tr .= '
Магический барьер способен поглотить еще ' . $ed['add_pog2'] . ' ед. урона (' . $ed['add_pog2p'] . '%)'; + } + + if ($tr != '') { + $ei .= $tr; + } + if ($eff[$i]['info'] != '') { + $ei .= '
Информация:
' . $eff[$i]['info']; + } + + $efcol = $eff[$i]['x']; + $efimg = $eff[$i]['img']; + $ef .= << HTML; - unset($efix, $efcol, $efimg); + unset($efix, $efcol, $efimg); + } + } elseif ($eff[$i] != 'delete') { + $i = -2; } - } elseif ($eff[$i] != 'delete') { - $i = -2; + $i++; } - $i++; - } - } else { - $ef = << HTML; + } } - $ca = ''; if ($ur['clan'] > 0) { @@ -712,9 +717,9 @@ JS; $i = 0; if (is_array($itm)) { + while ($i < count($itm)) { - // - if (isset($st['items_img'][$tpImg[$itm[$i]['inOdet']]])) { + if (isset($tpImg[$itm[$i]['inOdet']], $st['items_img'][$tpImg[$itm[$i]['inOdet']]])) { $itm[$i]['img'] = $st['items_img'][$tpImg[$itm[$i]['inOdet']]]; } //генерируем предметы @@ -782,7 +787,7 @@ JS; } $var1 = (int)$t; - $var2 = (int)$itm[$i]['uid']; + $var2 = (int)$id; $var3 = (int)$itm[$i]['id']; $var4 = (int)$itm[$i]['inOdet']; $var5 = $itm[$i]['name']; @@ -808,7 +813,6 @@ JS; public function testUsersLive(): bool { $tl = 0; - for ($i = 0; $i < count($this->uids); $i++) { if (empty($this->stats[$i]['id'])) { continue; @@ -1455,7 +1459,7 @@ JS; */ private function testExp($y, $s2): int { - if ($s2['levels'] == 'undefined' || $this->users[$this->uids[$s2['id']]]['pass'] == 'saintlucia') { + if ($s2['levels'] == 'undefined' || $this->users[$this->uids[$s2['id']]]['bot'] > 0) { return 0; } @@ -1860,16 +1864,17 @@ JS; mysql_query('DELETE FROM `battle_act` WHERE `id` = "' . $pl['id'] . '"'); } } - } - //тест удара - if ($this->uAtc['id'] > 0) { - if ($pl['out1'] == 0 && $pl['out2'] == 0) { - //Может разменяться только тот кто бил - if ($pl['uid1'] == $u->info['id'] || $pl['uid2'] == $u->info['id']) { + + //тест удара + if ($this->uAtc['id'] > 0) { + if ($pl['out1'] == 0 && $pl['out2'] == 0) { + //Может разменяться только тот кто бил + if ($pl['uid1'] == $u->info['id'] || $pl['uid2'] == $u->info['id']) { + $this->addNewAtack($u); + } + } else { $this->addNewAtack($u); } - } else { - $this->addNewAtack($u); } } @@ -1879,10 +1884,9 @@ JS; if ( isset($bot) && $this->stats[$this->uids[$bot]]['hpNow'] >= 1 && - $this->stats[$this->uids[$bot]]['pass'] != 'saintlucia' + $this->users[$this->uids[$bot]]['bot'] != 1 ) { //Тут проверка на бота saintlucia $j = 0; - while ($j < count($this->users)) { if ($this->i->razdel == 0) { $tnbot = time() + rand(1, 1); @@ -1955,25 +1959,28 @@ JS; $this->users[$j]['hpnow'] >= 1 && $this->users[$this->uids[$bot]]['hpnow'] >= 1 ) { - $this->atacks[$this->ga[$bot][$this->users[$j]['id']]]['a1'] = - rand(1, 5) . '' . rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5); + if (isset($this->ga[$bot][$this->users[$j]['id']])) { + $this->atacks[$this->ga[$bot][$this->users[$j]['id']]]['a1'] = + rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5); - $this->atacks[$this->ga[$bot][$this->users[$j]['id']]]['b1'] = rand(1, 5); + $this->atacks[$this->ga[$bot][$this->users[$j]['id']]]['b1'] = rand(1, 5); - $this->atacks[$this->ga[$bot][$this->users[$j]['id']]]['a2'] = - rand(1, 5) . '' . rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5); + $this->atacks[$this->ga[$bot][$this->users[$j]['id']]]['a2'] = + rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5); - $this->atacks[$this->ga[$bot][$this->users[$j]['id']]]['b2'] = rand(1, 5); + $this->atacks[$this->ga[$bot][$this->users[$j]['id']]]['b2'] = rand(1, 5); + } + if (isset($this->ag[$bot][$this->users[$j]['id']])) { + $this->atacks[$this->ag[$bot][$this->users[$j]['id']]]['a1'] = + rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5); - $this->atacks[$this->ag[$bot][$this->users[$j]['id']]]['a1'] = - rand(1, 5) . '' . rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5); + $this->atacks[$this->ag[$bot][$this->users[$j]['id']]]['b1'] = rand(1, 5); - $this->atacks[$this->ag[$bot][$this->users[$j]['id']]]['b1'] = rand(1, 5); + $this->atacks[$this->ag[$bot][$this->users[$j]['id']]]['a2'] = + rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5); - $this->atacks[$this->ag[$bot][$this->users[$j]['id']]]['a2'] = - rand(1, 5) . '' . rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5); - - $this->atacks[$this->ag[$bot][$this->users[$j]['id']]]['b2'] = rand(1, 5); + $this->atacks[$this->ag[$bot][$this->users[$j]['id']]]['b2'] = rand(1, 5); + } if ( isset($this->ga[$bot][$this->users[$j]['id']]) && @@ -2022,7 +2029,16 @@ JS; } } - //Приемы которые используются моментально (в конце хода) + /** + * Массово встречается в подключаемых файлах приёмов. + * @param array $arr + * @return void + * @deprecated + */ + public function add_log(array $arr): void + { + Log::add($arr); + } private function botAtack($uid, $pl, $tp): void { @@ -2217,7 +2233,7 @@ JS; // Заносим в логи + записываем статистику боя $this->addlogRazmen($id, $at); - var_dump($at); + //Запускаем магию предметов $this->magicItems($this->atacks[$id]['uid1'], $this->atacks[$id]['uid2'], $id); $this->magicItems($this->atacks[$id]['uid2'], $this->atacks[$id]['uid1'], $id); @@ -3867,7 +3883,7 @@ JS; Log::add($mas); $j++; } - var_dump($at); + } //Добавляем статистику + записываем в баттл_юзерс НР игроков @@ -4414,6 +4430,8 @@ JS; return; } + var_dump($_POST); + //atack: '3_2_0_0_0' (length=9) //block: '5' (length=1) @@ -4441,6 +4459,7 @@ JS; } $this->uAtc = $na; $js .= 'testClearZone();'; + var_dump($this->uAtc); } public function teamsTake(User $u): void @@ -4769,6 +4788,7 @@ JS; while ($i < count($this->uids)) { if ($this->stats[$i]['hpNow'] > 0) { if (!isset($teams[$this->users[$i]['team']])) { + $teams[$this->users[$i]['team']] = ''; $tms[$j] = $this->users[$i]['team']; $j++; } @@ -4821,6 +4841,7 @@ JS; $i++; } + //генерируем команды $i = 0; while ($i < count($tms)) { diff --git a/_incl_data/class/Priems.php b/_incl_data/class/Priems.php index 859d3d22..03771a71 100644 --- a/_incl_data/class/Priems.php +++ b/_incl_data/class/Priems.php @@ -2243,13 +2243,17 @@ class Priems return [0 => $lvar, 1 => $pz]; } + /** + * Генерирует html строку для вставки в JS $("#priems").html(" сюда "); + * @return string + */ public function seeMy(): string { global $btl; $i = 0; $p = explode('|', $this->u->info['priems']); $pr = ''; - $all = (int)$_GET['all']; + $all = $_GET['all'] ??= '0'; while ($i < $this->u->info['priemslot']) { if ($p[$i] > 0) { $pl = Db::getRow('select * from priems where level <= ? and activ > 0 and id = ?', [$this->u->info['level'], $p[$i]]); @@ -2289,14 +2293,20 @@ class Priems $notr = $this->testpriem($pl, 2); $cli2 = ''; - if (($pz[$i] > 0 || $notr > 0) || (isset($this->u->stats['nopriems']) && $pl['nosh'] == 0) || $this->u->stats['notuse_last_pr'] == $pl['id']) { + if (($pz[$i] > 0 || $notr > 0) || (isset($this->u->stats['nopriems']) && $pl['nosh'] == 0) || isset($this->u->stats['notuse_last_pr']) && $this->u->stats['notuse_last_pr'] == $pl['id']) { $cli2 = ' class="nopriemuse" '; } /// ТУТ! $priemName = $pl['name']; $priemImg = $pl['img']; + + // Слава StackOverflow! https://stackoverflow.com/a/43631576 + $var = json_encode("$priemName
$lvar"); + $jsOnmouseover = "top.hi(this,$var,event,3,0,1,1,'width: 240px;')"; + $htmlJs = htmlspecialchars($jsOnmouseover, ENT_QUOTES); + $pr .= << + HTML; diff --git a/_incl_data/class/User/Stats.php b/_incl_data/class/User/Stats.php index 6019a67e..79077adc 100644 --- a/_incl_data/class/User/Stats.php +++ b/_incl_data/class/User/Stats.php @@ -171,9 +171,9 @@ class Stats $st['items'] = []; $st['effects'] = []; - - - $st['vip'] = $u['vip']; + if (!empty($u['vip'])) { + $st['vip'] = $u['vip']; + } foreach (Conversion::dataStringToArray($u['stats']) as $stat => $value) { //fixme несуществующие статы mg5 mg6 a6 s8-s15 @@ -297,7 +297,7 @@ class Stats //Бонусы комплектов - if (is_iterable($coms['new'])) { + if (isset($coms['new']) && is_iterable($coms['new'])) { foreach ($coms['new'] as $complect) { $com = Db::getValue( 'select data from complects where com = ? and x <= ? order by x desc limit 1', diff --git a/_incl_data/class/User/WearedScrolls.php b/_incl_data/class/User/WearedScrolls.php index e7d09315..af30dcd7 100644 --- a/_incl_data/class/User/WearedScrolls.php +++ b/_incl_data/class/User/WearedScrolls.php @@ -15,7 +15,7 @@ class WearedScrolls public static function ScrollsChange(array &$u): void { //Замена свитков - if ($u['autospell'] == 0 || $u['battle'] != 0) { + if (empty($u['autospell']) || !empty($u['battle'])) { return; } //проверяем свитки diff --git a/buttons.php b/buttons.php index c7ed14a3..4cd0b7a1 100644 --- a/buttons.php +++ b/buttons.php @@ -76,7 +76,7 @@ if (!isset($_COOKIE['d1c'])) { - + HTML; diff --git a/main.php b/main.php index 7dd72dd0..a2d47d37 100644 --- a/main.php +++ b/main.php @@ -271,6 +271,8 @@ if (in_array( $q->testquest(); } +echo ""; + $iloc = ''; $iloce = ''; $img = Config::img(); @@ -403,8 +405,7 @@ $spl = Db::getValue('select exp from levels where nextlevel = ? order by exp lim -
'; + echo '
'; } if (isset($btl_last['id']) && $u->info['battle'] == 0) { require_once('modules_data/btl_.php'); @@ -449,9 +450,7 @@ if (isset($btl_last['id']) && $u->info['battle'] == 0) { if ($u->info['allLock'] < time()) { $u->deleteItem(intval($_GET['delete']), $u->info['id']); } else { - echo ''; + echo ''; } } elseif (isset($_GET['unstack']) && isset($_GET['inv']) && $u->newAct($_GET['sd4'])) { $u->unstack(intval($_GET['unstack']), intval($_GET['unstackCount'])); @@ -508,7 +507,7 @@ if (isset($_GET['security']) && !isset($u->tfer['id']) && $trololo == 1) { //поединок if ((!isset($btl_last['id']) || $u->info['battle'] > 0) && !isset($u->info['battle_lsto'])) { require_once('modules_data/btl_.php'); - echo ''; + echo ''; } } else { @@ -533,9 +532,7 @@ if (isset($_GET['security']) && !isset($u->tfer['id']) && $trololo == 1) { ) && $trololo == 1 && $u->info['inTurnir'] == 0 && $u->info['inTurnirnew'] == 0) { if ($u->info['allLock'] > time()) { require_once('modules_data/_locations.php'); - echo ''; + echo ''; } else { require_once('modules_data/_transfers.php'); } diff --git a/modules_data/alignPanel.php b/modules_data/alignPanel.php index c9317e8f..2445cdce 100644 --- a/modules_data/alignPanel.php +++ b/modules_data/alignPanel.php @@ -71,7 +71,7 @@ foreach ($bonus[(int)$u->info['align']]['items'] as $bonusItem) { ?> - +