From cee8174d02e38542548fc74de93450cfebefaa91 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Wed, 28 Apr 2021 14:36:14 +0200 Subject: Codechange: track servers with a ServerAddress instead of a NetworkAddress This allows future extensions to have different ways of referencing a server, instead of forcing to use IP:port. --- src/network/network_gamelist.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/network/network_gamelist.cpp') diff --git a/src/network/network_gamelist.cpp b/src/network/network_gamelist.cpp index 92964bf25..d4843ff67 100644 --- a/src/network/network_gamelist.cpp +++ b/src/network/network_gamelist.cpp @@ -26,7 +26,7 @@ int _network_game_list_version = 0; ///< Current version of all items in the lis /** * Add a new item to the linked gamelist. If the IP and Port match * return the existing item instead of adding it again - * @param address the address of the to-be added item + * @param connection_string the address of the to-be added item * @return a point to the newly added or already existing item */ NetworkGameList *NetworkGameListAddItem(const std::string &connection_string) @@ -34,7 +34,7 @@ NetworkGameList *NetworkGameListAddItem(const std::string &connection_string) NetworkGameList *item, *prev_item; /* Parse the connection string to ensure the default port is there. */ - const std::string resolved_connection_string = ParseConnectionString(connection_string, NETWORK_DEFAULT_PORT).GetAddressAsString(false); + const std::string resolved_connection_string = ServerAddress::Parse(connection_string, NETWORK_DEFAULT_PORT).connection_string; prev_item = nullptr; for (item = _network_game_list; item != nullptr; item = item->next) { -- cgit v1.2.3-54-g00ecf