diff --git a/Example.php b/Example.php index 9a044d9..3d58c9c 100644 --- a/Example.php +++ b/Example.php @@ -5,7 +5,7 @@ Header( 'Content-Type: text/plain' ); // Edit this -> - define( 'SQ_SERVER_ADDR', 'gs2.my-run.de' ); + define( 'SQ_SERVER_ADDR', 'localhost' ); define( 'SQ_SERVER_PORT', 27015 ); define( 'SQ_TIMEOUT', 1 ); define( 'SQ_ENGINE', SourceQuery :: SOURCE ); diff --git a/RconExample.php b/RconExample.php new file mode 100644 index 0000000..f7b140c --- /dev/null +++ b/RconExample.php @@ -0,0 +1,29 @@ + + define( 'SQ_SERVER_ADDR', 'localhost' ); + define( 'SQ_SERVER_PORT', 27015 ); + define( 'SQ_TIMEOUT', 1 ); + define( 'SQ_ENGINE', SourceQuery :: SOURCE ); + // Edit this <- + + $Query = new SourceQuery( ); + + try + { + $Query->Connect( SQ_SERVER_ADDR, SQ_SERVER_PORT, SQ_TIMEOUT, SQ_ENGINE ); + + $Query->SetRconPassword( 'my_awesome_password' ); + + var_dump( $Query->Rcon( 'say hello' ) ); + } + catch( Exception $e ) + { + echo $e->getMessage( ); + } + + $Query->Disconnect( );