Eris
1.3.19
|
MetaQuery is a temporary connection used to retrieve information about a game server. More...
#include <MetaQuery.h>
Public Member Functions | |
MetaQuery (Meta *svr, const std::string &host, unsigned int index) | |
long | getQueryNo () const |
return the serial-number of the query GET operation [for identification of replies] | |
const std::string & | getHost () const |
return the host string this query is using | |
unsigned int | getServerIndex () const |
long | getElapsed () |
Access the elapsed time (in millseconds) since the query was issued. | |
bool | isReady (PollData &data) const |
bool | isComplete () const |
![]() | |
virtual | ~BaseConnection () |
destructor, will perform a hard disconnect if necessary | |
virtual int | connect (const std::string &host, short port) |
open a connection to the specified host/port; invokes the failure handler if the connection could not be opened. | |
Status | getStatus () const |
get the current status of the connection | |
bool | isConnected () const |
Ascertain whether or not the connection is usable for transport. | |
int | getFileDescriptor () |
get the underlyinmg file descriptor (socket). | |
short | getPort () const |
Gets the port of the connection. |
Protected Member Functions | |
void | setComplete () |
virtual void | onConnect () |
Over-ride the default connection behaviour to issue the query. | |
virtual void | handleFailure (const std::string &msg) |
derived-class notification when a failure occurs | |
virtual void | handleTimeout (const std::string &msg) |
void | onQueryTimeout () |
![]() | |
BaseConnection (const std::string &cnm, const std::string &id, Atlas::Bridge *br) | |
create an unconnected instance | |
void | recv () |
perform a blocking read from the underlying socket | |
virtual void | setStatus (Status sc) |
update the connection status and generate signals | |
void | onConnectTimeout () |
void | onNegotiateTimeout () |
void | hardDisconnect (bool emit) |
performs and instant disconnection from the server specified whether the change of state should be signalled | |
void | nonblockingConnect () |
complete the connection state and start negotiation | |
void | pollNegotiation () |
track negotation of the Atlas codecs / stream |
Protected Attributes | |
const std::string | _host |
The host being querried. | |
Meta * | _meta |
The Meta-server object which owns the query. | |
long | _queryNo |
The serial number of the query GET. | |
WFMath::TimeStamp | _stamp |
Time stamp of the request, to estimate ping to server. | |
unsigned int | m_serverIndex |
bool | m_complete |
![]() | |
Atlas::Objects::ObjectsEncoder * | _encode |
the objects encoder, bound to _codec | |
Atlas::Net::StreamConnect * | _sc |
negotiation object (NULL after connection!) | |
Atlas::Codec * | m_codec |
Status | _status |
current status of the connection | |
const std::string | _id |
a unique identifier for this connection | |
tcp_socket_stream * | _stream |
the underlying iostream channel | |
std::string | _clientName |
the client identified used during connection | |
Atlas::Bridge * | _bridge |
the connection bridge (i.e something implementing objectArrived()) : this can be the derived class itself, or any other object | |
Timeout * | _timeout |
network level timeouts | |
short | _port |
the port we're connected to |
Friends | |
class | Meta |
Additional Inherited Members | |
![]() | |
enum | Status { INVALID_STATUS = 0, NEGOTIATE, CONNECTING, CONNECTED, DISCONNECTED, DISCONNECTING, QUERY_GET } |
possible states for the connection More... | |
![]() | |
sigc::signal< void > | Connected |
sent on successful negotiation of a game server connection | |
sigc::signal< void > | Disconnected |
final disconnect (or hard disocnnect) notifcation |
MetaQuery is a temporary connection used to retrieve information about a game server.
It issues an anoymous GET operation, and expects to receive an INFO operation containing a 'server' entity in response. This entity contains attributes such as the ruleset, uptime, number of connectec players and so on. In addition, MetaQuery tracks the time the server takes to response, and this estimates the server's ping. This time also includes server latency.