Eris  1.4.0
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
Eris::ServerInfo Class Reference

Information about a specific game server, retrieved via the Meta-server and anonymous GETs. More...

#include <ServerInfo.h>

Public Types

enum  Status { INVALID, QUERYING, VALID, TIMEOUT }
 

Public Member Functions

Status getStatus () const
 
const std::string & getHostname () const
 retrive the hostname (or dotted-decimal IP) of the server. More...
 
const std::string & getServername () const
 retrieve the human-readable name of the server (e.g 'Bob's Mason Server')
 
const std::string & getRuleset () const
 retrieve a human-readable name of the ruleset (e.g. 'mason' or 'circe')
 
const std::string & getServer () const
 the server program name, i.e 'stage' or 'cyphesis'
 
const std::string & getVersion () const
 the server program version, as a free text string
 
const std::string & getBuildDate () const
 the server program build-date, as a free text string
 
int getNumClients () const
 the number of clients currently connected to the server
 
int getPing () const
 the round-trip time to the server. More...
 
double getUptime () const
 the server's uptime in seconds
 
long getEntities () const
 the number of entities on the server
 
const std::vector< std::string > & getAssets () const
 

Protected Member Functions

 ServerInfo (const std::string &host)
 construct with the host IP only; other values will be set to defaults
 
void processServer (const Atlas::Objects::Entity::RootEntity &svr)
 called by Meta when info is received from the server, sets status to valid. More...
 
void setPing (int p)
 
void setStatus (Status s)
 

Friends

class Meta
 
class Connection
 

Detailed Description

Information about a specific game server, retrieved via the Meta-server and anonymous GETs.

The information includes statistics (uptime, number of clients), configuration (ruleset) and general information (an adminsitrator specifed name). This data is intended to allow clients to display a browser interface, similar to those found in Quake 3 or Tribes 2, from which they can select a server to play on. Note that in the future, each ServerInfo will represent a game world instance, not necessarily a single server, and that a single server might run multiple games. Thus, hostname / IP is a very poor ordering / caching value. Some sort of unique game-instance ID may need to be developed here.

Member Enumeration Documentation

◆ Status

Enumerator
TIMEOUT 

server query timed out

Member Function Documentation

◆ getHostname()

const std::string& Eris::ServerInfo::getHostname ( ) const
inline

retrive the hostname (or dotted-decimal IP) of the server.

For multi-server worlds, this will be a name that resolves to a machine capable of accepting the initial LOGIN, and hence should not need special handling.

◆ getPing()

int Eris::ServerInfo::getPing ( ) const
inline

the round-trip time to the server.

The meaning of this when multi-server worlds exist needs to be considered. Verify the accuracy of the ping estimation, since it is currently very poor

◆ processServer()

void Eris::ServerInfo::processServer ( const Atlas::Objects::Entity::RootEntity &  svr)
protected

called by Meta when info is received from the server, sets status to valid.

Referenced by Eris::Meta::disconnect(), getEntities(), and Eris::Connection::handleFailure().


The documentation for this class was generated from the following files: