summaryrefslogtreecommitdiff
path: root/src/network/network_udp.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-07-26 09:53:58 +0000
committerrubidium <rubidium@openttd.org>2007-07-26 09:53:58 +0000
commit6806635971eb690dca415f27d32fb11dafe2eddc (patch)
tree8396613de43c53e1bb16036d43417d8604fe4413 /src/network/network_udp.cpp
parent1ea5cba27b1558b9a6332f805cdfc10e97cf13cf (diff)
downloadopenttd-6806635971eb690dca415f27d32fb11dafe2eddc.tar.xz
(svn r10694) -Codechange: update the server information in the game list every once in a while so the information stays fairly up-to-date when you are looking through the servers.
Diffstat (limited to 'src/network/network_udp.cpp')
-rw-r--r--src/network/network_udp.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/network/network_udp.cpp b/src/network/network_udp.cpp
index 0dd5971d4..32bd26923 100644
--- a/src/network/network_udp.cpp
+++ b/src/network/network_udp.cpp
@@ -490,10 +490,12 @@ void NetworkUDPQueryServer(const char* host, unsigned short port, bool manually)
// Clear item in gamelist
item = NetworkGameListAddItem(inet_addr(inet_ntoa(out_addr.sin_addr)), ntohs(out_addr.sin_port));
- memset(&item->info, 0, sizeof(item->info));
- ttd_strlcpy(item->info.server_name, host, lengthof(item->info.server_name));
- ttd_strlcpy(item->info.hostname, host, lengthof(item->info.hostname));
- item->online = false;
+ if (StrEmpty(item->info.server_name)) {
+ memset(&item->info, 0, sizeof(item->info));
+ ttd_strlcpy(item->info.server_name, host, lengthof(item->info.server_name));
+ ttd_strlcpy(item->info.hostname, host, lengthof(item->info.hostname));
+ item->online = false;
+ }
item->manually = manually;
// Init the packet