Очистка ненужного функционала. #49 #51

This commit is contained in:
2023-06-13 03:44:13 +03:00
parent f49f8cd08d
commit 5e06f5e136
24 changed files with 153 additions and 722 deletions
+3 -59
View File
@@ -2182,19 +2182,13 @@ class Battle
if (isset($pld['id'])) {
if ($this->users[$i]['battle_yron'] >= 500) {
\User\ItemsModel::addItem(4754, $pld['id'], '');
\User\ItemsModel::addItem(4754, $pld['id'], '');
\User\ItemsModel::addItem(4754, $pld['id'], '');
\User\ItemsModel::addItem(4754, $pld['id'], '');
\User\ItemsModel::addItem(4754, $pld['id'], '');
$pld['battle_text'] .= ' За Героическое Сражение вы получаете <strong>Реликвия Ангела (x5)</strong>. ';
mysql_query(
'UPDATE `users_achiv` SET `pg`= `pg`+1 WHERE `id` = "' . $pld['id'] . '" LIMIT 1'
);
if ($this->users[$i]['team'] == $this->info['team_win'] && rand(1, 100) <= 5) {
\User\ItemsModel::addItem(10020, $pld['id'], '');
$pld['battle_text'] .= ' и <strong>Жетон Успеха</strong>. ';
$pld['battle_text'] .= ' За Героическое Сражение вы получаете <strong>Жетон Успеха</strong>. ';
}
} else {
$pld['battle_text'] .= ' Вы ничего не получили. <strong>Нужно набить больше 500 урона урона</strong> .';
@@ -2624,17 +2618,11 @@ class Battle
$this->users[$i]['battle_exp'] = ceil($this->users[$i]['battle_exp'] * 0.10);
}
$this->users[$i]['nich'] += 1;
mysql_query(
'UPDATE `users` SET `swin` = 0, `slose` = 0 WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'
);
} elseif ($this->users[$i]['team'] == $this->info['team_win'] && $this->info['type'] != 564) {
$gm[$i] = $this->info['money'];
$gms[$i] = $this->info['money3'];
$this->users[$i]['win'] += 1;
$act01 = 1;
mysql_query(
'UPDATE `users` SET `swin` = `swin` + 1, `slose` = 0 WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'
);
} elseif ($this->info['type'] != 564) {
if ($this->users[$i]['level'] <= 1) {
$this->users[$i]['battle_exp'] = ceil($this->users[$i]['battle_exp'] * 0.33);
@@ -2644,9 +2632,6 @@ class Battle
$bm[$i] = $this->info['money'];
$bms[$i] = $this->info['money3'];
$this->users[$i]['lose'] += 1;
mysql_query(
'UPDATE `users` SET `swin` = 0, `slose` = `slose` + 1 WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'
);
$act01 = 2;
}
//Рассчитываем кол-во выигрышных сумм и кто сколько получил (для екр.)
@@ -3108,7 +3093,7 @@ class Battle
}
}
if ($this->info['priz'] > 0) {
if ($this->info['priz'] > 0 && true == false) { // тут были реликвии ангела.
//Призовой хаот
/*
[4754]
@@ -3153,7 +3138,7 @@ class Battle
}
$tmoni = 1;
while ($tmoni <= floor($tmon / 2)) {
\User\ItemsModel::addItem(4754, $this->users[$i]['id'], ''); //
\User\ItemsModel::addItem(0, $this->users[$i]['id'], ''); // тут были реликвии ангела.
$tmoni++;
}
$this->users[$i]['battle_text'] .= ' За призовой хаот вы получаете <strong>Призовой Жетон (x' . floor(
@@ -3289,47 +3274,6 @@ class Battle
}
if ($this->info['dungeon'] == 0 && $this->info['razdel'] == 5 && $u->info['battle_yron'] >= 2000) //$u->info['battle_yron']
{
//Реликвия Ангела ang_g
if ($this->users[$i]['team'] == $this->info['team_win']) {
//При выигрыше увеличиваем
$tmoni = 2;
} else {
$tmoni = 1;
}
//
$tmon = $tmoni;
$effblago = mysql_fetch_array(
mysql_query(
'SELECT * FROM `eff_users` WHERE `uid` = ' . $this->users[$i]['id'] . ' AND `delete` = 0 AND `id_eff`= 414 LIMIT 1'
)
);
if (isset ($effblago['id'])) {
$limitg = 50;
} else {
$limitg = 25;
}
while ($tmoni >= 1) {
if ($u->info['ang_g'] < $limitg) {
\User\ItemsModel::addItem(4754, $this->users[$i]['id'], '');
mysql_query(
'UPDATE `users` SET `ang_g`=`ang_g`+1 WHERE `id` =' . $this->users[$i]['id'] . ''
);
} else {
$tmon--;
}
$tmoni--;
}
if ($this->info['type'] != 33) {
$this->users[$i]['battle_text'] .= ' За хаот вы получаете <strong>Реликвия Ангела (' . $tmon . ')</strong>. Всего [' . ($u->info['ang_g'] + $tmon) . '/' . $limitg . '] в день. ';
}
unset($tmon, $tmoni, $effblago, $limitg);
}
if ($this->info['razdel'] == 5 || $this->info['razdel'] == 4) {
if (date('d.m') == '31.10' || (date('m') == 11 && date('d') < 7)) {
//Хэллоуин 4504
-1
View File
@@ -75,7 +75,6 @@ class Config
$c['expstop'] = 2999999; //9; //Опыт на котором останавливаемся 11 149999999
$c['expstopu'] = 2999999; //Опыт на котором останавливаемся
$c['noobgade'] = false; //нуб квест (пещера)
$c['bonusonline'] = true; //бонус за онлайн
$c['level_ransfer'] = 8; //С какого уровня разрешены передачи
$c['znahar'] = true; //бесплатный знахарь
$c['nolevel'] = false; //лимитирование уровней
+2 -2
View File
@@ -4,7 +4,7 @@ namespace Core;
class ConversionHelper
{
/** Ïðåâðàùàåò ñòðîêó data ('a=1|b=2|c=3') èç ÁÄ â ìàññèâ [a=>1, b=>2, c=>3].
/** Превращает строку data ('a=1|b=2|c=3') из БД в массив [a=>1, b=>2, c=>3].
* @param string $dataString
* @return array
*/
@@ -14,7 +14,7 @@ class ConversionHelper
return $arr ?: [];
}
/** Ïðåâðàùàåò ìàññèâ [a=>1, b=>2, c=>3] â ñòðîêó data ('a=1|b=2|c=3') äëÿ ÁÄ.
/** Превращает массив [a=>1, b=>2, c=>3] в строку data ('a=1|b=2|c=3') для БД.
* @param array $dataArray
* @return string
*/
+4 -6
View File
@@ -1552,12 +1552,10 @@ class Dungeon
'SELECT * FROM `dungeon_actions` WHERE `uid` = "' . $u->info['id'] . '" AND `dn` = "' . $this->info['id'] . '" AND `vars` = "luck_itm' . $pl['id'] . '" LIMIT 1'
)
);
if (!isset($fxv['id'])) {
//Розыгрыш
if ($this->info['bsid'] == 0) {
$action = 'javascript: top.fartgame(\'' . $pl['id'] . '\',\'' . $pl['img'] . '\',\'' . $pl['name'] . '\',1,\'\');';
$tk = 1;
}
//Розыгрыш
if (!isset($fxv['id']) && $this->info['bsid'] == 0) {
$action = "javascript: top.fartgame('{$pl['id']}', '{$pl['img']}', '{$pl['name']}')";
$tk = 1;
}
}
if ($tk == 0) {
+2 -2
View File
@@ -341,10 +341,10 @@ class FightRequest
Db::sql('delete from stats where id = ?', [$user['id']]);
Db::sql('delete from items_users where uid = ?', [$user['id']]);
Db::sql('delete from eff_users where uid = ?', [$user['id']]);
\Core\ConversionHelper::dataStringToArray(4754, $user['id']);
// \Core\ConversionHelper::dataStringToArray(4754, $user['id']);
}
} else {
\Core\ConversionHelper::dataStringToArray(4754, $user['id']);
// \Core\ConversionHelper::dataStringToArray(4754, $user['id']); реликвии ангела
}
}
return [
@@ -19,7 +19,7 @@ class Config
const STEP_EKR = 151;
const DELAY_EFFECT_ID = 486;
const CUSTOM_BATTLE_ID = 25000;
const PRIZE_ITEM_ID = 4754;
const PRIZE_ITEM_ID = 0;
const RETURN_ROOM = 9;
const MINIMUM_USER_LEVEL = 8;
@@ -327,6 +327,8 @@ class TournamentModel
*/
public static function givePrizeItems(int $uid, int $quantity): void
{
return; //реликвии вывели из игры!
$query = 'insert into items_users (item_id, uid, data, iznosMAX, lastUPD, time_create)
values (4754, :uid, :data, 1, unix_timestamp(), unix_timestamp())';
$args = [
+1 -70
View File
@@ -650,40 +650,6 @@ class User
return $n;
}
public function pensia($type)
{
if (!$type) {
if (($this->info['align'] > 0 || $this->info['clan'] > 0 || $this->info['level'] > 12) && $this->info['align'] != 2) {
$r = ($this->info['level'] - 6) * 0.04;
if (date('m') >= 6 || date('m') <= 8 || date('w') == 0 || date('w') == 6) {
$r = round($r * 2, 2);
}
$r = $r . ' ЕКР.';
} else {
$r = $this->info['level'];
if (date('m') >= 6 || date('m') <= 8 || date('w') == 0 || date('w') == 6) {
$r = round($r * 2, 2);
}
$r = $r . ' КР.';
}
} else {
if (($this->info['align'] > 0 || $this->info['clan'] > 0 || $this->info['level'] > 12) && $this->info['align'] != 2) {
$r = ($this->info['level'] - 6) * 0.04;
if (date('m') >= 6 || date('m') <= 8 || date('w') == 0 || date('w') == 6) {
$r = round($r * 2, 2);
}
$r = [2, $r];
} else {
$r = $this->info['level'];
if (date('m') >= 6 || date('m') <= 8 || date('w') == 0 || date('w') == 6) {
$r = round($r * 2, 2);
}
$r = [1, $r];
}
}
return $r;
}
public function testAlign($an, int $uid): int
{
$r = 1;
@@ -1537,11 +1503,6 @@ class User
$this->getStats($this->info); // Бля, а вдруг?
$this->info['relik']['relik'] = Db::getValue(
'select count(*) from items_users where item_id = 4757 and `delete` = 0 and uid = ?',
[$this->info['id']]
);
$this->info['achiv'] = Db::getRow('select * from users_achiv where id = ?', [$this->info['id']]);
if (!isset($this->info['achiv']['id'])) {
Db::sql('insert into users_achiv (id) value (?)', [$this->info['id']]);
@@ -3774,36 +3735,6 @@ class User
return '<div align="left">' . $r . '</div>';
}
public function takeBonus()
{
if (isset($_GET['getb1w']) && $_GET['getb1w'] == 3) {
$pensia1 = $this->pensia(false);
$pensia2 = $this->pensia(true);
$afk = $this->info['timeMain'] < time() - 15 * 60 ? 1 : 0;
//fixme: костыль с abs() потому что числа прилетали отрицательные. Разобраться почему так.
if ($pensia2[0] == 1) {
$this->info['money'] += abs($pensia2[1]);
mysql_query(
'UPDATE `users` SET `money` = `money` + "' . $pensia2[1] . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'
);
} else {
$this->info['money2'] += abs($pensia2[1]);
mysql_query(
'UPDATE `users` SET `money2` = `money2` + "' . $pensia2[1] . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'
);
}
$this->error = 'Вам начислен бонус в размере ' . $pensia1 . '! ';
mysql_query(
'INSERT INTO `aaa_bonus` (
`uid`,`time`,`afk`,`type`,`money`
) VALUES (
"' . $this->info['id'] . '","' . (time(
) + 3600) . '","' . $afk . '","' . $pensia2[0] . '","' . $pensia2[1] . '"
)'
);
}
}
public function addDelo($type, $uid, $txt, $tm, $ct, $frm, $mo, $mi, $vvv = false)
{
return Db::sql(
@@ -9341,7 +9272,7 @@ LIMIT 1'
} elseif ($uid != $this->info['id'] || $res == 1) {
$u = mysql_fetch_array(
mysql_query(
'SELECT `u`.`twink`,`u`.`swin`,`u`.`slose`,`u`.`stopexp`,`u`.`battle`,`u`.`id`,`u`.`no_ip`,`u`.`level`,`u`.`login`,`u`.`clan`,`u`.`vip`,
'SELECT `u`.`twink`,`u`.`stopexp`,`u`.`battle`,`u`.`id`,`u`.`no_ip`,`u`.`level`,`u`.`login`,`u`.`clan`,`u`.`vip`,
`st`.`id`,`st`.`lider`,`st`.`btl_cof`,`st`.`last_hp`,`st`.`last_pr`,`st`.`smena`,`st`.`stats`,`st`.`hpAll`,`st`.`mpAll`,`st`.`hpNow`,`st`.`mpNow`,`st`.`enNow`,`st`.`transfers`,`st`.`regHP`,`st`.`regMP`,`st`.`showmenu`,`st`.`prmenu`,`st`.`ability`,`st`.`skills`,`st`.`sskills`,`st`.`nskills`,`st`.`exp`,`st`.`minHP`,`st`.`minMP`,`st`.`zv`,`st`.`dn`,`st`.`dnow`,`st`.`team`,`st`.`battle_yron`,`st`.`battle_exp`,`st`.`enemy`,`st`.`last_a`,`st`.`last_b`,`st`.`battle_text`,`st`.`upLevel`,`st`.`wipe`,`st`.`bagStats`,`st`.`timeGo`,`st`.`timeGoL`,`st`.`nextAct`,`st`.`active`,`st`.`bot`,`st`.`lastAlign`,`st`.`tactic1`,`st`.`tactic2`,`st`.`tactic3`,`st`.`tactic4`,`st`.`tactic5`,`st`.`tactic6`,`st`.`tactic7`,`st`.`x`,`st`.`y`,`st`.`s`,`st`.`battleEnd`,`st`.`priemslot`,`st`.`priems`,`st`.`priems_z`,`st`.`bet`,`st`.`clone`,`st`.`atack`,`st`.`bbexp`,`st`.`ref_data`,`st`.`res_x`,`st`.`res_y`,`st`.`res_s`,`st`.`bn_capitalcity`,`st`.`bn_demonscity`
FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id`="' . mysql_real_escape_string(
$uid
-1
View File
@@ -56,7 +56,6 @@ $uids = getIds('select id from users');
Db::sql('delete from items_users where uid > 0 and uid not in (?)', [$uids]);
Db::sql('delete from eff_users where uid > 0 and uid not in (?)', [$uids]);
Db::sql('delete from users_achiv where id > 0 and id not in (?)', [$uids]);
Db::sql('delete from aaa_bonus where uid > 0 and uid not in (?)', [$uids]);
Db::sql('delete from users_delo where uid > 0 and uid not in (?) or time < unix_timestamp() - 86400 * 10', [$uids]);
Db::sql('delete from users_reting where uid > 0 and uid not in (?)', [$uids]);
Db::sql('delete from aaa_reting_list where uid > 0 and uid not in (?)', [$uids]);
-4
View File
@@ -44,7 +44,6 @@ if( isset($_GET['actions']) ) {
// forign_keys! Никто не знает про foreign_keys!
function delete_user_all( $uid , $login ) {
mysql_query('DELETE FROM `aaa_bonus` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `aaa_znahar` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `actions` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `add_smiles` WHERE `uid` = "'.$uid.'"');
@@ -154,6 +153,3 @@ mysql_query('DELETE FROM `items_users` WHERE `delete` > `time_create` AND `delet
//6. Очистка личного дела
mysql_query('DELETE FROM `users_delo` WHERE `time` < "'.(time()-86400*30).'" LIMIT 1000');
//7. сброс счетчика жетонов
mysql_query('UPDATE `users` SET `ang_g` = 0 WHERE `ang_g` > 0');