define( 'SQ_SERVER_ADDR', 'localhost' );
define( 'SQ_SERVER_PORT', 27015 );
define( 'SQ_TIMEOUT', 3 );
define( 'SQ_ENGINE', SourceQuery::SOURCE );
// Edit this <-
$Timer = MicroTime( true );
$Query = new SourceQuery( );
$Info = Array( );
$Rules = Array( );
$Players = Array( );
$Exception = null;
try
{
$Query->Connect( SQ_SERVER_ADDR, SQ_SERVER_PORT, SQ_TIMEOUT, SQ_ENGINE );
//$Query->SetUseOldGetChallengeMethod( true ); // Use this when players/rules retrieval fails on games like Starbound
$Info = $Query->GetInfo( );
$Players = $Query->GetPlayers( );
$Rules = $Query->GetRules( );
}
catch( Exception $e )
{
$Exception = $e;
}
finally
{
$Query->Disconnect( );
}
$Timer = Number_Format( MicroTime( true ) - $Timer, 4, '.', '' );
?>
Source Query PHP Library
Server Info |
s |
$InfoValue ): ?>
|
";
print_r( $InfoValue );
echo "";
}
else
{
if( $InfoValue === true )
{
echo 'true';
}
else if( $InfoValue === false )
{
echo 'false';
}
else
{
echo htmlspecialchars( $InfoValue );
}
}
?> |
No information received |
Player |
Frags |
Time |
|
|
|
No players received |
Rules |
$Value ): ?>
|
|
No rules received |