You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
Pavel Djundik 5881a4273b
Add some keywords
10 years ago
SourceQuery Trim NUL bytes from rcon output, fixes #51 10 years ago
.gitattributes Normalize line endings 10 years ago
.gitignore Add Composer Support 10 years ago
Example.php Normalize line endings 10 years ago
LICENSE Create LICENSE 10 years ago
README.md Add packagist badge 10 years ago
RconExample.php Fix #37 10 years ago
View.php Normalize line endings 10 years ago
composer.json Add some keywords 10 years ago

README.md

PHP Source Query Packagist

This class was created to query game server which use the Source query protocol, this includes all source games, and all the games that implement Steamworks.

The class also allows you to query servers using RCON although this only works for half-life 1 and source engine games.

Minecraft also uses Source RCON protocol, and this means you can use this class to send commands to your minecraft server while having engine set to Source engine.

This library requires a modern version of PHP, so make sure you are using at least PHP 5.4 or newer.

Protocol specifications can be found over at VDC

Supported Games

Functions

Connect( $Ip, $Port, $Timeout, $Engine ) Opens connection to a server
Disconnect( ) Closes all open connections
Ping( ) Ping the server to see if it exists
Warning: Source engine may not answer to this
GetInfo( ) Returns server info in an array
GetPlayers( ) Returns players on the server in an array
GetRules( ) Returns public rules (cvars) in an array
SetRconPassword( $Password ) Sets rcon password for later use with Rcon()
Rcon( $Command ) Execute rcon command on the server

Also refer to an example to work things out.

License

PHP Source Query
Copyright (C) 2012-2015 xPaw

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA