GameSpy

Summary
This class extends the base GameQuery class to implement support for the GameSpy query protocol.
Internal method for constructing request strings that will be sent to the host server.
Internal method for parsing response strings that will be sent to the host server.

GQProtocol_GameSpy

This class extends the base GameQuery class to implement support for the GameSpy query protocol.  It is indended to be dynamically loaded by the Monitor function defined in the base class.

// include the base class
require_once("GameQuery.php");

// create a monitor instance using this protocol
$monitor = GameQuery::Monitor('GameSpy', '99.99.99.1:9999', $options );
Summary
Internal method for constructing request strings that will be sent to the host server.
Internal method for parsing response strings that will be sent to the host server.

Protected Variables

$queriesAssociative array used internally for tracking which types of queries are to be sent.

Reimplemented Methods

_request

protected function _request($options =  NULL)

Internal method for constructing request strings that will be sent to the host server.  By default, queries are sent for details, rules, and players, but each can be disabled using the options array that is passed to the Monitor method.

$monitor = GameQuery::Monitor('MyNewGame', '99.99.99.1:29999', array('players' => 0) );

Parameters

$optionsOptional associative array of directives to control module behavior.  In this protocol class, it indicates which queries to send.

Returns

A string or array of strings containing server request data.

_response

protected function _response($response =  NULL)

Internal method for parsing response strings that will be sent to the host server.

For this protocol, data is broken into three basic sections in the top-level array.

  • server_info
  • player_info
  • team_info

Parameters

$responseUnprocessed response string.

Returns

A nested array structure derived from the server response data.

protected function _request($options =  NULL)
Internal method for constructing request strings that will be sent to the host server.
protected function _response($response =  NULL)
Internal method for parsing response strings that will be sent to the host server.