TPProto::GameInfo Class Reference

A Frame for describing a game on the server. More...

#include <gameinfo.h>

Inheritance diagram for TPProto::GameInfo:

TPProto::Frame List of all members.

Public Member Functions

 GameInfo ()
 Default constructor.
virtual ~GameInfo ()
 Required virtual destructor.
void packBuffer (Buffer *buf)
 Pack this GameInfo Frame into a Buffer, asserts.
bool unpackBuffer (Buffer *buf)
 Unpack from a Buffer.
std::string getGameName () const
 Gets the game name for the game.
std::set< std::string > getAvailableProtocolVersions () const
 Gets the available protocol versions.
std::string getServerName () const
 Get the name of the server software.
std::string getServerVersion () const
 Get the version of the server software.
std::string getRulesetName () const
 Get the name of the ruleset.
std::string getRulesetVersion () const
 Get the version of the ruleset.
std::string getMediaBaseUrl () const
 Get the base url for media for the game.
std::set< std::string > getConnectionUrls () const
 Get the urls this game can be connected by.
std::string getAdvertisedIp (const std::string &url) const
 Gets the IP address advertised for a Connection URL.
std::string getOptionString (uint32_t optionid) const
 Get the OptionString associated with a given option id.
uint32_t getOptionInt (uint32_t optionid) const
 Get the Option Integer associated with a given option id.

Detailed Description

A Frame for describing a game on the server.


Member Function Documentation

void TPProto::GameInfo::packBuffer ( Buffer buf  )  [virtual]

Pack this GameInfo Frame into a Buffer, asserts.

Packs this GameInfo frame into the buffer. Since the frame only comes from the server, this method assert(0).

Parameters:
buf The Buffer to pack into, ignored.

Implements TPProto::Frame.

bool TPProto::GameInfo::unpackBuffer ( Buffer buf  )  [virtual]

Unpack from a Buffer.

Unpacks the GameInfo frame from the Buffer, if possible.

Parameters:
buf The Buffer to unpack..
Returns:
True if successfully unpacked, false otherwise.

Implements TPProto::Frame.

std::string TPProto::GameInfo::getGameName (  )  const

Gets the game name for the game.

Returns:
A string containing the game name.

std::set< std::string > TPProto::GameInfo::getAvailableProtocolVersions (  )  const

Gets the available protocol versions.

Returns:
A set of strings, each is an available protocol version.

std::string TPProto::GameInfo::getServerName (  )  const

Get the name of the server software.

Returns:
A string of the server software's name.

std::string TPProto::GameInfo::getServerVersion (  )  const

Get the version of the server software.

Returns:
A string of the server software's version.

std::string TPProto::GameInfo::getRulesetName (  )  const

Get the name of the ruleset.

Returns:
A string of the ruleset's name.

std::string TPProto::GameInfo::getRulesetVersion (  )  const

Get the version of the ruleset.

Returns:
A string of the ruleset's version.

std::string TPProto::GameInfo::getMediaBaseUrl (  )  const

Get the base url for media for the game.

Returns:
A string of the base media URL.

std::set< std::string > TPProto::GameInfo::getConnectionUrls (  )  const

Get the urls this game can be connected by.

Returns:
A set of strings of urls

std::string TPProto::GameInfo::getAdvertisedIp ( const std::string &  url  )  const

Gets the IP address advertised for a Connection URL.

Parameters:
url The URL to get the corresponding IP of.
Returns:
A string of the corresponding advertised IP address, or an empty String.

std::string TPProto::GameInfo::getOptionString ( uint32_t  optionid  )  const

Get the OptionString associated with a given option id.

An empty return string could be either empty in the option, or the option does not exist for this game.

Parameters:
optionid The option id to get the string of.
Returns:
The string of the option value, or an empty string.

uint32_t TPProto::GameInfo::getOptionInt ( uint32_t  optionid  )  const

Get the Option Integer associated with a given option id.

A value of 0 could be either 0 for the option, or the option does not exist for this game.

Parameters:
optionid The option id to get the integer of.
Returns:
The uint32_t value of the option, or 0.


The documentation for this class was generated from the following files:
Generated on Tue Jan 6 08:15:47 2009 for libtpproto-cpp by  doxygen 1.5.1