summaryrefslogtreecommitdiff
path: root/network_client.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-09-01 13:35:43 +0000
committertron <tron@openttd.org>2006-09-01 13:35:43 +0000
commit8ef52bc43c3afe9139aed61a64b023f5ca49101d (patch)
tree8390bc18a0b9bc901d95d47c600997066ebe0508 /network_client.c
parent47b0d41d63b5e835d528f82a232d75a995e31fda (diff)
downloadopenttd-8ef52bc43c3afe9139aed61a64b023f5ca49101d.tar.xz
(svn r6297) -Codechange: Disentangle the query window mess a bit: Move the network game password handling somewhere were it belongs to
Diffstat (limited to 'network_client.c')
-rw-r--r--network_client.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/network_client.c b/network_client.c
index d804715a8..db78632e3 100644
--- a/network_client.c
+++ b/network_client.c
@@ -13,6 +13,7 @@
#include "functions.h"
#include "network_client.h"
#include "network_gamelist.h"
+#include "network_gui.h"
#include "saveload.h"
#include "command.h"
#include "window.h"
@@ -423,18 +424,16 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_ERROR)
DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_NEED_PASSWORD)
{
- NetworkPasswordType type;
- type = NetworkRecv_uint8(MY_CLIENT, p);
+ NetworkPasswordType type = NetworkRecv_uint8(MY_CLIENT, p);
- if (type == NETWORK_GAME_PASSWORD) {
- ShowNetworkNeedGamePassword();
- return NETWORK_RECV_STATUS_OKAY;
- } else if (type == NETWORK_COMPANY_PASSWORD) {
- ShowNetworkNeedCompanyPassword();
- return NETWORK_RECV_STATUS_OKAY;
- }
+ switch (type) {
+ case NETWORK_GAME_PASSWORD:
+ case NETWORK_COMPANY_PASSWORD:
+ ShowNetworkNeedPassword(type);
+ return NETWORK_RECV_STATUS_OKAY;
- return NETWORK_RECV_STATUS_MALFORMED_PACKET;
+ default: return NETWORK_RECV_STATUS_MALFORMED_PACKET;
+ }
}
DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_WELCOME)