summaryrefslogtreecommitdiff
path: root/network_client.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-01-25 18:11:06 +0000
committerDarkvater <darkvater@openttd.org>2006-01-25 18:11:06 +0000
commit78fa9c73933a10e052ed9358a73dc1015f49d14b (patch)
tree2e2b02a496376c4fb097825d484c2c4a6f6f5492 /network_client.c
parent42a9353ae2283939609d068725d89ac93f199bcd (diff)
downloadopenttd-78fa9c73933a10e052ed9358a73dc1015f49d14b.tar.xz
(svn r3427) - Feature: Allow seeing and setting the maximum amount of companies and spectators for a server. This can be changed/viewed during runtime as well in the console.
Diffstat (limited to 'network_client.c')
-rw-r--r--network_client.c38
1 files changed, 24 insertions, 14 deletions
diff --git a/network_client.c b/network_client.c
index 060e230ea..a7452fd87 100644
--- a/network_client.c
+++ b/network_client.c
@@ -395,20 +395,30 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_ERROR)
{
NetworkErrorCode error = NetworkRecv_uint8(MY_CLIENT, p);
- if (error == NETWORK_ERROR_NOT_AUTHORIZED || error == NETWORK_ERROR_NOT_EXPECTED ||
- error == NETWORK_ERROR_PLAYER_MISMATCH) {
- // We made an error in the protocol, and our connection is closed.... :(
- _switch_mode_errorstr = STR_NETWORK_ERR_SERVER_ERROR;
- } else if (error == NETWORK_ERROR_WRONG_REVISION) {
- // Wrong revision :(
- _switch_mode_errorstr = STR_NETWORK_ERR_WRONG_REVISION;
- } else if (error == NETWORK_ERROR_WRONG_PASSWORD) {
- // Wrong password
- _switch_mode_errorstr = STR_NETWORK_ERR_WRONG_PASSWORD;
- } else if (error == NETWORK_ERROR_KICKED) {
- _switch_mode_errorstr = STR_NETWORK_ERR_KICKED;
- } else if (error == NETWORK_ERROR_CHEATER) {
- _switch_mode_errorstr = STR_NETWORK_ERR_CHEATER;
+ switch (error) {
+ /* We made an error in the protocol, and our connection is closed.... */
+ case NETWORK_ERROR_NOT_AUTHORIZED:
+ case NETWORK_ERROR_NOT_EXPECTED:
+ case NETWORK_ERROR_PLAYER_MISMATCH:
+ _switch_mode_errorstr = STR_NETWORK_ERR_SERVER_ERROR;
+ break;
+ case NETWORK_ERROR_FULL:
+ _switch_mode_errorstr = STR_NETWORK_ERR_SERVER_FULL;
+ break;
+ case NETWORK_ERROR_WRONG_REVISION:
+ _switch_mode_errorstr = STR_NETWORK_ERR_WRONG_REVISION;
+ break;
+ case NETWORK_ERROR_WRONG_PASSWORD:
+ _switch_mode_errorstr = STR_NETWORK_ERR_WRONG_PASSWORD;
+ break;
+ case NETWORK_ERROR_KICKED:
+ _switch_mode_errorstr = STR_NETWORK_ERR_KICKED;
+ break;
+ case NETWORK_ERROR_CHEATER:
+ _switch_mode_errorstr = STR_NETWORK_ERR_CHEATER;
+ break;
+ default:
+ _switch_mode_errorstr = STR_NETWORK_ERR_LOSTCONNECTION;
}
DeleteWindowById(WC_NETWORK_STATUS_WINDOW, 0);