PHP gameserver status query framework
This is a very basic game server query framework. It’s designed to be easily extendable to accommodate more games. It requires PHP 5.3+.
serverquery/
directory to your websiteserverquery/cache/
directory is writableconfig.example.php
to config.php
and edit it with your settings, games, and serverstemplate.php
and/or serverquery.css
as neededserverquery/serverquery.php
using include
or require
somewhere on your webpageAll configuration settings are in config.php
. Each option is well documented in a docblock, so refer to those for details.
Each game class can accept an array of options specific to that game engine. Each array in $games
and $servers
can have a config
key that is an associative array of options. Options set in $servers
override options set in $games
.
Here are the available options and default settings for each included game class:
Option | Type | Default | Description |
---|---|---|---|
hideBots | boolean | true |
Hide bots from player count and list |
Option | Type | Default | Description |
---|---|---|---|
useQuery | boolean | false |
Use the Query protocol (server must set enable-query=true ) |
queryPort | integer | 25565 |
Port used by the Query protocol (server query.port property) |
useLegacy | boolean | false |
Use the pre-1.7 Server List Ping protocol (overrides useQuery ) |
Option | Type | Default | Description |
---|---|---|---|
queryPort | integer | 7878 |
Port used to query the server REST API |
Option | Type | Default | Description |
---|---|---|---|
queryPort | integer | 10011 |
Port used by the ServerQuery protocol |
queryUser | string | Username for the ServerQuery protocol | |
queryPass | string | Password for the ServerQuery protocol |
With cron mode enabled, the servers must be queried by cron.php
. For best results, execute the script once every 1 minute.
On linux, this can be achieved by adding a line to your crontab like the one below.
* * * * * php /path/to/cron.php > /dev/null 2>&1
This project is released under the MIT License.