Main Page | Class Hierarchy | Class List | Directories | Class Members | Related Pages | Examples

gameSpy Class Reference

Uses the gameSpy protcol to communicate with the server. More...

Inheritance diagram for gameSpy:

Inheritance graph
Collaboration diagram for gameSpy:

Collaboration graph
List of all members.

Public Member Functions

 getGameJoinerURI ()
 Returns a GameJoiner URI.
 query_server ($getPlayers=TRUE, $getRules=TRUE)
 Querys the server.
 getDebugDumps ($html=FALSE, $dumper=NULL)
 Creates hexdumps out of the debug info.
 _processServerInfo ($rawdata)
 Process the given raw data and stores everything.
 _processPlayers ($rawPlayerData)
 Extracts the players out of the given data.
 _processRules ($rawData)
 Extracts the rules out of the given data.
 _sortByQueryId ($data)
 sorts the given gamespy 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

Detailed Description

Uses the gameSpy protcol to communicate with the server.

Author:
Jeremias Reith (jr@terragate.net)
Version:
Id
gameSpy.php 211 2005-04-16 17:18:05Z jr
Bug:
some games does not escape the backslash, so we have a problem when somebody has a backlsash in its name
The following games have been tested with this class:

Examples:

example_usage.php.


Member Function Documentation

gameSpy::_getClassName  ) 
 

returns the class name of the instance

Returns:
the class name of the instance
Override this for mixed case class names and support for PHP <5

Reimplemented from gsQuery.

Reimplemented in armyGame, deusEX, igi2, ut2004, and vietkong.

gameSpy::_processPlayers rawPlayerData  ) 
 

Extracts the players out of the given data.

For internal use only.

Parameters:
rawPlayerData data with players
Returns:
TRUE on success

Reimplemented in armyGame, and igi2.

gameSpy::_processRules rawData  ) 
 

Extracts the rules out of the given data.

For internal use only.

Parameters:
rawData data with rules
Returns:
TRUE on success

gameSpy::_processServerInfo rawdata  ) 
 

Process the given raw data and stores everything.

For internal use only.

Parameters:
rawdata data that has the basic server infos
Returns:
TRUE on success

Reimplemented in armyGame.

gameSpy::_sendCommand address,
port,
command,
timeout = 500000
 

sends a command to a server and returns the answer

For internal use only.

Parameters:
address ip or hostname of the server
port port to connect to
command data to send
timeout how long to wait for data (in seconds)
Returns:
the raw answser

Reimplemented from gsQuery.

gameSpy::_sortByQueryId data  ) 
 

sorts the given gamespy data

For internal use only.

Parameters:
data raw data to sort
Returns:
raw data sorted

gameSpy::getDebugDumps html = FALSE,
dumper = NULL
 

Creates hexdumps out of the debug info.

Parameters:
html whether to create an html hexdump
dumper an optional preconfigured HexDumper instance
Returns:
an array with hexdumps for each send command/received result
Pass an HexDumper instance if you want to format the dump yourself. Each element of the result will contain a 2 element array with the hexdump of the send data first and the dump of the received data behind it.

Reimplemented from gsQuery.

gameSpy::getGameJoinerURI  ) 
 

Returns a GameJoiner URI.

See also:
http://gamejoiner.terragate.net
The server has to be queried before in some cases (to find out the game port). The client needs GameJoiner to join the game with this URI

Returns:
A GameJoiner URI

Reimplemented from gsQuery.

Reimplemented in ut2004.

gameSpy::query_server getPlayers = TRUE,
getRules = TRUE
 

Querys the server.

This method is abstract

Parameters:
getPlayers wheather to retrieve player infos
getRules wheather to retrieve rules
Returns:
TRUE on success

Reimplemented from gsQuery.

Reimplemented in armyGame, deusEX, igi2, and vietkong.


The documentation for this class was generated from the following file:
Generated on Sat Oct 15 16:51:59 2005 for gsQuery by  doxygen 1.4.4