SuperTuxKart
Public Member Functions | Protected Attributes | List of all members
Server Class Reference

Public Member Functions

 Server (const XMLNode &server_info)
 Initialises the object from an XML node. More...
 
 Server (unsigned server_id, const irr::core::stringw &name, int max_players, int current_players, unsigned difficulty, unsigned server_mode, const TransportAddress &address, bool password_protected, bool game_started, const std::string &current_track="")
 
const TransportAddressgetAddress () const
 Returns ip address and port of this server. More...
 
const std::string & getLowerCaseName () const
 Returns the lower case name of the server. More...
 
const irr::core::stringw & getName () const
 Returns the name of the server. More...
 
const uint32_t getServerId () const
 Returns the ID of this server. More...
 
const uint32_t getServerOwner () const
 Returns the user id in STK addon server of the server owner (WAN). More...
 
uint16_t getPrivatePort () const
 
const int getMaxPlayers () const
 Returns the maximum number of players allowed on this server. More...
 
const int getCurrentPlayers () const
 Returns the number of currently connected players. More...
 
unsigned getServerMode () const
 
RaceManager::Difficulty getDifficulty () const
 
bool isPasswordProtected () const
 
const core::stringw & getServerOwnerName () const
 
const std::string & getServerOwnerLowerCaseName () const
 
float getDistance () const
 
bool supportsEncryption () const
 
bool isOfficial () const
 
bool isGameStarted () const
 
const std::vector< std::tuple< int, core::stringw, double, float > > & getPlayers () const
 
void setServerId (unsigned id)
 
void setPrivatePort (uint16_t port)
 
void setSupportsEncryption (bool val)
 
bool searchByName (const std::string &lower_case_word)
 
TrackgetCurrentTrack () const
 
const std::string & getCountryCode () const
 
void setIPV6Connection (bool val)
 
bool useIPV6Connection () const
 
void setIPV6Address (const std::string &addr)
 
const std::string & getIPV6Address () const
 

Protected Attributes

irr::core::stringw m_name
 The server name to be displayed. More...
 
std::string m_lower_case_name
 Name in lower case for comparisons. More...
 
std::string m_server_owner_lower_case_name
 
std::string m_lower_case_player_names
 
std::string m_ipv6_address
 
uint32_t m_server_id
 
uint32_t m_server_owner
 
int m_max_players
 The maximum number of players that the server supports.
 
int m_current_players
 The number of players currently on the server.
 
TransportAddress m_address
 The public ip address and port of this server. More...
 
uint16_t m_private_port
 This is the private port of the server. More...
 
unsigned m_server_mode
 
RaceManager::Difficulty m_difficulty
 
bool m_password_protected
 
core::stringw m_server_owner_name
 
float m_distance
 
bool m_official
 
bool m_supports_encrytion
 
bool m_game_started
 
bool m_ipv6_connection
 
std::vector< std::tuple< int, core::stringw, double, float > > m_players
 
std::string m_current_track
 
std::string m_country_code
 

Constructor & Destructor Documentation

◆ Server()

Server::Server ( const XMLNode server_info)

Initialises the object from an XML node.

Constructor based on XML data received from the stk server.

Parameters
xmlThe data for one server as received as part of the get-all stk-server request.

Member Function Documentation

◆ getAddress()

const TransportAddress& Server::getAddress ( ) const
inline

Returns ip address and port of this server.

◆ getCurrentPlayers()

const int Server::getCurrentPlayers ( ) const
inline

Returns the number of currently connected players.

◆ getLowerCaseName()

const std::string& Server::getLowerCaseName ( ) const
inline

Returns the lower case name of the server.

◆ getMaxPlayers()

const int Server::getMaxPlayers ( ) const
inline

Returns the maximum number of players allowed on this server.

◆ getName()

const irr::core::stringw& Server::getName ( ) const
inline

Returns the name of the server.

◆ getServerId()

const uint32_t Server::getServerId ( ) const
inline

Returns the ID of this server.

◆ getServerOwner()

const uint32_t Server::getServerOwner ( ) const
inline

Returns the user id in STK addon server of the server owner (WAN).

Member Data Documentation

◆ m_address

TransportAddress Server::m_address
protected

The public ip address and port of this server.

◆ m_lower_case_name

std::string Server::m_lower_case_name
protected

Name in lower case for comparisons.

◆ m_name

irr::core::stringw Server::m_name
protected

The server name to be displayed.

◆ m_private_port

uint16_t Server::m_private_port
protected

This is the private port of the server.

This is used if a WAN game is started, but one client is discovered on the same LAN, so a direct connection using the private port with a broadcast is possible.


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