userdata["acclevel"] < 80) die ("Access denied!");
?>
title; ?>
query($query);
$cheater = array();
$query = "UPDATE hlstats_Players SET last_event = IF(hideranking <> 2, UNIX_TIMESTAMP(), last_event), hideranking = 2 WHERE playerId IN ";
$insert_part = "";
$first = 0;
while (list($player_id) = $db->fetch_row($result)) {
if ($first == 0)
$insert_part = "(".$player_id;
else
$insert_part .= ",".$player_id;
$first++;
}
if ($first > 0) {
echo "
Updating $first cheaters...";
$insert_part .= ")";
$update_query = $query.$insert_part;
$db->query($update_query);
echo "OK";
}
}
if (isset($_POST['confirm']))
{
echo "\n";
$s_id = $_POST['masterserver'];
$host = $servers[$s_id]["host"];
$port = $servers[$s_id]["port"];
echo "- Requesting cheaterlist from $host:$port...";
$host = gethostbyname($host);
$socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
$packet = $servers[$s_id]["packet"];
$bytes_sent = socket_sendto($socket, $packet, strlen($packet), 0, $host, $port);
echo "".$bytes_sent." bytes OK
";
echo "- Retrieving data from masterserver...";
$recv_bytes = 0;
$buffer = "";
$timeout = 30;
$answer = "";
$packets = 0;
$read = array($socket);
while (socket_select($read, $write = NULL, $except = NULL, &$timeout) > 0) {
$recv_bytes += socket_recvfrom($socket, &$buffer, 2000, 0, &$host, &$port);
if (($buffer[0] == chr(255)) && ($buffer[1] == chr(255)) && ($buffer[2] == "Z") && ($buffer[3] == chr(255)) &&
($buffer[4] == "1") && ($buffer[5] == ".") && ($buffer[6] == "0") && ($buffer[7] == "0") && ($buffer[8] == chr(255))) {
$answer .= substr($buffer, 9, strlen($buffer));
}
$buffer = "";
$timeout = "1";
$packets++;
}
$steam_ids = explode(chr(255), $answer);
array_pop($steam_ids);
echo "recieving $recv_bytes bytes in $packets packets...".count($steam_ids)." cheaters...OK
";
$query = "SELECT playerId FROM hlstats_PlayerUniqueIds WHERE uniqueId in ";
$insert_part = "";
$first = 0;
foreach ($steam_ids as $entry) {
// temporary: used to transfer current cheaters to elstatsneo masterserver ~~ 30000 cheaters transferred :)
// $db->query("INSERT INTO vac_ids VALUES ('$entry')");
if ($first == 0)
$insert_part = "('".$entry."'";
else
$insert_part .= ",'".$entry."'";
$first++;
if ($first % 50 == 0) {
$insert_part .= ")";
$select_query = $query.$insert_part;
hide_cheaters($select_query);
$insert_part = "";
$first = 0;
}
}
if ($first > 0) {
$insert_part .= ")";
$select_query = $query.$insert_part;
hide_cheaters($select_query);
}
echo "- Closing connection to masterserver...";
socket_close($socket);
echo "OK
";
echo "
\n";
} else {
?>