mirror of
https://github.com/xPaw/PHP-Source-Query.git
synced 2026-06-10 23:03:15 +02:00
d9bab8aa25
Docblock changes. Reorder methods to be logical.
27 lines
574 B
PHP
27 lines
574 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
require __DIR__ . '/../vendor/autoload.php';
|
|
|
|
use xPaw\SourceQuery\SourceQuery;
|
|
use xPaw\SourceQuery\Socket\SourceSocket;
|
|
|
|
// For the sake of this example
|
|
header('Content-Type: text/plain');
|
|
header('X-Content-Type-Options: nosniff');
|
|
|
|
$query = new SourceQuery(new SourceSocket());
|
|
|
|
try {
|
|
$query->connect('localhost', 27015, 1);
|
|
|
|
print_r($query->getInfo());
|
|
print_r($query->getPlayers());
|
|
print_r($query->getRules());
|
|
} catch (Exception $exception) {
|
|
echo $exception->getMessage();
|
|
} finally {
|
|
$query->disconnect();
|
|
}
|