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.
Kubo2
927425e171
|
10 years ago | |
---|---|---|
SourceQuery | 10 years ago | |
Example.php | 11 years ago | |
README.md | 10 years ago | |
RconExample.php | 11 years ago | |
View.php | 10 years ago |
README.md
PHP Source Query
Description
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.
Protocol specifications can be found over at VDC
- https://developer.valvesoftware.com/wiki/Server_queries
- https://developer.valvesoftware.com/wiki/Source_RCON_Protocol
Supported Games
- All multiplayer games released by Valve: Counter-Strike 1.6, Counter-Strike: Global Offensive, Team Fortress 2, etc...
- Rag Doll Kung Fu
- The Ship
- Dino D-Day
- Nuclear Dawn
- Call of Duty: Modern Warfare 3
- Starbound (use SetUseOldGetChallengeMethod method after connecting)
- Arma 3 (add +1 to the server port, their implementation also violates Source query protocol spec.)
- Minecraft (RCON ONLY!)
- and many other games that implement Source Query Protocol
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
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/