From 5f9d3b85bf226f488f9e4cba8263655bfc76c48c Mon Sep 17 00:00:00 2001 From: Ivor Barhansky Date: Mon, 29 Apr 2024 17:22:11 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B1=D0=BE=D1=80=D0=BA=D0=B0=20=D0=BD?= =?UTF-8?q?=D0=B5=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D1=83=D0=B5?= =?UTF-8?q?=D0=BC=D1=8B=D1=85=20=D0=BE=D1=82=D1=81=D1=8B=D0=BB=D0=BE=D0=BA?= =?UTF-8?q?=20=D0=BD=D0=B0=20=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3=D1=83?= =?UTF-8?q?=D1=80=D0=B0=D1=86=D0=B8=D1=8E.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _incl_data/class/Battle/Finish.php | 406 ++++++++++++++--------------- _incl_data/class/Core/Config.php | 63 ++--- _incl_data/class/User.php | 11 - clans_inf.php | 2 - forum_script/index.php | 8 +- main.php | 2 +- modules_data/_friends.php | 1 - modules_data/_transfers.php | 1 - modules_data/_zv.php | 5 +- obraz.php | 8 +- register.php | 2 +- repass.php | 2 +- settings.php | 2 +- 13 files changed, 232 insertions(+), 281 deletions(-) diff --git a/_incl_data/class/Battle/Finish.php b/_incl_data/class/Battle/Finish.php index 0a55c7f4..ea7b96e7 100644 --- a/_incl_data/class/Battle/Finish.php +++ b/_incl_data/class/Battle/Finish.php @@ -54,7 +54,7 @@ class Finish } } } - + //данные о игроках в бою $t = Db::getRows( @@ -125,7 +125,7 @@ class Finish } $this->battle->i->setPlayerC(); - + Db::sql('update battle set players_c = ? where id = ?', [$this->battle->i->getPlayersC(), $this->battle->i->id]); if (!empty($vtvl)) { @@ -255,8 +255,7 @@ class Finish mysql_query( 'INSERT INTO `dungeon_items` (`dn`,`item_id`,`time`,`x`,`y`) VALUES ( - "' . $this->battle->users[$i]['dnow'] . '","' . $plik['item_id'] . '","' . (time( - ) - 600) . '","' . $this->battle->users[$i]['x'] . '","' . $this->battle->users[$i]['y'] . '" + "' . $this->battle->users[$i]['dnow'] . '","' . $plik['item_id'] . '","' . (time() - 600) . '","' . $this->battle->users[$i]['x'] . '","' . $this->battle->users[$i]['y'] . '" )' ); } @@ -488,8 +487,7 @@ class Finish 'UPDATE `users` SET `battle` = "0" WHERE `id` = "' . $this->battle->users[$i]['id'] . '" LIMIT 1' ); mysql_query( - 'UPDATE `stats` SET `zv` = "0",`team` = "0",`exp` = `exp` + `battle_exp`,`battle_exp` = "0",`battle_yron` = "0",`enemy` = "0", `timeGo` = "' . time( - ) . '" WHERE `id` = "' . $this->battle->users[$i]['id'] . '" LIMIT 1' + 'UPDATE `stats` SET `zv` = "0",`team` = "0",`exp` = `exp` + `battle_exp`,`battle_exp` = "0",`battle_yron` = "0",`enemy` = "0", `timeGo` = "' . time() . '" WHERE `id` = "' . $this->battle->users[$i]['id'] . '" LIMIT 1' ); mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $this->battle->users[$i]['id'] . '" LIMIT 100'); } @@ -687,8 +685,7 @@ class Finish } } mysql_query( - 'UPDATE `dungeon_bots` SET `delete` = "' . time( - ) . '" AND `inBattle` = "' . $this->battle->i->id . '" WHERE `dn` = "' . $this->battle->i->dnId . '" AND `for_dn` = "0" AND `delete` = "0" ' + 'UPDATE `dungeon_bots` SET `delete` = "' . time() . '" AND `inBattle` = "' . $this->battle->i->id . '" WHERE `dn` = "' . $this->battle->i->dnId . '" AND `for_dn` = "0" AND `delete` = "0" ' ); } else { //выкидываем всех игроков в клетку RESTART @@ -722,7 +719,7 @@ class Finish $this->expCoef += $this->battle->stats[$i]['pbe']; } - if ($this->battle->i->razdel == 5 && (Config::get('m') >= 6 && Config::get('m') <= 8 || Config::get('w') == 0 || Config::get('w') == 6)) { + if ($this->battle->i->razdel == 5 && (date('m') >= 6 && date('m') <= 8 || date('w') == 0 || date('w') == 6)) { $this->expCoef += 5; } @@ -1032,13 +1029,13 @@ class Finish ]; $admn = $admn[$this->battle->users[$i]['level']]; - if (Config::get('m') >= 6 && Config::get('m') <= 8) { + if (date('m') >= 6 && date('m') <= 8) { //Летний период - if (Config::get('w') == 0 || Config::get('w') == 5 || Config::get('w') == 6) { + if (date('w') == 0 || date('w') == 5 || date('w') == 6) { //Выходные дни $admn = $admn * 2; } - } elseif (Config::get('w') == 0 || Config::get('w') == 5 || Config::get('w') == 6) { + } elseif (date('w') == 0 || date('w') == 5 || date('w') == 6) { //Выходные дни $admn = $admn * 2; } @@ -1290,17 +1287,14 @@ class Finish } if ($this->battle->users[$i]['battle_yron'] > 0) { mysql_query( - 'INSERT INTO `eff_users` (`no_Ace`,`id_eff`,`overType`,`uid`,`name`,`data`,`timeUse`) VALUES ("1","478","111","' . $this->battle->users[$i]['id'] . '","Право на подвиг","pravonapodvig=1","' . time( - ) . '")' + 'INSERT INTO `eff_users` (`no_Ace`,`id_eff`,`overType`,`uid`,`name`,`data`,`timeUse`) VALUES ("1","478","111","' . $this->battle->users[$i]['id'] . '","Право на подвиг","pravonapodvig=1","' . time() . '")' ); } mysql_query( - 'INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `ip`, `vals`, `val`) VALUES ("' . $this->battle->users[$i]['id'] . '","' . time( - ) . '","capitalcity","' . $this->battle->users[$i]['room'] . '","end_trup"," ","","")' + 'INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `ip`, `vals`, `val`) VALUES ("' . $this->battle->users[$i]['id'] . '","' . time() . '","capitalcity","' . $this->battle->users[$i]['room'] . '","end_trup"," ","","")' ); mysql_query( - 'INSERT INTO `eff_users` (`no_Ace`,`id_eff`,`overType`,`uid`,`name`,`data`,`timeUse`) VALUES ("1","479","112","' . $u->info['id'] . '","Защита от нападения","zashitatk=1","' . time( - ) . '")' + 'INSERT INTO `eff_users` (`no_Ace`,`id_eff`,`overType`,`uid`,`name`,`data`,`timeUse`) VALUES ("1","479","112","' . $u->info['id'] . '","Защита от нападения","zashitatk=1","' . time() . '")' ); $ritem = rand(1, 1000); if ($ritem == 555) { @@ -1361,8 +1355,7 @@ class Finish 'UPDATE `rep` SET `rep3` = `rep3` + "' . $rzbvo . '" WHERE `id` = "' . $this->battle->users[$i]['id'] . '" LIMIT 1' ); mysql_query( - 'INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `ip`, `vals`, `val`) VALUES ("' . $this->battle->users[$i]['id'] . '","' . time( - ) . '","capitalcity","' . $this->battle->users[$i]['room'] . '","end_xaot"," ","","")' + 'INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `ip`, `vals`, `val`) VALUES ("' . $this->battle->users[$i]['id'] . '","' . time() . '","capitalcity","' . $this->battle->users[$i]['room'] . '","end_xaot"," ","","")' ); } @@ -1467,7 +1460,7 @@ class Finish $this->battle->users[$i]['id'], ] ); - + if ($this->battle->i->turnir == 0) { //пишем в чат $cmsg->setTo($this->battle->users[$i]['login']); @@ -1514,17 +1507,19 @@ class Finish } - private function addItemToItemsLocal(int $itemId, int $uid, string $data = ''): void + /** + * Сохраняем лог в архив + * @return void + */ + private function saveLogs(): void { Db::sql( - "insert into items_local (room, time, item_id, data, tr_login, colvo) values (?,unix_timestamp(),?,?,?,1)", - [ - $this->battle->users[$this->battle->uids[$uid]]['room'], - $itemId, - $data, - $this->battle->users[$this->battle->uids[$uid]]['login'], - ] + 'insert into battle_logs_save select id, time, battle, id_hod, text, vars, zona1, zonb1, zona2, zonb2, type from battle_logs where battle = ? and id_hod <= ?', + [$this->battle->i->id, $this->battle->hodID] ); + Db::sql('delete from battle_logs where battle = ?', [$this->battle->i->id]); + Db::sql('delete from battle_stat where battle < ?', [$this->battle->i->id - 100]); + Db::sql('delete from battle_actions where btl = ?', [$this->battle->i->id]); } private function addGlobalItems($bid, $uid, $itm, $ico, $exp, $cr, $ecr): void @@ -1583,159 +1578,53 @@ class Finish $this->addGlobalItemItm($itm, $uid, $cmsg, $chat); } - /** - * Сохраняем лог в архив - * @return void - */ - private function saveLogs(): void + private function addGlobalItemsDropsOnMainStreet(int $bid, int $uid): void { - Db::sql( - 'insert into battle_logs_save select id, time, battle, id_hod, text, vars, zona1, zonb1, zona2, zonb2, type from battle_logs where battle = ? and id_hod <= ?', - [$this->battle->i->id, $this->battle->hodID] - ); - Db::sql('delete from battle_logs where battle = ?', [$this->battle->i->id]); - Db::sql('delete from battle_stat where battle < ?', [$this->battle->i->id - 100]); - Db::sql('delete from battle_actions where btl = ?', [$this->battle->i->id]); + //Выпадение дропа на ЦП + $mf = Db::getValue('select floor(count(id) / 20) as c from users where online > unix_timestamp() - 120'); + $mf = mt_rand(1, max($mf, 1)); + if ($bid == 1008) { + //Старый Новый Год + for ($i = 0; $i < $mf; $i++) { + if (mt_rand(0, 1) === 1) { + continue; + } + if (mt_rand(0, 86) <= 71) { + for ($j = 1; $j <= 7; $j++) { + $this->addItemToItemsLocal(1000, $uid, '|nosale=1|srok=259200'); + } + } else { + $customs = [911, 1172, 1173, 1461, 1462, 1463, 2141, 2142, 2143, 2144, 2870, 4037, 4038, 4039, 4040]; + $this->addItemToItemsLocal($customs[array_rand($customs)], $uid, '|nosale=1|srok=259200'); + } + } + } elseif ($bid == 1007) { + //Хэллоуин, Тыквоголовый CAPITAL CITY + for ($i = 0; $i < $mf; $i++) { + if (mt_rand(0, 1) === 1) { + continue; + } + $this->addItemToItemsLocal(4504, $uid); + } + } elseif ($bid == 1006 && mt_rand(1, 10) === 1 || in_array($bid, range(1000, 1004))) { + //Трупожор CAPITAL CITY + $this->addItemToItemsLocal(4451, $uid, 'srok=2592000'); + } + + } - private function dieInDungeon(int $dnr, int $i, User $u, ChatMessage $cmsg, Chat $chat): void + private function addItemToItemsLocal(int $itemId, int $uid, string $data = ''): void { - if ($dnr != 1) { - return; - } - - $vars = $this->battle->users[$i]['room'] == 370 ? 'dielaba' : 'die'; - $dies = Actions::countDungeon( - $this->battle->users[$i]['dnow'], - $this->battle->users[$i]['id'], - $vars + Db::sql( + "insert into items_local (room, time, item_id, data, tr_login, colvo) values (?,unix_timestamp(),?,?,?,1)", + [ + $this->battle->users[$this->battle->uids[$uid]]['room'], + $itemId, + $data, + $this->battle->users[$this->battle->uids[$uid]]['login'], + ] ); - Actions::addDungeon( - $this->battle->users[$i]['dnow'], - $this->battle->users[$i]['id'], - $this->battle->users[$i]['x'], - $this->battle->users[$i]['y'], - $vars - ); - - $la = $this->battle->users[$i]['sex'] == 1 ? 'ла' : ''; - - if ($dies < 2 || $this->battle->i->dungeon == 15) { - - $shaibaItemId = Db::getValue('select id from items_users where uid = ? and item_id = 4910 limit 1', [$this->battle->users[$i]['id']]); - - if ($shaibaItemId) { - //выбрасываем шайбу - ItemsModel::delete($shaibaItemId); - Db::sql( - "insert into dungeon_obj (name, dn, x, y, img, action, w, h, os1, os2, os3, date) - values ('Шайба',?,?,?,'shaiba.png','fileact:15/shaiba',120,220,5,8,12,?)", - [ - $this->battle->i->dnId, - $this->battle->users[$i]['x'], - $this->battle->users[$i]['y'], - "{use:'takeit',rt1:69,rl1:-47,rt2:74,rl2:126,rt3:76,rl3:140,rt4:80,rl4:150}", - ] - ); - } - - //телепортируем в рестарт (координата 0х0) - $this->battle->users[$i]['x'] = $this->battle->users[$i]['res_x']; - $this->battle->users[$i]['y'] = $this->battle->users[$i]['res_y']; - $this->battle->users[$i]['s'] = $this->battle->users[$i]['res_s']; - - $roomName = Db::getValue('select name from room where id = ?', [(int)$this->battle->users[$i]['room']]); - - $reviveRoomName = $this->battle->users[$i]['room'] == 370 ? 'начале лабиринта' : "комнате «{$roomName}»"; - $rtxt = "{$this->battle->users[$i]['login']} трагически погиб$la и находится в $reviveRoomName"; - - } elseif ($this->battle->i->dungeon == 102) { - $nld = ''; - $lab = Db::getRow('select id, users from laba_now where id = ?', [$this->battle->users[$i]['id']]); - - if ($lab['users'] < 2) { - //Удаляем подземелье - Db::sql('delete from laba_now where id = ?', [$lab['id']]); - Db::sql('delete from laba_map where id = ?', [$lab['id']]); - Db::sql('delete from laba_obj where lib = ?', [$lab['id']]); - Db::sql('delete from laba_act where lib = ?', [$lab['id']]); - Db::sql('delete from laba_itm where lib = ?', [$lab['id']]); - } else { - $lab['users']--; - mysql_query( - 'UPDATE `laba_now` SET `users` = "' . $lab['users'] . '" WHERE `id` = "' . $lab['id'] . '" LIMIT 1' - ); - } - mysql_query( - 'UPDATE `stats` SET `dnow` = "0" WHERE `id` = "' . $this->battle->users[$i]['id'] . '" LIMIT 1' - ); - mysql_query( - 'UPDATE `users` SET `room` = "369" WHERE `id` = "' . $this->battle->users[$i]['id'] . '" LIMIT 1' - ); - //удаляем все предметы которые пропадают после выхода из пещеры - mysql_query( - 'UPDATE `items_users` SET `delete` = "' . time( - ) . '" WHERE `uid` = "' . $this->battle->users[$i]['id'] . '" AND `delete` < 1234567890 AND `inShop` = "0" AND (`dn_delete` = "1" OR `data` LIKE "%fromlaba=1%")' - ); - if ($this->battle->users[$i]['login'] != '') { - if ($this->battle->users[$i]['sex'] == 0) { - $rtxt = '' . $this->battle->users[$i]['login'] . ' трагически погиб без права на воскрешение и покидает подземелье' . $nld; - } else { - $rtxt = '' . $this->battle->users[$i]['login'] . ' трагически погибла без права на воскрешение и покидает подземелье' . $nld; - } - } - } else { - $tinf = mysql_fetch_array( - mysql_query( - 'SELECT `uid` FROM `dungeon_now` WHERE `id` = "' . $this->battle->i->dnId . '" LIMIT 1' - ) - ); - $nld = ''; - if ($tinf['uid'] == $this->battle->users[$i]['id']) { - $tinf = mysql_fetch_array( - mysql_query( - 'SELECT `id` FROM `stats` WHERE `dnow` = "' . $this->battle->i->dnId . '" AND `hpNow` >= 1 LIMIT 1' - ) - ); - if (isset($tinf['id'])) { - $tinf = mysql_fetch_array( - mysql_query( - 'SELECT `id`,`login` FROM `users` WHERE `id` = "' . $tinf['id'] . '" LIMIT 1' - ) - ); - $nld .= ', новым лидером становится "' . $tinf['login'] . '"'; - mysql_query( - 'UPDATE `dungeon_now` SET `uid` = "' . $tinf['id'] . '" WHERE `id` = "' . $this->battle->i->dnId . '" LIMIT 1' - ); - } - } - - mysql_query( - 'UPDATE `stats` SET `dnow` = "0" WHERE `id` = "' . $this->battle->users[$i]['id'] . '" LIMIT 1' - ); - mysql_query( - 'UPDATE `users` SET `room` = "321" WHERE `id` = "' . $this->battle->users[$i]['id'] . '" LIMIT 1' - ); - //удаляем все предметы которые пропадают после выхода из пещеры - mysql_query( - 'UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $this->battle->users[$i]['id'] . '" AND `dn_delete` = "1" LIMIT 1000' - ); - mysql_query( - 'UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $u->info['id'] . '" AND `item_id` = "1189" OR `item_id` = "4447" OR `item_id` = "1174") LIMIT 1000' - ); - - if ($this->battle->users[$i]['sex'] == 0) { - $rtxt = '' . $this->battle->users[$i]['login'] . ' трагически погиб без права на воскрешение и покидает подземелье' . $nld; - } else { - $rtxt = '' . $this->battle->users[$i]['login'] . ' трагически погибла без права на воскрешение и покидает подземелье' . $nld; - } - } - if (!empty($rtxt)) { - $cmsg->setDn($this->battle->i->dnId); - $cmsg->setText($rtxt); - $cmsg->setTypeTime(1); - $chat->sendMsg($cmsg); - } } private function addGlobalItemsIco(string $ico, int $uid, ChatMessage $cmsg, Chat $chat): void @@ -1862,40 +1751,143 @@ class Finish } } - private function addGlobalItemsDropsOnMainStreet(int $bid, int $uid): void + private function dieInDungeon(int $dnr, int $i, User $u, ChatMessage $cmsg, Chat $chat): void { - //Выпадение дропа на ЦП - $mf = Db::getValue('select floor(count(id) / 20) as c from users where online > unix_timestamp() - 120'); - $mf = mt_rand(1, max($mf, 1)); - if ($bid == 1008) { - //Старый Новый Год - for ($i = 0; $i < $mf; $i++) { - if (mt_rand(0, 1) === 1) { - continue; - } - if (mt_rand(0, 86) <= 71) { - for ($j = 1; $j <= 7; $j++) { - $this->addItemToItemsLocal(1000, $uid, '|nosale=1|srok=259200'); - } - } else { - $customs = [911, 1172, 1173, 1461, 1462, 1463, 2141, 2142, 2143, 2144, 2870, 4037, 4038, 4039, 4040]; - $this->addItemToItemsLocal($customs[array_rand($customs)], $uid, '|nosale=1|srok=259200'); - } - } - } elseif ($bid == 1007) { - //Хэллоуин, Тыквоголовый CAPITAL CITY - for ($i = 0; $i < $mf; $i++) { - if (mt_rand(0, 1) === 1) { - continue; - } - $this->addItemToItemsLocal(4504, $uid); - } - } elseif ($bid == 1006 && mt_rand(1, 10) === 1 || in_array($bid, range(1000, 1004))) { - //Трупожор CAPITAL CITY - $this->addItemToItemsLocal(4451, $uid, 'srok=2592000'); + if ($dnr != 1) { + return; } + $vars = $this->battle->users[$i]['room'] == 370 ? 'dielaba' : 'die'; + $dies = Actions::countDungeon( + $this->battle->users[$i]['dnow'], + $this->battle->users[$i]['id'], + $vars + ); + Actions::addDungeon( + $this->battle->users[$i]['dnow'], + $this->battle->users[$i]['id'], + $this->battle->users[$i]['x'], + $this->battle->users[$i]['y'], + $vars + ); + $la = $this->battle->users[$i]['sex'] == 1 ? 'ла' : ''; + + if ($dies < 2 || $this->battle->i->dungeon == 15) { + + $shaibaItemId = Db::getValue('select id from items_users where uid = ? and item_id = 4910 limit 1', [$this->battle->users[$i]['id']]); + + if ($shaibaItemId) { + //выбрасываем шайбу + ItemsModel::delete($shaibaItemId); + Db::sql( + "insert into dungeon_obj (name, dn, x, y, img, action, w, h, os1, os2, os3, date) + values ('Шайба',?,?,?,'shaiba.png','fileact:15/shaiba',120,220,5,8,12,?)", + [ + $this->battle->i->dnId, + $this->battle->users[$i]['x'], + $this->battle->users[$i]['y'], + "{use:'takeit',rt1:69,rl1:-47,rt2:74,rl2:126,rt3:76,rl3:140,rt4:80,rl4:150}", + ] + ); + } + + //телепортируем в рестарт (координата 0х0) + $this->battle->users[$i]['x'] = $this->battle->users[$i]['res_x']; + $this->battle->users[$i]['y'] = $this->battle->users[$i]['res_y']; + $this->battle->users[$i]['s'] = $this->battle->users[$i]['res_s']; + + $roomName = Db::getValue('select name from room where id = ?', [(int)$this->battle->users[$i]['room']]); + + $reviveRoomName = $this->battle->users[$i]['room'] == 370 ? 'начале лабиринта' : "комнате «{$roomName}»"; + $rtxt = "{$this->battle->users[$i]['login']} трагически погиб$la и находится в $reviveRoomName"; + + } elseif ($this->battle->i->dungeon == 102) { + $nld = ''; + $lab = Db::getRow('select id, users from laba_now where id = ?', [$this->battle->users[$i]['id']]); + + if ($lab['users'] < 2) { + //Удаляем подземелье + Db::sql('delete from laba_now where id = ?', [$lab['id']]); + Db::sql('delete from laba_map where id = ?', [$lab['id']]); + Db::sql('delete from laba_obj where lib = ?', [$lab['id']]); + Db::sql('delete from laba_act where lib = ?', [$lab['id']]); + Db::sql('delete from laba_itm where lib = ?', [$lab['id']]); + } else { + $lab['users']--; + mysql_query( + 'UPDATE `laba_now` SET `users` = "' . $lab['users'] . '" WHERE `id` = "' . $lab['id'] . '" LIMIT 1' + ); + } + mysql_query( + 'UPDATE `stats` SET `dnow` = "0" WHERE `id` = "' . $this->battle->users[$i]['id'] . '" LIMIT 1' + ); + mysql_query( + 'UPDATE `users` SET `room` = "369" WHERE `id` = "' . $this->battle->users[$i]['id'] . '" LIMIT 1' + ); + //удаляем все предметы которые пропадают после выхода из пещеры + mysql_query( + 'UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $this->battle->users[$i]['id'] . '" AND `delete` < 1234567890 AND `inShop` = "0" AND (`dn_delete` = "1" OR `data` LIKE "%fromlaba=1%")' + ); + if ($this->battle->users[$i]['login'] != '') { + if ($this->battle->users[$i]['sex'] == 0) { + $rtxt = '' . $this->battle->users[$i]['login'] . ' трагически погиб без права на воскрешение и покидает подземелье' . $nld; + } else { + $rtxt = '' . $this->battle->users[$i]['login'] . ' трагически погибла без права на воскрешение и покидает подземелье' . $nld; + } + } + } else { + $tinf = mysql_fetch_array( + mysql_query( + 'SELECT `uid` FROM `dungeon_now` WHERE `id` = "' . $this->battle->i->dnId . '" LIMIT 1' + ) + ); + $nld = ''; + if ($tinf['uid'] == $this->battle->users[$i]['id']) { + $tinf = mysql_fetch_array( + mysql_query( + 'SELECT `id` FROM `stats` WHERE `dnow` = "' . $this->battle->i->dnId . '" AND `hpNow` >= 1 LIMIT 1' + ) + ); + if (isset($tinf['id'])) { + $tinf = mysql_fetch_array( + mysql_query( + 'SELECT `id`,`login` FROM `users` WHERE `id` = "' . $tinf['id'] . '" LIMIT 1' + ) + ); + $nld .= ', новым лидером становится "' . $tinf['login'] . '"'; + mysql_query( + 'UPDATE `dungeon_now` SET `uid` = "' . $tinf['id'] . '" WHERE `id` = "' . $this->battle->i->dnId . '" LIMIT 1' + ); + } + } + + mysql_query( + 'UPDATE `stats` SET `dnow` = "0" WHERE `id` = "' . $this->battle->users[$i]['id'] . '" LIMIT 1' + ); + mysql_query( + 'UPDATE `users` SET `room` = "321" WHERE `id` = "' . $this->battle->users[$i]['id'] . '" LIMIT 1' + ); + //удаляем все предметы которые пропадают после выхода из пещеры + mysql_query( + 'UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $this->battle->users[$i]['id'] . '" AND `dn_delete` = "1" LIMIT 1000' + ); + mysql_query( + 'UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $u->info['id'] . '" AND `item_id` = "1189" OR `item_id` = "4447" OR `item_id` = "1174") LIMIT 1000' + ); + + if ($this->battle->users[$i]['sex'] == 0) { + $rtxt = '' . $this->battle->users[$i]['login'] . ' трагически погиб без права на воскрешение и покидает подземелье' . $nld; + } else { + $rtxt = '' . $this->battle->users[$i]['login'] . ' трагически погибла без права на воскрешение и покидает подземелье' . $nld; + } + } + if (!empty($rtxt)) { + $cmsg->setDn($this->battle->i->dnId); + $cmsg->setText($rtxt); + $cmsg->setTypeTime(1); + $chat->sendMsg($cmsg); + } } public function getBtlstatus(): array diff --git a/_incl_data/class/Core/Config.php b/_incl_data/class/Core/Config.php index 056ab7b9..ad337cec 100644 --- a/_incl_data/class/Core/Config.php +++ b/_incl_data/class/Core/Config.php @@ -2,14 +2,16 @@ namespace Core; +use DateTime; + class Config { const EKR_RUB_PRICE = 30; const KR_TO_EKR_EXCHANGE = 500; const EKR_TO_KR_EXCHANGE = 200; + private const HOSTNAME = 'new-combats.tech'; + public const GAMENAME = 'Новый Бойцовский Клуб'; private static self $instance; - private static string $hostname = 'new-combats.tech'; - private static string $gamename = 'Бойцовский Клуб'; private function __construct() { @@ -27,75 +29,51 @@ class Config private static function subdomain(string $name): string { - return DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR . $name . '.' . self::$hostname; + return DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR . $name . '.' . self::HOSTNAME; } public static function get(?string $key = null) { - $c['ver'] = '1.8.3.7'; + $c['ver'] = '0.8.2 alpha'; /* Конфигурации игры */ - $c['name'] = 'Новый «' . self::$gamename . '»'; - $c['title'] = $c['name'] . ' - Бесплатная,браузерная онлайн игра'; //Название игры - $c['title2'] = ' - Бесплатная, онлайн игра посвященная сражениям и магии!'; - $c['title3'] = $c['name']; - $c['keys'] = self::$gamename . ', combats.com, ' . self::$gamename . ' игра, ' . self::$gamename . ' играть, игра ' . self::$gamename . ', старый ' . self::$gamename . ', ' . self::$gamename . ' онлайн игра, ' . self::$gamename . ' браузерная игра, играть в ' . $c['name'] . ', игра бк, бк игра, старый бк, играть в бк, бк онлайн игра, новый бк, Легендарный ' . $c['name'] . ', легендарный бк, combats, комбатс, combats ru, combats com, OldBK, oldbk ru, oldbk com, олдбк, old bk, олд бк, mycombats, rebk, recombats, oldcombats, obk2'; //Ключевые слова META - $c['desc'] = self::$gamename . ' – это бесплатная увлекательная браузерная онлайн игра 2004-2009г, в которой сконцентрировано все самое лучшее от современных онлайн игр. В этой браузерной игре заложены самые интересные традиции всем известной онлайн игры под названием «' . self::$gamename . ' 2004-2009», которая, кстати, стала первооткрывателем всех браузерных игр.'; //Описание META - $c['footer'] = $c['name'] . ' © 2013-' . date('Y'); + $c['title'] = self::GAMENAME . ' - Бесплатная, браузерная онлайн игра'; //Название игры + $c['keys'] = self::GAMENAME . ', combats.com, ' . self::GAMENAME . ' игра, ' . self::GAMENAME . ' играть, игра ' . self::GAMENAME . ', старый ' . self::GAMENAME . ', ' . self::GAMENAME . ' онлайн игра, ' . self::GAMENAME . ' браузерная игра, играть в ' . self::GAMENAME . ', игра бк, бк игра, старый бк, играть в бк, бк онлайн игра, новый бк, Легендарный ' . self::GAMENAME . ', легендарный бк, combats, комбатс, combats ru, combats com, OldBK, oldbk ru, oldbk com, олдбк, old bk, олд бк, mycombats, rebk, recombats, oldcombats, obk2'; //Ключевые слова META + $c['desc'] = self::GAMENAME . ' – это бесплатная увлекательная браузерная онлайн игра 2004-2009г, в которой сконцентрировано все самое лучшее от современных онлайн игр. В этой браузерной игре заложены самые интересные традиции всем известной онлайн игры под названием «' . self::GAMENAME . ' 2004-2009», которая, кстати, стала первооткрывателем всех браузерных игр.'; //Описание META + $c['footer'] = self::GAMENAME . ' © 2013-' . date('Y'); //Сервера - $c['host'] = self::$hostname; + $c['host'] = self::HOSTNAME; $c['forum'] = self::subdomain('forum'); - $c['img'] = 'img.' . self::$hostname; - $c['thiscity'] = 'capitalcity'; - $c['capitalcity'] = self::$hostname; - $c['abandonedplain'] = self::$hostname; - $c['https'] = DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR . self::$hostname; + $c['img'] = 'img.' . self::HOSTNAME; + $c['https'] = DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR . self::HOSTNAME; $c['img2'] = self::subdomain('img'); - $c['lib'] = self::subdomain('lib'); $c['exit'] = ""; - $c['support'] = 'support@' . $c['host']; - - - //Валюта - $c['curency_name'] = 'RUB'; - $c['curency_value'] = 30; + $c['support'] = 'support@' . self::HOSTNAME; //Бот клон $c['bot_level'] = 0; // до какого лвл бот (включительно) $c['propsk_die'] = 0; //Смерть при пропуске ходов, 0 - выкл. , >= 1 - количество пропусков до смерти при нападении - //Скупка $c['exp'] = 0; //бонус опыта - $c['shop_type1'] = 100; //в гос НЕ ТРОГАТЬ + + //Скупка $c['shop_type2'] = 90; //в березку НЕ ТРОГАТЬ $c['shop_all'] = 0; //Скупка на все! , 0 - сделать для отключения скупки. $c['shop_all_type1'] = 100; //Скупка только с госе! , 0 - сделать для отключения скупки. $c['shop_all_type2'] = 100; //Скупка только с березки! , 0 - сделать для отключения скупки. // - $c['nosanich'] = true; //Странички Саныча не выпадают - true , выпадают - false - $c['zuby'] = false; //зубы + $c['limitedexp'] = false; //лимит опыта $c['expstop'] = 2999999; //9; //Опыт на котором останавливаемся 11 149999999 $c['expstopu'] = 2999999; //Опыт на котором останавливаемся $c['noobgade'] = false; //нуб квест (пещера) - $c['level_ransfer'] = 8; //С какого уровня разрешены передачи - + $c['level_transfer'] = 8; //С какого уровня разрешены передачи $c['noitembuy'] = false; //Не требует ресурсы для покупки $c['effz'] = 0; //Скольким секундам равен заряд $c['money_haot'] = true; //кр за хаоты - $c['crtoecr'] = 500; //Курс обмена кр на екр (если 0, то выключено) - $c['ecrtocr'] = 200; //Курс обмена екр на кр $c['bonuslevel'] = true; //Бонус уровня $c['bonussocial'] = false; //Бонус социальный - $c['w'] = date('w'); - $c['m'] = date('m'); - - $c['counters'] = ''; - $c['counters_noFrm'] = ''; - $c['securetime'] = 0; //Время последнего возможного взлома персов (подбор пароля по базам данных других игр) - - $c['copyright'] = 'Copyright © ' . date('Y') . ' « Новый Бойцовский Клуб »'; $c['db_host'] = 'db'; $c['db_user'] = 'prod1'; $c['db_name'] = 'game_production'; @@ -110,4 +88,9 @@ class Config } return self::$instance; } + + public static function getCopyright(): string + { + return '©' . (new DateTime())->format('Y') . ' Copyright «' . self::GAMENAME . '». All Rights Reserved.'; + } } diff --git a/_incl_data/class/User.php b/_incl_data/class/User.php index 3a541255..26d74cfe 100644 --- a/_incl_data/class/User.php +++ b/_incl_data/class/User.php @@ -243,17 +243,6 @@ class User $this->statnames->getBonus(); $this->statnames->getRequirement(); - if (Core\Config::get('securetime') > 0) { - if (!defined('IP')) { - define('IP', $_SERVER['REMOTE_ADDR']); - } - - if (isset($this->info['id']) && ($this->info['ip'] != IP || $this->info['banned'] > 0) && $_SERVER['REQUEST_URI'] != '/') { - unset($this->info, $_COOKIE['login']); - die(Config::get('exit')); - } - } - if (!isset ($_COOKIE['btl'], $this->info['battle']) || $this->info['battle'] != $_COOKIE['btl']) { setcookie('btl', $this->info['battle'] ?? '', time() + 86400); } diff --git a/clans_inf.php b/clans_inf.php index 8af14e26..905176c1 100644 --- a/clans_inf.php +++ b/clans_inf.php @@ -21,7 +21,6 @@ if ($uplogin != 'delete' && $utf8Login != 'delete' && $utf8Login2 != 'delete') { if (!isset($clan['id'])) { die( ' - Произошла ошибка

@@ -29,7 +28,6 @@ if (!isset($clan['id'])) {

Назад


(c) ' . $c['title'] . '

- ' . $c['counters'] . ' ' ); } diff --git a/forum_script/index.php b/forum_script/index.php index 065b8c65..cf88fa86 100644 --- a/forum_script/index.php +++ b/forum_script/index.php @@ -1179,13 +1179,9 @@ function MM_jumpMenu(targ, selObj, restore) { //v3.0