<?php

// die();

function getIP() {
   if(isset($_SERVER['HTTP_X_REAL_IP'])) return $_SERVER['HTTP_X_REAL_IP'];
   return $_SERVER['REMOTE_ADDR'];
}

if(!isset($_GET['tests'])) {
	//if( $_SERVER['HTTP_CF_CONNECTING_IP'] != $_SERVER['SERVER_ADDR'] && $_SERVER['HTTP_CF_CONNECTING_IP'] != '127.0.0.1' ) {	die('Hello pussy!');   }
	if(getIP() != $_SERVER['SERVER_ADDR'] && getIP() != '127.0.0.1' && getIP() != '51.89.6.100') {
		die(getIP().'<br>'.$_SERVER['SERVER_ADDR']);
	}
}

define('GAME',true);
setlocale(LC_CTYPE ,"ru_RU.CP1251");
include('_incl_data/__config.php');
include('_incl_data/class/__db_connect.php');
include('_incl_data/class/__user.php');
include('_incl_data/class/__magic.php');

//Подаем турнир (хаот) для 8-11 уровней
$inc = mysql_query('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`,`cancel`,`maxplayers`,`tm1max`,`tm2max`) 
VALUES ("<i><font color=green>Автозаявка! </b>Тест прошу не заходить<b></font></i>","1","1","capitalcity","0","33","300","180","8","8","12","12","1","5","'.time().'","1","1","0","40","0","0")');

$t='<font color=red>Внимание!!!</font> <b>Героическое Сражение</b> началось.';
mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("<font color=#cb0000>'.$t.'</font>","capitalcity","","6","1","'.time().'")');



if($inc) { 
	echo 'true';
}else{
	echo 'false';
}

?>