diff options
author | rubidium <rubidium@openttd.org> | 2009-01-20 01:32:06 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-01-20 01:32:06 +0000 |
commit | 4aabc91c04c8fafa4f2be139394ef7e4912bc42f (patch) | |
tree | f14ce239c04d4b6e3d7f4dbe6723e777a42cc03f /src/network/network_gamelist.cpp | |
parent | 0893cb2adfd7eaa729058bdf903c3064c84f707c (diff) | |
download | openttd-4aabc91c04c8fafa4f2be139394ef7e4912bc42f.tar.xz |
(svn r15157) -Codechange: wrap the hostname/ip and port into a single structure so we can pass either one of them and not convert an ip to a string and then back again.
Diffstat (limited to 'src/network/network_gamelist.cpp')
-rw-r--r-- | src/network/network_gamelist.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/network/network_gamelist.cpp b/src/network/network_gamelist.cpp index efec52220..235e9afe3 100644 --- a/src/network/network_gamelist.cpp +++ b/src/network/network_gamelist.cpp @@ -96,18 +96,13 @@ void NetworkGameListRequery() if (++requery_cnt < REQUERY_EVERY_X_GAMELOOPS) return; requery_cnt = 0; - struct in_addr ip; - NetworkGameList *item; - - for (item = _network_game_list; item != NULL; item = item->next) { + for (NetworkGameList *item = _network_game_list; item != NULL; item = item->next) { item->retries++; if (item->retries < REFRESH_GAMEINFO_X_REQUERIES && (item->online || item->retries >= MAX_GAME_LIST_REQUERY_COUNT)) continue; - ip.s_addr = item->ip; - /* item gets mostly zeroed by NetworkUDPQueryServer */ uint8 retries = item->retries; - NetworkUDPQueryServer(inet_ntoa(ip), item->port); + NetworkUDPQueryServer(NetworkAddress(item->ip, item->port)); item->retries = (retries >= REFRESH_GAMEINFO_X_REQUERIES) ? 0 : retries; } } |