summaryrefslogtreecommitdiff
path: root/src/network/network_gamelist.cpp
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-04-28 14:36:14 +0200
committerPatric Stout <github@truebrain.nl>2021-07-11 20:38:42 +0200
commitcee8174d02e38542548fc74de93450cfebefaa91 (patch)
tree094ad162d578263d28470a444b3c7656d6bc09ab /src/network/network_gamelist.cpp
parentf4dd2d88c721c085376f59908097500bc5f0c143 (diff)
downloadopenttd-cee8174d02e38542548fc74de93450cfebefaa91.tar.xz
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.
Diffstat (limited to 'src/network/network_gamelist.cpp')
-rw-r--r--src/network/network_gamelist.cpp4
1 files changed, 2 insertions, 2 deletions
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) {