Inheritance diagram for gsQuery:

Public Member Functions | |
| gsQuery ($address, $queryport) | |
| Standard constructor. | |
| createInstance ($protocol, $address, $port) | |
| Creates a new gsQuery object that supports the given protocol. | |
| unserialize ($string) | |
| Creates an instance out of an previously serialized string. | |
| unserializeFromURL ($url) | |
| Retrieves a serialized object via HTTP and deserializes it. | |
| getSupportedProtocols () | |
| Returns all supported protocols / games. | |
| getGameJoinerURI () | |
| Returns a GameJoiner URI. | |
| getNativeJoinURI () | |
| Returns a native join URI. | |
| query_server ($getPlayers=TRUE, $getRules=TRUE) | |
| Querys the server. | |
| sortPlayers ($players, $sortkey='name') | |
| Sorts the given players. | |
| htmlize ($string) | |
| htmlizes the given raw string | |
| textify ($string) | |
| converts the raw string to ascii | |
| serialize () | |
| serializes the object as string | |
| getDebugDumps ($html=FALSE, $dumper=NULL) | |
| Creates hexdumps out of the debug info. | |
| _init () | |
| This method deletes all fetched data. | |
| _sendCommand ($address, $port, $command, $timeout=500000) | |
| sends a command to a server and returns the answer | |
| _getClassName () | |
| returns the class name of the instance | |
| __sleep () | |
| Serialization handler. | |
Public Attributes | |
| $version = '$$$SVN_VERSION$$$' | |
| The version of the gsQuery package. | |
| $address | |
| ip or hostname of the server | |
| $queryport | |
| port to use for the query | |
| $online | |
| status of the server | |
| $gamename | |
| the name of the game | |
| $hostport | |
| the port you have to connect to enter the game | |
| $gameversion | |
| the version of the game | |
| $servertitle | |
| The title of the server. | |
| $mapname | |
| The name of the map (often corresponds with the filename of the map). | |
| $maptitle | |
| A more descriptive name of the map. | |
| $gametype | |
| The gametype. | |
| $numplayers | |
| current number of players on the server | |
| $maxplayers | |
| maximum number of players allowed on the server | |
| $password | |
| Wheather the game server is password protected. | |
| $nextmap | |
| next map on the server | |
| $players | |
| players playing on the server | |
| $playerkeys | |
| Hash of available player infos. | |
| $playerteams | |
| list of the team names | |
| $maplist | |
| a list of all maps in cycle | |
| $rules | |
| Hash with all server rules. | |
| $errstr | |
| Short errormessage if something goes wrong. | |
| $debug | |
| Array with debug infos. | |
The gsQuery package has one class for each protocol or game. This class is abstract but due to the lack of real OO capabilities it cannot be declared as abstract. Use the static method createInstance to create a gsQuery object that supports the specified protocol.
Generic usage:
// including gsQuery
include_once('path/to/gsQuery/gsQuery.php');
// create a gsQuery instance
$gameserver = gsQuery::createInstance('gameSpy', 'myserver.com', 1234)
// query the server $status = $gameserver->query_server();
// check for success
if($status) {
// process retrieved data
} else {
// create an error message
}
|
||||||||||||
|
Standard constructor.
|
|
|
Serialization handler.
|
|
|
returns the class name of the instance
Reimplemented in armyGame, deusEX, gameSpy, gameSpyQ, halo, igi2, openQuery, ut2004, and vietkong. |
|
|
This method deletes all fetched data.
For internal use only. This method should be called if an instance is used for multiple querys |
|
||||||||||||||||||||
|
sends a command to a server and returns the answer
For internal use only.
Reimplemented in gameSpy. |
|
||||||||||||||||
|
Creates a new gsQuery object that supports the given protocol. This static method will create an instance of the appropriate subclass for you.
|
|
||||||||||||
|
Creates hexdumps out of the debug info.
|
|
|
Returns a GameJoiner URI.
|
|
|
Returns a native join URI. Some games are registering an URI type to allow easy joining of games
Reimplemented in ut2004. |
|
|
Returns all supported protocols / games. This method is static. There should be no other php files in the gsQuery directory
|
|
|
htmlizes the given raw string
|
|
||||||||||||
|
Querys the server. This method is abstract
Reimplemented in armyGame, d3, deusEX, gameSpy, gameSpyQ, halo, hlife, hlife2, igi2, mohs, nwn, openQuery, q2, q3a, rvnshld, savage, and vietkong. |
|
|
serializes the object as string
|
|
||||||||||||
|
Sorts the given players. You can sort by name, score, frags, deaths, honor and time
|
|
|
converts the raw string to ascii
Reimplemented in q2. |
|
|
Creates an instance out of an previously serialized string. Use this to restore a object that has been previously serialized with serialize
|
|
|
Retrieves a serialized object via HTTP and deserializes it. Useful if UDP traffic isn't allowed
|
|
|
Array with debug infos. Stores all the send/received data Format: send data => received data |
|
|
status of the server TRUE: server online, FALSE: server offline |
|
|
Wheather the game server is password protected.
1: server is password protected |
|
|
Hash of available player infos. There is a key for each player info available (e.g. name, score, ping etc). The value is TRUE if the info is available |
|
|
players playing on the server
players[$playerid]['name']. Check playerkeys to get the keys available |
|
|
Hash with all server rules.
key: rulename |
1.4.4