(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

This commit is contained in:
rubidium
2011-04-09 21:52:38 +00:00
parent 6ce83c0aaa
commit d1a50a01b4
2 changed files with 34 additions and 32 deletions

View File

@@ -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;
}