Mercurial > hg > openttd
annotate src/network/network_gamelist.cpp @ 6121:38184d805f9e draft
(svn r8857) -Documentation: Added some doxygen @file tags, repaired others (the @file tag MUST be found before any line of code, that includes preprocessor directives).
author | celestar <celestar@openttd.org> |
---|---|
date | Fri, 23 Feb 2007 08:37:33 +0000 |
parents | ad77d11aeccf |
children | 57363e064324 |
rev | line source |
---|---|
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1 /* $Id$ */ |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
2 |
6121
38184d805f9e
(svn r8857) -Documentation: Added some doxygen @file tags, repaired others (the @file tag MUST be found before any line of code, that includes preprocessor directives).
celestar <celestar@openttd.org>
parents:
5917
diff
changeset
|
3 /** |
38184d805f9e
(svn r8857) -Documentation: Added some doxygen @file tags, repaired others (the @file tag MUST be found before any line of code, that includes preprocessor directives).
celestar <celestar@openttd.org>
parents:
5917
diff
changeset
|
4 * @file network_gamelist.cpp This file handles the GameList |
38184d805f9e
(svn r8857) -Documentation: Added some doxygen @file tags, repaired others (the @file tag MUST be found before any line of code, that includes preprocessor directives).
celestar <celestar@openttd.org>
parents:
5917
diff
changeset
|
5 * Also, it handles the request to a server for data about the server |
38184d805f9e
(svn r8857) -Documentation: Added some doxygen @file tags, repaired others (the @file tag MUST be found before any line of code, that includes preprocessor directives).
celestar <celestar@openttd.org>
parents:
5917
diff
changeset
|
6 */ |
38184d805f9e
(svn r8857) -Documentation: Added some doxygen @file tags, repaired others (the @file tag MUST be found before any line of code, that includes preprocessor directives).
celestar <celestar@openttd.org>
parents:
5917
diff
changeset
|
7 |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
8 #ifdef ENABLE_NETWORK |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
9 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
10 #include "../stdafx.h" |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
11 #include "../debug.h" |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
12 #include "../newgrf_config.h" |
5587
c44c070c5032
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium <rubidium@openttd.org>
parents:
5584
diff
changeset
|
13 #include "../helpers.hpp" |
5917
ad77d11aeccf
(svn r8544) -Codechange: move game list related function/struct declarations to network_gamelist.h
rubidium <rubidium@openttd.org>
parents:
5915
diff
changeset
|
14 #include "core/game.h" |
5897
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
15 #include "network_udp.h" |
5917
ad77d11aeccf
(svn r8544) -Codechange: move game list related function/struct declarations to network_gamelist.h
rubidium <rubidium@openttd.org>
parents:
5915
diff
changeset
|
16 #include "network_gamelist.h" |
ad77d11aeccf
(svn r8544) -Codechange: move game list related function/struct declarations to network_gamelist.h
rubidium <rubidium@openttd.org>
parents:
5915
diff
changeset
|
17 #include "network_gui.h" |
ad77d11aeccf
(svn r8544) -Codechange: move game list related function/struct declarations to network_gamelist.h
rubidium <rubidium@openttd.org>
parents:
5915
diff
changeset
|
18 |
ad77d11aeccf
(svn r8544) -Codechange: move game list related function/struct declarations to network_gamelist.h
rubidium <rubidium@openttd.org>
parents:
5915
diff
changeset
|
19 NetworkGameList *_network_game_list = NULL; |
5897
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
20 |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
21 /** Should we stop/contiue requerying of offline servers? */ |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
22 static bool _stop_requerying = false; |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
23 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
24 /** Add a new item to the linked gamelist. If the IP and Port match |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
25 * return the existing item instead of adding it again |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
26 * @param ip the IP-address (inet_addr) of the to-be added item |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
27 * @param port the port the server is running on |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
28 * @return a point to the newly added or already existing item */ |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
29 NetworkGameList *NetworkGameListAddItem(uint32 ip, uint16 port) |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
30 { |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
31 NetworkGameList *item, *prev_item; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
32 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
33 prev_item = NULL; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
34 for (item = _network_game_list; item != NULL; item = item->next) { |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
35 if (item->ip == ip && item->port == port) return item; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
36 prev_item = item; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
37 } |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
38 |
5609
358c07fb3212
(svn r8066) - Codechange: MallocT(), CallocT(), ReallocT() now return the pointer to allocated memory instead of modifying the pointer given as parameter
KUDr <KUDr@openttd.org>
parents:
5587
diff
changeset
|
39 item = MallocT<NetworkGameList>(1); |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
40 memset(item, 0, sizeof(*item)); |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
41 item->next = NULL; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
42 item->ip = ip; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
43 item->port = port; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
44 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
45 if (prev_item == NULL) { |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
46 _network_game_list = item; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
47 } else { |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
48 prev_item->next = item; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
49 } |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
50 DEBUG(net, 4, "[gamelist] added server to list"); |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
51 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
52 UpdateNetworkGameWindow(false); |
5897
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
53 _stop_requerying = false; |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
54 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
55 return item; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
56 } |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
57 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
58 /** Remove an item from the gamelist linked list |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
59 * @param remove pointer to the item to be removed */ |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
60 void NetworkGameListRemoveItem(NetworkGameList *remove) |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
61 { |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
62 NetworkGameList *item, *prev_item; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
63 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
64 prev_item = NULL; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
65 for (item = _network_game_list; item != NULL; item = item->next) { |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
66 if (remove == item) { |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
67 if (prev_item == NULL) { |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
68 _network_game_list = remove->next; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
69 } else { |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
70 prev_item->next = remove->next; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
71 } |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
72 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
73 /* Remove GRFConfig information */ |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
74 ClearGRFConfigList(&remove->info.grfconfig); |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
75 free(remove); |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
76 remove = NULL; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
77 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
78 DEBUG(net, 4, "[gamelist] removed server from list"); |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
79 UpdateNetworkGameWindow(false); |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
80 return; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
81 } |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
82 prev_item = item; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
83 } |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
84 } |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
85 |
5897
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
86 enum { |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
87 MAX_GAME_LIST_REQUERY_COUNT = 5, |
5915
83c7ced841a0
(svn r8542) -Codechange (Fix?): tweak the gamelist requery timeout so more servers are found for slow network connections.
rubidium <rubidium@openttd.org>
parents:
5897
diff
changeset
|
88 REQUERY_EVERY_X_GAMELOOPS = 60, |
5897
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
89 }; |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
90 |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
91 /** Requeries the (game) servers we have not gotten a reply from */ |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
92 void NetworkGameListRequery(void) |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
93 { |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
94 static uint8 requery_cnt = 0; |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
95 |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
96 if (_stop_requerying || ++requery_cnt < REQUERY_EVERY_X_GAMELOOPS) return; |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
97 |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
98 requery_cnt = 0; |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
99 _stop_requerying = true; |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
100 |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
101 struct in_addr ip; |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
102 NetworkGameList *item; |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
103 |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
104 for (item = _network_game_list; item != NULL; item = item->next) { |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
105 if (item->online || item->retries >= MAX_GAME_LIST_REQUERY_COUNT) continue; |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
106 |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
107 ip.s_addr = item->ip; |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
108 |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
109 /* item gets mostly zeroed by NetworkUDPQueryServer */ |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
110 uint8 retries = item->retries; |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
111 NetworkUDPQueryServer(inet_ntoa(ip), item->port); |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
112 item->retries = retries + 1; |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
113 |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
114 _stop_requerying = false; |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
115 } |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
116 |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
117 } |
bc46ad759678
(svn r8520) -Fix/Feature: requery gameservers that did not respond to their first query.
rubidium <rubidium@openttd.org>
parents:
5609
diff
changeset
|
118 |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
119 #endif /* ENABLE_NETWORK */ |