From a8afbe74bfdbe6aa9ceb88c8e70c63bfe37aeda0 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Thu, 29 Apr 2021 12:01:54 +0200 Subject: Cleanup: remove write-only variable "hostname" in NetworkGameList --- src/network/core/game_info.h | 1 - src/network/network_gamelist.cpp | 1 - src/network/network_udp.cpp | 5 ----- 3 files changed, 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(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)); } -- cgit v1.2.3-70-g09d2