Eris
1.4.0
|
MetaQuery is a temporary connection used to retrieve information about a game server. More...
#include <MetaQuery.h>
Public Member Functions | |
MetaQuery (boost::asio::io_service &io_service, Meta &svr, const std::string &host, size_t index) | |
long | getQueryNo () const |
return the serial-number of the query GET operation [for identification of replies] | |
size_t | getServerIndex () const |
long | getElapsed () |
Access the elapsed time (in millseconds) since the query was issued. | |
bool | isComplete () const |
![]() | |
virtual | ~BaseConnection () |
destructor, will perform a hard disconnect if necessary | |
virtual int | connectRemote (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. More... | |
virtual int | connectLocal (const std::string &socket) |
Try to connect to a local socket. | |
Status | getStatus () const |
get the current status of the connection | |
bool | isConnected () const |
Ascertain whether or not the connection is usable for transport. | |
const std::string & | getHost () const |
Gets the host of the connection. More... | |
short | getPort () const |
Gets the port of the connection. More... | |
Protected Member Functions | |
void | setComplete () |
void | onConnect () override |
Over-ride the default connection behaviour to issue the query. | |
void | handleFailure (const std::string &msg) override |
derived-class notification when a failure occurs | |
void | handleTimeout (const std::string &msg) override |
void | onQueryTimeout () |
void | dispatch () override |
![]() | |
BaseConnection (boost::asio::io_service &io_service, const std::string &cnm, const std::string &id, Atlas::Bridge &br) | |
create an unconnected instance More... | |
void | stateChanged (StreamSocket::Status status) |
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 | |
Protected Attributes | |
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. | |
size_t | m_serverIndex |
bool | m_complete |
boost::asio::deadline_timer | m_completeTimer |
![]() | |
boost::asio::io_service & | _io_service |
std::shared_ptr< StreamSocket > | _socket |
Status | _status |
current status of the connection | |
const std::string | _id |
a unique identifier for this connection | |
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 | |
std::string | _host |
the host name we're connected to | |
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.