diff options
author | Patric Stout <truebrain@openttd.org> | 2021-07-11 12:08:03 +0200 |
---|---|---|
committer | Patric Stout <github@truebrain.nl> | 2021-07-11 20:38:42 +0200 |
commit | 1baec41542780cf4fc898df7d2fc9925d823fb44 (patch) | |
tree | 57aa8bc38997fc9d39a4ae66af7b912712e1830e /src/network/network_internal.h | |
parent | cee8174d02e38542548fc74de93450cfebefaa91 (diff) | |
download | openttd-1baec41542780cf4fc898df7d2fc9925d823fb44.tar.xz |
Change: groundwork to allow ServerAddress to use invite codes
Normally TCPConnecter will do a DNS resolving of the connection_string
and connect to it. But for SERVER_ADDRESS_INVITE_CODE this is different:
the Game Coordinator does the "resolving".
This means we need to allow TCPConnecter to not setup a connection
and allow it to be told when a connection has been setup by an external
(to TCPConnecter) part of the code. We do this by telling the (active)
socket for the connection.
This means the rest of the code doesn't need to know the TCPConnecter
is not doing a simple resolve+connect. The rest of the code only
cares the connection is established; not how it was established.
Diffstat (limited to 'src/network/network_internal.h')
-rw-r--r-- | src/network/network_internal.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/network/network_internal.h b/src/network/network_internal.h index c1e6aa7b9..95226286c 100644 --- a/src/network/network_internal.h +++ b/src/network/network_internal.h @@ -122,6 +122,7 @@ StringID GetNetworkErrorMsg(NetworkErrorCode err); bool NetworkMakeClientNameUnique(std::string &new_name); std::string GenerateCompanyPasswordHash(const std::string &password, const std::string &password_server_id, uint32 password_game_seed); +std::string_view ParseCompanyFromConnectionString(const std::string &connection_string, CompanyID *company_id); NetworkAddress ParseConnectionString(const std::string &connection_string, uint16 default_port); std::string NormalizeConnectionString(const std::string &connection_string, uint16 default_port); |