Warning: include(config_sview.php): failed to open stream: No such file or directory in C:\xampp\htdocs\dFb\UT3Query\index.php on line 2
Warning: include(): Failed opening 'config_sview.php' for inclusion (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\dFb\UT3Query\index.php on line 2
Notice: Undefined variable: standalone in C:\xampp\htdocs\dFb\UT3Query\index.php on line 3
//
if ($TOPTEXT != ("")) echo "
$TOPTEXT
";
//
function UT3QueryServer($host,$port,&$return)
{
$sock = @fsockopen( "udp://" . $host, $port );
if ( !$sock ) return SERVERINVALID;
socket_set_timeout( $sock, 0, 500000 );
// Send challenge request.
if ( !@fwrite( $sock, "\xFE\xFD\x09\x10\x20\x30\x40\xFF\xFF\xFF\x01" ) )
return SERVER_DOWN;
// Get challenge response.
$challenge = fread( $sock, 1400 );
if ( !$challenge )
return UNKNOWN_ERROR;
$challenge = substr( preg_replace( "/[^0-9\-]/si", "", $challenge ), 1 );
$query = sprintf(
"\xFE\xFD\x00\x10\x20\x30\x40%c%c%c%c\xFF\xFF\xFF\x01",
( $challenge >> 24 ),
( $challenge >> 16 ),
( $challenge >> 8 ),
( $challenge >> 0 )
);
// Send data request.
if ( !@fwrite( $sock, $query ) )
return UNKNOWN_ERROR;
// Get data response.
$response = array();
for ($x = 0; $x < 2; $x++)
{
$response[] = @fread($sock,2048);
}
// Merge multiple packets (shouldn't be required but one never knows)
$response = implode($response);
// Strip the first irrelevant data:
$response = substr($response,16);
// Split by the \0
$response = explode("\0",$response);
// Remove the last irrelevant data:
array_pop($response);
array_pop($response);
array_pop($response);
array_pop($response);
// Build the return array:
$return = array();
$type = 0;
foreach ($response as $key)
{
if ($type == 0) $val = $key;
if ($type == 1) $return[$val] = $key;
$type == 0 ? $type = 1 : $type = 0;
}
return SERVEROK;
}
////////////////////SERVER 1
unset($server, $host, $port, $sock, $temp, $values, $returnvalue);
$server = ("$server1ip:$server1qport");
$temp = explode(':',$server);
$host = $temp[0];
$port = $temp[1];
$values = '';
$returnvalue = UT3QueryServer($host,$port,&$values);
if ($returnvalue != SERVEROK)
{
echo "