Очистка ненужного функционала. #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
+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