2022-06-06 21:30:34 +00:00
< ? php
# <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> IP
2022-08-25 11:23:36 +00:00
function getIPblock ()
{
return isset ( $_SERVER [ 'HTTP_X_REAL_IP' ]) ? $_SERVER [ 'HTTP_X_REAL_IP' ] : $_SERVER [ 'REMOTE_ADDR' ];
2022-06-06 21:30:34 +00:00
}
# <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
2022-08-25 11:23:36 +00:00
if ( $_SERVER [ 'HTTP_CF_CONNECTING_IP' ] != $_SERVER [ 'SERVER_ADDR' ] && $_SERVER [ 'HTTP_CF_CONNECTING_IP' ] != '127.0.0.1' ) {
die ( 'Hello pussy!' );
}
if ( getIPblock () != $_SERVER [ 'SERVER_ADDR' ] && getIPblock () != '127.0.0.1' && getIPblock () != '' && getIPblock () != '5.187.7.71' ) {
die ( getIPblock () . '<br>' . $_SERVER [ 'SERVER_ADDR' ]);
2022-06-06 21:30:34 +00:00
}
2022-08-25 11:23:36 +00:00
const GAME = true ;
2022-06-06 21:30:34 +00:00
include ( '_incl_data/__config.php' );
include ( '_incl_data/class/__db_connect.php' );
2022-08-25 11:23:36 +00:00
/**@var $pdo PDO */
$zv = new FightRequest ();
2022-06-06 21:30:34 +00:00
2022-08-25 11:23:36 +00:00
function send_chat ( $type , $from , $text , $time )
{
global $pdo ;
$pdo -> prepare ( 'insert into chat (text, city, login, type, new, time, room) values (?,?,?,?,?,?,?)' ) -> execute ([ $text , 'capitalcity' , $from , $type , 1 , $time , 3 ]);
2022-06-06 21:30:34 +00:00
}
2022-08-25 11:23:36 +00:00
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>' ;
}
2022-06-06 21:30:34 +00:00
}
2022-08-25 11:23:36 +00:00
$sp = $pdo -> query ( 'select id, pass from users where battle in (select id from battle where team_win = -1 and time_over = 0 and time_start < unix_timestamp() - 3600 limit 100)' );
foreach ( $sp as $pl ) {
inuser_go_btl ( $pl );
2022-06-06 21:30:34 +00:00
}
$zv -> testCronZv ();