Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kekalainen/gamerq
RCON & query library for various game servers. Mirror of https://gitlab.com/kekalainen/gamerq
https://github.com/kekalainen/gamerq
game gamespy query rcon source ut3
Last synced: about 2 months ago
JSON representation
RCON & query library for various game servers. Mirror of https://gitlab.com/kekalainen/gamerq
- Host: GitHub
- URL: https://github.com/kekalainen/gamerq
- Owner: kekalainen
- License: mit
- Created: 2024-08-18T18:53:19.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-18T19:44:56.000Z (5 months ago)
- Last Synced: 2024-08-18T21:24:43.625Z (5 months ago)
- Topics: game, gamespy, query, rcon, source, ut3
- Language: PHP
- Homepage: https://packagist.org/packages/kekalainen/gamerq
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GameRQ - RCON & query library
A PHP library for querying various game servers and sending RCON commands to them.
# Supported games
This library should support all games that implement the [Source query](https://developer.valvesoftware.com/wiki/Server_queries) protocol, [Source RCON protocol](https://developer.valvesoftware.com/wiki/Source_RCON_Protocol), [GameSpy v4 / UT3 query protocol](https://wiki.unrealadmin.org/UT3_query_protocol) or [webrcon](https://github.com/Facepunch/webrcon). Not all protocol features are implemented. Below is an incomplete table of supported games.
| Game | RCON | Query |
| ---- | :--: | :---: |
| [Garry's Mod](https://gmod.facepunch.com) | ✅ | ✅ |
| [Minecraft](https://minecraft.net) | ✅ | ✅ |
| [Rust](https://rust.facepunch.com) | ✅ | ✅ |# Usage examples
## RCON
```php
$rcon = new \Kekalainen\GameRQ\Rcon\SourceRcon; // Source games & Minecraft
$rcon = new \Kekalainen\GameRQ\Rcon\WebSocketRcon; // Rusttry {
$rcon->connect($address, $port, $password);$response = $rcon->command('status');
echo var_dump($response);
} catch (\Exception $exception) {
echo $exception->getMessage();
} finally {
$rcon->disconnect();
}
```## Query
```php
$query = new \Kekalainen\GameRQ\Query\SourceQuery; // Source games
$query = new \Kekalainen\GameRQ\Query\MinecraftQuery; // Minecraft (TCP)
$query = new \Kekalainen\GameRQ\Query\GameSpy4Query; // Minecraft (UDP)try {
$query->connect($address, $port);$info = $query->info();
echo var_dump($info);
} catch (\Exception $exception) {
echo $exception->getMessage();
} finally {
$query->disconnect();
}
```