dev-php74 #30
11
AI.php
11
AI.php
@ -141,14 +141,9 @@ if (isset($_GET['test'])) {
|
||||
die();
|
||||
}
|
||||
|
||||
function getIP()
|
||||
{
|
||||
return isset($_SERVER['HTTP_X_REAL_IP']) ? $_SERVER['HTTP_X_REAL_IP'] : $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
|
||||
if (!isset($_GET['robot']) && getIP() != $_SERVER['SERVER_ADDR'] && getIP() != '127.0.0.1' && getIP() != '' && getIP(
|
||||
) != '31.131.116.166' && !isset($_GET['test'])) {
|
||||
die(getIP() . '<br>' . $_SERVER['SERVER_ADDR']);
|
||||
if (!isset($_GET['robot']) && UserIp::get() != $_SERVER['SERVER_ADDR'] && UserIp::get() != '127.0.0.1' && UserIp::get(
|
||||
) != '' && UserIp::get() != '31.131.116.166') {
|
||||
die(UserIp::get() . '<br>' . $_SERVER['SERVER_ADDR']);
|
||||
}
|
||||
|
||||
|
||||
|
354
aunitpay.php
354
aunitpay.php
@ -1,196 +1,168 @@
|
||||
|
||||
<?php
|
||||
|
||||
function getIP() {
|
||||
if(isset($_SERVER['HTTP_X_REAL_IP'])) return $_SERVER['HTTP_X_REAL_IP'];
|
||||
return $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
|
||||
if(getIP() != '31.186.100.49' && getIP() != '178.132.203.105' && getIP() != '52.29.152.23' && getIP() != '52.19.56.234')
|
||||
function getResponseError($message)
|
||||
{
|
||||
die('..|.,');
|
||||
}
|
||||
|
||||
|
||||
function getResponseError($message)
|
||||
{
|
||||
return json_encode(
|
||||
array(
|
||||
'error' => array(
|
||||
'message' => $message
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
function getResponseSuccess($message)
|
||||
{
|
||||
return json_encode(
|
||||
array(
|
||||
'result' => array(
|
||||
'message' => $message
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
date_default_timezone_set('Europe/Moscow');
|
||||
$c = array(
|
||||
/* MySQL Áàçà äàííûõ */
|
||||
'db_name' => 'pay_operations', //Òàáëèöà â êîòîðóþ çàíîñÿòñÿ äàííûå
|
||||
'db_host' => 'localhost',
|
||||
'db_user' => 'newcom1_abk',
|
||||
'db_pass' => '4nWYsIM[c?}P',
|
||||
'db_base' => 'newcom1_abk',
|
||||
/* Íàñòðîéêè ïëàòåæåé
|
||||
'ip_list' => array('127,0,0,1,188.166.34.68,136.243.38.147,136.243.38.149,136.243.38.150,136.243.38.151,136.243.38.189,88.198.88.98'), //Óêàçûâàòü ÷åðåç çàïÿòóþ (Ðàçðåøåííûå IP)
|
||||
'key' => 'qtzl0igb', //gamedealer key
|
||||
'id' => '65643' //ID ïðîåêòà*/
|
||||
return json_encode(
|
||||
[
|
||||
'error' => [
|
||||
'message' => $message,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
function connect_db($c) {
|
||||
$db = mysql_connect($c['db_host'],$c['db_user'],$c['db_pass']) or die('Îøèáêà ïîäêëþ÷åíèÿ ê MySQL ñåðâåðó!');
|
||||
mysql_select_db($c['db_base'],$db) or die('Îøèáêà ïîäêëþ÷åíèÿ ê áàçå äàííûõ!');
|
||||
mysql_query('SET NAMES cp1251');
|
||||
}
|
||||
|
||||
function getFormSignature($account, $currency, $sum, $secretKey)
|
||||
{
|
||||
$hashStr = $account.'{up}'.$currency.'{up}'.$sum.'{up}'.$secretKey;
|
||||
return hash('sha256', $hashStr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$request=$_GET;
|
||||
if (empty($request['method'])
|
||||
|| empty($request['params'])
|
||||
|| !is_array($request['params'])
|
||||
)
|
||||
{
|
||||
echo getResponseError('Invalid request');
|
||||
die();
|
||||
}
|
||||
$method = $request['method'];
|
||||
$params = $request['params'];
|
||||
if ($_GET['method']=="check")
|
||||
{
|
||||
|
||||
echo getResponseSuccess('CHECK is successful');
|
||||
die();
|
||||
//echo "Çàïðîñ óñïåøíî îáðàáîòàí".$pays['account'];
|
||||
//echo getFormSignature($_GET['params[account]'],"RUB",$_GET['params[payerSum]'],"392bb04608af9aa823a277173c83f633");;
|
||||
}
|
||||
//MERCHANT_ORDER_ID=142&P_PHONE=380688028300&P_EMAIL=evhenii_kula%40mail.ru&CUR_ID=94&AMOUNT=90&MERCHANT_ID=65643&SIGN=c0fc70d5446614597d44ff13f2c7a6a5&intid=29728441
|
||||
/*
|
||||
MERCHANT_ORDER_ID
|
||||
P_PHONE
|
||||
P_EMAIL
|
||||
CUR_ID
|
||||
AMOUNT
|
||||
MERCHANT_ID
|
||||
SIGN
|
||||
intid
|
||||
|
||||
https://àäðåñ_âàøåãî_îáðàáîò÷èêà?
|
||||
method=check
|
||||
params[account]=userId
|
||||
params[date]=2012-10-01 12:32:00
|
||||
params[operator]=beeline
|
||||
params[paymentType]=mc
|
||||
params[projectId]=1
|
||||
params[phone]=9XXXXXXXXX
|
||||
params[payerSum]=10.00
|
||||
params[payerCurrency]=RUB
|
||||
params[signature]=9bdf52a4830779a1383ac24f1b3ed054
|
||||
params[orderSum]=10.00
|
||||
params[orderCurrency]=RUB
|
||||
params[unitpayId]=1234567
|
||||
params[test]=0
|
||||
*/
|
||||
if ($_GET['method']=="pay")
|
||||
{
|
||||
connect_db($c);
|
||||
$nick = mysql_fetch_array(mysql_query('SELECT * FROM `pay_operation` WHERE `id` = "'.$params['account'].'" LIMIT 1'));
|
||||
if (!isset($nick['good']))
|
||||
{
|
||||
echo getResponseError('Bad order');
|
||||
die();
|
||||
}
|
||||
$user = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$nick['uid'].'" LIMIT 1'));
|
||||
if (isset ($params['account']))
|
||||
{
|
||||
if ($nick['good']!=0)
|
||||
{
|
||||
echo getResponseError('Already Used');
|
||||
die();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
mysql_query('UPDATE `users` SET `money2` = `money2` + '.$nick['ekr'].' WHERE `id` = "'.$nick['uid'].'" LIMIT 1');
|
||||
mysql_query('UPDATE `pay_operation` SET `good` = "'.time().'" WHERE `id` = "'.$params['account'].'" LIMIT 1');
|
||||
mysql_query('UPDATE `users` SET `catch` = `catch` + '.$nick['ekr'].' WHERE `id` = "'.$nick['uid'].'" LIMIT 1');
|
||||
|
||||
//mysql_query('INSERT INTO `'.$c['db_name'].'` (`time`,`type`,`ip`,`value`,`money`,`project`) VALUES ("'.time().'","'.mysql_real_escape_string($type).'","'.$_SERVER['HTTP_X_REAL_IP'].'","'.mysql_real_escape_string($value).'","'.mysql_real_escape_string($money).'","'.mysql_real_escape_string($this->id).'")');
|
||||
|
||||
$r = '<span class=date>'.date('d.m.Y H:i').'</span> Àëõèìèê <img src=https://img.new-combats.com/i/align/align50.gif width=12 height=15 /><u><b>Àäìèíèñòðàòîð</b> / Àâòîìàòè÷åñêàÿ îïëàòà</u> ñîîáùàåò: ';
|
||||
if($user['sex'] == 1)
|
||||
{
|
||||
$r .= 'Óâàæàåìàÿ';
|
||||
}
|
||||
else
|
||||
{
|
||||
$r .= 'Óâàæàåìûé';
|
||||
}
|
||||
$r .= ' <b>'.$user['login'].'</b>, íà Âàø èãðîâîé ñ÷åò çà÷èñëåíî '.$nick['ekr'].' Åâðîêðåäèòîâ. Áëàãîäàðèì Âàñ çà ïîêóïêó!';
|
||||
//$str1 = iconv("cp1251","UTF-8",$r);
|
||||
mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$user['city']."','".$user['room']."','','".$user['login']."','".$r."','-1','5','0')");
|
||||
//echo $r."r<br>";
|
||||
|
||||
|
||||
if ($nick['ref'] !=0)
|
||||
{
|
||||
$refecr=round(($nick['ekr']/10));
|
||||
mysql_query('UPDATE `users` SET `money2` = `money2` + '.$refecr.' WHERE `id` = "'.$nick['ref'].'" LIMIT 1');
|
||||
$referal = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$nick['ref'].'" LIMIT 1'));
|
||||
$r = '<span class=date>'.date('d.m.Y H:i').'</span> Àëõèìèê <img src=https://img.new-combats.com/i/align/align50.gif width=12 height=15 /><u><b>Àäìèíèñòðàòîð</b> / Ðåôåðàëüíûé çàðàáîòîê</u> ñîîáùàåò: ';
|
||||
if($referal['sex'] == 1)
|
||||
{
|
||||
$r .= 'Óâàæàåìàÿ';
|
||||
}
|
||||
else
|
||||
{
|
||||
$r .= 'Óâàæàåìûé';
|
||||
}
|
||||
$r .= ' <b>'.$referal['login'].'</b>, íà Âàø èãðîâîé ñ÷åò çà÷èñëåíî '.$refecr.' Åâðîêðåäèòîâ. Áëàãîäîðÿ âàøåìó ðåôåðàëó!'.$user['login'].'';
|
||||
//$str1 = iconv("cp1251","UTF-8",$r);
|
||||
mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$referal['city']."','".$referal['room']."','','".$referal['login']."','".$r."','-1','5','0')");
|
||||
|
||||
|
||||
}
|
||||
|
||||
//echo "Ïîêóïàòåë: ".$user['login']." | ID: ".$nick['uid']." | Ñóììà: ".$nick['ekr']." | ID îïåðàöèè: ".$params['account']."<br>";
|
||||
if (isset ($referal['id']))
|
||||
{
|
||||
//echo "Ðåôåðàë(òîò êòî ïðèâåë): ".$referal['login']." | ID: ".$referal['id']." | Ñóììà: ".$refecr."<br>";
|
||||
}
|
||||
else
|
||||
{
|
||||
//echo "Ïîëüçîâàòåëü ðåôåðàë íå íàéäåí!!";
|
||||
}
|
||||
|
||||
echo getResponseSuccess('PAY is successful');
|
||||
die();
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
echo getResponseError('No order');
|
||||
die();
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
function getResponseSuccess($message)
|
||||
{
|
||||
return json_encode(
|
||||
[
|
||||
'result' => [
|
||||
'message' => $message,
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
date_default_timezone_set('Europe/Moscow');
|
||||
$c = [
|
||||
/* MySQL Áàçà äàííûõ */
|
||||
'db_name' => 'pay_operations', //Òàáëèöà â êîòîðóþ çàíîñÿòñÿ äàííûå
|
||||
'db_host' => 'localhost',
|
||||
'db_user' => 'newcom1_abk',
|
||||
'db_pass' => '4nWYsIM[c?}P',
|
||||
'db_base' => 'newcom1_abk',
|
||||
/* Íàñòðîéêè ïëàòåæåé
|
||||
'ip_list' => array('127,0,0,1,188.166.34.68,136.243.38.147,136.243.38.149,136.243.38.150,136.243.38.151,136.243.38.189,88.198.88.98'), //Óêàçûâàòü ÷åðåç çàïÿòóþ (Ðàçðåøåííûå IP)
|
||||
'key' => 'qtzl0igb', //gamedealer key
|
||||
'id' => '65643' //ID ïðîåêòà*/
|
||||
];
|
||||
|
||||
|
||||
function connect_db($c)
|
||||
{
|
||||
$db = mysql_connect($c['db_host'], $c['db_user'], $c['db_pass']) or die('Îøèáêà ïîäêëþ÷åíèÿ ê MySQL ñåðâåðó!');
|
||||
mysql_select_db($c['db_base'], $db) or die('Îøèáêà ïîäêëþ÷åíèÿ ê áàçå äàííûõ!');
|
||||
mysql_query('SET NAMES cp1251');
|
||||
}
|
||||
|
||||
function getFormSignature($account, $currency, $sum, $secretKey)
|
||||
{
|
||||
$hashStr = $account . '{up}' . $currency . '{up}' . $sum . '{up}' . $secretKey;
|
||||
return hash('sha256', $hashStr);
|
||||
}
|
||||
|
||||
|
||||
$request = $_GET;
|
||||
if (empty($request['method'])
|
||||
|| empty($request['params'])
|
||||
|| !is_array($request['params'])
|
||||
) {
|
||||
echo getResponseError('Invalid request');
|
||||
die();
|
||||
}
|
||||
$method = $request['method'];
|
||||
$params = $request['params'];
|
||||
if ($_GET['method'] == "check") {
|
||||
|
||||
echo getResponseSuccess('CHECK is successful');
|
||||
die();
|
||||
|
||||
}
|
||||
//MERCHANT_ORDER_ID=142&P_PHONE=380688028300&P_EMAIL=evhenii_kula%40mail.ru&CUR_ID=94&AMOUNT=90&MERCHANT_ID=65643&SIGN=c0fc70d5446614597d44ff13f2c7a6a5&intid=29728441
|
||||
/*
|
||||
MERCHANT_ORDER_ID
|
||||
P_PHONE
|
||||
P_EMAIL
|
||||
CUR_ID
|
||||
AMOUNT
|
||||
MERCHANT_ID
|
||||
SIGN
|
||||
intid
|
||||
|
||||
https://àäðåñ_âàøåãî_îáðàáîò÷èêà?
|
||||
method=check
|
||||
params[account]=userId
|
||||
params[date]=2012-10-01 12:32:00
|
||||
params[operator]=beeline
|
||||
params[paymentType]=mc
|
||||
params[projectId]=1
|
||||
params[phone]=9XXXXXXXXX
|
||||
params[payerSum]=10.00
|
||||
params[payerCurrency]=RUB
|
||||
params[signature]=9bdf52a4830779a1383ac24f1b3ed054
|
||||
params[orderSum]=10.00
|
||||
params[orderCurrency]=RUB
|
||||
params[unitpayId]=1234567
|
||||
params[test]=0
|
||||
*/
|
||||
if ($_GET['method'] == "pay") {
|
||||
connect_db($c);
|
||||
$nick = mysql_fetch_array(
|
||||
mysql_query('SELECT * FROM `pay_operation` WHERE `id` = "' . $params['account'] . '" LIMIT 1')
|
||||
);
|
||||
if (!isset($nick['good'])) {
|
||||
echo getResponseError('Bad order');
|
||||
die();
|
||||
}
|
||||
$user = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "' . $nick['uid'] . '" LIMIT 1'));
|
||||
if (isset ($params['account'])) {
|
||||
if ($nick['good'] != 0) {
|
||||
echo getResponseError('Already Used');
|
||||
die();
|
||||
} else {
|
||||
|
||||
mysql_query(
|
||||
'UPDATE `users` SET `money2` = `money2` + ' . $nick['ekr'] . ' WHERE `id` = "' . $nick['uid'] . '" LIMIT 1'
|
||||
);
|
||||
mysql_query(
|
||||
'UPDATE `pay_operation` SET `good` = "' . time() . '" WHERE `id` = "' . $params['account'] . '" LIMIT 1'
|
||||
);
|
||||
mysql_query(
|
||||
'UPDATE `users` SET `catch` = `catch` + ' . $nick['ekr'] . ' WHERE `id` = "' . $nick['uid'] . '" LIMIT 1'
|
||||
);
|
||||
|
||||
$r = '<span class=date>' . date(
|
||||
'd.m.Y H:i'
|
||||
) . '</span> Àëõèìèê <img src=https://img.new-combats.com/i/align/align50.gif width=12 height=15 /><u><b>Àäìèíèñòðàòîð</b> / Àâòîìàòè÷åñêàÿ îïëàòà</u> ñîîáùàåò: ';
|
||||
if ($user['sex'] == 1) {
|
||||
$r .= 'Óâàæàåìàÿ';
|
||||
} else {
|
||||
$r .= 'Óâàæàåìûé';
|
||||
}
|
||||
$r .= ' <b>' . $user['login'] . '</b>, íà Âàø èãðîâîé ñ÷åò çà÷èñëåíî ' . $nick['ekr'] . ' Åâðîêðåäèòîâ. Áëàãîäàðèì Âàñ çà ïîêóïêó!';
|
||||
|
||||
mysql_query(
|
||||
"INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $user['city'] . "','" . $user['room'] . "','','" . $user['login'] . "','" . $r . "','-1','5','0')"
|
||||
);
|
||||
|
||||
if ($nick['ref'] != 0) {
|
||||
$refecr = round(($nick['ekr'] / 10));
|
||||
mysql_query(
|
||||
'UPDATE `users` SET `money2` = `money2` + ' . $refecr . ' WHERE `id` = "' . $nick['ref'] . '" LIMIT 1'
|
||||
);
|
||||
$referal = mysql_fetch_array(
|
||||
mysql_query('SELECT * FROM `users` WHERE `id` = "' . $nick['ref'] . '" LIMIT 1')
|
||||
);
|
||||
$r = '<span class=date>' . date(
|
||||
'd.m.Y H:i'
|
||||
) . '</span> Àëõèìèê <img src=https://img.new-combats.com/i/align/align50.gif width=12 height=15 /><u><b>Àäìèíèñòðàòîð</b> / Ðåôåðàëüíûé çàðàáîòîê</u> ñîîáùàåò: ';
|
||||
if ($referal['sex'] == 1) {
|
||||
$r .= 'Óâàæàåìàÿ';
|
||||
} else {
|
||||
$r .= 'Óâàæàåìûé';
|
||||
}
|
||||
$r .= ' <b>' . $referal['login'] . '</b>, íà Âàø èãðîâîé ñ÷åò çà÷èñëåíî ' . $refecr . ' Åâðîêðåäèòîâ. Áëàãîäîðÿ âàøåìó ðåôåðàëó!' . $user['login'] . '';
|
||||
//$str1 = iconv("cp1251","UTF-8",$r);
|
||||
mysql_query(
|
||||
"INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $referal['city'] . "','" . $referal['room'] . "','','" . $referal['login'] . "','" . $r . "','-1','5','0')"
|
||||
);
|
||||
}
|
||||
|
||||
echo getResponseSuccess('PAY is successful');
|
||||
die();
|
||||
}
|
||||
|
||||
} else {
|
||||
echo getResponseError('No order');
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
@ -6,82 +6,61 @@
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//if( $_SERVER['HTTP_CF_CONNECTING_IP'] != $_SERVER['SERVER_ADDR'] && $_SERVER['HTTP_CF_CONNECTING_IP'] != '127.0.0.1' ) { die('Hello pussy!'); }
|
||||
|
||||
function getIP() {
|
||||
if(isset($_SERVER['HTTP_X_REAL_IP'])) return $_SERVER['HTTP_X_REAL_IP'];
|
||||
return $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
|
||||
if(getIP() != $_SERVER['SERVER_ADDR'] && getIP() != '127.0.0.1' && getIP() != '' && getIP() != '5.187.7.71') {
|
||||
if(!isset($_GET['test'])) {
|
||||
die(getIP().'<br>'.$_SERVER['SERVER_ADDR']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
define('GAME',true);
|
||||
|
||||
const GAME = true;
|
||||
require_once('_incl_data/__config.php');
|
||||
require_once('_incl_data/class/__db_connect.php');
|
||||
|
||||
function e($t) {
|
||||
mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("core #'.date('d.m.Y').' %'.date('H:i:s').' (Êðèòè÷åñêàÿ îøèáêà): <b>'.mysql_real_escape_string($t).'</b>","capitalcity","LEL","6","1","-1")');
|
||||
if (UserIp::get() != $_SERVER['SERVER_ADDR'] && UserIp::get() != '127.0.0.1' && UserIp::get() != '' && UserIp::get(
|
||||
) != '5.187.7.71' && !isset($_GET['test'])) {
|
||||
die(UserIp::get() . '<br>' . $_SERVER['SERVER_ADDR']);
|
||||
}
|
||||
|
||||
$count = array(
|
||||
0, //çàâåðøåííûõ ïîåäèíêîâ
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
);
|
||||
|
||||
function clear_user($plid) {
|
||||
mysql_query('UPDATE `users` SET `login` = "delete",`login2` = `login` WHERE `id` = "'.$plid.'" LIMIT 1');
|
||||
/* mysql_query('DELETE FROM `users` WHERE `id` = "'.$plid.'" LIMIT 1');
|
||||
mysql_query('DELETE FROM `items_users` WHERE `uid` = "'.$plid.'"');
|
||||
mysql_query('DELETE FROM `eff_users` WHERE `uid` = "'.$plid.'"');
|
||||
mysql_query('DELETE FROM `bank` WHERE `uid` = "'.$plid.'"');*/
|
||||
function e($t)
|
||||
{
|
||||
mysql_query(
|
||||
'INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("core #' . date('d.m.Y') . ' %' . date(
|
||||
'H:i:s'
|
||||
) . ' (Êðèòè÷åñêàÿ îøèáêà): <b>' . mysql_real_escape_string($t) . '</b>","capitalcity","LEL","6","1","-1")'
|
||||
);
|
||||
}
|
||||
|
||||
/*$sp = mysql_query('SELECT `id` FROM `users` WHERE `cityreg` = "" && `timereg` = "0" LIMIT 100');
|
||||
while($pl = mysql_fetch_array($sp)) {
|
||||
$n_st = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `id` = "'.$pl['id'].'" LIMIT 1'));
|
||||
if(!isset($n_st['id'])) {
|
||||
clear_user($pl['id']);
|
||||
}
|
||||
}*/
|
||||
$count = [
|
||||
0, //çàâåðøåííûõ ïîåäèíêîâ
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
];
|
||||
|
||||
function inuser_go_btl($id) {
|
||||
if(isset($id['id'])) {
|
||||
echo file_get_contents('https://new-combats.com/jx/battle/refresh.php?uid='.$id['id'].'&cron_core='.md5($id['id'].'_brfCOreW@!_'.$id['pass']).'&pass='.$id['pass']);
|
||||
echo '<hr>';
|
||||
}
|
||||
function clear_user($plid)
|
||||
{
|
||||
mysql_query('UPDATE `users` SET `login` = "delete",`login2` = `login` WHERE `id` = ' . $plid);
|
||||
}
|
||||
|
||||
function inuser_go_btl($id)
|
||||
{
|
||||
if (isset($id['id'])) {
|
||||
echo file_get_contents(
|
||||
'https://new-combats.com/jx/battle/refresh.php?uid=' . $id['id'] . '&cron_core=' . md5(
|
||||
$id['id'] . '_brfCOreW@!_' . $id['pass']
|
||||
) . '&pass=' . $id['pass']
|
||||
);
|
||||
echo '<hr>';
|
||||
}
|
||||
}
|
||||
|
||||
/* ñ÷èòàåì ïîåäèíêè */
|
||||
//e('îáðàáîòêà îòìåíåíà.');
|
||||
$i = 0;
|
||||
while( $i < 3 ) {
|
||||
$sp = mysql_query('SELECT `id`,`time_start` FROM `battle` WHERE `team_win` = "-1" AND `time_over` = "0" AND `type` = 329 LIMIT 100');
|
||||
while($pl = mysql_fetch_array($sp)) {
|
||||
$user1 = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `battle` = "'.$pl['id'].'" LIMIT 1'));
|
||||
inuser_go_btl($user1);
|
||||
}
|
||||
$i++;
|
||||
while ($i < 3) {
|
||||
$sp = mysql_query(
|
||||
'SELECT `id`,`time_start` FROM `battle` WHERE `team_win` = "-1" AND `time_over` = "0" AND `type` = 329 LIMIT 100'
|
||||
);
|
||||
while ($pl = mysql_fetch_array($sp)) {
|
||||
$user1 = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `battle` = "' . $pl['id'] . '" LIMIT 1'));
|
||||
inuser_go_btl($user1);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
//$i = 0;
|
||||
//while( $i < 3 ) {
|
||||
/* $sp = mysql_query('SELECT `id`,`time_start` FROM `battle` WHERE `team_win` = "-1" AND `time_over` = "0" AND `time_start` < "'.(time()-3600).'" LIMIT 100');
|
||||
while($pl = mysql_fetch_array($sp)) {
|
||||
$user1 = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `battle` = "'.$pl['id'].'" LIMIT 1'));
|
||||
inuser_go_btl($user1);
|
||||
}*/
|
||||
//$i++;
|
||||
//}
|
||||
?>
|
@ -1,19 +1,15 @@
|
||||
<?php
|
||||
|
||||
function getIP()
|
||||
{
|
||||
return isset($_SERVER['HTTP_X_REAL_IP']) ? $_SERVER['HTTP_X_REAL_IP'] : $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
|
||||
if (!isset($_GET['tests']) && getIP() != $_SERVER['SERVER_ADDR'] && getIP() != '127.0.0.1' && getIP(
|
||||
) != '51.89.6.100') {
|
||||
exit(getIP() . '<br>' . $_SERVER['SERVER_ADDR']);
|
||||
}
|
||||
|
||||
const GAME = true;
|
||||
setlocale(LC_CTYPE, "ru_RU.CP1251");
|
||||
include('_incl_data/class/__db_connect.php');
|
||||
require_once '_incl_data/__config.php';
|
||||
require_once '_incl_data/class/__db_connect.php';
|
||||
|
||||
if (!isset($_GET['tests']) && UserIp::get() != $_SERVER['SERVER_ADDR'] && UserIp::get() != '127.0.0.1' && UserIp::get() != '51.89.6.100') {
|
||||
exit(UserIp::get() . '<br>' . $_SERVER['SERVER_ADDR']);
|
||||
}
|
||||
|
||||
//Ïîäàåì òóðíèð (õàîò) äëÿ 8-11 óðîâíåé
|
||||
$pdo = \Core\Database::pdoinit();
|
||||
$inc = $pdo->prepare(
|
||||
'insert into zayvki (`comment`,`arand`,`noatack`,`city`,`creator`,`type`,`time_start`,`timeout`,`min_lvl_1`,`min_lvl_2`,`max_lvl_1`,`max_lvl_2`,`noinc`,`razdel`,`time`,`fastfight`,`priz`,`maxplayers`,`tm1max`,`tm2max`) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,unix_timestamp(),?,?,?,?,?)'
|
||||
)->execute(
|
||||
|
@ -1,22 +1,19 @@
|
||||
<?php
|
||||
const GAME = true;
|
||||
setlocale(LC_CTYPE, "ru_RU.CP1251");
|
||||
include('_incl_data/__config.php');
|
||||
include('_incl_data/class/__db_connect.php');
|
||||
|
||||
function getIP()
|
||||
{
|
||||
return isset($_SERVER['HTTP_X_REAL_IP']) ? $_SERVER['HTTP_X_REAL_IP'] : $_SERVER['REMOTE_ADDR'];
|
||||
if (!isset($_GET['test']) && UserIp::get() != $_SERVER['SERVER_ADDR'] && UserIp::get() != '127.0.0.1' && UserIp::get(
|
||||
) != '' && UserIp::get() != '31.131.106.205') {
|
||||
exit(UserIp::get() . '<br>' . $_SERVER['SERVER_ADDR']);
|
||||
}
|
||||
|
||||
if (!isset($_GET['test']) && getIP() != $_SERVER['SERVER_ADDR'] && getIP() != '127.0.0.1' && getIP() != '' && getIP(
|
||||
) != '31.131.106.205') {
|
||||
exit(getIP() . '<br>' . $_SERVER['SERVER_ADDR']);
|
||||
}
|
||||
|
||||
function changeSleep($uid, $sleep_action)
|
||||
{
|
||||
$u = User::start();
|
||||
if ($sleep_action == 1) {
|
||||
//
|
||||
mysql_query('INSERT INTO `sleep` (`uid`,`time`,`sleep`) VALUES ("' . $uid . '","' . time() . '","1")');
|
||||
//
|
||||
mysql_query(
|
||||
"UPDATE `eff_users` SET `sleeptime`=" . time() . ",`deactiveLast` = ( `deactiveTime` - " . time(
|
||||
) . " ) WHERE `uid`='" . mysql_real_escape_string($uid) . "' AND `no_Ace` = 0 AND `delete` = 0"
|
||||
@ -26,11 +23,8 @@ function changeSleep($uid, $sleep_action)
|
||||
) . '" WHERE `uid` = "' . $uid . '" AND `delete` < 1001 AND `data` LIKE "%|sleep_moroz=1%"'
|
||||
);
|
||||
$u->addAction(time(), 'sleep', $u->info['city']);
|
||||
//
|
||||
} elseif ($sleep_action == 2) {
|
||||
//
|
||||
mysql_query('INSERT INTO `sleep` (`uid`,`time`,`sleep`) VALUES ("' . $uid . '","' . time() . '","2")');
|
||||
//
|
||||
$sp = mysql_query(
|
||||
'SELECT * FROM `items_users` WHERE `time_sleep` > 0 AND `uid` = "' . $uid . '" AND `delete` < 1001 AND `data` LIKE "%|sleep_moroz=1%"'
|
||||
);
|
||||
@ -75,10 +69,6 @@ $cnfg = [
|
||||
|
||||
echo '#start#';
|
||||
|
||||
define('GAME', true);
|
||||
setlocale(LC_CTYPE, "ru_RU.CP1251");
|
||||
include('_incl_data/__config.php');
|
||||
include('_incl_data/class/__db_connect.php');
|
||||
$magic = new Magic();
|
||||
|
||||
$itbs = [
|
||||
@ -804,10 +794,6 @@ while ($pl = mysql_fetch_array($sp)) {
|
||||
unset($stor, $stgo);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
//Ñðàæàåìñÿ
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -816,7 +802,7 @@ while ($pl = mysql_fetch_array($sp)) {
|
||||
}
|
||||
} elseif ($pl['status'] == 0 && $pl['time_start'] < time()) {
|
||||
//Íà÷èíàåì òóðíèð
|
||||
if (nostart($pl) == false) {
|
||||
if (!nostart($pl)) {
|
||||
|
||||
//Íà÷èíàåì òóðíèð!
|
||||
$spm = mysql_query('SELECT `x`,`y` FROM `bs_map` WHERE `mid` = "' . $pl['type_map'] . '"');
|
||||
@ -1062,7 +1048,6 @@ while ($pl = mysql_fetch_array($sp)) {
|
||||
if ($pl['status'] == 0) {
|
||||
if ($pl['ch1'] == 0 && $pl['time_start'] - 60 * 60 < time()) {
|
||||
mysql_query('UPDATE `bs_turnirs` SET `ch1` = `ch1` + 1 WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
|
||||
//e('Íà÷àëî òóðíèðà âå÷íûõ «5» óðîâíåé, äëÿ '.$pl['to_lvl'].' óðîâíåé â <b>Áàøíå Ñìåðòè</b> ÷åðåç '.timeOut($pl['time_start']-time()).' (<small>'.date('d.m.Y H:i',$pl['time_start']).'</small>), òåêóùèé ïðèçîâîé ôîíä: '.round($pl['money']*0.85,2).' êð., çàÿâîê: '.$pl['users'].'');
|
||||
} elseif ($pl['ch1'] == 1 && $pl['time_start'] - 10 * 60 < time()) {
|
||||
mysql_query('UPDATE `bs_turnirs` SET `ch1` = `ch1` + 1 WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
|
||||
e(
|
||||
|
@ -1,190 +1,198 @@
|
||||
<?php
|
||||
|
||||
function getIP() {
|
||||
if(isset($_SERVER['HTTP_X_REAL_IP'])) return $_SERVER['HTTP_X_REAL_IP'];
|
||||
return $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
|
||||
if(!isset($_GET['test']))
|
||||
{
|
||||
/*if( $_SERVER['HTTP_CF_CONNECTING_IP'] != $_SERVER['SERVER_ADDR'] && $_SERVER['HTTP_CF_CONNECTING_IP'] != '127.0.0.1' )
|
||||
{
|
||||
die('<center><br><h3>½ðîäè ;)</h3><img src="i/fack.jpg">');
|
||||
}*/
|
||||
if(getIP() != $_SERVER['SERVER_ADDR'] && getIP() != '127.0.0.1' && getIP() != '' && getIP() != '31.131.97.206')
|
||||
{
|
||||
die(getIP().'<br>'.$_SERVER['SERVER_ADDR']);
|
||||
}
|
||||
}
|
||||
/*
|
||||
if( $_SERVER['HTTP_CF_CONNECTING_IP'] != $_SERVER['SERVER_ADDR'] && $_SERVER['HTTP_CF_CONNECTING_IP'] != '127.0.0.1' ) { die('<center><br><h3>½ðîäè ;)</h3><img src="i/fack.jpg">'); }
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
define('GAME',true);
|
||||
|
||||
const GAME = true;
|
||||
require_once('_incl_data/__config.php');
|
||||
require_once('_incl_data/class/__db_connect.php');
|
||||
|
||||
function e($t) {
|
||||
mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("core #'.date('d.m.Y').' %'.date('H:i:s').' ( ðèòè÷åñêठîøèáêà): <b>'.mysql_real_escape_string($t).'</b>","capitalcity","LEL","6","1","-1")');
|
||||
if (!isset($_GET['test']) && UserIp::get() != $_SERVER['SERVER_ADDR'] && UserIp::get() != '127.0.0.1' && UserIp::get() != '' && UserIp::get() != '31.131.97.206') {
|
||||
die(UserIp::get() . '<br>' . $_SERVER['SERVER_ADDR']);
|
||||
}
|
||||
|
||||
function testMonster( $mon , $type , $mbk ) {
|
||||
$r = true;
|
||||
$mbk2 = '';
|
||||
if(isset($mon['id'])) {
|
||||
//
|
||||
if($type == 'start') {
|
||||
//?åíü íåäåëè
|
||||
if( $mon['start_day'] != -1 ) {
|
||||
if( ($mon['start_day'] < 7 && $mon['start_day'] != (int)date('w')) || $mon['start_day'] != 7 ) {
|
||||
$r = false;
|
||||
$mbk2 .= '(íåäåëÿ)';
|
||||
}
|
||||
}
|
||||
//?èñëî
|
||||
if( $mon['start_dd'] != -1 ) {
|
||||
if( $mon['start_dd'] != date('j') ) {
|
||||
$r = false;
|
||||
$mbk2 .= '(÷èñëî)';
|
||||
}
|
||||
}
|
||||
//ìåñ²ö
|
||||
if( $mon['start_mm'] != -1 ) {
|
||||
if( $mon['start_mm'] != date('n') ) {
|
||||
$r = false;
|
||||
$mbk2 .= '(ìåñÿö)';
|
||||
}
|
||||
}
|
||||
//÷àñ
|
||||
if( $mon['start_hh'] != -1 ) {
|
||||
if( $mon['start_hh'] != (int)date('H') ) {
|
||||
$r = false;
|
||||
$mbk2 .= '('.$mon['start_hh'].'|'.((int)date('H')).' ÷àñ)';
|
||||
}
|
||||
if( $mon['start_min'] != -1 ) {
|
||||
if( $mon['start_min'] < (int)date('i') ) {
|
||||
$r = false;
|
||||
$mbk2 .= '('.$mon['start_min'].'|'.((int)date('i')).' ìèíóòû)';
|
||||
}
|
||||
}
|
||||
}
|
||||
}elseif($type == 'back') {
|
||||
//?åíü íåäåëè
|
||||
if( $mon['back_day'] != -1 ) {
|
||||
if( ($mon['back_day'] < 7 && $mon['back_day'] != date('w')) || $mon['back_day'] != 7 ) {
|
||||
$r = false;
|
||||
$mbk2 .= '(äåíü íåäåëè)';
|
||||
}
|
||||
}
|
||||
//?èñëî
|
||||
if( $mon['back_dd'] != -1 ) {
|
||||
if( $mon['back_dd'] != date('j') ) {
|
||||
$r = false;
|
||||
$mbk2 .= '(÷èñëî)';
|
||||
}
|
||||
}
|
||||
//ìåñ²ö
|
||||
if( $mon['back_mm'] != -1 ) {
|
||||
if( $mon['back_mm'] != date('n') ) {
|
||||
$r = false;
|
||||
$mbk2 .= '(ìåñÿö)';
|
||||
}
|
||||
}
|
||||
//÷àñ
|
||||
if( $mon['back_hh'] != -1 ) {
|
||||
if( $mon['back_hh'] != (int)date('H') ) {
|
||||
$r = false;
|
||||
$mbk2 .= '(÷àñ)';
|
||||
}
|
||||
if( $mon['back_min'] != -1 ) {
|
||||
if( $mon['back_min'] < (int)date('i') ) {
|
||||
$r = false;
|
||||
$mbk2 .= '(ìèíóòû)';
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
//÷òî-òî äðóãîå
|
||||
$r = false;
|
||||
$mbk2 .= '(÷òî-òî äðóãîå)';
|
||||
}
|
||||
//
|
||||
}
|
||||
if( $mbk == true ) {
|
||||
return $mbk2;
|
||||
}else{
|
||||
return $r;
|
||||
}
|
||||
|
||||
function e($t)
|
||||
{
|
||||
mysql_query(
|
||||
'INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("core #' . date('d.m.Y') . ' %' . date(
|
||||
'H:i:s'
|
||||
) . ' ( ðèòè÷åñêठîøèáêà): <b>' . mysql_real_escape_string($t) . '</b>","capitalcity","LEL","6","1","-1")'
|
||||
);
|
||||
}
|
||||
|
||||
$sp = mysql_query('SELECT `u`.*,`st`.* FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON `st`.`id` = `u`.`id` WHERE `u`.`no_ip` = "trupojor" LIMIT 100');
|
||||
while($pl = mysql_fetch_array($sp)) {
|
||||
/*echo "ID:".$pl['id']."<br>";
|
||||
echo "online:".$pl['online']."<br>";
|
||||
$testtime=time()-60;
|
||||
echo "time:".$testtime."<br>";*/
|
||||
$act = 0;
|
||||
if($pl['online'] < time()-60) {
|
||||
$pl['online'] = time();
|
||||
mysql_query('UPDATE `users` SET `online` = "'.$pl['online'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
|
||||
}
|
||||
|
||||
//$testb=mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `type` = 500 AND `team_win` = -1 LIMIT 1'));
|
||||
if($pl['res_x'] < time() /*&& !isset($testb['id'])*/) {
|
||||
//¸îæíî äåéñòâîâàòü!
|
||||
$mon = mysql_fetch_array(mysql_query('SELECT * FROM `aaa_monsters` WHERE `uid` = "'.$pl['id'].'" LIMIT 1'));
|
||||
if( isset($mon['id']) ) {
|
||||
if( testMonster($mon,'start',false) == true && $pl['room'] == 303 ) {
|
||||
$pl['room'] = $mon['start_room'];
|
||||
mysql_query('UPDATE `users` SET `room` = "'.$pl['room'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
|
||||
mysql_query('UPDATE `stats` SET `hpNow` = "1000000000000",`mpNow` = "1000000000000" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
|
||||
if( $mon['start_text'] != '' /*&& $pl['level'] <10*/) {
|
||||
mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("<font color=red>Âíèìàíèå!</font> '.mysql_real_escape_string(str_replace('{b}','<b>'.$pl['login'].'</b> ['.$pl['level'].']<a target=_blank href=inf.php?'.$pl['id'].' ><img width=12 height=11 src=https://img.new-combats.com/i/inf_capitalcity.gif ></a>',$mon['start_text'])).'","'.$pl['city'].'","","6","1","'.time().'")');
|
||||
//mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("<font color=red>Âíèìàíèå!</font> '.mysql_real_escape_string(str_replace('{b}','<b>'.$pl['login'].'</b> ['.$pl['level'].']<a target=_blank href=inf.php?'.$pl['id'].' ><img width=12 height=11 src=https://img.new-combats.com/i/inf_capitalcity.gif ></a>',$mon['start_text'])).'","'.$pl['city'].'","","1","1","'.time().'")');
|
||||
}
|
||||
$act = 1;
|
||||
}
|
||||
}else{
|
||||
mysql_query('UPDATE `stats` SET `res_x` = "'.(time()+3600).'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
|
||||
}
|
||||
}
|
||||
|
||||
//e('['.date('d.m.Y H:i:s').'] TRUPOJOR -> '.$pl['login'].' -> [room: '.$pl['room'].' , test: '.testMonster($mon,'start',true).' , res_x: '.$pl['res_x'].' , battle: '.$pl['battle'].' , act: '.$act.' ]');
|
||||
|
||||
if( $act == 0 && $pl['room'] != 303 && $pl['battle'] == 0 ) {
|
||||
if(!isset($mon['id'])) {
|
||||
$mon = mysql_fetch_array(mysql_query('SELECT * FROM `aaa_monsters` WHERE `uid` = "'.$pl['id'].'" LIMIT 1'));
|
||||
}
|
||||
if( isset($mon['id']) ) {
|
||||
if( testMonster($mon,'back',false) == true ) {
|
||||
$pl['room'] = 303;
|
||||
mysql_query('UPDATE `users` SET `room` = "'.$pl['room'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
|
||||
mysql_query('UPDATE `stats` SET `hpNow` = "1000000000000",`mpNow` = "1000000000000" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
|
||||
if( $mon['back_text'] != '' ) {
|
||||
mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("<font color=red>Âíèìàíèå!</font> '.mysql_real_escape_string(str_replace('{b}','<b>'.$pl['login'].'</b> ['.$pl['level'].']<a target=_blank href=inf.php?'.$pl['id'].' ><img width=12 height=11 src=https://img.new-combats.com/i/inf_capitalcity.gif ></a>',$mon['back_text'])).'","'.$pl['city'].'","","6","1","'.time().'")');
|
||||
mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("<font color=red>Âíèìàíèå!</font> '.mysql_real_escape_string(str_replace('{b}','<b>'.$pl['login'].'</b> ['.$pl['level'].']<a target=_blank href=inf.php?'.$pl['id'].' ><img width=12 height=11 src=https://img.new-combats.com/i/inf_capitalcity.gif ></a>',$mon['back_text'])).'","'.$pl['city'].'","","1","1","'.time().'")');
|
||||
}
|
||||
$act = 2;
|
||||
}else{
|
||||
echo '[Îæèäàíèå: '.$mon['id'].' -> '.$mon['login'].' | '.testMonster($mon,'back',true).']<br>';
|
||||
}
|
||||
}
|
||||
}
|
||||
/*if($pl['battle'] > 0) {
|
||||
//inuser_go_atack($pl);
|
||||
}else{
|
||||
if($pl['room'] == 303 && $pl['timeGo'] < time()) {
|
||||
if($pl['res_x'] < time()) {
|
||||
$pl['room'] = $pl['invBlock'];
|
||||
mysql_query('UPDATE `users` SET `room` = "'.$pl['room'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
|
||||
mysql_query('UPDATE `stats` SET `hpNow` = "1000000000000",`mpNow` = "1000000000000" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
|
||||
mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("<font color=red>Ðíèìàíèå!</font> <b>'.$pl['login'].'</b> ['.$pl['level'].']<a target=_blank href=inf.php?'.$pl['id'].' ><img width=12 height=11 src=https://img.new-combats.com/i/inf_capitalcity.gif ></a> âûáðàëñ² íà îõîòó, áóäüòå îñòîðîæíû!","'.$pl['city'].'","","6","1","'.time().'")');
|
||||
}
|
||||
}
|
||||
}*/
|
||||
usleep(300000);
|
||||
function testMonster($mon, $type, $mbk)
|
||||
{
|
||||
$r = true;
|
||||
$mbk2 = '';
|
||||
if (isset($mon['id'])) {
|
||||
//
|
||||
if ($type == 'start') {
|
||||
//?åíü íåäåëè
|
||||
if ($mon['start_day'] != -1) {
|
||||
if (($mon['start_day'] < 7 && $mon['start_day'] != (int)date('w')) || $mon['start_day'] != 7) {
|
||||
$r = false;
|
||||
$mbk2 .= '(íåäåëÿ)';
|
||||
}
|
||||
}
|
||||
//?èñëî
|
||||
if ($mon['start_dd'] != -1) {
|
||||
if ($mon['start_dd'] != date('j')) {
|
||||
$r = false;
|
||||
$mbk2 .= '(÷èñëî)';
|
||||
}
|
||||
}
|
||||
//ìåñ²ö
|
||||
if ($mon['start_mm'] != -1) {
|
||||
if ($mon['start_mm'] != date('n')) {
|
||||
$r = false;
|
||||
$mbk2 .= '(ìåñÿö)';
|
||||
}
|
||||
}
|
||||
//÷àñ
|
||||
if ($mon['start_hh'] != -1) {
|
||||
if ($mon['start_hh'] != (int)date('H')) {
|
||||
$r = false;
|
||||
$mbk2 .= '(' . $mon['start_hh'] . '|' . ((int)date('H')) . ' ÷àñ)';
|
||||
}
|
||||
if ($mon['start_min'] != -1) {
|
||||
if ($mon['start_min'] < (int)date('i')) {
|
||||
$r = false;
|
||||
$mbk2 .= '(' . $mon['start_min'] . '|' . ((int)date('i')) . ' ìèíóòû)';
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ($type == 'back') {
|
||||
//?åíü íåäåëè
|
||||
if ($mon['back_day'] != -1) {
|
||||
if (($mon['back_day'] < 7 && $mon['back_day'] != date('w')) || $mon['back_day'] != 7) {
|
||||
$r = false;
|
||||
$mbk2 .= '(äåíü íåäåëè)';
|
||||
}
|
||||
}
|
||||
//?èñëî
|
||||
if ($mon['back_dd'] != -1) {
|
||||
if ($mon['back_dd'] != date('j')) {
|
||||
$r = false;
|
||||
$mbk2 .= '(÷èñëî)';
|
||||
}
|
||||
}
|
||||
//ìåñ²ö
|
||||
if ($mon['back_mm'] != -1) {
|
||||
if ($mon['back_mm'] != date('n')) {
|
||||
$r = false;
|
||||
$mbk2 .= '(ìåñÿö)';
|
||||
}
|
||||
}
|
||||
//÷àñ
|
||||
if ($mon['back_hh'] != -1) {
|
||||
if ($mon['back_hh'] != (int)date('H')) {
|
||||
$r = false;
|
||||
$mbk2 .= '(÷àñ)';
|
||||
}
|
||||
if ($mon['back_min'] != -1) {
|
||||
if ($mon['back_min'] < (int)date('i')) {
|
||||
$r = false;
|
||||
$mbk2 .= '(ìèíóòû)';
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//÷òî-òî äðóãîå
|
||||
$r = false;
|
||||
$mbk2 .= '(÷òî-òî äðóãîå)';
|
||||
}
|
||||
//
|
||||
}
|
||||
if ($mbk == true) {
|
||||
return $mbk2;
|
||||
} else {
|
||||
return $r;
|
||||
}
|
||||
}
|
||||
|
||||
$sp = mysql_query(
|
||||
'SELECT `u`.*,`st`.* FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON `st`.`id` = `u`.`id` WHERE `u`.`no_ip` = "trupojor" LIMIT 100'
|
||||
);
|
||||
while ($pl = mysql_fetch_array($sp)) {
|
||||
$act = 0;
|
||||
if ($pl['online'] < time() - 60) {
|
||||
$pl['online'] = time();
|
||||
mysql_query('UPDATE `users` SET `online` = "' . $pl['online'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
|
||||
}
|
||||
|
||||
if ($pl['res_x'] < time() /*&& !isset($testb['id'])*/) {
|
||||
//¸îæíî äåéñòâîâàòü!
|
||||
$mon = mysql_fetch_array(mysql_query('SELECT * FROM `aaa_monsters` WHERE `uid` = "' . $pl['id'] . '" LIMIT 1'));
|
||||
if (isset($mon['id'])) {
|
||||
if (testMonster($mon, 'start', false) == true && $pl['room'] == 303) {
|
||||
$pl['room'] = $mon['start_room'];
|
||||
mysql_query(
|
||||
'UPDATE `users` SET `room` = "' . $pl['room'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'
|
||||
);
|
||||
mysql_query(
|
||||
'UPDATE `stats` SET `hpNow` = "1000000000000",`mpNow` = "1000000000000" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'
|
||||
);
|
||||
if ($mon['start_text'] != '' /*&& $pl['level'] <10*/) {
|
||||
mysql_query(
|
||||
'INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("<font color=red>Âíèìàíèå!</font> ' . mysql_real_escape_string(
|
||||
str_replace(
|
||||
'{b}',
|
||||
'<b>' . $pl['login'] . '</b> [' . $pl['level'] . ']<a target=_blank href=inf.php?' . $pl['id'] . ' ><img width=12 height=11 src=https://img.new-combats.com/i/inf_capitalcity.gif ></a>',
|
||||
$mon['start_text']
|
||||
)
|
||||
) . '","' . $pl['city'] . '","","6","1","' . time() . '")'
|
||||
);
|
||||
}
|
||||
$act = 1;
|
||||
}
|
||||
} else {
|
||||
mysql_query(
|
||||
'UPDATE `stats` SET `res_x` = "' . (time() + 3600) . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ($act == 0 && $pl['room'] != 303 && $pl['battle'] == 0) {
|
||||
if (!isset($mon['id'])) {
|
||||
$mon = mysql_fetch_array(
|
||||
mysql_query('SELECT * FROM `aaa_monsters` WHERE `uid` = "' . $pl['id'] . '" LIMIT 1')
|
||||
);
|
||||
}
|
||||
if (isset($mon['id'])) {
|
||||
if (testMonster($mon, 'back', false) == true) {
|
||||
$pl['room'] = 303;
|
||||
mysql_query(
|
||||
'UPDATE `users` SET `room` = "' . $pl['room'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'
|
||||
);
|
||||
mysql_query(
|
||||
'UPDATE `stats` SET `hpNow` = "1000000000000",`mpNow` = "1000000000000" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'
|
||||
);
|
||||
if ($mon['back_text'] != '') {
|
||||
mysql_query(
|
||||
'INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("<font color=red>Âíèìàíèå!</font> ' . mysql_real_escape_string(
|
||||
str_replace(
|
||||
'{b}',
|
||||
'<b>' . $pl['login'] . '</b> [' . $pl['level'] . ']<a target=_blank href=inf.php?' . $pl['id'] . ' ><img width=12 height=11 src=https://img.new-combats.com/i/inf_capitalcity.gif ></a>',
|
||||
$mon['back_text']
|
||||
)
|
||||
) . '","' . $pl['city'] . '","","6","1","' . time() . '")'
|
||||
);
|
||||
mysql_query(
|
||||
'INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("<font color=red>Âíèìàíèå!</font> ' . mysql_real_escape_string(
|
||||
str_replace(
|
||||
'{b}',
|
||||
'<b>' . $pl['login'] . '</b> [' . $pl['level'] . ']<a target=_blank href=inf.php?' . $pl['id'] . ' ><img width=12 height=11 src=https://img.new-combats.com/i/inf_capitalcity.gif ></a>',
|
||||
$mon['back_text']
|
||||
)
|
||||
) . '","' . $pl['city'] . '","","1","1","' . time() . '")'
|
||||
);
|
||||
}
|
||||
$act = 2;
|
||||
} else {
|
||||
echo '[Îæèäàíèå: ' . $mon['id'] . ' -> ' . $mon['login'] . ' | ' . testMonster(
|
||||
$mon, 'back', true
|
||||
) . ']<br>';
|
||||
}
|
||||
}
|
||||
}
|
||||
usleep(300000);
|
||||
}
|
||||
?>
|
@ -1,20 +1,15 @@
|
||||
<?php
|
||||
|
||||
function getIP()
|
||||
{
|
||||
return isset($_SERVER['HTTP_X_REAL_IP']) ? $_SERVER['HTTP_X_REAL_IP'] : $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
|
||||
if (!isset($_GET['test']) && getIP() != $_SERVER['SERVER_ADDR'] && getIP() != '127.0.0.1' && getIP() != '' && getIP(
|
||||
) != '31.131.97.206') {
|
||||
die(getIP() . '<br>' . $_SERVER['SERVER_ADDR']);
|
||||
}
|
||||
|
||||
const GAME = true;
|
||||
setlocale(LC_CTYPE, "ru_RU.CP1251");
|
||||
include('_incl_data/__config.php');
|
||||
include('_incl_data/class/__db_connect.php');
|
||||
$u = User::start();
|
||||
|
||||
if (!isset($_GET['test']) && UserIp::get() != $_SERVER['SERVER_ADDR'] && UserIp::get() != '127.0.0.1' && UserIp::get(
|
||||
) != '' && UserIp::get() != '31.131.97.206') {
|
||||
die(UserIp::get() . '<br>' . $_SERVER['SERVER_ADDR']);
|
||||
}
|
||||
|
||||
//
|
||||
$sp = mysql_query('SELECT * FROM `battle` WHERE `otmorozok` = 1 AND `team_win` = -1 AND `otmorozok_use` = 0');
|
||||
while ($pl = mysql_fetch_array($sp)) {
|
||||
|
@ -1,4 +1,7 @@
|
||||
<?php
|
||||
if (!defined('GAME_VERSION')) {
|
||||
require_once '_incl_data/autoload.php';
|
||||
}
|
||||
if (!defined('GAME')) {
|
||||
die();
|
||||
}
|
||||
@ -44,11 +47,24 @@ if ($u->room['file'] == 'an/bank') {
|
||||
|
||||
$re2 = '';
|
||||
if (isset($_GET['enter']) && !isset($u->bank['id'])) {
|
||||
$bank = mysql_fetch_array(mysql_query('SELECT * FROM `bank` WHERE `uid` = "' . $u->info['id'] . '" AND `id` = "' . mysql_real_escape_string((int)$_POST['bank']) . '" LIMIT 1'));
|
||||
$bank = mysql_fetch_array(
|
||||
mysql_query(
|
||||
'SELECT * FROM `bank` WHERE `uid` = "' . $u->info['id'] . '" AND `id` = "' . mysql_real_escape_string(
|
||||
(int)$_POST['bank']
|
||||
) . '" LIMIT 1'
|
||||
)
|
||||
);
|
||||
if (!isset($bank['id'])) {
|
||||
$re2 = 'Íåâåðíûé íîìåð ñ÷åòà.';
|
||||
} elseif ($bank['pass'] != $_POST['pass']) {
|
||||
$pl = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `time` > "' . (time() - 60 * 60) . '" AND `vars` = "bank_bad_pass_' . mysql_real_escape_string($bank['id']) . '" LIMIT 5'));
|
||||
$pl = mysql_fetch_array(
|
||||
mysql_query(
|
||||
'SELECT COUNT(*) FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `time` > "' . (time(
|
||||
) - 60 * 60) . '" AND `vars` = "bank_bad_pass_' . mysql_real_escape_string(
|
||||
$bank['id']
|
||||
) . '" LIMIT 5'
|
||||
)
|
||||
);
|
||||
if ($pl[0] >= 3) {
|
||||
$re2 = 'Âàø ñ÷åò áûë çàáëîêèðîâàí íà 1 ÷àñ';
|
||||
} else {
|
||||
@ -58,34 +74,65 @@ if ($u->room['file'] == 'an/bank') {
|
||||
$pp = [0 => 'îê', 1 => 'êà', 2 => 'êè', 3 => 'êè'];
|
||||
$re2 = 'Íåâåðíûé íîìåð ñ÷åòà èëè ïàðîëü. Ó âàñ îñòàëîñü ' . (3 - $pl[0]) . ' ïîïûò' . $pp[3 - $pl[0]] . ', â ïðîòèâíîì ñëó÷àè ñ÷åò áóäåò çàáëîêèðîâàí íà ÷àñ';
|
||||
}
|
||||
mysql_query('INSERT INTO `actions` (`uid`,`time`,`city`,`room`,`vars`,`ip`) VALUES ("' . $u->info['id'] . '","' . time() . '","' . $u->info['city'] . '","' . $u->info['room'] . '","bank_bad_pass_' . mysql_real_escape_string($bank['id']) . '","' . mysql_real_escape_string($_SERVER['HTTP_X_REAL_IP']) . '")');
|
||||
mysql_query(
|
||||
'INSERT INTO `actions` (`uid`,`time`,`city`,`room`,`vars`,`ip`) VALUES ("' . $u->info['id'] . '","' . time(
|
||||
) . '","' . $u->info['city'] . '","' . $u->info['room'] . '","bank_bad_pass_' . mysql_real_escape_string(
|
||||
$bank['id']
|
||||
) . '","' . mysql_real_escape_string($_SERVER['HTTP_X_REAL_IP']) . '")'
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
||||
if ($u->info['allLock'] > time()) {
|
||||
echo '<script>setTimeout(function(){alert("Âàì çàïðåùåíî ïîëüçîâàòüñÿ óñëóãàìè áàíêà äî ' . date('d.m.y H:i', $u->info['allLock']) . '")},250);</script>';
|
||||
echo '<script>setTimeout(function(){alert("Âàì çàïðåùåíî ïîëüçîâàòüñÿ óñëóãàìè áàíêà äî ' . date(
|
||||
'd.m.y H:i', $u->info['allLock']
|
||||
) . '")},250);</script>';
|
||||
} else {
|
||||
//âîøëè!
|
||||
$bank['useNow'] = time() + 12 * 60 * 60;
|
||||
mysql_query('UPDATE `bank` SET `useNow` = "0" WHERE `id` != "' . $bank['id'] . '" AND `uid` = "' . $u->info['id'] . '" AND `useNow`!="0" LIMIT 1');
|
||||
mysql_query('UPDATE `bank` SET `useNow` = "' . $bank['useNow'] . '" WHERE `id` = "' . $bank['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1');
|
||||
mysql_query('INSERT INTO `actions` (`uid`,`time`,`city`,`room`,`vars`,`ip`) VALUES ("' . $u->info['id'] . '","' . time() . '","' . $u->info['city'] . '","' . $u->info['room'] . '","bank_good_pass_' . mysql_real_escape_string($bank['id']) . '","' . mysql_real_escape_string($_SERVER['HTTP_X_REAL_IP']) . '")');
|
||||
mysql_query(
|
||||
'UPDATE `bank` SET `useNow` = "0" WHERE `id` != "' . $bank['id'] . '" AND `uid` = "' . $u->info['id'] . '" AND `useNow`!="0" LIMIT 1'
|
||||
);
|
||||
mysql_query(
|
||||
'UPDATE `bank` SET `useNow` = "' . $bank['useNow'] . '" WHERE `id` = "' . $bank['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1'
|
||||
);
|
||||
mysql_query(
|
||||
'INSERT INTO `actions` (`uid`,`time`,`city`,`room`,`vars`,`ip`) VALUES ("' . $u->info['id'] . '","' . time(
|
||||
) . '","' . $u->info['city'] . '","' . $u->info['room'] . '","bank_good_pass_' . mysql_real_escape_string(
|
||||
$bank['id']
|
||||
) . '","' . mysql_real_escape_string($_SERVER['HTTP_X_REAL_IP']) . '")'
|
||||
);
|
||||
$u->bank = $bank;
|
||||
}
|
||||
}
|
||||
} elseif (isset($_GET['res'])) {
|
||||
//echo $_GET['schet'].'<br>';
|
||||
$b_pass = mysql_fetch_array(mysql_query('SELECT * FROM `bank` WHERE `uid` = "' . $u->info['id'] . '" AND `id` = "' . mysql_real_escape_string(getNumId($_GET['schet'])) . '" ORDER BY `id` DESC LIMIT 1'));
|
||||
$b_pass = mysql_fetch_array(
|
||||
mysql_query(
|
||||
'SELECT * FROM `bank` WHERE `uid` = "' . $u->info['id'] . '" AND `id` = "' . mysql_real_escape_string(
|
||||
getNumId($_GET['schet'])
|
||||
) . '" ORDER BY `id` DESC LIMIT 1'
|
||||
)
|
||||
);
|
||||
if ($b_pass['repass'] >= time()) {
|
||||
$re2 = 'Íîìåðà ñ÷åòîâ è ïàðîëè ê íèì ìîæíî âûñëàòü òîëüêî îäèí ðàç â ñóòêè';
|
||||
} else {
|
||||
mysql_query('INSERT INTO `actions` (`uid`,`time`,`city`,`room`,`vars`,`ip`) VALUES ("' . $u->info['id'] . '","' . time() . '","' . $u->info['city'] . '","' . $u->info['room'] . '","bank_res","' . mysql_real_escape_string($_SERVER['HTTP_X_REAL_IP']) . '")');
|
||||
mysql_query(
|
||||
'INSERT INTO `actions` (`uid`,`time`,`city`,`room`,`vars`,`ip`) VALUES ("' . $u->info['id'] . '","' . time(
|
||||
) . '","' . $u->info['city'] . '","' . $u->info['room'] . '","bank_res","' . mysql_real_escape_string(
|
||||
$_SERVER['HTTP_X_REAL_IP']
|
||||
) . '")'
|
||||
);
|
||||
$re2 = 'Âûñëàí íîìåð ñ÷åòà è ïàðîëü íà email, óêàçàííûé â àíêåòå';
|
||||
mysql_query('UPDATE `bank` SET `repass` = "' . (time() + 24 * 3600) . '" WHERE `id` = "' . $b_pass['id'] . '" LIMIT 1');
|
||||
mysql_query(
|
||||
'UPDATE `bank` SET `repass` = "' . (time(
|
||||
) + 24 * 3600) . '" WHERE `id` = "' . $b_pass['id'] . '" LIMIT 1'
|
||||
);
|
||||
$subject = 'Âîññòàíîâëåíèå ïàðîëÿ îò ñ÷åòà â áàíêå ïåðñîíàæà ' . $u->info['login'];
|
||||
$message = 'Íîìåð ñ÷åòà: ' . getNum($b_pass['id']) . '<br>Ïàðîëü: ' . $b_pass['pass'] .
|
||||
'<br><br>Ñ óâàæåíèåì,<br>Àäìèíèñòðàöèÿ Áîéöîâñêîãî Êëóáà';
|
||||
mails($u->info['mail'], $message, $subject);
|
||||
\Core\Mail::send($u->info['mail'], $message, $subject);
|
||||
//mails($u->info['mail'], $message, $subject);
|
||||
unset($subject, $message);
|
||||
}
|
||||
} elseif (isset($_GET['open']) && !isset($u->bank['id'])) {
|
||||
@ -101,7 +148,10 @@ if ($u->room['file'] == 'an/bank') {
|
||||
} elseif ($u->info['align'] != 2) {
|
||||
$pass = rand(10000, 91191);
|
||||
$pass = htmlspecialchars($_POST['pass1'], null, 'cp1251');
|
||||
$ins = mysql_query('INSERT INTO `bank` (`uid`,`create`,`pass`) VALUES ("' . $u->info['id'] . '","' . time() . '","' . $pass . '")');
|
||||
$ins = mysql_query(
|
||||
'INSERT INTO `bank` (`uid`,`create`,`pass`) VALUES ("' . $u->info['id'] . '","' . time(
|
||||
) . '","' . $pass . '")'
|
||||
);
|
||||
if ($ins) {
|
||||
$bank = mysql_insert_id();
|
||||
if ($u->info['level'] < 8 && $_POST['rdn01'] == 2) {
|
||||
@ -109,9 +159,16 @@ if ($u->room['file'] == 'an/bank') {
|
||||
} else {
|
||||
$u->info['money'] -= 3;
|
||||
}
|
||||
$upd = mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '",`money4` = "' . $u->info['money4'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
|
||||
$re2 = 'Ñ÷åò ¹<b>' . getNum($bank) . '</b> áûë óñïåøíî îòêðûò.<br>Ïàðîëü îò ñ÷åòà: <b>' . $pass . '</b><br><small><br>(Ñìåíèòü ïàðîëü ìîæíî â ðàçäåëå "Óïðàâëåíèå ñ÷åòîì" ïîñëå àâòîðèçàöèè)';
|
||||
$u->addDelo(3, $u->info['id'], 'Âû óñïåøíî îòêðûëè ñ÷åò ¹' . getNum($bank) . '', time(), $u->info['city'], 'Bank.System', 3, 0, '');
|
||||
$upd = mysql_query(
|
||||
'UPDATE `users` SET `money` = "' . $u->info['money'] . '",`money4` = "' . $u->info['money4'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
|
||||
);
|
||||
$re2 = 'Ñ÷åò ¹<b>' . getNum(
|
||||
$bank
|
||||
) . '</b> áûë óñïåøíî îòêðûò.<br>Ïàðîëü îò ñ÷åòà: <b>' . $pass . '</b><br><small><br>(Ñìåíèòü ïàðîëü ìîæíî â ðàçäåëå "Óïðàâëåíèå ñ÷åòîì" ïîñëå àâòîðèçàöèè)';
|
||||
$u->addDelo(
|
||||
3, $u->info['id'], 'Âû óñïåøíî îòêðûëè ñ÷åò ¹' . getNum($bank) . '', time(), $u->info['city'],
|
||||
'Bank.System', 3, 0, ''
|
||||
);
|
||||
} else {
|
||||
$re2 = 'Áàíê îòêàçàë â ïîëó÷åíèè áàíêîâñêîãî ñ÷åòà.';
|
||||
}
|
||||
@ -127,7 +184,9 @@ if ($u->room['file'] == 'an/bank') {
|
||||
}
|
||||
} elseif (isset($_GET['exit']) && isset($u->bank['id'])) {
|
||||
$u->bank = false;
|
||||
mysql_query('UPDATE `bank` SET `useNow` = "0" WHERE `uid` = "' . $u->info['id'] . '" AND `useNow`!="0" LIMIT 1');
|
||||
mysql_query(
|
||||
'UPDATE `bank` SET `useNow` = "0" WHERE `uid` = "' . $u->info['id'] . '" AND `useNow`!="0" LIMIT 1'
|
||||
);
|
||||
}
|
||||
|
||||
if ($u->info['allLock'] > time()) {
|
||||
@ -138,9 +197,21 @@ if ($u->room['file'] == 'an/bank') {
|
||||
if (isset($_POST['sd4']) && $u->newAct($_POST['sd4'])) {
|
||||
if (isset($_POST['transfer_kredit2']) && $u->info['admin'] > 0) {
|
||||
//ïåðåâîä åêðåäèòîâ ñ îäíîãî ñ÷åòà íà äðóãîé
|
||||
$ub = mysql_fetch_array(mysql_query('SELECT * FROM `bank` WHERE `id` = "' . mysql_real_escape_string((int)$_POST['num2']) . '" LIMIT 1'));
|
||||
$ub = mysql_fetch_array(
|
||||
mysql_query(
|
||||
'SELECT * FROM `bank` WHERE `id` = "' . mysql_real_escape_string(
|
||||
(int)$_POST['num2']
|
||||
) . '" LIMIT 1'
|
||||
)
|
||||
);
|
||||
if (isset($ub['id']) && $ub['id'] != $u->bank['id']) {
|
||||
$ut = mysql_fetch_array(mysql_query('SELECT `id`,`level`,`city`,`room`,`login` FROM `users` WHERE `id` = "' . mysql_real_escape_string($ub['uid']) . '" LIMIT 1'));
|
||||
$ut = mysql_fetch_array(
|
||||
mysql_query(
|
||||
'SELECT `id`,`level`,`city`,`room`,`login` FROM `users` WHERE `id` = "' . mysql_real_escape_string(
|
||||
$ub['uid']
|
||||
) . '" LIMIT 1'
|
||||
)
|
||||
);
|
||||
if ($ut['level'] >= 0 || $ut['id'] == $u->info['id'] || $u->info['admin'] > 0) {
|
||||
$mn = floor((int)($_POST['tansfer_sum2'] * 100));
|
||||
$mn = round(($mn / 100), 2);
|
||||
@ -150,29 +221,67 @@ if ($u->room['file'] == 'an/bank') {
|
||||
if ($mn < 0.01 || $mn > 1000000000) {
|
||||
$re2 = 'Íåâåðíî óêàçàíà ñóììà';
|
||||
} else {
|
||||
$upd = mysql_query('UPDATE `bank` SET `money2` = "' . mysql_real_escape_string($u->bank['money2'] - $mn) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1');
|
||||
$upd = mysql_query(
|
||||
'UPDATE `bank` SET `money2` = "' . mysql_real_escape_string(
|
||||
$u->bank['money2'] - $mn
|
||||
) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1'
|
||||
);
|
||||
if ($upd) {
|
||||
$u->bank['money2'] -= $mn;
|
||||
$ub['money2'] += $mn - $prc;
|
||||
|
||||
mysql_query('UPDATE `users` SET `catch` = `catch` + "' . floor($mn - $prc) . '" WHERE `id` = "' . $ut['id'] . '" LIMIT 1');
|
||||
mysql_query('UPDATE `users` SET `frg` = `frg` + ' . floor($mn) . ' WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
|
||||
mysql_query(
|
||||
'UPDATE `users` SET `catch` = `catch` + "' . floor(
|
||||
$mn - $prc
|
||||
) . '" WHERE `id` = "' . $ut['id'] . '" LIMIT 1'
|
||||
);
|
||||
mysql_query(
|
||||
'UPDATE `users` SET `frg` = `frg` + ' . floor(
|
||||
$mn
|
||||
) . ' WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
|
||||
);
|
||||
|
||||
mysql_query('UPDATE `bank` SET `money2` = "' . mysql_real_escape_string($ub['money2']) . '" WHERE `id` = "' . $ub['id'] . '" LIMIT 1');
|
||||
$re2 = 'Âû óäà÷íî ïåðåâåëè <b>' . ($mn - $prc) . ' åêð.</b> (êîìèññèÿ <b>' . $prc . ' åêð.</b>) íà ñ÷åò ¹' . getNum($ub['id']) . ' ïåðñîíàæó "<b>' . $ut['login'] . '</b>"';
|
||||
$u->addDelo(3, $ut['id'], 'Ïîëó÷åíî <b>' . ($mn - $prc) . ' åêð.</b> ñî ñ÷åòà ¹' . getNum($u->bank['id']) . ' îò ïåðñîíàæà "' . $u->info['login'] . '", êîìèññèÿ <b>' . $prc . ' åêð.</b> <i>(Èòîãî: ' . $ub['money1'] . ' êð., ' . $ub['money2'] . ' åêð.)</i>', time(), $ut['city'], 'Bank.System', mysql_real_escape_string($mn - $prc), 0, $ub['id']);
|
||||
$u->addDelo(3, $u->info['id'], 'Ïåðåäàíî <b>' . ($mn - $prc) . ' åêð.</b> íà ñ÷åò ¹' . getNum($ub['id']) . ' ïåðñîíàæó "' . $ut['login'] . '", êîìèññèÿ <b>' . $prc . ' åêð.</b> <i>(Èòîãî: ' . $u->bank['money1'] . ' êð., ' . $u->bank['money2'] . ' åêð.)</i>', time(), $u->info['city'], 'Bank.System', 0, mysql_real_escape_string($mn), $u->bank['id']);
|
||||
mysql_query(
|
||||
'UPDATE `bank` SET `money2` = "' . mysql_real_escape_string(
|
||||
$ub['money2']
|
||||
) . '" WHERE `id` = "' . $ub['id'] . '" LIMIT 1'
|
||||
);
|
||||
$re2 = 'Âû óäà÷íî ïåðåâåëè <b>' . ($mn - $prc) . ' åêð.</b> (êîìèññèÿ <b>' . $prc . ' åêð.</b>) íà ñ÷åò ¹' . getNum(
|
||||
$ub['id']
|
||||
) . ' ïåðñîíàæó "<b>' . $ut['login'] . '</b>"';
|
||||
$u->addDelo(
|
||||
3, $ut['id'], 'Ïîëó÷åíî <b>' . ($mn - $prc) . ' åêð.</b> ñî ñ÷åòà ¹' . getNum(
|
||||
$u->bank['id']
|
||||
) . ' îò ïåðñîíàæà "' . $u->info['login'] . '", êîìèññèÿ <b>' . $prc . ' åêð.</b> <i>(Èòîãî: ' . $ub['money1'] . ' êð., ' . $ub['money2'] . ' åêð.)</i>',
|
||||
time(), $ut['city'], 'Bank.System', mysql_real_escape_string($mn - $prc), 0,
|
||||
$ub['id']
|
||||
);
|
||||
$u->addDelo(
|
||||
3, $u->info['id'],
|
||||
'Ïåðåäàíî <b>' . ($mn - $prc) . ' åêð.</b> íà ñ÷åò ¹' . getNum(
|
||||
$ub['id']
|
||||
) . ' ïåðñîíàæó "' . $ut['login'] . '", êîìèññèÿ <b>' . $prc . ' åêð.</b> <i>(Èòîãî: ' . $u->bank['money1'] . ' êð., ' . $u->bank['money2'] . ' åêð.)</i>',
|
||||
time(), $u->info['city'], 'Bank.System', 0, mysql_real_escape_string($mn),
|
||||
$u->bank['id']
|
||||
);
|
||||
$log = '"' . $u->info['login'] . '" [' . $u->info['level'] . '] ïåðåâåë ñî ñâîåãî áàíêîâñêîãî ñ÷åòà ¹' . $u->bank['id'] . ' íà ñ÷åò ¹' . $ub['id'] . ' ê ïåðñîíàæó "' . $ut['login'] . '" [' . $ut['level'] . '] ' . ($mn - $prc) . ' åêð.';
|
||||
$u->addDelo(1, $u->info['id'], $log, time(), $u->info['city'], 'Bank.System', 0, 0, '');
|
||||
$u->addDelo(
|
||||
1, $u->info['id'], $log, time(), $u->info['city'], 'Bank.System', 0, 0, ''
|
||||
);
|
||||
$u->addDelo(1, $ut['id'], $log, time(), $ut['city'], 'Bank.System', 0, 0, '');
|
||||
if ($ut['id'] != $u->info['id']) {
|
||||
$alg = '';
|
||||
if ($u->info['align'] == 50) {
|
||||
$alg = '<img src=https://img.new-combats.com/i/align/align50.gif >';
|
||||
}
|
||||
$text = '"' . $alg . '[login:' . $u->info['login'] . ']" ïåðåâåë' . ($u->info['sex'] == 0 ? "" : "à") . ' âàì <b>' . ($mn - $prc) . ' åêð.</b> ñî ñâîåãî áàíêîâñêîãî ñ÷åòà ¹' . getNum($u->bank['id']) . ' íà âàø áàíêîâñêèé ñ÷åò ¹' . getNum($ub['id']) . '.';
|
||||
$text = '"' . $alg . '[login:' . $u->info['login'] . ']" ïåðåâåë' . ($u->info['sex'] == 0 ? "" : "à") . ' âàì <b>' . ($mn - $prc) . ' åêð.</b> ñî ñâîåãî áàíêîâñêîãî ñ÷åòà ¹' . getNum(
|
||||
$u->bank['id']
|
||||
) . ' íà âàø áàíêîâñêèé ñ÷åò ¹' . getNum($ub['id']) . '.';
|
||||
|
||||
mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES ('" . $ut['city'] . "','" . $ut['room'] . "','','" . $ut['login'] . "','" . $text . "','" . time() . "','12','0','1')");
|
||||
mysql_query(
|
||||
"INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES ('" . $ut['city'] . "','" . $ut['room'] . "','','" . $ut['login'] . "','" . $text . "','" . time(
|
||||
) . "','12','0','1')"
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$re2 = 'Íå óäàëîñü âûïîëíèòü îïåðàöèþ';
|
||||
@ -190,9 +299,21 @@ if ($u->room['file'] == 'an/bank') {
|
||||
} elseif (isset($_POST['transfer_kredit']) && $u->info['align'] != 2) {
|
||||
//ïåðåâîä êðåäèòîâ ñ îäíîãî ñ÷åòà íà äðóãîé
|
||||
if ($u->info['level'] >= 4 || $u->info['admin'] > 0) {
|
||||
$ub = mysql_fetch_array(mysql_query('SELECT * FROM `bank` WHERE `id` = "' . mysql_real_escape_string((int)$_POST['num']) . '" LIMIT 1'));
|
||||
$ub = mysql_fetch_array(
|
||||
mysql_query(
|
||||
'SELECT * FROM `bank` WHERE `id` = "' . mysql_real_escape_string(
|
||||
(int)$_POST['num']
|
||||
) . '" LIMIT 1'
|
||||
)
|
||||
);
|
||||
if (isset($ub['id']) && $ub['id'] != $u->bank['id']) {
|
||||
$ut = mysql_fetch_array(mysql_query('SELECT `id`,`level`,`city`,`room`,`login` FROM `users` WHERE `id` = "' . mysql_real_escape_string($ub['uid']) . '" LIMIT 1'));
|
||||
$ut = mysql_fetch_array(
|
||||
mysql_query(
|
||||
'SELECT `id`,`level`,`city`,`room`,`login` FROM `users` WHERE `id` = "' . mysql_real_escape_string(
|
||||
$ub['uid']
|
||||
) . '" LIMIT 1'
|
||||
)
|
||||
);
|
||||
if ($ut['level'] >= 4 || $ut['id'] == $u->info['id'] || $u->info['admin'] > 0) {
|
||||
$mn = floor((int)($_POST['tansfer_sum'] * 100));
|
||||
$mn = round(($mn / 100), 2);
|
||||
@ -202,20 +323,51 @@ if ($u->room['file'] == 'an/bank') {
|
||||
if ($mn < 0.01 || $mn > 1000000000) {
|
||||
$re2 = 'Íåâåðíî óêàçàíà ñóììà';
|
||||
} else {
|
||||
$upd = mysql_query('UPDATE `bank` SET `money1` = "' . mysql_real_escape_string($u->bank['money1'] - $mn) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1');
|
||||
$upd = mysql_query(
|
||||
'UPDATE `bank` SET `money1` = "' . mysql_real_escape_string(
|
||||
$u->bank['money1'] - $mn
|
||||
) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1'
|
||||
);
|
||||
if ($upd) {
|
||||
$u->bank['money1'] -= $mn;
|
||||
$ub['money1'] += $mn - $prc;
|
||||
mysql_query('UPDATE `bank` SET `money1` = "' . mysql_real_escape_string($ub['money1']) . '" WHERE `id` = "' . $ub['id'] . '" LIMIT 1');
|
||||
$re2 = 'Âû óäà÷íî ïåðåâåëè <b>' . ($mn - $prc) . ' êð.</b> (êîìèññèÿ <b>' . $prc . ' êð.</b>) íà ñ÷åò ¹' . getNum($ub['id']) . ' ïåðñîíàæó "<b>' . $ut['login'] . '</b>"';
|
||||
$u->addDelo(3, $ut['id'], 'Ïîëó÷åíî <b>' . ($mn - $prc) . ' êð.</b> ñî ñ÷åòà ¹' . getNum($u->bank['id']) . ' îò ïåðñîíàæà "' . $u->info['login'] . '", êîìèññèÿ <b>' . $prc . ' êð.</b> <i>(Èòîãî: ' . $ub['money1'] . ' êð., ' . $ub['money2'] . ' åêð.)</i>', time(), $ut['city'], 'Bank.System', mysql_real_escape_string($mn - $prc), 0, $ub['id']);
|
||||
$u->addDelo(3, $u->info['id'], 'Ïåðåäàíî <b>' . ($mn - $prc) . ' êð.</b> íà ñ÷åò ¹' . getNum($ub['id']) . ' ïåðñîíàæó "' . $ut['login'] . '", êîìèññèÿ <b>' . $prc . ' êð.</b> <i>(Èòîãî: ' . $u->bank['money1'] . ' êð., ' . $u->bank['money2'] . ' åêð.)</i>', time(), $u->info['city'], 'Bank.System', 0, mysql_real_escape_string($mn), $u->bank['id']);
|
||||
mysql_query(
|
||||
'UPDATE `bank` SET `money1` = "' . mysql_real_escape_string(
|
||||
$ub['money1']
|
||||
) . '" WHERE `id` = "' . $ub['id'] . '" LIMIT 1'
|
||||
);
|
||||
$re2 = 'Âû óäà÷íî ïåðåâåëè <b>' . ($mn - $prc) . ' êð.</b> (êîìèññèÿ <b>' . $prc . ' êð.</b>) íà ñ÷åò ¹' . getNum(
|
||||
$ub['id']
|
||||
) . ' ïåðñîíàæó "<b>' . $ut['login'] . '</b>"';
|
||||
$u->addDelo(
|
||||
3, $ut['id'],
|
||||
'Ïîëó÷åíî <b>' . ($mn - $prc) . ' êð.</b> ñî ñ÷åòà ¹' . getNum(
|
||||
$u->bank['id']
|
||||
) . ' îò ïåðñîíàæà "' . $u->info['login'] . '", êîìèññèÿ <b>' . $prc . ' êð.</b> <i>(Èòîãî: ' . $ub['money1'] . ' êð., ' . $ub['money2'] . ' åêð.)</i>',
|
||||
time(), $ut['city'], 'Bank.System', mysql_real_escape_string($mn - $prc), 0,
|
||||
$ub['id']
|
||||
);
|
||||
$u->addDelo(
|
||||
3, $u->info['id'],
|
||||
'Ïåðåäàíî <b>' . ($mn - $prc) . ' êð.</b> íà ñ÷åò ¹' . getNum(
|
||||
$ub['id']
|
||||
) . ' ïåðñîíàæó "' . $ut['login'] . '", êîìèññèÿ <b>' . $prc . ' êð.</b> <i>(Èòîãî: ' . $u->bank['money1'] . ' êð., ' . $u->bank['money2'] . ' åêð.)</i>',
|
||||
time(), $u->info['city'], 'Bank.System', 0, mysql_real_escape_string($mn),
|
||||
$u->bank['id']
|
||||
);
|
||||
$log = '"' . $u->info['login'] . '" [' . $u->info['level'] . '] ïåðåâåë ñî ñâîåãî áàíêîâñêîãî ñ÷åòà ¹' . $u->bank['id'] . ' íà ñ÷åò ¹' . $ub['id'] . ' ê ïåðñîíàæó "' . $ut['login'] . '" [' . $ut['level'] . '] ' . ($mn - $prc) . ' êð. Äîïîëíèòåëüíî ñíÿòî ' . $prc . ' êð. çà óñëóãè áàíêà.';
|
||||
$u->addDelo(1, $u->info['id'], $log, time(), $u->info['city'], 'Bank.System', 0, 0, '');
|
||||
$u->addDelo(
|
||||
1, $u->info['id'], $log, time(), $u->info['city'], 'Bank.System', 0, 0, ''
|
||||
);
|
||||
$u->addDelo(1, $ut['id'], $log, time(), $ut['city'], 'Bank.System', 0, 0, '');
|
||||
if ($ut['id'] != $u->info['id']) {
|
||||
$text = '"[login:' . $u->info['login'] . ']" ïåðåâåë' . ($u->info['sex'] == 0 ? "" : "à") . ' âàì <b>' . ($mn - $prc) . ' êð.</b> ñî ñâîåãî áàíêîâñêîãî ñ÷åòà ¹' . getNum($u->bank['id']) . ' íà âàø áàíêîâñêèé ñ÷åò ¹' . getNum($ub['id']) . '.';
|
||||
mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'" . $ut['city'] . "','" . $ut['room'] . "','','" . $ut['login'] . "','" . $text . "','" . time() . "','6','0','1')");
|
||||
$text = '"[login:' . $u->info['login'] . ']" ïåðåâåë' . ($u->info['sex'] == 0 ? "" : "à") . ' âàì <b>' . ($mn - $prc) . ' êð.</b> ñî ñâîåãî áàíêîâñêîãî ñ÷åòà ¹' . getNum(
|
||||
$u->bank['id']
|
||||
) . ' íà âàø áàíêîâñêèé ñ÷åò ¹' . getNum($ub['id']) . '.';
|
||||
mysql_query(
|
||||
"INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'" . $ut['city'] . "','" . $ut['room'] . "','','" . $ut['login'] . "','" . $text . "','" . time(
|
||||
) . "','6','0','1')"
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$re2 = 'Íå óäàëîñü âûïîëíèòü îïåðàöèþ';
|
||||
@ -233,18 +385,25 @@ if ($u->room['file'] == 'an/bank') {
|
||||
} else {
|
||||
$re2 = 'Ïåðåäà÷à êðåäèòîâ âîçìîæíà òîëüêî ñ 4-ãî óðîâíÿ';
|
||||
}
|
||||
} elseif ($u->info['align'] != 2 && $u->info['haos'] < time() && $u->info['haos'] != 1 && $u->info['align'] != 50 && isset($_POST['convert_kredit']) && 1 == 2) {
|
||||
} elseif ($u->info['align'] != 2 && $u->info['haos'] < time(
|
||||
) && $u->info['haos'] != 1 && $u->info['align'] != 50 && isset($_POST['convert_kredit']) && 1 == 2) {
|
||||
//îáìåíÿòü êð. íà åêð.
|
||||
if ($u->info['palpro'] > time()) {
|
||||
$mn = ceil((int)($_POST['convert_sum2'] * 100));
|
||||
$mn = round(($mn / 100), 2);
|
||||
$mne = round($mn / $noc, 2);
|
||||
$mn = round(($mn / 100 * 103 + 5), 2);
|
||||
$sm = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "bank_kr_to_ekr_[' . date('d.m.Y', time()) . ']" ORDER BY `id` DESC LIMIT 1', 1);
|
||||
$sm = $u->testAction(
|
||||
'`uid` = "' . $u->info['id'] . '" AND `vars` = "bank_kr_to_ekr_[' . date(
|
||||
'd.m.Y', time()
|
||||
) . ']" ORDER BY `id` DESC LIMIT 1', 1
|
||||
);
|
||||
$sm_lim = 50;
|
||||
if (isset($sm['id']) && $sm['vals'] + $mne > $sm_lim) {
|
||||
if ($sm['vals'] < $sm_lim) {
|
||||
$re2 = 'Íà ñåãîäíÿ Âû ìîæåòå îáìåíÿòü åùå íà <b>' . ($sm_lim - $sm['vals']) . ' åêð.</b>. (Ïðèìåðíî ' . round((($sm_lim - $sm['vals']) * $noc), 2) . ' êð.), òåêóùèé îáìåí íà <b>' . $mne . ' åêð.</b>.';
|
||||
$re2 = 'Íà ñåãîäíÿ Âû ìîæåòå îáìåíÿòü åùå íà <b>' . ($sm_lim - $sm['vals']) . ' åêð.</b>. (Ïðèìåðíî ' . round(
|
||||
(($sm_lim - $sm['vals']) * $noc), 2
|
||||
) . ' êð.), òåêóùèé îáìåí íà <b>' . $mne . ' åêð.</b>.';
|
||||
} else {
|
||||
$re2 = 'Íà ñåãîäíÿ Âû èñ÷åðïàëè ñâîé ëèìèò îáìåíà êð. íà åêð. (' . $sm_lim . ' åêð.)';
|
||||
}
|
||||
@ -253,23 +412,44 @@ if ($u->room['file'] == 'an/bank') {
|
||||
if (!isset($sm['id'])) {
|
||||
$u->addAction(time(), 'bank_kr_to_ekr_[' . date('d.m.Y') . ']', $mne);
|
||||
} else {
|
||||
mysql_query('UPDATE `actions` SET `vals` = "' . ($sm['vals'] + $mne) . '" WHERE `id` = "' . $sm['id'] . '" LIMIT 1');
|
||||
mysql_query(
|
||||
'UPDATE `actions` SET `vals` = "' . ($sm['vals'] + $mne) . '" WHERE `id` = "' . $sm['id'] . '" LIMIT 1'
|
||||
);
|
||||
}
|
||||
$re2 = 'Âû óñïåøíî îáìåíÿëè <b>' . $mn . ' êð.</b> íà <b>' . $mne . ' åêð.</b>';
|
||||
$u->bank['money1'] -= $mn;
|
||||
$u->bank['money2'] += $mne;
|
||||
|
||||
mysql_query('UPDATE `users` SET `catch` = `catch` + "' . round($mne, 2) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
|
||||
mysql_query(
|
||||
'UPDATE `users` SET `catch` = `catch` + "' . round(
|
||||
$mne, 2
|
||||
) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
|
||||
);
|
||||
|
||||
mysql_query('UPDATE `bank` SET `money1` = "' . mysql_real_escape_string($u->bank['money1']) . '", `money2` = "' . mysql_real_escape_string($u->bank['money2']) . '" WHERE `id` = "' . mysql_real_escape_string($u->bank['id']) . '" LIMIT 1');
|
||||
mysql_query(
|
||||
'UPDATE `bank` SET `money1` = "' . mysql_real_escape_string(
|
||||
$u->bank['money1']
|
||||
) . '", `money2` = "' . mysql_real_escape_string(
|
||||
$u->bank['money2']
|
||||
) . '" WHERE `id` = "' . mysql_real_escape_string($u->bank['id']) . '" LIMIT 1'
|
||||
);
|
||||
$log = '"' . $u->info['login'] . '" [' . $u->info['level'] . '] îáìåíÿë <b>' . $mn . ' êð.</b> íà <b>' . $mne . ' åêð.</b>, Áàíêîâñêèé ñ÷åò ¹' . $u->bank['id'] . '.';
|
||||
$u->addDelo(1, $u->info['id'], $log, time(), $u->info['city'], 'Bank.System', 0, 0, '');
|
||||
$u->addDelo(3, $u->info['id'], 'Âû óñïåøíî îáìåíÿëè <b>' . ceil((int)($_POST['convert_sum2'] * 100 / 100)) . ' êð.</b> íà <b>' . $mne . ' åêð.</b>, êîìèññèÿ <b>' . round((ceil((int)($_POST['convert_sum2'] * 100 / 100)) / 100 * 3 + 5), 2) . ' êð.</b> <i>(Èòîãî: ' . $u->bank['money1'] . ' êð., ' . $u->bank['money2'] . ' åêð.)</i>', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']);
|
||||
$u->addDelo(
|
||||
3, $u->info['id'], 'Âû óñïåøíî îáìåíÿëè <b>' . ceil(
|
||||
(int)($_POST['convert_sum2'] * 100 / 100)
|
||||
) . ' êð.</b> íà <b>' . $mne . ' åêð.</b>, êîìèññèÿ <b>' . round(
|
||||
(ceil((int)($_POST['convert_sum2'] * 100 / 100)) / 100 * 3 + 5), 2
|
||||
) . ' êð.</b> <i>(Èòîãî: ' . $u->bank['money1'] . ' êð., ' . $u->bank['money2'] . ' åêð.)</i>',
|
||||
time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']
|
||||
);
|
||||
} else {
|
||||
$re2 = 'Ó âàñ íåò <b>' . $mn . ' êð.</b> íà ñ÷åòå';
|
||||
}
|
||||
} else {
|
||||
$re2 = 'Ìèíèìàëüíàÿ ñóììà äëÿ îáìåíà ñîñòàâëÿåò ' . round((0.01 * ($noc * 1.03) + 5), 2) . ' êð.';
|
||||
$re2 = 'Ìèíèìàëüíàÿ ñóììà äëÿ îáìåíà ñîñòàâëÿåò ' . round(
|
||||
(0.01 * ($noc * 1.03) + 5), 2
|
||||
) . ' êð.';
|
||||
}
|
||||
} else {
|
||||
$re2 = 'Âû äîëæíû ïðîéòè ïðîâåðêó íà ÷èñòîòó ó Ïàëàäèíîâ èëè Òàðìàíîâ.';
|
||||
@ -282,11 +462,22 @@ if ($u->room['file'] == 'an/bank') {
|
||||
if ($mn < 0.01 || $mn > 1000000000) {
|
||||
$re2 = 'Íåâåðíî óêàçàíà ñóììà';
|
||||
} else {
|
||||
$upd = mysql_query('UPDATE `bank` SET `money1` = "' . mysql_real_escape_string($u->bank['money1'] + ($mn * $con)) . '",`money2` = "' . mysql_real_escape_string($u->bank['money2'] - $mn) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1');
|
||||
$upd = mysql_query(
|
||||
'UPDATE `bank` SET `money1` = "' . mysql_real_escape_string(
|
||||
$u->bank['money1'] + ($mn * $con)
|
||||
) . '",`money2` = "' . mysql_real_escape_string(
|
||||
$u->bank['money2'] - $mn
|
||||
) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1'
|
||||
);
|
||||
if ($upd) {
|
||||
$u->bank['money1'] += $mn * $con;
|
||||
$u->bank['money2'] -= $mn;
|
||||
$u->addDelo(3, $u->info['id'], 'Âû îáìåíÿëè <b>' . $mn . ' åêð.</b> íà <b>' . ($mn * $con) . ' êð.</b>, êîìèññèÿ <b>0 êð.</b> <i>(Èòîãî: ' . $u->bank['money1'] . ' êð., ' . $u->bank['money2'] . ' åêð.)</i>', time(), $u->info['city'], 'Bank.System', 0, mysql_real_escape_string($mn * $con), $u->bank['id']);
|
||||
$u->addDelo(
|
||||
3, $u->info['id'],
|
||||
'Âû îáìåíÿëè <b>' . $mn . ' åêð.</b> íà <b>' . ($mn * $con) . ' êð.</b>, êîìèññèÿ <b>0 êð.</b> <i>(Èòîãî: ' . $u->bank['money1'] . ' êð., ' . $u->bank['money2'] . ' åêð.)</i>',
|
||||
time(), $u->info['city'], 'Bank.System', 0, mysql_real_escape_string($mn * $con),
|
||||
$u->bank['id']
|
||||
);
|
||||
$re2 = 'Âû óäà÷íî îáìåíÿëè <b>' . $mn . ' åêð.</b> íà <b>' . ($mn * $con) . ' êð.</b>';
|
||||
} else {
|
||||
$re2 = 'Íå óäàëîñü âûïîëíèòü îïåðàöèþ';
|
||||
@ -303,12 +494,24 @@ if ($u->room['file'] == 'an/bank') {
|
||||
if ($mn < 0.01 || $mn > 1000000000) {
|
||||
$re2 = 'Íåâåðíî óêàçàíà ñóììà';
|
||||
} else {
|
||||
$upd = mysql_query('UPDATE `users` SET `money` = "' . mysql_real_escape_string($u->info['money'] + $mn) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
|
||||
$upd = mysql_query(
|
||||
'UPDATE `users` SET `money` = "' . mysql_real_escape_string(
|
||||
$u->info['money'] + $mn
|
||||
) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
|
||||
);
|
||||
if ($upd) {
|
||||
$u->bank['money1'] -= $mn;
|
||||
$u->info['money'] += $mn;
|
||||
mysql_query('UPDATE `bank` SET `money1` = "' . mysql_real_escape_string($u->bank['money1']) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1');
|
||||
$u->addDelo(3, $u->info['id'], 'Âû ñíÿëè ñî ñ÷åòà <b>' . $mn . ' êð.</b>, êîìèññèÿ <b>0 êð.</b> <i>(Èòîãî: ' . $u->bank['money1'] . ' êð., ' . $u->bank['money2'] . ' åêð.)</i>', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']);
|
||||
mysql_query(
|
||||
'UPDATE `bank` SET `money1` = "' . mysql_real_escape_string(
|
||||
$u->bank['money1']
|
||||
) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1'
|
||||
);
|
||||
$u->addDelo(
|
||||
3, $u->info['id'],
|
||||
'Âû ñíÿëè ñî ñ÷åòà <b>' . $mn . ' êð.</b>, êîìèññèÿ <b>0 êð.</b> <i>(Èòîãî: ' . $u->bank['money1'] . ' êð., ' . $u->bank['money2'] . ' åêð.)</i>',
|
||||
time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']
|
||||
);
|
||||
$re2 = 'Âû óäà÷íî ñíÿëè ñî ñ÷åòà <b>' . $mn . ' êð.</b>';
|
||||
} else {
|
||||
$re2 = 'Íå óäàëîñü âûïîëíèòü îïåðàöèþ';
|
||||
@ -325,12 +528,24 @@ if ($u->room['file'] == 'an/bank') {
|
||||
if ($mn < 0.01 || $mn > 1000000000) {
|
||||
$re2 = 'Íåâåðíî óêàçàíà ñóììà';
|
||||
} else {
|
||||
$upd = mysql_query('UPDATE `users` SET `money` = "' . mysql_real_escape_string($u->info['money'] - $mn) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
|
||||
$upd = mysql_query(
|
||||
'UPDATE `users` SET `money` = "' . mysql_real_escape_string(
|
||||
$u->info['money'] - $mn
|
||||
) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
|
||||
);
|
||||
if ($upd) {
|
||||
$u->bank['money1'] += $mn;
|
||||
$u->info['money'] -= $mn;
|
||||
mysql_query('UPDATE `bank` SET `money1` = "' . mysql_real_escape_string($u->bank['money1']) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1');
|
||||
$u->addDelo(3, $u->info['id'], 'Âû ïîëîæèëè íà ñ÷åò <b>' . $mn . ' êð.</b>, êîìèññèÿ <b>0 êð.</b> <i>(Èòîãî: ' . $u->bank['money1'] . ' êð., ' . $u->bank['money2'] . ' åêð.)</i>', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']);
|
||||
mysql_query(
|
||||
'UPDATE `bank` SET `money1` = "' . mysql_real_escape_string(
|
||||
$u->bank['money1']
|
||||
) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1'
|
||||
);
|
||||
$u->addDelo(
|
||||
3, $u->info['id'],
|
||||
'Âû ïîëîæèëè íà ñ÷åò <b>' . $mn . ' êð.</b>, êîìèññèÿ <b>0 êð.</b> <i>(Èòîãî: ' . $u->bank['money1'] . ' êð., ' . $u->bank['money2'] . ' åêð.)</i>',
|
||||
time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']
|
||||
);
|
||||
$re2 = 'Âû óäà÷íî ïîëîæèëè íà ñâîé ñ÷åò <b>' . $mn . ' êð.</b>';
|
||||
} else {
|
||||
$re2 = 'Íå óäàëîñü âûïîëíèòü îïåðàöèþ';
|
||||
@ -341,7 +556,10 @@ if ($u->room['file'] == 'an/bank') {
|
||||
}
|
||||
} elseif (isset($_POST['change_psw2'])) {
|
||||
//ñìåíà ïàðîëÿ ñ÷åòà
|
||||
$sm = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vals` = "id=' . $u->bank['id'] . '&new_pass=' . $u->bank['pass'] . '" AND `vars` = "bank_new_pass" AND `time` > "' . (time() - 24 * 60 * 60) . '" LIMIT 1', 1);
|
||||
$sm = $u->testAction(
|
||||
'`uid` = "' . $u->info['id'] . '" AND `vals` = "id=' . $u->bank['id'] . '&new_pass=' . $u->bank['pass'] . '" AND `vars` = "bank_new_pass" AND `time` > "' . (time(
|
||||
) - 24 * 60 * 60) . '" LIMIT 1', 1
|
||||
);
|
||||
if ($_POST['new_psw1'] != $_POST['new_psw2']) {
|
||||
$re2 = 'Ïàðîëè íå ñîâïàäàþò';
|
||||
} elseif (iconv_strlen($_POST['new_psw1']) < 6 || iconv_strlen($_POST['new_psw1']) > 32) {
|
||||
@ -350,12 +568,23 @@ if ($u->room['file'] == 'an/bank') {
|
||||
$re2 = 'Íåëüçÿ ìåíÿòü ïàðîëü ÷àùå îäíîãî ðàçà â äåíü';
|
||||
} else {
|
||||
//ìåíÿåì
|
||||
$upd = mysql_query('UPDATE `bank` SET `pass` = "' . mysql_real_escape_string($_POST['new_psw1']) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1');
|
||||
$upd = mysql_query(
|
||||
'UPDATE `bank` SET `pass` = "' . mysql_real_escape_string(
|
||||
$_POST['new_psw1']
|
||||
) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1'
|
||||
);
|
||||
if ($upd) {
|
||||
$u->addAction(time(), 'bank_new_pass', 'id=' . $u->bank['id'] . '&new_pass=' . $_POST['new_psw1'] . '');
|
||||
$u->addAction(
|
||||
time(), 'bank_new_pass', 'id=' . $u->bank['id'] . '&new_pass=' . $_POST['new_psw1'] . ''
|
||||
);
|
||||
$u->bank['pass'] = $_POST['new_psw1'];
|
||||
$re2 = 'Ïàðîëü îò ñ÷åòà ¹<b>' . getNum($u->bank['id']) . '</b> áûë óñïåøíî èçìåíåí<br>Íîâûé ïàðîëü: <b>' . $u->bank['pass'] . '</b>';
|
||||
$u->addDelo(3, $u->info['id'], 'Áûë èçìåíåí ïàðîëü îò ñ÷åòà.', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']);
|
||||
$re2 = 'Ïàðîëü îò ñ÷åòà ¹<b>' . getNum(
|
||||
$u->bank['id']
|
||||
) . '</b> áûë óñïåøíî èçìåíåí<br>Íîâûé ïàðîëü: <b>' . $u->bank['pass'] . '</b>';
|
||||
$u->addDelo(
|
||||
3, $u->info['id'], 'Áûë èçìåíåí ïàðîëü îò ñ÷åòà.', time(), $u->info['city'], 'Bank.System',
|
||||
0, 0, $u->bank['id']
|
||||
);
|
||||
} else {
|
||||
$re2 = 'Âàì îòêàçàëè â ñìåíå ïàðîëÿ';
|
||||
}
|
||||
@ -453,7 +682,10 @@ if ($u->room['file'] == 'an/bank') {
|
||||
id="greyText"
|
||||
class="menutop"
|
||||
onclick="location='main.php?loc=2.180.0.236&rnd=<? echo $code; ?>';"
|
||||
title="<? thisInfRm('2.180.0.236', 1); ?>">Ñòðàøèëêèíà
|
||||
title="<? thisInfRm(
|
||||
'2.180.0.236',
|
||||
1
|
||||
); ?>">Ñòðàøèëêèíà
|
||||
óëèöà</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -562,7 +794,9 @@ if ($u->room['file'] == 'an/bank') {
|
||||
<TD>Íîìåð ñ÷åòà</td>
|
||||
<TD colspan=2><select name="bank" size=0 style="width: 90px">
|
||||
<?
|
||||
$sp = mysql_query('SELECT * FROM `bank` WHERE `uid` = "' . $u->info['id'] . '" AND `block` = "0"');
|
||||
$sp = mysql_query(
|
||||
'SELECT * FROM `bank` WHERE `uid` = "' . $u->info['id'] . '" AND `block` = "0"'
|
||||
);
|
||||
while ($pl = mysql_fetch_array($sp)) {
|
||||
?>
|
||||
<option value="<? echo $pl['id']; ?>"
|
||||
@ -756,7 +990,8 @@ if ($u->room['file'] == 'an/bank') {
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
<? if ($u->info['align'] != 2 && $u->info['haos'] < time() && $u->info['haos'] != 1 && $u->info['align'] != 50 && 1 == 2) { ?>
|
||||
<? if ($u->info['align'] != 2 && $u->info['haos'] < time(
|
||||
) && $u->info['haos'] != 1 && $u->info['align'] != 50 && 1 == 2) { ?>
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<fieldset style="background-color:#DDEAD7">
|
||||
@ -855,7 +1090,9 @@ if ($u->room['file'] == 'an/bank') {
|
||||
<legend><b>Êóðñ åâðîêðåäèòà ê ìèðîâîé âàëþòå</b></legend>
|
||||
<table width="100%" border="0" cellpadding="2" cellspacing="0">
|
||||
<?
|
||||
$pl = mysql_fetch_array(mysql_query('SELECT * FROM `bank_table` ORDER BY `time` DESC LIMIT 1'));
|
||||
$pl = mysql_fetch_array(
|
||||
mysql_query('SELECT * FROM `bank_table` ORDER BY `time` DESC LIMIT 1')
|
||||
);
|
||||
if (isset($pl['id'])) {
|
||||
?>
|
||||
<tr>
|
||||
@ -873,13 +1110,15 @@ if ($u->room['file'] == 'an/bank') {
|
||||
['UAH', 'óêð. ãðèâåí'],
|
||||
['BYR', 'áåëîðóññêèõ ðóáëåé'],
|
||||
['AZN', 'àçåðáàéäæàíñêèõ ìàíàò'],
|
||||
['GBP', 'àíãë. ôóíòîâ ñòåðëèíãîâ']
|
||||
['GBP', 'àíãë. ôóíòîâ ñòåðëèíãîâ'],
|
||||
];
|
||||
while ($i < count($true)) {
|
||||
?>
|
||||
<tr>
|
||||
<td><span>1 åêð. = </span><span
|
||||
style="display:inline-block;width:100px"><b><?= round(($pl['cur'] / $pl[$true[$i][0]]), 4) ?></b></span><span><?= $true[$i][1] ?></span>
|
||||
style="display:inline-block;width:100px"><b><?= round(
|
||||
($pl['cur'] / $pl[$true[$i][0]]), 4
|
||||
) ?></b></span><span><?= $true[$i][1] ?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<?
|
||||
@ -904,12 +1143,16 @@ if ($u->room['file'] == 'an/bank') {
|
||||
<legend><b>Ïîñëåäíèå îïåðàöèè</b></legend>
|
||||
<table width="100%" border="0" cellpadding="2" cellspacing="0">
|
||||
<?
|
||||
$sp = mysql_query('SELECT * FROM `users_delo` WHERE `uid` = "' . $u->info['id'] . '" AND `dop` = "' . $u->bank['id'] . '" AND `type` = "3" ORDER BY `time` DESC LIMIT 21');
|
||||
$sp = mysql_query(
|
||||
'SELECT * FROM `users_delo` WHERE `uid` = "' . $u->info['id'] . '" AND `dop` = "' . $u->bank['id'] . '" AND `type` = "3" ORDER BY `time` DESC LIMIT 21'
|
||||
);
|
||||
while ($pl = mysql_fetch_array($sp)) {
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<small><? echo '<font color="green">' . date('d.m.Y H:i', $pl['time']) . '</font> ';
|
||||
<small><? echo '<font color="green">' . date(
|
||||
'd.m.Y H:i', $pl['time']
|
||||
) . '</font> ';
|
||||
echo $pl['text']; ?></small></td>
|
||||
</tr>
|
||||
<?
|
||||
@ -926,7 +1169,6 @@ if ($u->room['file'] == 'an/bank') {
|
||||
</table>
|
||||
</FORM>
|
||||
<small>Ñóììà óêàçàííàÿ â îêíå îïîâåùåíèÿ è ñóììû âçûìàåìàÿ\íà÷èñëÿåìàÿ ìîãóò ðàçëè÷àòüñÿ.</small>
|
||||
<?
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
@ -1,12 +1,15 @@
|
||||
<?php
|
||||
if (!defined('GAME_VERSION')) {
|
||||
require_once '_incl_data/autoload.php';
|
||||
}
|
||||
if (!defined('GAME')) {
|
||||
die();
|
||||
}
|
||||
require_once '_incl_data/mails.php';
|
||||
//require_once '_incl_data/mails.php';
|
||||
|
||||
if ($u->room['file'] == 'bank') {
|
||||
$noc = $c['crtoecr'] * 2; //120 kr = 1 ekr.
|
||||
$con = $c['ecrtocr'] * 2.5; //1 åêð. = 30 êð.
|
||||
$noc = \Core\Config::get('crtoecr') * 2; //120 kr = 1 ekr.
|
||||
$con = \Core\Config::get('ecrtocr') * 2.5; //1 åêð. = 30 êð.
|
||||
function getNum($v)
|
||||
{
|
||||
$plid = $v;
|
||||
@ -127,13 +130,16 @@ if ($u->room['file'] == 'bank') {
|
||||
$subject = 'Âîññòàíîâëåíèå ïàðîëÿ îò ñ÷åòà â áàíêå ïåðñîíàæà ' . $u->info['login'];
|
||||
$message = 'Íîìåð ñ÷åòà: ' . getNum($b_pass['id']) . '<br>Ïàðîëü: ' . $b_pass['pass'] .
|
||||
'<br><br>Ñ óâàæåíèåì,<br>Àäìèíèñòðàöèÿ Áîéöîâñêîãî Êëóáà';
|
||||
mails($u->info['mail'], $message, $subject);
|
||||
\Core\Mail::send($u->info['mail'], $message, $subject);
|
||||
//mails($u->info['mail'], $message, $subject);
|
||||
unset($subject, $message);
|
||||
}
|
||||
} elseif (isset($_GET['open']) && !isset($u->bank['id'])) {
|
||||
if ($_POST['rdn01'] == 2 && ($u->info['level'] >= 8 || $u->info['money4'] < 15)) {
|
||||
$re2 = 'Íåäîñòàòî÷íî çóáîâ!';
|
||||
} elseif ($u->info['money'] >= 3 || ($u->info['level'] < 8 && $u->info['money4'] >= 15 && $c['zuby'] == true)) {
|
||||
} elseif ($u->info['money'] >= 3 || ($u->info['level'] < 8 && $u->info['money4'] >= 15 && \Core\Config::get(
|
||||
'zuby'
|
||||
))) {
|
||||
if ($_POST['pass1'] == '' || $_POST['pass1'] == ' ') {
|
||||
$re2 = 'Âû íå óêàçàëè ïàðîëü!';
|
||||
} elseif ($_POST['pass1'] != $_POST['pass2']) {
|
||||
@ -149,7 +155,7 @@ if ($u->room['file'] == 'bank') {
|
||||
);
|
||||
if ($ins) {
|
||||
$bank = mysql_insert_id();
|
||||
if ($u->info['level'] < 8 && $_POST['rdn01'] == 2 && $c['zuby'] == true) {
|
||||
if ($u->info['level'] < 8 && $_POST['rdn01'] == 2 && \Core\Config::get('zuby')) {
|
||||
$u->info['money4'] -= 15;
|
||||
} else {
|
||||
$u->info['money'] -= 3;
|
||||
@ -171,7 +177,7 @@ if ($u->room['file'] == 'bank') {
|
||||
$re2 = 'Õàîñíèêè íå ìîãóò ñîçäàâàòü íîâûå ñ÷åòà â áàíêå.';
|
||||
}
|
||||
} else {
|
||||
if ($u->info['level'] < 8 && $c['zuby'] == true) {
|
||||
if ($u->info['level'] < 8 && \Core\Config::get('zuby')) {
|
||||
$re2 = 'Äëÿ îòêðûòèÿ ñ÷åòà íåîáõîäèìî èìåòü ïðè ñåáå <b>3.00 êð.</b> èëè <b>' . $u->zuby(15) . '</b>';
|
||||
} else {
|
||||
$re2 = 'Äëÿ îòêðûòèÿ ñ÷åòà íåîáõîäèìî èìåòü ïðè ñåáå <b>3.00 êð.</b>';
|
||||
@ -381,7 +387,7 @@ if ($u->room['file'] == 'bank') {
|
||||
$re2 = 'Ïåðåäà÷à êðåäèòîâ âîçìîæíà òîëüêî ñ 4-ãî óðîâíÿ';
|
||||
}
|
||||
} elseif ($u->info['align'] != 2 && $u->info['haos'] < time(
|
||||
) && $u->info['haos'] != 1 && $u->info['align'] != 50 && isset($_POST['convert_kredit']) && $c['crtoecr'] > 0) {
|
||||
) && $u->info['haos'] != 1 && $u->info['align'] != 50 && isset($_POST['convert_kredit']) && \Core\Config::get('crtoecr') > 0) {
|
||||
//îáìåíÿòü êð. íà åêð.
|
||||
if ($u->info['palpro'] > time()) {
|
||||
$mn = ceil((int)($_POST['convert_sum2'] * 100));
|
||||
@ -805,7 +811,7 @@ if ($u->room['file'] == 'bank') {
|
||||
<FIELDSET style="width:300px;">
|
||||
<LEGEND><B>Îòêðûòèå ñ÷åòà</B></LEGEND>
|
||||
<small>
|
||||
<? if ($u->info['level'] < 8 && $c['zuby'] == true) { ?>
|
||||
<? if ($u->info['level'] < 8 && \Core\Config::get('zuby')) { ?>
|
||||
<center>
|
||||
<input name="rdn01" type="radio" value="1"> <b>3.00 êð.</b> <input
|
||||
name="rdn01" type="radio" value="2"> <?= $u->zuby(15) ?>
|
||||
@ -1038,7 +1044,7 @@ if ($u->room['file'] == 'bank') {
|
||||
</td>
|
||||
</tr>
|
||||
<? if ($u->info['align'] != 2 && $u->info['haos'] < time(
|
||||
) && $u->info['haos'] != 1 && $c['crtoecr'] > 0) { ?>
|
||||
) && $u->info['haos'] != 1 && \Core\Config::get('crtoecr') > 0) { ?>
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<fieldset style="background-color:#DDEAD7">
|
||||
@ -1164,7 +1170,8 @@ if ($u->room['file'] == 'bank') {
|
||||
<div style="line-height: 1.5em">
|
||||
<?= $kurs_str ?>
|
||||
<small style="font-style: italic; color: dimgrey;">
|
||||
Äàííûå íà <strong><?= date('d.m.y H:i', $pl['time']) ?></strong> áåç
|
||||
Äàííûå íà <strong><?= date('d.m.y H:i', $pl['time']) ?></strong>
|
||||
áåç
|
||||
ó÷åòà êîìèññèé
|
||||
</small>
|
||||
</div>
|
||||
|
292
register.php
292
register.php
@ -1,31 +1,19 @@
|
||||
<?php
|
||||
if (!defined('GAME_VERSION')) {
|
||||
require_once '_incl_data/autoload.php';
|
||||
}
|
||||
|
||||
use Core\Mail;
|
||||
use Insallah\Db;
|
||||
|
||||
const GAME = true;
|
||||
require_once('_incl_data/__config.php');
|
||||
require_once('_incl_data/class/__db_connect.php');
|
||||
Core\Config::init();
|
||||
Core\Database::init();
|
||||
//const GAME = true;
|
||||
//require_once('_incl_data/__config.php');
|
||||
//require_once('_incl_data/class/__db_connect.php');
|
||||
$chat = new Chat();
|
||||
$filter = new Filter();
|
||||
require_once '_incl_data/mails.php';
|
||||
|
||||
function getIp()
|
||||
{
|
||||
$keys = [
|
||||
'HTTP_CLIENT_IP',
|
||||
'HTTP_X_FORWARDED_FOR',
|
||||
'REMOTE_ADDR',
|
||||
];
|
||||
foreach ($keys as $key) {
|
||||
if (!empty($_SERVER[$key])) {
|
||||
$iparr = explode(',', $_SERVER[$key]);
|
||||
$ip = trim(end($iparr));
|
||||
if (filter_var($ip, FILTER_VALIDATE_IP)) {
|
||||
return $ip;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//require_once '_incl_data/mails.php';
|
||||
|
||||
function add_effn($uid, $id)
|
||||
{
|
||||
@ -34,7 +22,10 @@ function add_effn($uid, $id)
|
||||
if (isset($eff['id2'])) {
|
||||
$n = $eff['mname'];
|
||||
$d = $eff['mdata'];
|
||||
$ins = mysql_query('INSERT INTO `eff_users` (`overType`,`id_eff`,`uid`,`name`,`timeUse`,`data`) VALUES ("' . $eff['oneType'] . '","' . $eff['id2'] . '","' . $uid . '","' . $n . '","' . time() . '","' . $d . '")');
|
||||
$ins = mysql_query(
|
||||
'INSERT INTO `eff_users` (`overType`,`id_eff`,`uid`,`name`,`timeUse`,`data`) VALUES ("' . $eff['oneType'] . '","' . $eff['id2'] . '","' . $uid . '","' . $n . '","' . time(
|
||||
) . '","' . $d . '")'
|
||||
);
|
||||
if ($ins) {
|
||||
$g[0] = 1;
|
||||
$g[1] = '...';
|
||||
@ -125,7 +116,9 @@ function error_check($id, $str_u, $name = 0)
|
||||
$log = mysql_fetch_array($q);
|
||||
unset($q);
|
||||
}
|
||||
$q = mysql_query('SELECT `id` from `lastnames` where `login`="' . mysql_real_escape_string($str_u) . '" LIMIT 1');
|
||||
$q = mysql_query(
|
||||
'SELECT `id` from `lastnames` where `login`="' . mysql_real_escape_string($str_u) . '" LIMIT 1'
|
||||
);
|
||||
if ($q) {
|
||||
$log2 = mysql_fetch_array($q);
|
||||
unset($q);
|
||||
@ -140,8 +133,12 @@ function error_check($id, $str_u, $name = 0)
|
||||
if (strlen($str_u) < 6 || strlen($str_u) > 50) {
|
||||
$error = 'E-mail не может быть короче 6-х символов и длинее 50-ти.';
|
||||
} else {
|
||||
$testEREm = mysql_fetch_array(mysql_query('SELECT `mail` FROM `users` WHERE `mail` LIKE "' . $str_u . '" LIMIT 1'));
|
||||
$emails = mysql_fetch_array(mysql_query('SELECT * FROM `ban_email` WHERE `email` LIKE "' . $str_u . '" LIMIT 1'));
|
||||
$testEREm = mysql_fetch_array(
|
||||
mysql_query('SELECT `mail` FROM `users` WHERE `mail` LIKE "' . $str_u . '" LIMIT 1')
|
||||
);
|
||||
$emails = mysql_fetch_array(
|
||||
mysql_query('SELECT * FROM `ban_email` WHERE `email` LIKE "' . $str_u . '" LIMIT 1')
|
||||
);
|
||||
if (isset($testEREm['mail'])) {
|
||||
$error = 'E-mail уже занят.';
|
||||
}
|
||||
@ -179,13 +176,19 @@ function error_check($id, $str_u, $name = 0)
|
||||
if ($id == 3 && !empty($str_u) && !empty($name)) //отсылка емаила при удачном емаиле str_u -> mail name -> nickname
|
||||
{
|
||||
$code = rand(10000000, 99999999);
|
||||
mysql_query('INSERT INTO `secure_code`(`email`, `code`, `time`) VALUES ("' . $str_u . '","' . $code . '","' . time() . '");');
|
||||
mails($str_u, 'Ñåêðåòíûé Êîä: ' . $code, 'Ñåêðåòíûé Êîä - Íîâûé Áîéöîâñêèé Êëóá ' . $name);
|
||||
mysql_query(
|
||||
'INSERT INTO `secure_code`(`email`, `code`, `time`) VALUES ("' . $str_u . '","' . $code . '","' . time(
|
||||
) . '");'
|
||||
);
|
||||
Mail::send($str_u, 'Ñåêðåòíûé Êîä: ' . $code, 'Ñåêðåòíûé Êîä - Íîâûé Áîéöîâñêèé Êëóá ' . $name);
|
||||
//mails($str_u, 'Ñåêðåòíûé Êîä: ' . $code, 'Ñåêðåòíûé Êîä - Íîâûé Áîéöîâñêèé Êëóá ' . $name);
|
||||
}
|
||||
|
||||
if ($id == 4 && !empty($str_u) && !empty($name)) //проверка кода безопасности str_u -> введенный код name -> email
|
||||
{
|
||||
$testcode = mysql_fetch_array(mysql_query('SELECT code FROM `secure_code` WHERE `email` = "' . $name . '" ORDER BY id DESC LIMIT 1'));
|
||||
$testcode = mysql_fetch_array(
|
||||
mysql_query('SELECT code FROM `secure_code` WHERE `email` = "' . $name . '" ORDER BY id DESC LIMIT 1')
|
||||
);
|
||||
if ($testcode['code'] != $str_u) {
|
||||
$error = 'Неверный код безопасности (Проверте пробелы и сам код в последнем емеиле)';
|
||||
}
|
||||
@ -516,7 +519,9 @@ if ($_SERVER['HTTP_USER_AGENT'] != '' &&
|
||||
|
||||
|
||||
<?php
|
||||
if (empty($_POST['secure_code']) && !empty($_POST['email_u']) && error_check(2, $_POST['email_u']) == "" && error_check(3, $_POST['email_u'], $_POST['nick_u']) == "") {
|
||||
if (empty($_POST['secure_code']) && !empty($_POST['email_u']) && error_check(
|
||||
2, $_POST['email_u']
|
||||
) == "" && error_check(3, $_POST['email_u'], $_POST['nick_u']) == "") {
|
||||
?>
|
||||
<div class="visible_class">
|
||||
<p>
|
||||
@ -549,7 +554,9 @@ if ($_SERVER['HTTP_USER_AGENT'] != '' &&
|
||||
} ?>
|
||||
|
||||
<?php
|
||||
if ((empty($_POST['pass1_u']) || empty($_POST['pass2_u'])) && !empty($_POST['secure_code']) && error_check(4, $_POST['secure_code'], $_POST['email_u']) == "") {
|
||||
if ((empty($_POST['pass1_u']) || empty($_POST['pass2_u'])) && !empty($_POST['secure_code']) && error_check(
|
||||
4, $_POST['secure_code'], $_POST['email_u']
|
||||
) == "") {
|
||||
?>
|
||||
<div class="visible_class">
|
||||
<p>
|
||||
@ -563,7 +570,9 @@ if ($_SERVER['HTTP_USER_AGENT'] != '' &&
|
||||
цифры для надёжности.</h3></p>
|
||||
</div>
|
||||
<?php
|
||||
} elseif (!empty($_POST['pass1_u']) && !empty($_POST['secure_code']) && error_check(5, $_POST['pass1_u'], $_POST['pass2_u']) != "") {
|
||||
} elseif (!empty($_POST['pass1_u']) && !empty($_POST['secure_code']) && error_check(
|
||||
5, $_POST['pass1_u'], $_POST['pass2_u']
|
||||
) != "") {
|
||||
?>
|
||||
<div class="visible_class">
|
||||
<p>
|
||||
@ -592,7 +601,9 @@ if ($_SERVER['HTTP_USER_AGENT'] != '' &&
|
||||
} ?>
|
||||
|
||||
<?php
|
||||
if (empty($_POST['pol_u']) && !empty($_POST['pass1_u']) && !empty($_POST['pass2_u']) && error_check(5, $_POST['pass1_u'], $_POST['pass2_u']) == "") {
|
||||
if (empty($_POST['pol_u']) && !empty($_POST['pass1_u']) && !empty($_POST['pass2_u']) && error_check(
|
||||
5, $_POST['pass1_u'], $_POST['pass2_u']
|
||||
) == "") {
|
||||
?>
|
||||
<div class="visible_class">
|
||||
<p>
|
||||
@ -676,7 +687,8 @@ if ($_SERVER['HTTP_USER_AGENT'] != '' &&
|
||||
</p>
|
||||
</div>
|
||||
<div class="form_radio_btn">
|
||||
<p><input name="class_u" type="radio" value="9" id="radio-9"> <label for="radio-9">Êðèòîóâîðîò</label>
|
||||
<p><input name="class_u" type="radio" value="9" id="radio-9"> <label
|
||||
for="radio-9">Êðèòîóâîðîò</label>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -688,13 +700,21 @@ if ($_SERVER['HTTP_USER_AGENT'] != '' &&
|
||||
|
||||
<?php
|
||||
}
|
||||
if (!empty($_POST['nick_u']) && !empty($_POST['email_u']) && !empty($_POST['secure_code']) && !empty($_POST['pol_u']) && !empty($_POST['bday_u']) && !empty($_POST['class_u']) && error_check(4, $_POST['secure_code'], $_POST['email_u']) == "") {
|
||||
if (!empty($_POST['nick_u']) && !empty($_POST['email_u']) && !empty($_POST['secure_code']) && !empty($_POST['pol_u']) && !empty($_POST['bday_u']) && !empty($_POST['class_u']) && error_check(
|
||||
4, $_POST['secure_code'], $_POST['email_u']
|
||||
) == "") {
|
||||
//================================
|
||||
session_start();
|
||||
$u = User::start();
|
||||
//Создаем персонажа
|
||||
if ($_POST['ref'] > 0) {
|
||||
$ref = mysql_fetch_array(mysql_query('SELECT `id`,`login` FROM `users` WHERE `id` = "' . mysql_real_escape_string($_POST['ref']) . '" LIMIT 1'));
|
||||
$ref = mysql_fetch_array(
|
||||
mysql_query(
|
||||
'SELECT `id`,`login` FROM `users` WHERE `id` = "' . mysql_real_escape_string(
|
||||
$_POST['ref']
|
||||
) . '" LIMIT 1'
|
||||
)
|
||||
);
|
||||
if (isset($ref['id'])) {
|
||||
$_POST['ref'] = $ref['id'];
|
||||
} else {
|
||||
@ -703,7 +723,8 @@ if ($_SERVER['HTTP_USER_AGENT'] != '' &&
|
||||
unset($ref);
|
||||
}
|
||||
|
||||
mysql_query('INSERT INTO `users` (`name`,`align`,`real`,`login`,`host_reg`,`pass`,`ip`,`ipreg`,`city`,`cityreg`,`room`,`timereg`,
|
||||
mysql_query(
|
||||
'INSERT INTO `users` (`name`,`align`,`real`,`login`,`host_reg`,`pass`,`ip`,`ipreg`,`city`,`cityreg`,`room`,`timereg`,
|
||||
`activ`,`mail`,`bithday`,`sex`,`fnq`,`battle`,`design`,`molch2`,`level`, `hobby`, `clan_zv`
|
||||
) VALUES (
|
||||
"",
|
||||
@ -712,8 +733,8 @@ if ($_SERVER['HTTP_USER_AGENT'] != '' &&
|
||||
"' . mysql_real_escape_string($_POST['nick_u']) . '",
|
||||
"' . (int)$_POST['ref'] . '",
|
||||
"' . mysql_real_escape_string(md5($_POST['pass1_u'])) . '",
|
||||
"' . getIp() . '",
|
||||
"' . getIp() . '",
|
||||
"' . UserIp::get() . '",
|
||||
"' . UserIp::get() . '",
|
||||
"capitalcity",
|
||||
"capitalcity",
|
||||
9,
|
||||
@ -729,26 +750,46 @@ if ($_SERVER['HTTP_USER_AGENT'] != '' &&
|
||||
8,
|
||||
"",
|
||||
0
|
||||
)');
|
||||
)'
|
||||
);
|
||||
|
||||
$uid = mysql_insert_id();
|
||||
if ($uid > 0) {
|
||||
if (isset($_COOKIE['from'])) {
|
||||
mysql_query('INSERT INTO `from` (`type`,`ip`,`uid`,`time`,`val`) VALUES ( "0", "' . getIp() . '","' . $uid . '", "' . time() . '", "' . mysql_real_escape_string($_COOKIE['from']) . '" ) ');
|
||||
mysql_query(
|
||||
'INSERT INTO `from` (`type`,`ip`,`uid`,`time`,`val`) VALUES ( 0, "' . UserIp::get(
|
||||
) . '",' . $uid . ', unix_timestamp(), "' . mysql_real_escape_string($_COOKIE['from']) . '" ) '
|
||||
);
|
||||
}
|
||||
//Сообщения при регистрации от паладинов.
|
||||
$pal = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `align` > 1 AND `align` < 2 AND `online` > "' . (time() - 120) . '" ORDER BY `online` DESC LIMIT 1'));
|
||||
$pal = mysql_fetch_array(
|
||||
mysql_query(
|
||||
'SELECT * FROM `users` WHERE `align` > 1 AND `align` < 2 AND `online` > "' . (time(
|
||||
) - 120) . '" ORDER BY `online` DESC LIMIT 1'
|
||||
)
|
||||
);
|
||||
if (!isset($pal['id'])) {
|
||||
$pal = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `align` > 3 AND `align` < 4 AND `online` > "' . (time() - 120) . '" ORDER BY `online` DESC LIMIT 1'));
|
||||
$pal = mysql_fetch_array(
|
||||
mysql_query(
|
||||
'SELECT * FROM `users` WHERE `align` > 3 AND `align` < 4 AND `online` > "' . (time(
|
||||
) - 120) . '" ORDER BY `online` DESC LIMIT 1'
|
||||
)
|
||||
);
|
||||
}
|
||||
if (isset($pal['id'])) {
|
||||
//отсылаем сообщение от $pal['login']
|
||||
$paltext = 'Приветствую ' . $_POST['nick_u'] . '. Отправляемся драться в хаоты, если нет заявок, создайте бой, дополнительно купите зверя и не забывайте выходить на центральную площать убивать Трупожора своего уровня!Приятной игры. ';
|
||||
mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`new`) VALUES ('capitalcity','0','" . $pal['login'] . "','" . $_POST['nick_u'] . "','" . $paltext . "','" . time() . "','3','0','1')");
|
||||
mysql_query(
|
||||
"INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`new`) VALUES ('capitalcity','0','" . $pal['login'] . "','" . $_POST['nick_u'] . "','" . $paltext . "','" . time(
|
||||
) . "','3','0','1')"
|
||||
);
|
||||
} else {
|
||||
//Не знаю что делать, пусть будет просто приветствие :)
|
||||
$text = 'Приветствую <b>' . $_POST['nick_u'] . '</b>.<b>В инвентаре Вы найдете сундук, в котором Ваше Обмундирование!Отправляйтесь драться в хаоты и не забывайте бить Городского Монстра!';
|
||||
mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`new`) VALUES ('capitalcity','0','','" . $_POST['nick_u'] . "','" . $text . "','" . time() . "','3','0','1')");
|
||||
mysql_query(
|
||||
"INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`new`) VALUES ('capitalcity','0','','" . $_POST['nick_u'] . "','" . $text . "','" . time(
|
||||
) . "','3','0','1')"
|
||||
);
|
||||
}
|
||||
|
||||
//топор
|
||||
@ -757,41 +798,69 @@ if ($_SERVER['HTTP_USER_AGENT'] != '' &&
|
||||
$us = add_effn($uid, 1); // сила
|
||||
$us = add_effn($uid, 20); // сокрушение
|
||||
//ТОПОР
|
||||
mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uid . "','s1=62|s2=3|s3=3|s4=30|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=9|a3=0|a4=0|a5=0|mg1=0|mg2=0|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=0|s6=0|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0',-75,-9,100000)");
|
||||
mysql_query(
|
||||
"INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uid . "','s1=62|s2=3|s3=3|s4=30|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=9|a3=0|a4=0|a5=0|mg1=0|mg2=0|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=0|s6=0|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0',-75,-9,100000)"
|
||||
);
|
||||
$re = $u->addItem(6433, $uid);
|
||||
Db::sql('update items_users set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1) where id = ?', [6433, $re]);
|
||||
Db::sql(
|
||||
'update items_users set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1) where id = ?',
|
||||
[6433, $re]
|
||||
);
|
||||
//Коррекция кредов
|
||||
mysql_query('UPDATE `users` SET `money` = `money`200 WHERE `id` = "' . $uid . '" LIMIT 1');//êîðåêòèðîâêà äåíåã 2244 - 2101
|
||||
mysql_query(
|
||||
'UPDATE `users` SET `money` = `money`200 WHERE `id` = "' . $uid . '" LIMIT 1'
|
||||
);//êîðåêòèðîâêà äåíåã 2244 - 2101
|
||||
//уворот
|
||||
} elseif ($_POST['class_u'] == 2) {
|
||||
//кастим эфекты уворота
|
||||
$us = add_effn($uid, 8); // ловка
|
||||
$us = add_effn($uid, 20); // сокрушение
|
||||
mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uid . "','s1=21|s2=31|s3=16|s4=30|rinv=40|m9=5|m6=10|s7=0|a1=9|a2=0|a3=0|a4=0|a5=0|mg1=0|mg2=0|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=0|s6=0',-75,-9,100000)");
|
||||
mysql_query(
|
||||
"INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uid . "','s1=21|s2=31|s3=16|s4=30|rinv=40|m9=5|m6=10|s7=0|a1=9|a2=0|a3=0|a4=0|a5=0|mg1=0|mg2=0|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=0|s6=0',-75,-9,100000)"
|
||||
);
|
||||
$re = $u->addItem(6431, $uid);
|
||||
Db::sql('update items_users set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1) where id = ?', [6431, $re]);
|
||||
Db::sql(
|
||||
'update items_users set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1) where id = ?',
|
||||
[6431, $re]
|
||||
);
|
||||
//Коррекция кредитов
|
||||
mysql_query('UPDATE `users` SET `money` = `money`200 WHERE `id` = "' . $uid . '" LIMIT 1');//êîðåêòèðîâêà äåíåã 2244 - 1972
|
||||
mysql_query(
|
||||
'UPDATE `users` SET `money` = `money`200 WHERE `id` = "' . $uid . '" LIMIT 1'
|
||||
);//êîðåêòèðîâêà äåíåã 2244 - 1972
|
||||
//танк
|
||||
} elseif ($_POST['class_u'] == 3) {
|
||||
//кастим эфекты
|
||||
$us = add_effn($uid, 1); // сила
|
||||
$us = add_effn($uid, 20); // сокрушение
|
||||
mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uid . "','s1=42|s2=3|s3=3|s4=50|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=0|a3=9|a4=0|a5=0|mg1=0|mg2=0|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=0|s6=0|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0',-75,-9,100000)");
|
||||
mysql_query(
|
||||
"INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uid . "','s1=42|s2=3|s3=3|s4=50|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=0|a3=9|a4=0|a5=0|mg1=0|mg2=0|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=0|s6=0|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0',-75,-9,100000)"
|
||||
);
|
||||
$re = $u->addItem(6432, $uid);
|
||||
Db::sql('update items_users set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1) where id = ?', [6432, $re]);
|
||||
Db::sql(
|
||||
'update items_users set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1) where id = ?',
|
||||
[6432, $re]
|
||||
);
|
||||
//Коррекция Кредитов
|
||||
mysql_query('UPDATE `users` SET `money` = `money`200 WHERE `id` = "' . $uid . '" LIMIT 1');//êîðåêòèðîâêà äåíåã 2244 - 2101
|
||||
mysql_query(
|
||||
'UPDATE `users` SET `money` = `money`200 WHERE `id` = "' . $uid . '" LIMIT 1'
|
||||
);//êîðåêòèðîâêà äåíåã 2244 - 2101
|
||||
//крит
|
||||
} elseif ($_POST['class_u'] == 4)//крит
|
||||
{
|
||||
$us = add_effn($uid, 7); // инта
|
||||
$us = add_effn($uid, 20); // сокрушение
|
||||
mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uid . "','s1=24|s2=15|s3=29|s4=30|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=0|a3=0|a4=9|a5=0|mg1=0|mg2=0|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=0|s6=0|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0',-75,-9,100000)");
|
||||
mysql_query(
|
||||
"INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uid . "','s1=24|s2=15|s3=29|s4=30|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=0|a3=0|a4=9|a5=0|mg1=0|mg2=0|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=0|s6=0|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0',-75,-9,100000)"
|
||||
);
|
||||
$re = $u->addItem(6430, $uid);
|
||||
Db::sql('update items_users set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1) where id = ?', [6430, $re]);
|
||||
Db::sql(
|
||||
'update items_users set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1) where id = ?',
|
||||
[6430, $re]
|
||||
);
|
||||
//коррекция кредов при старте
|
||||
mysql_query('UPDATE `users` SET `money` = `money`200 WHERE `id` = "' . $uid . '" LIMIT 1');//êîðåêòèðîâêà äåíåã 2244 - 1988
|
||||
mysql_query(
|
||||
'UPDATE `users` SET `money` = `money`200 WHERE `id` = "' . $uid . '" LIMIT 1'
|
||||
);//êîðåêòèðîâêà äåíåã 2244 - 1988
|
||||
//воздух
|
||||
} elseif ($_POST['class_u'] == 5)//воздух
|
||||
{
|
||||
@ -800,11 +869,18 @@ if ($_SERVER['HTTP_USER_AGENT'] != '' &&
|
||||
$us = add_effn($uid, 32); // Холодный разум
|
||||
$us = add_effn($uid, 53); // Маг уселок воздух
|
||||
$us = add_effn($uid, 439); // Маг уселок
|
||||
mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uid . "','s1=14|s2=3|s3=3|s4=25|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=0|a3=0|a4=0|a5=3|mg1=0|mg2=6|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=13|s6=40|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0',-75,-9,100000)");
|
||||
mysql_query(
|
||||
"INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uid . "','s1=14|s2=3|s3=3|s4=25|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=0|a3=0|a4=0|a5=3|mg1=0|mg2=6|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=13|s6=40|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0',-75,-9,100000)"
|
||||
);
|
||||
$re = $u->addItem(6435, $uid);
|
||||
Db::sql('update items_users set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1) where id = ?', [6435, $re]);
|
||||
Db::sql(
|
||||
'update items_users set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1) where id = ?',
|
||||
[6435, $re]
|
||||
);
|
||||
// Коррекция Кредов
|
||||
mysql_query('UPDATE `users` SET `money` = `money`200 WHERE `id` = "' . $uid . '" LIMIT 1');//êîðåêòèðîâêà äåíåã 2244 - 1988
|
||||
mysql_query(
|
||||
'UPDATE `users` SET `money` = `money`200 WHERE `id` = "' . $uid . '" LIMIT 1'
|
||||
);//êîðåêòèðîâêà äåíåã 2244 - 1988
|
||||
//огонь
|
||||
} elseif ($_POST['class_u'] == 6) {
|
||||
//кастим эфекты
|
||||
@ -812,11 +888,18 @@ if ($_SERVER['HTTP_USER_AGENT'] != '' &&
|
||||
$us = add_effn($uid, 32); // Холодный разум
|
||||
$us = add_effn($uid, 51); // Маг уселок огонь
|
||||
$us = add_effn($uid, 439); // Маг уселок
|
||||
mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uid . "','s1=14|s2=3|s3=3|s4=25|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=0|a3=0|a4=0|a5=3|mg1=6|mg2=0|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=13|s6=40|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0',-75,-9,100000)");
|
||||
mysql_query(
|
||||
"INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uid . "','s1=14|s2=3|s3=3|s4=25|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=0|a3=0|a4=0|a5=3|mg1=6|mg2=0|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=13|s6=40|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0',-75,-9,100000)"
|
||||
);
|
||||
$re = $u->addItem(6447, $uid);
|
||||
Db::sql('update items_users set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1) where id = ?', [6447, $re]);
|
||||
Db::sql(
|
||||
'update items_users set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1) where id = ?',
|
||||
[6447, $re]
|
||||
);
|
||||
//Коррекция Кредитов
|
||||
mysql_query('UPDATE `users` SET `money` = `money`200 WHERE `id` = "' . $uid . '" LIMIT 1');//êîðåêòèðîâêà äåíåã 2244 - 1988
|
||||
mysql_query(
|
||||
'UPDATE `users` SET `money` = `money`200 WHERE `id` = "' . $uid . '" LIMIT 1'
|
||||
);//êîðåêòèðîâêà äåíåã 2244 - 1988
|
||||
//земля
|
||||
} elseif ($_POST['class_u'] == 7) {
|
||||
//кастим эфекты
|
||||
@ -824,11 +907,18 @@ if ($_SERVER['HTTP_USER_AGENT'] != '' &&
|
||||
$us = add_effn($uid, 32); // Холодный разум
|
||||
$us = add_effn($uid, 54); // Маг уселок земля
|
||||
$us = add_effn($uid, 439); // Маг уселок
|
||||
mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uid . "','s1=14|s2=3|s3=3|s4=25|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=0|a3=0|a4=0|a5=3|mg1=0|mg2=0|mg3=0|mg4=6|mg5=0|mg6=0|mg7=0|s5=13|s6=40|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0',-75,-9,100000)");
|
||||
mysql_query(
|
||||
"INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uid . "','s1=14|s2=3|s3=3|s4=25|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=0|a3=0|a4=0|a5=3|mg1=0|mg2=0|mg3=0|mg4=6|mg5=0|mg6=0|mg7=0|s5=13|s6=40|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0',-75,-9,100000)"
|
||||
);
|
||||
$re = $u->addItem(6436, $uid);
|
||||
Db::sql('update items_users set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1) where id = ?', [6436, $re]);
|
||||
Db::sql(
|
||||
'update items_users set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1) where id = ?',
|
||||
[6436, $re]
|
||||
);
|
||||
//Коррекция Кредитов
|
||||
mysql_query('UPDATE `users` SET `money` = `money`200 WHERE `id` = "' . $uid . '" LIMIT 1');//êîðåêòèðîâêà äåíåã 2244 - 1988
|
||||
mysql_query(
|
||||
'UPDATE `users` SET `money` = `money`200 WHERE `id` = "' . $uid . '" LIMIT 1'
|
||||
);//êîðåêòèðîâêà äåíåã 2244 - 1988
|
||||
//вода
|
||||
} elseif ($_POST['class_u'] == 8) {
|
||||
//кастим эфекты
|
||||
@ -836,21 +926,35 @@ if ($_SERVER['HTTP_USER_AGENT'] != '' &&
|
||||
$us = add_effn($uid, 32); // Холодный разум
|
||||
$us = add_effn($uid, 52); // Маг уселок вода
|
||||
$us = add_effn($uid, 439); // Маг уселок
|
||||
mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uid . "','s1=14|s2=3|s3=3|s4=25|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=0|a3=0|a4=0|a5=3|mg1=0|mg2=0|mg3=6|mg4=0|mg5=0|mg6=0|mg7=0|s5=13|s6=40|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0',-75,-9,100000)");
|
||||
mysql_query(
|
||||
"INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uid . "','s1=14|s2=3|s3=3|s4=25|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=0|a3=0|a4=0|a5=3|mg1=0|mg2=0|mg3=6|mg4=0|mg5=0|mg6=0|mg7=0|s5=13|s6=40|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0',-75,-9,100000)"
|
||||
);
|
||||
$re = $u->addItem(6448, $uid);
|
||||
Db::sql('update items_users set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1) where id = ?', [6448, $re]);
|
||||
Db::sql(
|
||||
'update items_users set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1) where id = ?',
|
||||
[6448, $re]
|
||||
);
|
||||
//Коррекция кредов
|
||||
mysql_query('UPDATE `users` SET `money` = `money`200 WHERE `id` = "' . $uid . '" LIMIT 1');//êîðåêòèðîâêà äåíåã 2244 - 1988
|
||||
mysql_query(
|
||||
'UPDATE `users` SET `money` = `money`200 WHERE `id` = "' . $uid . '" LIMIT 1'
|
||||
);//êîðåêòèðîâêà äåíåã 2244 - 1988
|
||||
//Критоуворот
|
||||
} elseif ($_POST['class_u'] == 9) {
|
||||
//кастим эфекты уворота
|
||||
$us = add_effn($uid, 8); // ловка
|
||||
$us = add_effn($uid, 20); // сокрушение
|
||||
mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uid . "','s1=15|s2=23|s3=30|s4=30|rinv=40|m9=5|m6=10|s7=0|a1=9|a2=0|a3=0|a4=0|a5=0|mg1=0|mg2=0|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=0|s6=0',-75,-9,100000)");
|
||||
mysql_query(
|
||||
"INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uid . "','s1=15|s2=23|s3=30|s4=30|rinv=40|m9=5|m6=10|s7=0|a1=9|a2=0|a3=0|a4=0|a5=0|mg1=0|mg2=0|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=0|s6=0',-75,-9,100000)"
|
||||
);
|
||||
$re = $u->addItem(6530, $uid);
|
||||
Db::sql('update items_users set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1) where id = ?', [6530, $re]);
|
||||
Db::sql(
|
||||
'update items_users set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1) where id = ?',
|
||||
[6530, $re]
|
||||
);
|
||||
//Коррекция кредитов
|
||||
mysql_query('UPDATE `users` SET `money` = `money`200 WHERE `id` = "' . $uid . '" LIMIT 1');//êîðåêòèðîâêà äåíåã 2244 - 1972
|
||||
mysql_query(
|
||||
'UPDATE `users` SET `money` = `money`200 WHERE `id` = "' . $uid . '" LIMIT 1'
|
||||
);//êîðåêòèðîâêà äåíåã 2244 - 1972
|
||||
}
|
||||
if ($_POST['ref'] > 0) {
|
||||
$re = $u->addItem(4811, $uid);
|
||||
@ -870,22 +974,44 @@ if ($_SERVER['HTTP_USER_AGENT'] != '' &&
|
||||
|
||||
//добовляем благодать ангела при регистрации
|
||||
$ttime = time();
|
||||
mysql_query("INSERT INTO `eff_users`(`id_eff`, `uid`, `name`, `data`, `overType`, `timeUse`, `timeAce`, `user_use`, `delete`, `v1`, `v2`, `img2`, `x`, `hod`, `bj`, `sleeptime`, `no_Ace`, `file_finish`, `tr_life_user`, `deactiveTime`, `deactiveLast`, `mark`, `bs`) VALUES
|
||||
(412,'" . $uid . "','Áëàãîäàòü Àíãåëà [1]','add_gold=1|add_speedhp=35|add_speedmp=35|add_exp=35|add_repair_discount=25|add_speed_dungeon=10|add_hpVinos=5|add_m10=5|add_m11=5|add_za=25|add_zma=25',52," . $ttime . ",0,'',0,0,0,'',1,-1,0,0,1,'',0,0,0,0,0)");
|
||||
mysql_query(
|
||||
"INSERT INTO `eff_users`(`id_eff`, `uid`, `name`, `data`, `overType`, `timeUse`, `timeAce`, `user_use`, `delete`, `v1`, `v2`, `img2`, `x`, `hod`, `bj`, `sleeptime`, `no_Ace`, `file_finish`, `tr_life_user`, `deactiveTime`, `deactiveLast`, `mark`, `bs`) VALUES
|
||||
(412,'" . $uid . "','Áëàãîäàòü Àíãåëà [1]','add_gold=1|add_speedhp=35|add_speedmp=35|add_exp=35|add_repair_discount=25|add_speed_dungeon=10|add_hpVinos=5|add_m10=5|add_m11=5|add_za=25|add_zma=25',52," . $ttime . ",0,'',0,0,0,'',1,-1,0,0,1,'',0,0,0,0,0)"
|
||||
);
|
||||
|
||||
//мульты
|
||||
$ipm1 = mysql_fetch_array(mysql_query('SELECT * FROM `logs_auth` WHERE `uid` = "' . $uid . '" AND `ip`!="' . getIp() . '" ORDER BY `id` LIMIT 1'));
|
||||
$ppl = mysql_query('SELECT * FROM `logs_auth` WHERE `ip`!="" AND (`ip` = "' . getIp() . '" OR `ip`="' . $ipm1['ip'] . '" OR `ip`="' . $_COOKIE['ip'] . '")');
|
||||
$ipm1 = mysql_fetch_array(
|
||||
mysql_query(
|
||||
'SELECT * FROM `logs_auth` WHERE `uid` = ' . $uid . ' AND `ip`!="' . UserIp::get(
|
||||
) . '" ORDER BY `id` LIMIT 1'
|
||||
)
|
||||
);
|
||||
$ppl = mysql_query(
|
||||
'SELECT * FROM `logs_auth` WHERE `ip`!="" AND (`ip` = "' . UserIp::get(
|
||||
) . '" OR `ip`="' . $ipm1['ip'] . '" OR `ip`="' . $_COOKIE['ip'] . '")'
|
||||
);
|
||||
while ($spl = mysql_fetch_array($ppl)) {
|
||||
$ml = mysql_fetch_array(mysql_query('SELECT `id` FROM `mults` WHERE (`uid` = "' . $spl['uid'] . '" AND `uid2` = "' . $uid . '") OR (`uid2` = "' . $spl['uid'] . '" AND `uid` = "' . $uid . '") LIMIT 1'));
|
||||
$ml = mysql_fetch_array(
|
||||
mysql_query(
|
||||
'SELECT `id` FROM `mults` WHERE (`uid` = "' . $spl['uid'] . '" AND `uid2` = "' . $uid . '") OR (`uid2` = "' . $spl['uid'] . '" AND `uid` = "' . $uid . '") LIMIT 1'
|
||||
)
|
||||
);
|
||||
if (!isset($ml['id']) && $spl['ip'] != '' && $spl['ip'] != '127.0.0.1') {
|
||||
mysql_query('INSERT INTO `mults` (`uid`,`uid2`,`ip`) VALUES ("' . $uid . '","' . $spl['uid'] . '","' . $spl['ip'] . '")');
|
||||
mysql_query(
|
||||
'INSERT INTO `mults` (`uid`,`uid2`,`ip`) VALUES ("' . $uid . '","' . $spl['uid'] . '","' . $spl['ip'] . '")'
|
||||
);
|
||||
}
|
||||
}
|
||||
mysql_query("INSERT INTO `logs_auth` (`uid`,`ip`,`browser`,`type`,`time`,`depass`) VALUES ('" . $uid . "','" . getIp() . "','" . $_SERVER['HTTP_USER_AGENT'] . "','1','" . time() . "','')");
|
||||
mysql_query(
|
||||
"INSERT INTO `logs_auth` (`uid`,`ip`,`browser`,`type`,`time`,`depass`) VALUES ('" . $uid . "','" . UserIp::get(
|
||||
) . "','" . $_SERVER['HTTP_USER_AGENT'] . "','1','" . time() . "','')"
|
||||
);
|
||||
|
||||
//Обновяем таблицы
|
||||
mysql_query("UPDATE `users` SET `online`='" . time() . "',`ip` = '" . getIp() . "' WHERE `uid` = '" . $uid . "' LIMIT 1");
|
||||
mysql_query(
|
||||
"UPDATE `users` SET `online`= unix_timestamp(),`ip` = '" . UserIp::get(
|
||||
) . "' WHERE id = '" . $uid . "' LIMIT 1"
|
||||
);
|
||||
|
||||
if (
|
||||
!setcookie('login', $_POST['nick_u'], (time() + 60 * 60 * 24 * 7), '', '.new-combats.com') ||
|
||||
@ -895,8 +1021,10 @@ if ($_SERVER['HTTP_USER_AGENT'] != '' &&
|
||||
die('Ошибка сохранения cookie.');
|
||||
} else {
|
||||
Db::sql('insert into users_learning_status (uid) values (?)', [$uid]);
|
||||
die('Ñïàñèáî çà ðåãèñòðàöèþ â èãðîâîì ìèðå Áîéöîâñêîãî Êëóáà, æåëàåì âàì ïîáåä è äîëãîé èãðû.
|
||||
 ñëó÷àå âîïðîñîâ ïî èãðå, Âàì áóäåò äîñòóïåí îáùèé ÷àò!<br><script>function test(){ top.location.href="https://new-combats.com/bk"; } setTimeout("test()",100);</script>');
|
||||
die(
|
||||
'Ñïàñèáî çà ðåãèñòðàöèþ â èãðîâîì ìèðå Áîéöîâñêîãî Êëóáà, æåëàåì âàì ïîáåä è äîëãîé èãðû.
|
||||
 ñëó÷àå âîïðîñîâ ïî èãðå, Âàì áóäåò äîñòóïåí îáùèé ÷àò!<br><script>function test(){ top.location.href="https://new-combats.com/bk"; } setTimeout("test()",100);</script>'
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
3640
registergmail.php
3640
registergmail.php
File diff suppressed because it is too large
Load Diff
13
repass.php
13
repass.php
@ -20,13 +20,11 @@ if (isset($_POST['relogin'])) {
|
||||
Config::init();
|
||||
Database::init();
|
||||
define('IP', UserIp::get());
|
||||
|
||||
$u = User::start();
|
||||
|
||||
$usr = mysql_fetch_array(
|
||||
mysql_query(
|
||||
'SELECT * FROM `users` WHERE `login` = "' . mysql_real_escape_string($_POST['relogin']) . '" LIMIT 1'
|
||||
)
|
||||
);
|
||||
'SELECT * FROM `users` WHERE `login` = "' . mysql_real_escape_string($_POST['relogin']) . '"'));
|
||||
if (isset($usr['id'])) {
|
||||
|
||||
if ($usr['admin'] == 0 && $usr['banned'] == 0) {
|
||||
@ -41,9 +39,10 @@ if (isset($_POST['relogin'])) {
|
||||
);
|
||||
if (isset($lst_psw['id'])) {
|
||||
$error = 'Âûñûëàòü ïàðîëü ìîæíî íå áîëåå îäíîãî ðàçà â ñóòêè.';
|
||||
} elseif (str_replace('0', '', $_POST['redate']) == str_replace(
|
||||
'0', '', $usr['bithday']
|
||||
) && ($_POST['reanswer'] == $usr['q1'] || $usr['q1'] == '')) {
|
||||
} elseif (
|
||||
str_replace('0', '', $_POST['redate']) == str_replace('0', '', $usr['bithday']) &&
|
||||
($_POST['reanswer'] == $usr['q1'] || $usr['q1'] == '')
|
||||
) {
|
||||
$error = '<br><br><br>Ïàðîëü îò ïåðñîíàæà "' . $usr['login'] . '" áûë óñïåøíî âûñëàí íà E-mail óêàçàííûé ïðè ðåãèñòðàöèè! <br><br><br>';
|
||||
$re = mysql_fetch_array(
|
||||
mysql_query(
|
||||
|
@ -1,116 +1,141 @@
|
||||
<?
|
||||
function getIP() {
|
||||
if(isset($_SERVER['HTTP_X_REAL_IP'])) return $_SERVER['HTTP_X_REAL_IP'];
|
||||
return $_SERVER['REMOTE_ADDR'];
|
||||
<?php
|
||||
|
||||
const GAME = true;
|
||||
require_once('_incl_data/__config.php');
|
||||
require_once('_incl_data/class/__db_connect.php');
|
||||
|
||||
if (UserIp::get() != $_SERVER['SERVER_ADDR'] && UserIp::get() != '127.0.0.1' && !isset($_GET['test15684555'])) {
|
||||
die(UserIp::get() . '<br>' . $_SERVER['SERVER_ADDR']);
|
||||
}
|
||||
|
||||
if(getIP() != $_SERVER['SERVER_ADDR'] && getIP() != '127.0.0.1') {
|
||||
if(!isset($_GET['test15684555'])) {
|
||||
die(getIP().'<br>'.$_SERVER['SERVER_ADDR']);
|
||||
}
|
||||
$add_exp_list = [];
|
||||
$all_exp_list = [];
|
||||
$exp_list = [];
|
||||
$win_list = [];
|
||||
$lose_list = [];
|
||||
$nich_list = [];
|
||||
$xu_list = [];
|
||||
$level_list = [];
|
||||
|
||||
$sp = mysql_query('SELECT `id`,`level`,`name` FROM `clan`');
|
||||
while ($pl = mysql_fetch_array($sp)) {
|
||||
$timday = time() - 86400;
|
||||
$xu = mysql_fetch_array(
|
||||
mysql_query(
|
||||
'SELECT COUNT(`id`) FROM `users` WHERE `clan` = "' . $pl['id'] . '" AND `admin` = 0 AND `online` > "' . $timday . '" AND `real` = 1 LIMIT 1'
|
||||
)
|
||||
);
|
||||
$xu = $xu[0];
|
||||
|
||||
$clanw = mysql_fetch_array(
|
||||
mysql_query(
|
||||
'SELECT COUNT(`id`) FROM `battle` WHERE `type` = 250 AND `time_over` > "' . $timday . '" AND ((`team_win`=1 AND `clan1` = "' . $pl['id'] . '") OR (`team_win`=2 AND `clan2` = "' . $pl['id'] . '")) LIMIT 1'
|
||||
)
|
||||
);
|
||||
$clanw = $clanw[0];
|
||||
|
||||
$clanl = mysql_fetch_array(
|
||||
mysql_query(
|
||||
'SELECT COUNT(`id`) FROM `battle` WHERE `type` = 250 AND `time_over` > "' . $timday . '" AND ((`team_win`=2 AND `clan1` = "' . $pl['id'] . '") OR (`team_win`=1 AND `clan2` = "' . $pl['id'] . '")) LIMIT 1'
|
||||
)
|
||||
);
|
||||
$clanl = $clanl[0];
|
||||
|
||||
//$st = mysql_fetch_array(mysql_query('SELECT SUM(`val`) AS `exp` FROM `users_reting` WHERE `clan` = "'.$pl['id'].'" LIMIT 1'));
|
||||
$st = mysql_fetch_array(mysql_query('SELECT `exp` FROM `clan` WHERE `id` = "' . $pl['id'] . '" LIMIT 1'));
|
||||
|
||||
$wn = mysql_fetch_array(
|
||||
mysql_query(
|
||||
'SELECT SUM(`win`) AS `win` , SUM(`lose`) AS `lose` , SUM(`nich`) AS `nich` FROM `users` WHERE `clan` = "' . $pl['id'] . '" LIMIT 1'
|
||||
)
|
||||
);
|
||||
|
||||
$rl = mysql_fetch_array(
|
||||
mysql_query(
|
||||
'SELECT `exp`,`global`,`exp_real`, `win`,`lose` FROM `aaa_clan_reting_list` WHERE `clan` = "' . $pl['id'] . '" ORDER BY `id` DESC LIMIT 1'
|
||||
)
|
||||
);
|
||||
|
||||
$exp_list[$pl['id']] = $st['exp'];
|
||||
$log_list[$pl['id']] = $pl['name'];
|
||||
$level_list[$pl['id']] = $pl['level'];
|
||||
$win_list[$pl['id']] = $wn['win'];
|
||||
$lose_list[$pl['id']] = $wn['lose'];
|
||||
$nich_list[$pl['id']] = $wn['nich'];
|
||||
|
||||
$xu_list[$pl['id']] = $xu;
|
||||
$add_exp = 0;
|
||||
if (date('d') == 1) {
|
||||
$global_exp = 0;
|
||||
} else {
|
||||
$global_exp = round($rl['global']);
|
||||
}
|
||||
|
||||
$xul = mysql_query(
|
||||
'SELECT `st`.`repexp`,`st`.`id` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`clan`="' . $pl['id'] . '"'
|
||||
);
|
||||
while ($xull = mysql_fetch_array($xul)) {
|
||||
$add_exp = $add_exp + $xull['repexp'];
|
||||
mysql_query('UPDATE `stats` SET `repexp` = 0 WHERE `id` = "' . $xull['id'] . '" LIMIT 1');
|
||||
}
|
||||
|
||||
if ($xu > 0 && $pl['id'] != 62 && $pl['id'] != 93) {
|
||||
$add_exp_list[$pl['id']] = $add_exp; //çàïèñûâàåì ñêîëüêî îïûòà ïîëó÷èë çà ñåãîäíÿ
|
||||
$all_exp_list[$pl['id']] = $global_exp + $add_exp; //çàïèñûâàåì ñêîëüêî îïûòà ïîëó÷èë âñåãî + ñåãîäíÿøíèé
|
||||
} else {
|
||||
$add_exp_list[$pl['id']] = 0; //çàïèñûâàåì ñêîëüêî îïûòà ïîëó÷èë çà ñåãîäíÿ
|
||||
$all_exp_list[$pl['id']] = 0; //çàïèñûâàåì ñêîëüêî îïûòà ïîëó÷èë âñåãî + ñåãîäíÿøíèé
|
||||
}
|
||||
|
||||
}
|
||||
define('GAME',true);
|
||||
require_once('_incl_data/__config.php');
|
||||
require_once('_incl_data/class/__db_connect.php');
|
||||
|
||||
$add_exp_list = array();
|
||||
$all_exp_list = array();
|
||||
$exp_list = array();
|
||||
$win_list = array();
|
||||
$lose_list = array();
|
||||
$nich_list = array();
|
||||
$xu_list = array();
|
||||
$level_list = array();
|
||||
unset($pl, $sp, $xul, $xull);
|
||||
|
||||
$sp = mysql_query('SELECT `id`,`level`,`name` FROM `clan`');
|
||||
while( $pl = mysql_fetch_array($sp) ) {
|
||||
$timday=time()-86400;
|
||||
$xu = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `users` WHERE `clan` = "'.$pl['id'].'" AND `admin` = 0 AND `online` > "'.$timday.'" AND `real` = 1 LIMIT 1'));
|
||||
$xu = $xu[0];
|
||||
arsort($all_exp_list);
|
||||
|
||||
$clanw = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `battle` WHERE `type` = 250 AND `time_over` > "'.$timday.'" AND ((`team_win`=1 AND `clan1` = "'.$pl['id'].'") OR (`team_win`=2 AND `clan2` = "'.$pl['id'].'")) LIMIT 1'));
|
||||
$clanw = $clanw[0];
|
||||
$keys = array_keys($all_exp_list);
|
||||
$i = 0;
|
||||
while ($i <= count($keys)) {
|
||||
if (isset($keys[$i])) {
|
||||
mysql_query(
|
||||
'INSERT INTO `aaa_clan_reting_list` ( `level`,`xu`,`win`,`lose`,`nich`,`exp_real`,`clan`,`pos`,`global`,`exp`,`date`,`time` ) VALUES (
|
||||
"' . $level_list[$keys[$i]] . '","' . $xu_list[$keys[$i]] . '","' . $win_list[$keys[$i]] . '","' . $lose_list[$keys[$i]] . '","' . $nich_list[$keys[$i]] . '","' . $exp_list[$keys[$i]] . '","' . $keys[$i] . '","' . ($i + 1) . '","' . $all_exp_list[$keys[$i]] . '","' . $add_exp_list[$keys[$i]] . '","' . date(
|
||||
'dmY'
|
||||
) . '","' . time() . '"
|
||||
)'
|
||||
);
|
||||
if ($i == 0) {
|
||||
mysql_query(
|
||||
'UPDATE `clan` SET `money2` = `money2` + "' . ($xu_list[$keys[$i]] * 3 / 10) . '" WHERE `id` = "' . $keys[$i] . '" LIMIT 1'
|
||||
);
|
||||
mysql_query(
|
||||
'INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("<font color=#cb0000><b>Ðåéòèíã êëàíîâ ' . date(
|
||||
'd-m-Y'
|
||||
) . ':</b></font>","capitalcity","","6","1","' . time() . '")'
|
||||
);
|
||||
mysql_query(
|
||||
'INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("<font color=#000000>Êëàí ' . $log_list[$keys[$i]] . ' ïîëó÷àåò ' . ($xu_list[$keys[$i]] * 3 / 10) . ' Åêð. â êàçíó êëàíà çà 1-å ìåñòî â ðåéòèíãå.</font>","capitalcity","","6","1","' . time(
|
||||
) . '")'
|
||||
);
|
||||
} elseif ($i == 1) {
|
||||
mysql_query(
|
||||
'UPDATE `clan` SET `money2` = `money2` + "' . ($xu_list[$keys[$i]] * 2 / 10) . '" WHERE `id` = "' . $keys[$i] . '" LIMIT 1'
|
||||
);
|
||||
mysql_query(
|
||||
'INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("<font color=#000000>Êëàí ' . $log_list[$keys[$i]] . ' ïîëó÷àåò ' . ($xu_list[$keys[$i]] * 2 / 10) . ' Åêð. â êàçíó êëàíà çà 2-å ìåñòî â ðåéòèíãå.</font>","capitalcity","","6","1","' . time(
|
||||
) . '")'
|
||||
);
|
||||
} elseif ($i == 2) {
|
||||
mysql_query(
|
||||
'UPDATE `clan` SET `money2` = `money2` + "' . ($xu_list[$keys[$i]] * 1 / 10) . '" WHERE `id` = "' . $keys[$i] . '" LIMIT 1'
|
||||
);
|
||||
mysql_query(
|
||||
'INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("<font color=#000000>Êëàí ' . $log_list[$keys[$i]] . ' ïîëó÷àåò ' . ($xu_list[$keys[$i]] * 1 / 10) . ' Åêð. â êàçíó êëàíà çà 3-å ìåñòî â ðåéòèíãå.</font>","capitalcity","","6","1","' . time(
|
||||
) . '")'
|
||||
);
|
||||
}
|
||||
|
||||
$clanl = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `battle` WHERE `type` = 250 AND `time_over` > "'.$timday.'" AND ((`team_win`=2 AND `clan1` = "'.$pl['id'].'") OR (`team_win`=1 AND `clan2` = "'.$pl['id'].'")) LIMIT 1'));
|
||||
$clanl = $clanl[0];
|
||||
|
||||
//$st = mysql_fetch_array(mysql_query('SELECT SUM(`val`) AS `exp` FROM `users_reting` WHERE `clan` = "'.$pl['id'].'" LIMIT 1'));
|
||||
$st = mysql_fetch_array(mysql_query('SELECT `exp` FROM `clan` WHERE `id` = "'.$pl['id'].'" LIMIT 1'));
|
||||
|
||||
$wn = mysql_fetch_array(mysql_query('SELECT SUM(`win`) AS `win` , SUM(`lose`) AS `lose` , SUM(`nich`) AS `nich` FROM `users` WHERE `clan` = "'.$pl['id'].'" LIMIT 1'));
|
||||
|
||||
$rl = mysql_fetch_array(mysql_query('SELECT `exp`,`global`,`exp_real`, `win`,`lose` FROM `aaa_clan_reting_list` WHERE `clan` = "'.$pl['id'].'" ORDER BY `id` DESC LIMIT 1'));
|
||||
|
||||
$exp_list[$pl['id']] = $st['exp'];
|
||||
$log_list[$pl['id']] = $pl['name'];
|
||||
$level_list[$pl['id']] = $pl['level'];
|
||||
$win_list[$pl['id']] = $wn['win'];
|
||||
$lose_list[$pl['id']] = $wn['lose'];
|
||||
$nich_list[$pl['id']] = $wn['nich'];
|
||||
|
||||
$xu_list[$pl['id']] = $xu;
|
||||
$add_exp = 0 ;
|
||||
if( date('d') == 1)
|
||||
{
|
||||
$global_exp = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$global_exp = round($rl['global']);
|
||||
}
|
||||
//$xul = mysql_query('SELECT `level` FROM `users` WHERE `clan` = "'.$pl['id'].'" AND `admin` = 0 AND `real` = 1 LIMIT 1');
|
||||
$xul = mysql_query('SELECT `st`.`repexp`,`st`.`id` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`clan`="'.$pl['id'].'"');
|
||||
while( $xull = mysql_fetch_array($xul) )
|
||||
{
|
||||
$add_exp = $add_exp + $xull['repexp'];
|
||||
mysql_query('UPDATE `stats` SET `repexp` = 0 WHERE `id` = "'.$xull['id'].'" LIMIT 1');
|
||||
}
|
||||
|
||||
if ($xu > 0 && $pl['id'] !=62 && $pl['id'] !=93 )
|
||||
{
|
||||
$add_exp_list[$pl['id']] = $add_exp; //çàïèñûâàåì ñêîëüêî îïûòà ïîëó÷èë çà ñåãîäíÿ
|
||||
$all_exp_list[$pl['id']] = $global_exp+$add_exp; //çàïèñûâàåì ñêîëüêî îïûòà ïîëó÷èë âñåãî + ñåãîäíÿøíèé
|
||||
}
|
||||
else
|
||||
{
|
||||
$add_exp_list[$pl['id']] = 0; //çàïèñûâàåì ñêîëüêî îïûòà ïîëó÷èë çà ñåãîäíÿ
|
||||
$all_exp_list[$pl['id']] = 0; //çàïèñûâàåì ñêîëüêî îïûòà ïîëó÷èë âñåãî + ñåãîäíÿøíèé
|
||||
}
|
||||
|
||||
//$nonlin=mysql_fetch_array(mysql_query('SELECT COUNT(*) as num FROM `users` WHERE `clan` = "'.$pl['id'].'" AND `online` < "'.(time()-86400).'" '));
|
||||
//$all_exp_list[$pl['id']] -= $nonlin['num']*50000;
|
||||
}
|
||||
|
||||
unset($pl,$sp,$xul,$xull);
|
||||
|
||||
arsort($all_exp_list);
|
||||
|
||||
$keys = array_keys($all_exp_list);
|
||||
$i = 0;
|
||||
while( $i <= count($keys) ) {
|
||||
if( isset($keys[$i]) ) {
|
||||
mysql_query('INSERT INTO `aaa_clan_reting_list` ( `level`,`xu`,`win`,`lose`,`nich`,`exp_real`,`clan`,`pos`,`global`,`exp`,`date`,`time` ) VALUES (
|
||||
"'.$level_list[$keys[$i]].'","'.$xu_list[$keys[$i]].'","'.$win_list[$keys[$i]].'","'.$lose_list[$keys[$i]].'","'.$nich_list[$keys[$i]].'","'.$exp_list[$keys[$i]].'","'.$keys[$i].'","'.($i+1).'","'.$all_exp_list[$keys[$i]].'","'.$add_exp_list[$keys[$i]].'","'.date('dmY').'","'.time().'"
|
||||
)');
|
||||
if ($i == 0)
|
||||
{
|
||||
mysql_query('UPDATE `clan` SET `money2` = `money2` + "'.($xu_list[$keys[$i]]*3/10).'" WHERE `id` = "'.$keys[$i].'" LIMIT 1');
|
||||
mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("<font color=#cb0000><b>Ðåéòèíã êëàíîâ '.date('d-m-Y').':</b></font>","capitalcity","","6","1","'.time().'")');
|
||||
mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("<font color=#000000>Êëàí '.$log_list[$keys[$i]].' ïîëó÷àåò '.($xu_list[$keys[$i]]*3/10).' Åêð. â êàçíó êëàíà çà 1-å ìåñòî â ðåéòèíãå.</font>","capitalcity","","6","1","'.time().'")');
|
||||
}
|
||||
elseif ($i == 1)
|
||||
{
|
||||
mysql_query('UPDATE `clan` SET `money2` = `money2` + "'.($xu_list[$keys[$i]]*2/10).'" WHERE `id` = "'.$keys[$i].'" LIMIT 1');
|
||||
mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("<font color=#000000>Êëàí '.$log_list[$keys[$i]].' ïîëó÷àåò '.($xu_list[$keys[$i]]*2/10).' Åêð. â êàçíó êëàíà çà 2-å ìåñòî â ðåéòèíãå.</font>","capitalcity","","6","1","'.time().'")');
|
||||
}
|
||||
elseif ($i == 2)
|
||||
{
|
||||
mysql_query('UPDATE `clan` SET `money2` = `money2` + "'.($xu_list[$keys[$i]]*1/10).'" WHERE `id` = "'.$keys[$i].'" LIMIT 1');
|
||||
mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("<font color=#000000>Êëàí '.$log_list[$keys[$i]].' ïîëó÷àåò '.($xu_list[$keys[$i]]*1/10).' Åêð. â êàçíó êëàíà çà 3-å ìåñòî â ðåéòèíãå.</font>","capitalcity","","6","1","'.time().'")');
|
||||
}
|
||||
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
mysql_query('UPDATE `stats` SET `repexp` = 0 WHERE `repexp` > 0');
|
||||
?>
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
mysql_query('UPDATE `stats` SET `repexp` = 0 WHERE `repexp` > 0');
|
||||
|
@ -1,139 +1,144 @@
|
||||
<?
|
||||
function getIP() {
|
||||
if(isset($_SERVER['HTTP_X_REAL_IP'])) return $_SERVER['HTTP_X_REAL_IP'];
|
||||
return $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
<?php
|
||||
|
||||
const GAME = true;
|
||||
|
||||
if(getIP() != $_SERVER['SERVER_ADDR'] && getIP() != '127.0.0.1') {
|
||||
if(!isset($_GET['test15684555'])) {
|
||||
die(getIP().'<br>'.$_SERVER['SERVER_ADDR']);
|
||||
}
|
||||
}
|
||||
define('GAME',true);
|
||||
require_once('_incl_data/__config.php');
|
||||
require_once('_incl_data/class/__db_connect.php');
|
||||
if (UserIp::get() != $_SERVER['SERVER_ADDR'] && UserIp::get() != '127.0.0.1' && !isset($_GET['test15684555'])) {
|
||||
die(UserIp::get() . '<br>' . $_SERVER['SERVER_ADDR']);
|
||||
}
|
||||
|
||||
//if(isset($_GET['test'])) {
|
||||
//Ðåéòèíã ïî âêëàäàì
|
||||
$ub = [];
|
||||
$ui = [];
|
||||
$sp = mysql_query('SELECT * FROM `pay_operation` WHERE `good` > 0 ORDER BY `id` DESC');
|
||||
while ($pl = mysql_fetch_array($sp)) {
|
||||
if (!isset($ub[$pl['uid']])) {
|
||||
$ui[] = $pl['uid'];
|
||||
}
|
||||
$ub[$pl['uid']][date('d.m.Y', $pl['good'])] = $pl['ekr'];
|
||||
}
|
||||
$i = 0;
|
||||
while ($i < count($ui)) {
|
||||
if (isset($ui[$i])) {
|
||||
$j = 1;
|
||||
$k = 0;
|
||||
$nj = 0;
|
||||
while ($j <= 1000) {
|
||||
$dt = date('d.m.Y', time() - (86400 * $j));
|
||||
if (isset($ub[$ui[$i]][$dt])) {
|
||||
$k++;
|
||||
$nj = 0;
|
||||
} elseif ($j > 0 && $nj >= 6) {
|
||||
$j = 1000;
|
||||
} else {
|
||||
$nj++;
|
||||
}
|
||||
$j++;
|
||||
}
|
||||
mysql_query('DELETE FROM `users_paybonus` WHERE `id` = "' . $ui[$i] . '" LIMIT 1');
|
||||
mysql_query(
|
||||
'INSERT INTO `users_paybonus` (`id`,`level`) VALUES (
|
||||
"' . $ui[$i] . '","' . $k . '"
|
||||
)'
|
||||
);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
//Ðåéòèíã ïî âêëàäàì
|
||||
$ub = array();
|
||||
$ui = array();
|
||||
$sp = mysql_query('SELECT * FROM `pay_operation` WHERE `good` > 0 ORDER BY `id` DESC');
|
||||
while( $pl = mysql_fetch_array($sp) ) {
|
||||
if(!isset($ub[$pl['uid']])) {
|
||||
$ui[] = $pl['uid'];
|
||||
}
|
||||
$ub[$pl['uid']][date('d.m.Y',$pl['good'])] = $pl['ekr'];
|
||||
}
|
||||
$i = 0;
|
||||
while( $i < count($ui) ) {
|
||||
if(isset($ui[$i])) {
|
||||
$j = 1;
|
||||
$k = 0;
|
||||
$nj = 0;
|
||||
while( $j <= 1000 ) {
|
||||
$dt = date('d.m.Y',time() - (86400 * $j));
|
||||
if( isset($ub[$ui[$i]][$dt]) ) {
|
||||
$k++;
|
||||
$nj = 0;
|
||||
}elseif( $j > 0 && $nj >= 6 ) {
|
||||
$j = 1000;
|
||||
}else{
|
||||
$nj++;
|
||||
}
|
||||
$j++;
|
||||
}
|
||||
mysql_query('DELETE FROM `users_paybonus` WHERE `id` = "'.$ui[$i].'" LIMIT 1');
|
||||
mysql_query('INSERT INTO `users_paybonus` (`id`,`level`) VALUES (
|
||||
"'.$ui[$i].'","'.$k.'"
|
||||
)');
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$add_exp_list = [];
|
||||
$all_exp_list = [];
|
||||
$exp_list = [];
|
||||
$win_list = [];
|
||||
|
||||
$add_exp_list = array();
|
||||
$all_exp_list = array();
|
||||
$exp_list = array();
|
||||
$win_list = array();
|
||||
$test = mysql_fetch_array(
|
||||
mysql_query('SELECT `id` FROM `aaa_reting_list` WHERE `date` = "' . date('dmY') . '" LIMIT 1')
|
||||
);
|
||||
if (isset($test['id'])) {
|
||||
mysql_query('DELETE FROM `aaa_reting_list` WHERE `date` = "' . date('dmY') . '"');
|
||||
}
|
||||
unset($test);
|
||||
|
||||
$test = mysql_fetch_array(mysql_query('SELECT `id` FROM `aaa_reting_list` WHERE `date` = "'.date('dmY').'" LIMIT 1'));
|
||||
if(isset($test['id'])) {
|
||||
mysql_query('DELETE FROM `aaa_reting_list` WHERE `date` = "'.date('dmY').'"');
|
||||
}
|
||||
unset($test);
|
||||
$sp = mysql_query('SELECT `id`,`login`,`win` FROM `users` WHERE `real` = 1 AND `admin` = 0');
|
||||
while ($pl = mysql_fetch_array($sp)) {
|
||||
$st = mysql_fetch_array(
|
||||
mysql_query('SELECT `id`,`exp`,`repexp` FROM `stats` WHERE `id` = "' . $pl['id'] . '" AND `bot` = 0 LIMIT 1')
|
||||
);
|
||||
$rl = mysql_fetch_array(
|
||||
mysql_query(
|
||||
'SELECT `exp`,`global`,`exp_real` FROM `aaa_reting_list` WHERE `uid` = "' . $pl['id'] . '" ORDER BY `id` DESC LIMIT 1'
|
||||
)
|
||||
);
|
||||
|
||||
$sp = mysql_query('SELECT `id`,`login`,`win` FROM `users` WHERE `real` = 1 AND `admin` = 0');
|
||||
while( $pl = mysql_fetch_array($sp) ) {
|
||||
$st = mysql_fetch_array(mysql_query('SELECT `id`,`exp`,`repexp` FROM `stats` WHERE `id` = "'.$pl['id'].'" AND `bot` = 0 LIMIT 1'));
|
||||
$rl = mysql_fetch_array(mysql_query('SELECT `exp`,`global`,`exp_real` FROM `aaa_reting_list` WHERE `uid` = "'.$pl['id'].'" ORDER BY `id` DESC LIMIT 1'));
|
||||
$exp_list[$pl['id']] = $st['exp'];
|
||||
|
||||
$exp_list[$pl['id']] = $st['exp'];
|
||||
$win_list[$pl['id']] = $pl['win'];
|
||||
$log_list[$pl['id']] = $pl['login'];
|
||||
|
||||
$win_list[$pl['id']] = $pl['win'];
|
||||
$log_list[$pl['id']] = $pl['login'];
|
||||
$add_exp = $st['exp']; // - $rl['exp_real'];
|
||||
if (date('d') == 1) {
|
||||
$global_exp = 0; //çíà÷åíèå ðåéòèíãà îáíóëÿåòñÿ 1ãî ÷èñëà
|
||||
} else {
|
||||
//$global_exp = 0;
|
||||
$global_exp = round($rl['global']);
|
||||
}
|
||||
$global_exp = $global_exp + round($st['repexp']);
|
||||
|
||||
$add_exp = $st['exp']; // - $rl['exp_real'];
|
||||
if( date('d') == 1)
|
||||
{
|
||||
$global_exp = 0; //çíà÷åíèå ðåéòèíãà îáíóëÿåòñÿ 1ãî ÷èñëà
|
||||
}
|
||||
else
|
||||
{
|
||||
//$global_exp = 0;
|
||||
$global_exp = round($rl['global']);
|
||||
}
|
||||
$global_exp = $global_exp + round($st['repexp']);
|
||||
//$cp = mysql_query('SELECT `exp` FROM `aaa_reting_list` WHERE `uid` = "'.$pl['id'].'" ORDER BY `id` DESC LIMIT 100');
|
||||
//$dd = 0;
|
||||
//while( $cl = mysql_fetch_array($cp) ) {
|
||||
// $global_exp += round($cl['exp']/100*(100-$dd));
|
||||
// $dd++;
|
||||
//}
|
||||
$add_exp_list[$pl['id']] = $add_exp; //çàïèñûâàåì ñêîëüêî îïûòà ïîëó÷èë çà ñåãîäíÿ
|
||||
$all_exp_list[$pl['id']] = $global_exp;// + $add_exp; //çàïèñûâàåì ñêîëüêî îïûòà ïîëó÷èë âñåãî + ñåãîäíÿøíèé
|
||||
}
|
||||
unset($pl, $sp);
|
||||
|
||||
$add_exp_list[$pl['id']] = $add_exp; //çàïèñûâàåì ñêîëüêî îïûòà ïîëó÷èë çà ñåãîäíÿ
|
||||
$all_exp_list[$pl['id']] = $global_exp;// + $add_exp; //çàïèñûâàåì ñêîëüêî îïûòà ïîëó÷èë âñåãî + ñåãîäíÿøíèé
|
||||
}
|
||||
unset($pl,$sp);
|
||||
arsort($all_exp_list);
|
||||
|
||||
arsort($all_exp_list);
|
||||
$keys = array_keys($all_exp_list);
|
||||
|
||||
$keys = array_keys($all_exp_list);
|
||||
|
||||
$i = 0;
|
||||
while( $i <= count($keys) ) {
|
||||
if( isset($keys[$i]) ) {
|
||||
mysql_query('INSERT INTO `aaa_reting_list` ( `win`,`exp_real`,`uid`,`pos`,`global`,`exp`,`date`,`time` ) VALUES (
|
||||
"'.$win_list[$keys[$i]].'","'.$exp_list[$keys[$i]].'","'.$keys[$i].'","'.($i+1).'","'.$all_exp_list[$keys[$i]].'","'.$add_exp_list[$keys[$i]].'","'.date('dmY').'","'.time().'"
|
||||
)');
|
||||
if ($i == 0)
|
||||
{
|
||||
mysql_query('UPDATE `users` SET `money2` = `money2` + 1 WHERE `id` = "'.$keys[$i].'" LIMIT 1');
|
||||
mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("<font color=#cb0000><b>Ðåéòèíã èãðîêîâ '.date('d-m-Y').':</b></font>","capitalcity","","6","1","'.time().'")');
|
||||
mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("<font color=#000000>Èãðîê '.$log_list[$keys[$i]].' ïîëó÷àåò 1 Åêð. çà 1-å ìåñòî â ðåéòèíãå.</font>","capitalcity","","6","1","'.time().'")');
|
||||
}
|
||||
elseif ($i == 1)
|
||||
{
|
||||
mysql_query('UPDATE `users` SET `money2` = `money2` + 0.75 WHERE `id` = "'.$keys[$i].'" LIMIT 1');
|
||||
mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("<font color=#000000>Èãðîê '.$log_list[$keys[$i]].' ïîëó÷àåò 0.75 …êð. çà 2-å ìåñòî â ðåéòèíãå.</font>","capitalcity","","6","1","'.time().'")');
|
||||
}
|
||||
elseif ($i == 2)
|
||||
{
|
||||
mysql_query('UPDATE `users` SET `money2` = `money2` + 0.5 WHERE `id` = "'.$keys[$i].'" LIMIT 1');
|
||||
mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("<font color=#000000>Èãðîê '.$log_list[$keys[$i]].' ïîëó÷àåò 0.5 …êð. çà 3-å ìåñòî â ðåéòèíãå.</font>","capitalcity","","6","1","'.time().'")');
|
||||
}
|
||||
elseif ($i == 3)
|
||||
{
|
||||
mysql_query('UPDATE `users` SET `money2` = `money2` + 0.25 WHERE `id` = "'.$keys[$i].'" LIMIT 1');
|
||||
mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("<font color=#000000>Èãðîê '.$log_list[$keys[$i]].' ïîëó÷àåò 0.25 …êð. çà 4-å ìåñòî â ðåéòèíãå.</font>","capitalcity","","6","1","'.time().'")');
|
||||
}
|
||||
elseif ($i == 4)
|
||||
{
|
||||
mysql_query('UPDATE `users` SET `money2` = `money2` + 0.15 WHERE `id` = "'.$keys[$i].'" LIMIT 1');
|
||||
mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("<font color=#000000>Èãðîê '.$log_list[$keys[$i]].' ïîëó÷àåò 0.15 …êð. çà 5-å ìåñòî â ðåéòèíãå.</font>","capitalcity","","6","1","'.time().'")');
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
//}
|
||||
?>
|
||||
$i = 0;
|
||||
while ($i <= count($keys)) {
|
||||
if (isset($keys[$i])) {
|
||||
mysql_query(
|
||||
'INSERT INTO `aaa_reting_list` ( `win`,`exp_real`,`uid`,`pos`,`global`,`exp`,`date`,`time` ) VALUES (
|
||||
"' . $win_list[$keys[$i]] . '","' . $exp_list[$keys[$i]] . '","' . $keys[$i] . '","' . ($i + 1) . '","' . $all_exp_list[$keys[$i]] . '","' . $add_exp_list[$keys[$i]] . '","' . date(
|
||||
'dmY'
|
||||
) . '","' . time() . '"
|
||||
)'
|
||||
);
|
||||
if ($i == 0) {
|
||||
mysql_query('UPDATE `users` SET `money2` = `money2` + 1 WHERE `id` = "' . $keys[$i] . '" LIMIT 1');
|
||||
mysql_query(
|
||||
'INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("<font color=#cb0000><b>Ðåéòèíã èãðîêîâ ' . date(
|
||||
'd-m-Y'
|
||||
) . ':</b></font>","capitalcity","","6","1","' . time() . '")'
|
||||
);
|
||||
mysql_query(
|
||||
'INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("<font color=#000000>Èãðîê ' . $log_list[$keys[$i]] . ' ïîëó÷àåò 1 Åêð. çà 1-å ìåñòî â ðåéòèíãå.</font>","capitalcity","","6","1","' . time(
|
||||
) . '")'
|
||||
);
|
||||
} elseif ($i == 1) {
|
||||
mysql_query('UPDATE `users` SET `money2` = `money2` + 0.75 WHERE `id` = "' . $keys[$i] . '" LIMIT 1');
|
||||
mysql_query(
|
||||
'INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("<font color=#000000>Èãðîê ' . $log_list[$keys[$i]] . ' ïîëó÷àåò 0.75 …êð. çà 2-å ìåñòî â ðåéòèíãå.</font>","capitalcity","","6","1","' . time(
|
||||
) . '")'
|
||||
);
|
||||
} elseif ($i == 2) {
|
||||
mysql_query('UPDATE `users` SET `money2` = `money2` + 0.5 WHERE `id` = "' . $keys[$i] . '" LIMIT 1');
|
||||
mysql_query(
|
||||
'INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("<font color=#000000>Èãðîê ' . $log_list[$keys[$i]] . ' ïîëó÷àåò 0.5 …êð. çà 3-å ìåñòî â ðåéòèíãå.</font>","capitalcity","","6","1","' . time(
|
||||
) . '")'
|
||||
);
|
||||
} elseif ($i == 3) {
|
||||
mysql_query('UPDATE `users` SET `money2` = `money2` + 0.25 WHERE `id` = "' . $keys[$i] . '" LIMIT 1');
|
||||
mysql_query(
|
||||
'INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("<font color=#000000>Èãðîê ' . $log_list[$keys[$i]] . ' ïîëó÷àåò 0.25 …êð. çà 4-å ìåñòî â ðåéòèíãå.</font>","capitalcity","","6","1","' . time(
|
||||
) . '")'
|
||||
);
|
||||
} elseif ($i == 4) {
|
||||
mysql_query('UPDATE `users` SET `money2` = `money2` + 0.15 WHERE `id` = "' . $keys[$i] . '" LIMIT 1');
|
||||
mysql_query(
|
||||
'INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("<font color=#000000>Èãðîê ' . $log_list[$keys[$i]] . ' ïîëó÷àåò 0.15 …êð. çà 5-å ìåñòî â ðåéòèíãå.</font>","capitalcity","","6","1","' . time(
|
||||
) . '")'
|
||||
);
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user