#include <Metaserver.h>
Public Member Functions | |
| Meta (const std::string &cnm, const std::string &msv, unsigned int maxQueries) | |
| ServerList | getGameServerList () |
| Return the list of game servers. | |
| int | getGameServerCount () const |
| Return the current size of the server list. | |
| const ServerInfo & | getInfoForServer (unsigned int index) const |
| Return one of the servers. | |
| void | queryServer (const std::string &host) |
| Query a specific game server; emits a signal when complete. | |
| void | refresh () |
| Refresh the entire server list. | |
| void | cancel () |
| Cancel outstanding refresh / queries. | |
| const std::string & | getClientName () const |
| Access the client name. | |
| MetaStatus | getStatus () const |
| Get the current status of the Meta server list. | |
| unsigned int | numServers () const |
| Get the current number of servers. | |
Public Attributes | |
|
SigC::Signal1< void, const ServerInfo & > | ReceivedServerInfo |
| Emitted when information about a server is received. | |
| SigC::Signal1< void, int > | GotServerCount |
| Emitted once the size of the server list is known. | |
| SigC::Signal0< void > | CompletedServerList |
| Emitted when the entire server list has been refreshed. | |
| SigC::Signal1< void, const std::string & > | Failure |
| Indicates a failure (usually network related) has occurred. | |
Protected Types | |
| typedef std::list< MetaQuery * > | MetaQueryList |
|
typedef std::map< std::string, ServerInfo > | ServerInfoMap |
Protected Member Functions | |
| virtual void | objectArrived (const Atlas::Message::Element &msg) |
| void | recv () |
| process raw UDP packets from the meta-server | |
| void | recvCmd (uint32_t op) |
| Invoked when _bytesToRecv = 0 and expecting a command (_recvCmd = true). | |
| void | processCmd () |
| Invoked when _bytesToRecv = 0 and processing a command (_recvCmd = false). | |
| void | listReq (int offset=0) |
| Request a portion of the server list from the meta-server. | |
| void | setupRecvCmd () |
| void | setupRecvData (int words, uint32_t got) |
| void | doFailure (const std::string &msg) |
| void | queryFailure (MetaQuery *q, const std::string &msg) |
| void | queryTimeout (MetaQuery *q) |
| void | metaTimeout () |
| void | connect () |
| initiate a connection to the meta-server : this will issue a keep-alive followed by a list request. | |
| void | disconnect () |
| tear down an existing connection to the server | |
| void | gotData (PollData &) |
Protected Attributes | |
| std::string | _clientName |
| the name to use when negotiating | |
| MetaStatus | _status |
| std::string | _metaHost |
| MetaQueryList | _activeQueries |
| MetaQueryList | _deleteQueries |
| StringList | _pendingQueries |
| unsigned int | _maxActiveQueries |
| ServerInfoMap | _gameServers |
| ServerInfoMap | _lastValidList |
| udp_socket_stream * | _stream |
| char | _data [DATA_BUFFER_SIZE] |
| char * | _dataPtr |
| The current insert/extract pointer in the buffer. | |
| unsigned int | _bytesToRecv |
| The number of bytes to read before processing / dispatch. | |
| unsigned int | _totalServers |
| Total number of servers the Meta knows of. | |
| unsigned int | _packed |
| The servers in the curent LIST_RESP. | |
| bool | _recvCmd |
| true if the next block is a new command | |
| uint32_t | _gotCmd |
| the curent command being processed | |
| Timeout * | _timeout |
| Metaserver channel timeout. | |
Friends | |
| class | MetaQuery |
|
|
Cancel outstanding refresh / queries. This is primarily intended for use with 'Refresh', which might takes several minutes to complete. Note that 'CompletedServerList' is not emitted following cancellation. |
|
|
Request a portion of the server list from the meta-server.
|
|
|
Refresh the entire server list. This will clear the current list, ask the meta-server for each game server, and then issue a query against every returned server. This process can take a large amount of real-time as the number of game servers increases. Completion of the entire refresh is indicated by the 'CompletedServerList' signal. |
|
|
Indicates a failure (usually network related) has occurred. The server list will be cleared, and the status set to INVALID. |
1.3.9.1