SuperTuxKart
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
Server Class Reference
Inheritance diagram for Server:
Inheritance graph
[legend]

Public Member Functions

 Server (const XMLNode &server_info)
 Initialises the object from an XML node.
 
 Server (unsigned server_id, const irr::core::stringw &name, int max_players, int current_players, unsigned difficulty, unsigned server_mode, const SocketAddress &address, bool password_protected, bool game_started, const std::string &current_track="")
 
const SocketAddressgetAddress () const
 Returns IPv4 address and port of this server.
 
void setAddress (const SocketAddress &addr)
 
const std::string & getLowerCaseName () const
 Returns the lower case name of the server.
 
const irr::core::stringw & getName () const
 Returns the name of the server.
 
const uint32_t getServerId () const
 Returns the ID of this server.
 
const uint32_t getServerOwner () const
 Returns the user id in STK addon server of the server owner (WAN).
 
uint16_t getPrivatePort () const
 
const int getMaxPlayers () const
 Returns the maximum number of players allowed on this server.
 
const int getCurrentPlayers () const
 Returns the number of currently connected players.
 
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 SocketAddress &addr)
 
SocketAddressgetIPV6Address () const
 
virtual void saveServer () const
 
void setIsPasswordProtected (bool password_protected)
 
bool reconnectWhenQuitLobby () const
 
void setReconnectWhenQuitLobby (bool val)
 
std::string getBookmarkKey () const
 
const int getCurrentAI () const
 

Protected Attributes

irr::core::stringw m_name
 The server name to be displayed.
 
std::string m_lower_case_name
 Name in lower case for comparisons.
 
std::string m_server_owner_lower_case_name
 
std::string m_lower_case_player_names
 
std::unique_ptr< SocketAddressm_ipv6_address
 We need to use full socket address structure instead of string to hold it, because for local link address the scope id matters for multicasting.
 
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.
 
int m_current_ai
 
std::unique_ptr< SocketAddressm_address
 The public ip address and port of this server.
 
uint16_t m_private_port
 This is the private port of the server.
 
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
 
bool m_reconnect_when_quit_lobby
 
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 Data Documentation

◆ 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: