From f4bd3fff5ebfdd7c58ccaf23977b8447c740b48a Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Tue, 20 Apr 2021 16:42:37 +0200 Subject: Remove: "map_name" from server announcements / listing The idea back in the days was nice, but it never resulted in anything useful. Most servers either read "(loaded game)" or "Random Map", neither being useful. It was meant for heightmaps, so you could find a server that was using a specific one .. but there are many things wrong with that idea. Mostly, servers tend to save and load savegames from time to time, after which the original heightmap used was lost. All in all, removing map_name all together is just better. --- src/network/core/game.h | 1 - src/network/core/udp.cpp | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src/network/core') diff --git a/src/network/core/game.h b/src/network/core/game.h index 151ebef28..0a10cfb1f 100644 --- a/src/network/core/game.h +++ b/src/network/core/game.h @@ -22,7 +22,6 @@ * be sent to the clients. */ struct NetworkServerGameInfo { - char map_name[NETWORK_NAME_LENGTH]; ///< Map which is played ["random" for a randomized map] byte clients_on; ///< Current count of clients on server }; diff --git a/src/network/core/udp.cpp b/src/network/core/udp.cpp index aa6d39cbb..985c8fa72 100644 --- a/src/network/core/udp.cpp +++ b/src/network/core/udp.cpp @@ -205,7 +205,7 @@ void NetworkUDPSocketHandler::SendNetworkGameInfo(Packet *p, const NetworkGameIn p->Send_uint8 (info->clients_max); p->Send_uint8 (info->clients_on); p->Send_uint8 (info->spectators_on); - p->Send_string(info->map_name); + p->Send_string(""); // Used to be map-name. p->Send_uint16(info->map_width); p->Send_uint16(info->map_height); p->Send_uint8 (info->map_set); @@ -275,7 +275,7 @@ void NetworkUDPSocketHandler::ReceiveNetworkGameInfo(Packet *p, NetworkGameInfo info->game_date = p->Recv_uint16() + DAYS_TILL_ORIGINAL_BASE_YEAR; info->start_date = p->Recv_uint16() + DAYS_TILL_ORIGINAL_BASE_YEAR; } - p->Recv_string(info->map_name, sizeof(info->map_name)); + while (p->Recv_uint8() != 0) {} // Used to contain the map-name. info->map_width = p->Recv_uint16(); info->map_height = p->Recv_uint16(); info->map_set = p->Recv_uint8 (); -- cgit v1.2.3-54-g00ecf