summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-06-09 12:17:01 +0000
committerrubidium <rubidium@openttd.org>2008-06-09 12:17:01 +0000
commit35f3284a607fd5c1d1e43be0bef7fc42da25fc68 (patch)
tree5ac847d08af85cd81c504bf8f3e973528125d6a0 /src/network
parentb9eea932378fb85ed40f7e88fc93092e5bc056e5 (diff)
downloadopenttd-35f3284a607fd5c1d1e43be0bef7fc42da25fc68.tar.xz
(svn r13433) -Codechange: remove a now useless global variable.
-Fix: MP advertising was not advertising.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/network.cpp3
-rw-r--r--src/network/network.h2
-rw-r--r--src/network/network_gui.cpp6
-rw-r--r--src/network/network_udp.cpp4
4 files changed, 6 insertions, 9 deletions
diff --git a/src/network/network.cpp b/src/network/network.cpp
index 9bc144cdb..0ed6431b5 100644
--- a/src/network/network.cpp
+++ b/src/network/network.cpp
@@ -45,7 +45,6 @@ bool _network_reload_cfg;
bool _network_server; ///< network-server is active
bool _network_available; ///< is network mode available?
bool _network_dedicated; ///< are we a dedicated server?
-bool _network_advertise; ///< is the server advertising to the master server?
bool _is_network_server; ///< Does this client wants to be a network-server?
NetworkServerGameInfo _network_game_info;
NetworkPlayerInfo _network_player_info[MAX_PLAYERS];
@@ -1110,7 +1109,7 @@ void NetworkDisconnect()
}
}
- if (_network_advertise) NetworkUDPRemoveAdvertise();
+ if (_settings_client.network.server_advertise) NetworkUDPRemoveAdvertise();
DeleteWindowById(WC_NETWORK_STATUS_WINDOW, 0);
diff --git a/src/network/network.h b/src/network/network.h
index 1331a6826..8de34f112 100644
--- a/src/network/network.h
+++ b/src/network/network.h
@@ -16,7 +16,6 @@ extern bool _networking; ///< are we in networking mode?
extern bool _network_server; ///< network-server is active
extern bool _network_available; ///< is network mode available?
extern bool _network_dedicated; ///< are we a dedicated server?
-extern bool _network_advertise; ///< is the server advertising to the master server?
extern bool _is_network_server; ///< Does this client wants to be a network-server?
#else /* ENABLE_NETWORK */
@@ -29,7 +28,6 @@ static inline void NetworkShutDown() {}
#define _network_server 0
#define _network_available 0
#define _network_dedicated 0
-#define _network_advertise 0
#define _is_network_server 0
#endif /* ENABLE_NETWORK */
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp
index 23a0f86a7..379d49195 100644
--- a/src/network/network_gui.cpp
+++ b/src/network/network_gui.cpp
@@ -686,7 +686,7 @@ struct NetworkStartServerWindow : public QueryStringBaseWindow {
const FiosItem *item;
/* draw basic widgets */
- SetDParam(1, _connection_types_dropdown[_network_advertise]);
+ SetDParam(1, _connection_types_dropdown[_settings_client.network.server_advertise]);
SetDParam(2, _settings_client.network.max_clients);
SetDParam(3, _settings_client.network.max_companies);
SetDParam(4, _settings_client.network.max_spectators);
@@ -748,7 +748,7 @@ struct NetworkStartServerWindow : public QueryStringBaseWindow {
} break;
case NSSW_CONNTYPE_BTN: // Connection type
- ShowDropDownMenu(this, _connection_types_dropdown, _network_advertise, NSSW_CONNTYPE_BTN, 0, 0); // do it for widget NSSW_CONNTYPE_BTN
+ ShowDropDownMenu(this, _connection_types_dropdown, _settings_client.network.server_advertise, NSSW_CONNTYPE_BTN, 0, 0); // do it for widget NSSW_CONNTYPE_BTN
break;
case NSSW_CLIENTS_BTND: case NSSW_CLIENTS_BTNU: // Click on up/down button for number of clients
@@ -836,7 +836,7 @@ struct NetworkStartServerWindow : public QueryStringBaseWindow {
{
switch (widget) {
case NSSW_CONNTYPE_BTN:
- _network_advertise = (index != 0);
+ _settings_client.network.server_advertise = (index != 0);
break;
case NSSW_LANGUAGE_BTN:
_settings_client.network.server_lang = _language_dropdown[index] - STR_NETWORK_LANG_ANY;
diff --git a/src/network/network_udp.cpp b/src/network/network_udp.cpp
index 02c2fe1fd..c0ee3bbd5 100644
--- a/src/network/network_udp.cpp
+++ b/src/network/network_udp.cpp
@@ -52,7 +52,7 @@ DEF_UDP_RECEIVE_COMMAND(Master, PACKET_UDP_MASTER_ACK_REGISTER)
DEBUG(net, 2, "[udp] advertising on master server successful");
/* We are advertised, but we don't want to! */
- if (!_network_advertise) NetworkUDPRemoveAdvertise();
+ if (!_settings_client.network.server_advertise) NetworkUDPRemoveAdvertise();
}
///*** Communication with clients (we are server) ***/
@@ -562,7 +562,7 @@ void NetworkUDPAdvertise()
struct sockaddr_in out_addr;
/* Check if we should send an advertise */
- if (!_networking || !_network_server || !_network_udp_server || !_network_advertise)
+ if (!_networking || !_network_server || !_network_udp_server || !_settings_client.network.server_advertise)
return;
/* check for socket */