diff options
author | Patric Stout <truebrain@openttd.org> | 2021-05-05 23:21:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-05 23:21:14 +0200 |
commit | f94fb9377910c63fc8e1ea0ede1d96603e4d8862 (patch) | |
tree | 9b8041b53749744b4df075520181294806332e07 /src/network/network_gamelist.h | |
parent | ead30dc725c60cac8bc13c86d18b179dac684bec (diff) | |
download | openttd-f94fb9377910c63fc8e1ea0ede1d96603e4d8862.tar.xz |
Codechange: use connection_string in favour of NetworkAddress (#9197)
We now resolve the connection_string to a NetworkAddress in a much
later state. This means there are fewer places constructing a NetworkAddress.
The main benefit of this is in later PRs that introduce different types
of NetworkAddresses. Storing this in things like NetworkGameList is
rather complex, especially as NetworkAddress has to be mutable at all
times.
Additionally, the NetworkAddress is a complex object to store simple
information: how to connect to this server.
Diffstat (limited to 'src/network/network_gamelist.h')
-rw-r--r-- | src/network/network_gamelist.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/network/network_gamelist.h b/src/network/network_gamelist.h index ce35c01d8..31b3bc3e6 100644 --- a/src/network/network_gamelist.h +++ b/src/network/network_gamelist.h @@ -16,19 +16,19 @@ /** Structure with information shown in the game list (GUI) */ struct NetworkGameList { - NetworkGameInfo info; ///< The game information of this server - NetworkAddress address; ///< The connection info of the game server - bool online; ///< False if the server did not respond (default status) - bool manually; ///< True if the server was added manually - uint8 retries; ///< Number of retries (to stop requerying) - NetworkGameList *next; ///< Next pointer to make a linked game list + NetworkGameInfo info; ///< The game information of this server + std::string connection_string; ///< Address of the server + bool online; ///< False if the server did not respond (default status) + bool manually; ///< True if the server was added manually + uint8 retries; ///< Number of retries (to stop requerying) + NetworkGameList *next; ///< Next pointer to make a linked game list }; /** Game list of this client */ extern NetworkGameList *_network_game_list; void NetworkGameListAddItemDelayed(NetworkGameList *item); -NetworkGameList *NetworkGameListAddItem(NetworkAddress address); +NetworkGameList *NetworkGameListAddItem(const std::string &connection_string); void NetworkGameListRemoveItem(NetworkGameList *remove); void NetworkGameListRequery(); |