|
1 |
| -<?php |
2 |
| - require __DIR__ . '/SourceQuery/SourceQuery.class.php'; |
3 |
| - |
4 |
| - // For the sake of this example |
5 |
| - Header( 'Content-Type: text/plain' ); |
6 |
| - Header( 'X-Content-Type-Options: nosniff' ); |
7 |
| - |
8 |
| - // Edit this -> |
9 |
| - define( 'SQ_SERVER_ADDR', 'localhost' ); |
10 |
| - define( 'SQ_SERVER_PORT', 27015 ); |
11 |
| - define( 'SQ_TIMEOUT', 1 ); |
12 |
| - define( 'SQ_ENGINE', SourceQuery :: SOURCE ); |
13 |
| - // Edit this <- |
14 |
| - |
15 |
| - $Query = new SourceQuery( ); |
16 |
| - |
17 |
| - try |
18 |
| - { |
19 |
| - $Query->Connect( SQ_SERVER_ADDR, SQ_SERVER_PORT, SQ_TIMEOUT, SQ_ENGINE ); |
20 |
| - |
21 |
| - print_r( $Query->GetInfo( ) ); |
22 |
| - print_r( $Query->GetPlayers( ) ); |
23 |
| - print_r( $Query->GetRules( ) ); |
24 |
| - } |
25 |
| - catch( Exception $e ) |
26 |
| - { |
27 |
| - echo $e->getMessage( ); |
28 |
| - } |
29 |
| - |
30 |
| - $Query->Disconnect( ); |
| 1 | +<?php |
| 2 | + require __DIR__ . '/SourceQuery/SourceQuery.class.php'; |
| 3 | + |
| 4 | + // For the sake of this example |
| 5 | + Header( 'Content-Type: text/plain' ); |
| 6 | + Header( 'X-Content-Type-Options: nosniff' ); |
| 7 | + |
| 8 | + // Edit this -> |
| 9 | + define( 'SQ_SERVER_ADDR', 'localhost' ); |
| 10 | + define( 'SQ_SERVER_PORT', 27015 ); |
| 11 | + define( 'SQ_TIMEOUT', 1 ); |
| 12 | + define( 'SQ_ENGINE', SourceQuery :: SOURCE ); |
| 13 | + // Edit this <- |
| 14 | + |
| 15 | + $Query = new SourceQuery( ); |
| 16 | + |
| 17 | + try |
| 18 | + { |
| 19 | + $Query->Connect( SQ_SERVER_ADDR, SQ_SERVER_PORT, SQ_TIMEOUT, SQ_ENGINE ); |
| 20 | + |
| 21 | + print_r( $Query->GetInfo( ) ); |
| 22 | + print_r( $Query->GetPlayers( ) ); |
| 23 | + print_r( $Query->GetRules( ) ); |
| 24 | + } |
| 25 | + catch( Exception $e ) |
| 26 | + { |
| 27 | + echo $e->getMessage( ); |
| 28 | + } |
| 29 | + |
| 30 | + $Query->Disconnect( ); |
0 commit comments