|
OpenTTD Source 20251116-master-g21329071df
|
Address to a game server. More...
#include <address.h>
Static Public Member Functions | |
| static ServerAddress | Parse (std::string_view connection_string, uint16_t default_port, CompanyID *company_id=nullptr) |
| Convert a string containing either "hostname", "hostname:port" or invite code to a ServerAddress, where the string can be postfixed with "#company" to indicate the requested company. | |
Data Fields | |
| ServerAddressType | type |
| The type of this ServerAddress. | |
| std::string | connection_string |
| The connection string for this ServerAddress. | |
Private Member Functions | |
| ServerAddress (ServerAddressType type, std::string &&connection_string) | |
| Create a new ServerAddress object. | |
Address to a game server.
This generalises addresses which are based on different identifiers.
|
inlineprivate |
Create a new ServerAddress object.
Please use ServerAddress::Parse() instead of calling this directly.
| type | The type of the ServerAdress. |
| connection_string | The connection_string that belongs to this ServerAddress type. |
|
static |
Convert a string containing either "hostname", "hostname:port" or invite code to a ServerAddress, where the string can be postfixed with "#company" to indicate the requested company.
| connection_string | The string to parse. |
| default_port | The default port to set port to if not in connection_string. |
| company | Pointer to the company variable to set iff indicated. |
Definition at line 444 of file address.cpp.
References connection_string, ParseCompanyFromConnectionString(), ParseFullConnectionString(), SERVER_ADDRESS_DIRECT, and SERVER_ADDRESS_INVITE_CODE.
Referenced by NetworkClientConnectGame(), and NetworkGameListAddItem().
| std::string ServerAddress::connection_string |
The connection string for this ServerAddress.
Definition at line 198 of file address.h.
Referenced by NetworkClientConnectGame(), NetworkGameListAddItem(), Parse(), and TCPServerConnecter::TCPServerConnecter().
| ServerAddressType ServerAddress::type |
The type of this ServerAddress.
Definition at line 197 of file address.h.
Referenced by TCPServerConnecter::CheckActivity(), and TCPServerConnecter::TCPServerConnecter().