Уборка неиспользуемых отсылок на конфигурацию.
This commit is contained in:
parent
bd7af6b31c
commit
5f9d3b85bf
@ -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 = "<strong>{$this->battle->users[$i]['login']}</strong> трагически погиб$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 = '<strong>' . $this->battle->users[$i]['login'] . '</strong> трагически погиб без права на воскрешение и покидает подземелье' . $nld;
|
||||
} else {
|
||||
$rtxt = '<strong>' . $this->battle->users[$i]['login'] . '</strong> трагически погибла без права на воскрешение и покидает подземелье' . $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 = '<strong>' . $this->battle->users[$i]['login'] . '</strong> трагически погиб без права на воскрешение и покидает подземелье' . $nld;
|
||||
} else {
|
||||
$rtxt = '<strong>' . $this->battle->users[$i]['login'] . '</strong> трагически погибла без права на воскрешение и покидает подземелье' . $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 = "<strong>{$this->battle->users[$i]['login']}</strong> трагически погиб$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 = '<strong>' . $this->battle->users[$i]['login'] . '</strong> трагически погиб без права на воскрешение и покидает подземелье' . $nld;
|
||||
} else {
|
||||
$rtxt = '<strong>' . $this->battle->users[$i]['login'] . '</strong> трагически погибла без права на воскрешение и покидает подземелье' . $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 = '<strong>' . $this->battle->users[$i]['login'] . '</strong> трагически погиб без права на воскрешение и покидает подземелье' . $nld;
|
||||
} else {
|
||||
$rtxt = '<strong>' . $this->battle->users[$i]['login'] . '</strong> трагически погибла без права на воскрешение и покидает подземелье' . $nld;
|
||||
}
|
||||
}
|
||||
if (!empty($rtxt)) {
|
||||
$cmsg->setDn($this->battle->i->dnId);
|
||||
$cmsg->setText($rtxt);
|
||||
$cmsg->setTypeTime(1);
|
||||
$chat->sendMsg($cmsg);
|
||||
}
|
||||
}
|
||||
|
||||
public function getBtlstatus(): array
|
||||
|
@ -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'] = "<script>window.location.replace('{$c['https']}');</script>";
|
||||
$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 «<a href="//' . self::HOSTNAME . '">' . self::GAMENAME . '</a>». All Rights Reserved.';
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -21,7 +21,6 @@ if ($uplogin != 'delete' && $utf8Login != 'delete' && $utf8Login2 != 'delete') {
|
||||
if (!isset($clan['id'])) {
|
||||
die(
|
||||
'<html><head>
|
||||
|
||||
<meta http-equiv="Content-Language" content="ru">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
|
||||
<TITLE>Произошла ошибка</TITLE></HEAD><BODY text="#FFFFFF"><p><font color=black>
|
||||
@ -29,7 +28,6 @@ if (!isset($clan['id'])) {
|
||||
<b><p><a href = "javascript:window.history.go(-1);">Назад</b></a>
|
||||
<HR>
|
||||
<p align="right">(c) <a href="index.html">' . $c['title'] . '</a></p>
|
||||
' . $c['counters'] . '
|
||||
</body></html>'
|
||||
);
|
||||
}
|
||||
|
@ -1179,13 +1179,9 @@ function MM_jumpMenu(targ, selObj, restore) { //v3.0
|
||||
<div id="footer">
|
||||
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td width="10%" scope="col">
|
||||
<DIV> <?php
|
||||
echo $c['counters']; ?> </DIV>
|
||||
</td>
|
||||
<td width="10%" scope="col"></td>
|
||||
<td width="80%" scope="col">
|
||||
<div align="center"><?php
|
||||
echo $c['copyright']; ?></div>
|
||||
<div align="center"><?= \Core\Config::getCopyright() ?></div>
|
||||
</td>
|
||||
<td width="10%" scope="col"> </td>
|
||||
</tr>
|
||||
|
2
main.php
2
main.php
@ -528,7 +528,7 @@ if (isset($_GET['security']) && !isset($u->tfer['id']) && $trololo == 1) {
|
||||
} elseif (isset($_GET['skills']) && !isset($u->tfer['id']) && $trololo == 1) {
|
||||
require_once('modules_data/_umenie.php');
|
||||
} elseif ((isset($_GET['transfer']) || isset($u->tfer['id'])) && $u->info['level'] >= Config::get(
|
||||
'level_ransfer'
|
||||
'level_transfer'
|
||||
) && $trololo == 1 && $u->info['inTurnir'] == 0 && $u->info['inTurnirnew'] == 0) {
|
||||
if ($u->info['allLock'] > time()) {
|
||||
require_once('modules_data/_locations.php');
|
||||
|
@ -696,5 +696,4 @@ function printModeratorsOnline(): void
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<DIV><?= Config::get('counters_noFrm') ?></DIV>
|
||||
</body>
|
||||
|
@ -307,4 +307,3 @@ if (!isset($u->tfer['id'])) {
|
||||
?>
|
||||
{отображаем лог передач}
|
||||
<?php } ?>
|
||||
<div align="right"><?= $c['counters']; ?></div>
|
@ -247,8 +247,7 @@ if ($r === FightRequest::BATTLE_RAZDEL_ENDED) {
|
||||
[$zg['id']]
|
||||
);
|
||||
foreach ($users as $user) {
|
||||
${'tm' . $user['team']} .= '<b>' . $user['login'] . '</b> [' . $user['level'] . ']<a href="info/' . $user['id'] . '" target="_blank"><img src="' . Config::img(
|
||||
) . '/i/inf_capitalcity.gif" title="Инф. о ' . $user['login'] . '" alt="inf"></a><br>';
|
||||
${'tm' . $user['team']} .= '<b>' . $user['login'] . '</b> [' . $user['level'] . ']<a href="info/' . $user['id'] . '" target="_blank"><img src="' . Config::img() . '/i/inf_capitalcity.gif" title="Инф. о ' . $user['login'] . '" alt="inf"></a><br>';
|
||||
}
|
||||
if (empty($tm1)) {
|
||||
$tm1 = 'группа пока не набрана';
|
||||
@ -572,6 +571,4 @@ if ($zv->error) {
|
||||
<td><?php $zv->seeZv($zi, $r); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="text-align: right; margin-top: 5px;">
|
||||
<?= Config::get('counters') ?>
|
||||
</div>
|
||||
|
@ -2,10 +2,9 @@
|
||||
|
||||
use Core\Db;
|
||||
|
||||
define('GAME', time());
|
||||
|
||||
require_once '_incl_data/__config.php';
|
||||
require_once '_incl_data/class/__db_connect.php';
|
||||
if (!defined('GAME_VERSION')) {
|
||||
require_once '_incl_data/autoload.php';
|
||||
}
|
||||
|
||||
$urla = explode('?', $_SERVER["REQUEST_URI"]);
|
||||
$url = explode('/', $urla[0]);
|
||||
@ -58,7 +57,6 @@ HTML;
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
|
||||
<title>Новый Бойцовский клуб | Библиотека образов</title>
|
||||
<link rel="stylesheet" href="/main1.css">
|
||||
<link rel="stylesheet" href="/css/obraz.css">
|
||||
|
@ -150,7 +150,7 @@ $errorMessage = $newUser->getError() ? "<h4>{$newUser->getError()}</h4>" : '';
|
||||
<!DOCTYPE html>
|
||||
<head>
|
||||
|
||||
<title><?= Config::get('name') ?>: Регистрация - создай персонажа в игре.</title>
|
||||
<title><?= Config::GAMENAME ?>: Регистрация - создай персонажа в игре.</title>
|
||||
<meta name="description" content="<?= Config::get('desc') ?>"/>
|
||||
</head>
|
||||
<style>
|
||||
|
@ -88,7 +88,7 @@ if (isset($_POST['relogin'])) {
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru-RU">
|
||||
<head>
|
||||
<title><?= Config::get('name') ?>: Восстановление пароля от персонажа</title>
|
||||
<title><?= Config::GAMENAME ?>: Восстановление пароля от персонажа</title>
|
||||
<meta name="keywords" content="<?= Config::get('keys') ?>">
|
||||
<meta name="description" content="<?= Config::get('desc') ?>"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
|
||||
|
@ -275,7 +275,7 @@ if (isset($_POST['name'], $_POST['hobby'], $_POST['ChatColor'], $_POST['saveanke
|
||||
<td valign="top"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="footer"><?= Config::get('name') ?> © 2013-<?= date('Y') ?></div>
|
||||
<div class="footer"><?= Config::getCopyright() ?></div>
|
||||
<div style="display:none;"></div>
|
||||
</body>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user