diff options
author | rubidium <rubidium@openttd.org> | 2007-07-26 09:53:58 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-07-26 09:53:58 +0000 |
commit | fda75ae60368197ab4058b1941fcf0bf06598369 (patch) | |
tree | 8396613de43c53e1bb16036d43417d8604fe4413 /src/network/network_udp.cpp | |
parent | 6f12d2997ccb9aa46f2bfa0b90aebd3351988435 (diff) | |
download | openttd-fda75ae60368197ab4058b1941fcf0bf06598369.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.cpp | 10 |
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 |