diff options
author | Patric Stout <truebrain@openttd.org> | 2021-04-29 12:01:54 +0200 |
---|---|---|
committer | Patric Stout <github@truebrain.nl> | 2021-04-29 20:12:11 +0200 |
commit | a8afbe74bfdbe6aa9ceb88c8e70c63bfe37aeda0 (patch) | |
tree | 1507c5bb9b5fb419ceca1807e16415ea1bd943e1 | |
parent | 0b460bf4a17e12ba479e0822b8f9b7de29ac5816 (diff) | |
download | openttd-a8afbe74bfdbe6aa9ceb88c8e70c63bfe37aeda0.tar.xz |
Cleanup: remove write-only variable "hostname" in NetworkGameList
-rw-r--r-- | src/network/core/game_info.h | 1 | ||||
-rw-r--r-- | src/network/network_gamelist.cpp | 1 | ||||
-rw-r--r-- | src/network/network_udp.cpp | 5 |
3 files changed, 0 insertions, 7 deletions
diff --git a/src/network/core/game_info.h b/src/network/core/game_info.h index 28aea7507..324c6ea4a 100644 --- a/src/network/core/game_info.h +++ b/src/network/core/game_info.h @@ -74,7 +74,6 @@ struct NetworkGameInfo : NetworkServerGameInfo { uint16 map_width; ///< Map width uint16 map_height; ///< Map height char server_name[NETWORK_NAME_LENGTH]; ///< Server name - char hostname[NETWORK_HOSTNAME_LENGTH]; ///< Hostname of the server (if any) char server_revision[NETWORK_REVISION_LENGTH]; ///< The version number the server is using (e.g.: 'r304' or 0.5.0) bool dedicated; ///< Is this a dedicated server? bool version_compatible; ///< Can we connect to this server or not? (based on server_revision) diff --git a/src/network/network_gamelist.cpp b/src/network/network_gamelist.cpp index dfe07bdbb..3ee5099b7 100644 --- a/src/network/network_gamelist.cpp +++ b/src/network/network_gamelist.cpp @@ -51,7 +51,6 @@ static void NetworkGameListHandleDelayedInsert() ClearGRFConfigList(&item->info.grfconfig); memset(&item->info, 0, sizeof(item->info)); strecpy(item->info.server_name, ins_item->info.server_name, lastof(item->info.server_name)); - strecpy(item->info.hostname, ins_item->info.hostname, lastof(item->info.hostname)); item->online = false; } item->manually |= ins_item->manually; diff --git a/src/network/network_udp.cpp b/src/network/network_udp.cpp index d62998794..bb71e5cea 100644 --- a/src/network/network_udp.cpp +++ b/src/network/network_udp.cpp @@ -92,7 +92,6 @@ static void DoNetworkUDPQueryServer(NetworkAddress &address, bool needs_mutex, b /* Clear item in gamelist */ NetworkGameList *item = CallocT<NetworkGameList>(1); address.GetAddressAsString(item->info.server_name, lastof(item->info.server_name)); - strecpy(item->info.hostname, address.GetHostname(), lastof(item->info.hostname)); item->address = address; item->manually = manually; NetworkGameListAddItemDelayed(item); @@ -365,10 +364,6 @@ void ClientNetworkUDPSocketHandler::Receive_SERVER_RESPONSE(Packet *p, NetworkAd } } - if (item->info.hostname[0] == '\0') { - seprintf(item->info.hostname, lastof(item->info.hostname), "%s", client_addr->GetHostname()); - } - if (client_addr->GetAddress()->ss_family == AF_INET6) { strecat(item->info.server_name, " (IPv6)", lastof(item->info.server_name)); } |