game/cron_prizhaot.php

32 lines
1.2 KiB
PHP

<?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');
//Ïîäàåì òóðíèð (õàîò) äëÿ 8-11 óðîâíåé
$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(
[
"<i style='color: green;'>Àâòîçàÿâêà! <b>Òåñò ïðîøó íå çàõîäèòü</b></i>",
1, 1, 'capitalcity', 0, 33, 300, 180, 8, 8, 12, 12, 1, 5, 1, 1, 40, 0, 0,
]
);
$pdo->prepare('insert into chat (`text`,`type`,`new`,`time`) values (?,?,?,unix_timestamp())')
->execute(
["<span style='color: red'>Âíèìàíèå!!!</span> <span style='color:#cb0000'><b>Ãåðîè÷åñêîå Ñðàæåíèå</b> íà÷àëîñü.</span>", 6, 1,]
);
echo $inc ? 'true' : 'false';