Compare commits

...

6 Commits

4 changed files with 667 additions and 641 deletions

View File

@ -39,7 +39,7 @@ class Config
$c['capitalcity'] = $c['host']; $c['capitalcity'] = $c['host'];
$c['abandonedplain'] = $c['host']; $c['abandonedplain'] = $c['host'];
$c['https'] = 'https://' . $c['host'] . DIRECTORY_SEPARATOR; $c['https'] = 'https://' . $c['host'] . DIRECTORY_SEPARATOR;
$c['exit'] = '<script>top.location="' . $c['https'] . '";</script>'; $c['exit'] = '<script>top.location.href="' . $c['https'] . '";</script>';
$c['support'] = 'support@' . $c['host']; $c['support'] = 'support@' . $c['host'];

View File

@ -1201,56 +1201,50 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
return $bus['login_BIG']; return $bus['login_BIG'];
} }
public function microLogin(int $id, $t, $nnz = 1): string public function microLogin(int $id, int $t, int $nnz = 1): string
{ {
if ($t == 1) { if ($t !== 1) {
$inf = mysql_fetch_array(
mysql_query(
'SELECT
`u`.`id`,
`u`.`align`,`u`.`align2`,
`u`.`login`,
`u`.`clan`,
`u`.`level`,
`u`.`city`,
`u`.`online`,
`u`.`sex`,`u`.`autospell`,`u`.`noplaw`,
`u`.`cityreg`,
`u`.`palpro`,
`u`.`invis`,
`st`.`hpNow` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id`="' . mysql_real_escape_string(
$id
) . '" OR `u`.`login` = "' . mysql_real_escape_string((int)$id) . '" LIMIT 1'
)
);
} else {
$inf['id'] = $id; $inf['id'] = $id;
} else {
$inf = Db::getRow(
'select
users.id,
invis,
users.align,
align2,
clan,
cityreg,
login,
users.level,
c.name_mini
from users left join clan as c on c.id = users.clan
where users.id = ?',
[$id]
);
} }
$r = ''; $r = '';
if (isset($inf['id']) && (($inf['invis'] < time( if (
) && $inf['invis'] != 1) || ($this->info['id'] == $inf['id'] && $nnz == 1))) { isset($inf['id']) &&
(
($inf['invis'] < time() && $inf['invis'] !== 1) ||
($this->info['id'] == $inf['id'] && $nnz === 1)
)
) {
if ($inf['align'] > 0) { if ($inf['align'] > 0) {
$r .= '<img src="https://img.new-combats.com/i/align/align' . $inf['align'] . '.gif" />'; $r .= '<img src="https://' . Config::get('img') . '/i/align/align' . $inf['align'] . '.gif" />';
} }
if ($inf['align2'] > 0) { if ($inf['align2'] > 0) {
$r .= '<img src="https://img.new-combats.com/i/align/align' . $inf['align2'] . '.gif" />'; $r .= '<img src="https://' . Config::get('img') . '/i/align/align' . $inf['align2'] . '.gif" />';
} }
if ($inf['clan'] > 0) { if ($inf['name_mini']) {
$cln = mysql_fetch_array( $r .= '<img src="https://' . Config::get('img') . '/i/clan/' . $inf['name_mini'] . '.gif" />';
mysql_query(
'SELECT `id`,`name`,`name_mini`,`align`,`type_m`,`money1`,`exp` FROM `clan` WHERE `id` = "' . $inf['clan'] . '" LIMIT 1'
)
);
if (isset($cln['id'])) {
$r .= '<img src="https://img.new-combats.com/i/clan/' . $cln['name_mini'] . '.gif" />';
}
} }
if ($inf['cityreg'] == '') { if ($inf['cityreg'] == '') {
$inf['cityreg'] = 'capitalcity'; $inf['cityreg'] = 'capitalcity';
} }
$r .= ' <strong>' . $inf['login'] . '</strong> [' . $inf['level'] . ']<a target="_blank" href="https://new-combats.com/info/' . $inf['id'] . '"><img src="https://img.new-combats.com/i/inf_' . $inf['cityreg'] . '.gif" /></a>'; $r .= '<strong>' . $inf['login'] . '</strong> [' . $inf['level'] . ']<a target="_blank" href="' . Config::get('https') . '/info/' . $inf['id'] . '"><img src="https://' . Config::get('img') . '/i/inf_' . $inf['cityreg'] . '.gif" /></a>';
} else { } else {
$r = '<strong><i>Íåâèäèìêà</i></strong> [??]<a target="_blank" href="https://new-combats.com/info/0"><img src="https://img.new-combats.com/i/inf_capitalcity.gif" /></a>'; $r = '<strong><i>Íåâèäèìêà</i></strong> [??]';
} }
return $r; return $r;
} }
@ -1300,6 +1294,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
$this->info = Db::getRow( $this->info = Db::getRow(
'select 'select
*, *,
users.id as id,
users.level as level, users.level as level,
users.align as align, users.align as align,
users.sex as sex, users.sex as sex,
@ -1322,29 +1317,23 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
if (!isset($this->info['achiv']['id'])) { if (!isset($this->info['achiv']['id'])) {
Db::sql('insert into users_achiv (id) value (?)', [$this->info['id']]); Db::sql('insert into users_achiv (id) value (?)', [$this->info['id']]);
$this->info['achiv'] = mysql_fetch_array(
mysql_query('SELECT * FROM `users_achiv` WHERE `id`="' . $this->info['id'] . '" LIMIT 1')
);
$this->info['achiv'] = Db::getRow('select * from users_achiv where id = ?', [$this->info['id']]); $this->info['achiv'] = Db::getRow('select * from users_achiv where id = ?', [$this->info['id']]);
} }
if (Core\Config::get('securetime') > 0) { if (Core\Config::get('securetime') > 0) {
if (!defined('IP')) { if (!defined('IP')) {
$dip = $_SERVER['REMOTE_ADDR']; define('IP', $_SERVER['REMOTE_ADDR']);
define('IP', $dip);
} }
if (isset($this->info['id']) && ($this->info['ip'] != IP || $this->info['banned'] > 0) && $_SERVER['REQUEST_URI'] != '/') { if (isset($this->info['id']) && ($this->info['ip'] != IP || $this->info['banned'] > 0) && $_SERVER['REQUEST_URI'] != '/') {
unset($this->info, $_COOKIE['login'], $_COOKIE['pass']); unset($this->info, $_COOKIE['login'], $_COOKIE['pass']);
die('<script>top.location.href="https://new-combats.com/";</script>'); die(Config::get('exit'));
} }
} }
if (isset($this->info['id']) && $this->info['exp'] > 300000 && $this->info['twink'] > 0) { if (isset($this->info['id']) && $this->info['exp'] > 300000 && $this->info['twink'] > 0) {
$this->info['exp'] = 300000; $this->info['exp'] = 300000;
mysql_query( Db::sql('update stats set exp = ? where id = ?', [$this->info['exp'], $this->info['id']]);
'UPDATE `users` SET `exp` = ' . $this->info['exp'] . ' WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'
);
} }
if (isset($this->info['id']) && $this->info['inUser']) { if (isset($this->info['id']) && $this->info['inUser']) {
@ -1389,11 +1378,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
$this->info['__id'] = $md[8]; $this->info['__id'] = $md[8];
$this->info['__level'] = $md[9]; $this->info['__level'] = $md[9];
} }
if (isset ($_COOKIE['btl'])) { if (!isset ($_COOKIE['btl']) || $this->info['battle'] != $_COOKIE['btl']) {
if ($this->info['battle'] != $_COOKIE['btl']) {
setcookie('btl', $this->info['battle'], time() + 86400);
}
} else {
setcookie('btl', $this->info['battle'], time() + 86400); setcookie('btl', $this->info['battle'], time() + 86400);
} }
@ -1407,7 +1392,6 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
if (!isset($this->info['id'])) { if (!isset($this->info['id'])) {
unset($this->info); unset($this->info);
setcookie('login', '', time() - 60 * 60 * 24, '', Core\Config::get('host')); setcookie('login', '', time() - 60 * 60 * 24, '', Core\Config::get('host'));
setcookie('pass', '', time() - 60 * 60 * 24, '', Core\Config::get('host'));
} else { } else {
echo 'stats is lost.'; echo 'stats is lost.';
} }
@ -1580,7 +1564,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
} else { } else {
$t = mysql_fetch_array( $t = mysql_fetch_array(
mysql_query( mysql_query(
'SELECT `id`,`login`,`login2`,`pass`,`pass2`,`emailconfirmation`,`securetime`,`sys`,`online`,`ip`,`ipreg`,`joinIP`,`admin`,`city`,`room`,`banned`,`auth`,`align`,`mod_zvanie`,`clan`,`nextMsg`,`molch1`,`molch2`,`molch3`,`level`,`money`,`battle`,`cityreg`,`invBlock`,`invBlockCode`,`zag`,`a1`,`q1`,`mail`,`name`,`bithday`,`sex`,`hobby`,`chatColor`,`timereg`,`add_smiles`,`obraz`,`win`,`lose`,`nich`,`cityreg2`,`host`,`info_delete`,`dateEnter`,`afk`,`dnd`,`timeMain`,`clan_prava`,`addpr`,`marry`,`city2`,`invis`,`bot_id`,`haos`,`host_reg`,`inUser`,`jail`,`animal`,`vip`,`catch`,`frg`,`no_ip`,`type_pers`,`bot_room` FROM `users` WHERE `login` = "' . mysql_real_escape_string( 'SELECT `id`,`login`,`login2`,`pass`,`pass2`,`emailconfirmation`,`securetime`,`online`,`ip`,`ipreg`,`joinIP`,`admin`,`city`,`room`,`banned`,`auth`,`align`,`mod_zvanie`,`clan`,`nextMsg`,`molch1`,`molch2`,`molch3`,`level`,`money`,`battle`,`cityreg`,`invBlock`,`invBlockCode`,`zag`,`a1`,`q1`,`mail`,`name`,`bithday`,`sex`,`hobby`,`chatColor`,`timereg`,`add_smiles`,`obraz`,`win`,`lose`,`nich`,`host`,`info_delete`,`dateEnter`,`afk`,`dnd`,`timeMain`,`clan_prava`,`addpr`,`marry`,`city2`,`invis`,`bot_id`,`haos`,`host_reg`,`inUser`,`jail`,`animal`,`vip`,`catch`,`frg`,`no_ip`,`type_pers`,`bot_room` FROM `users` WHERE `login` = "' . mysql_real_escape_string(
$_POST['trnLogin'] $_POST['trnLogin']
) . '" AND `city` = "' . $this->info['city'] . '" LIMIT 1' ) . '" AND `city` = "' . $this->info['city'] . '" LIMIT 1'
) )
@ -2077,7 +2061,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
return mysql_fetch_array( return mysql_fetch_array(
mysql_query( mysql_query(
'SELECT 'SELECT
`u`.`id`,`u`.`login`,`u`.`login2`,`u`.`pass`,`u`.`pass2`,`u`.`repass`,`u`.`notrhod`,`u`.`emailconfirmation`,`u`.`securetime`,`u`.`sys`,`u`.`palpro`,`u`.`online`,`u`.`ip`,`u`.`ipreg`,`u`.`joinIP`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`banned`,`u`.`auth`,`u`.`align`,`u`.`align2`,`u`.`align_lvl`,`u`.`align_exp`,`u`.`mod_zvanie`,`u`.`clan`,`u`.`nextMsg`,`u`.`molch1`,`u`.`molch2`,`u`.`molch3`,`u`.`level`,`u`.`money`,`u`.`money2`,`u`.`money4`,`u`.`money3`,`u`.`battle`,`u`.`cityreg`,`u`.`invBlock`,`u`.`allLock`,`u`.`invBlockCode`,`u`.`zag`,`u`.`a1`,`u`.`q1`,`u`.`mail`,`u`.`name`,`u`.`bithday`,`u`.`sex`,`u`.`autospell`,`u`.`noplaw`,`u`.`hobby`,`u`.`chatColor`,`u`.`timereg`,`u`.`add_smiles`,`u`.`obraz`,`u`.`win`,`u`.`win_bs`,`u`.`lose`,`u`.`nich`,`u`.`cityreg2`,`u`.`host`,`u`.`info_delete`,`u`.`dateEnter`,`u`.`afk`,`u`.`dnd`,`u`.`timeMain`,`u`.`clan_prava`,`u`.`addpr`,`u`.`marry`,`u`.`city2`,`u`.`invis`,`u`.`bot_id`,`u`.`haos`,`u`.`host_reg`,`u`.`inUser`,`u`.`inTurnir`,`u`.`inTurnirnew`,`u`.`jail`,`u`.`animal`,`u`.`vip`,`u`.`catch`,`u`.`frg`,`u`.`no_ip`,`u`.`type_pers`,`u`.`bot_room`,`u`.`clan_delay`,`u`.`bukmeker`, `u`.`id`,`u`.`login`,`u`.`login2`,`u`.`pass`,`u`.`pass2`,`u`.`repass`,`u`.`notrhod`,`u`.`emailconfirmation`,`u`.`securetime`,`u`.`palpro`,`u`.`online`,`u`.`ip`,`u`.`ipreg`,`u`.`joinIP`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`banned`,`u`.`auth`,`u`.`align`,`u`.`align2`,`u`.`align_lvl`,`u`.`align_exp`,`u`.`mod_zvanie`,`u`.`clan`,`u`.`nextMsg`,`u`.`molch1`,`u`.`molch2`,`u`.`molch3`,`u`.`level`,`u`.`money`,`u`.`money2`,`u`.`money4`,`u`.`money3`,`u`.`battle`,`u`.`cityreg`,`u`.`invBlock`,`u`.`allLock`,`u`.`invBlockCode`,`u`.`zag`,`u`.`a1`,`u`.`q1`,`u`.`mail`,`u`.`name`,`u`.`bithday`,`u`.`sex`,`u`.`autospell`,`u`.`noplaw`,`u`.`hobby`,`u`.`chatColor`,`u`.`timereg`,`u`.`add_smiles`,`u`.`obraz`,`u`.`win`,`u`.`win_bs`,`u`.`lose`,`u`.`nich`,`u`.`host`,`u`.`info_delete`,`u`.`dateEnter`,`u`.`afk`,`u`.`dnd`,`u`.`timeMain`,`u`.`clan_prava`,`u`.`addpr`,`u`.`marry`,`u`.`city2`,`u`.`invis`,`u`.`bot_id`,`u`.`haos`,`u`.`host_reg`,`u`.`inUser`,`u`.`inTurnir`,`u`.`inTurnirnew`,`u`.`jail`,`u`.`animal`,`u`.`vip`,`u`.`catch`,`u`.`frg`,`u`.`no_ip`,`u`.`type_pers`,`u`.`bot_room`,`u`.`clan_delay`,`u`.`bukmeker`,
`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` `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 ' . $whr . ' LIMIT 1' FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE ' . $whr . ' LIMIT 1'
) )

View File

@ -10,6 +10,8 @@ Config::init();
if (!empty($_GET['id']) && !empty($_GET['code'])) { if (!empty($_GET['id']) && !empty($_GET['code'])) {
$status = Confirmation::byCode((int)$_GET['id'], (int)$_GET['code']); $status = Confirmation::byCode((int)$_GET['id'], (int)$_GET['code']);
} }
header('refresh:5;url=' . Config::get('https'));
?> ?>
<!DOCTYPE html> <!DOCTYPE html>

File diff suppressed because it is too large Load Diff