summaryrefslogtreecommitdiff
path: root/src/network/network_client.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-04-09 21:52:38 +0000
committerrubidium <rubidium@openttd.org>2011-04-09 21:52:38 +0000
commitd1a50a01b46684486428a2b63959cb160a016c39 (patch)
tree860b03560d9a7e540e4c633d0bb0118350abf401 /src/network/network_client.cpp
parent6ce83c0aaa4028f05088c9c613f6b7b08b250aab (diff)
downloadopenttd-d1a50a01b46684486428a2b63959cb160a016c39.tar.xz
(svn r22308) -Fix [FS#4574]: waiting on a server could kick the client, or rather the client would kick itself due to an unexpected packet
Diffstat (limited to 'src/network/network_client.cpp')
-rw-r--r--src/network/network_client.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp
index 1bd288a2e..66eff8fdb 100644
--- a/src/network/network_client.cpp
+++ b/src/network/network_client.cpp
@@ -719,17 +719,14 @@ DEF_GAME_RECEIVE_COMMAND(Client, PACKET_SERVER_WELCOME)
DEF_GAME_RECEIVE_COMMAND(Client, PACKET_SERVER_WAIT)
{
- if (this->status != STATUS_AUTHORIZED) return NETWORK_RECV_STATUS_MALFORMED_PACKET;
- this->status = STATUS_MAP_WAIT;
+ /* We set the internal wait state when requesting the map. */
+ if (this->status != STATUS_MAP_WAIT) return NETWORK_RECV_STATUS_MALFORMED_PACKET;
+ /* But... only now we set the join status to waiting, instead of requesting. */
_network_join_status = NETWORK_JOIN_STATUS_WAITING;
_network_join_waiting = p->Recv_uint8();
SetWindowDirty(WC_NETWORK_STATUS_WINDOW, 0);
- /* We are put on hold for receiving the map.. we need GUI for this ;) */
- DEBUG(net, 1, "The server is currently busy sending the map to someone else, please wait..." );
- DEBUG(net, 1, "There are %d clients in front of you", _network_join_waiting);
-
return NETWORK_RECV_STATUS_OKAY;
}