forked from mirror/OpenTTD
(svn r20549) -Codechange: centralise the handling of the incoming commands (from clients and the server)
This commit is contained in:
@@ -742,16 +742,13 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_COMMAND)
|
||||
const char *err = MY_CLIENT->Recv_Command(p, &cp);
|
||||
cp.frame = p->Recv_uint32();
|
||||
cp.my_cmd = p->Recv_bool();
|
||||
cp.next = NULL;
|
||||
|
||||
if (err != NULL) {
|
||||
IConsolePrintF(CC_ERROR, "WARNING: %s from server, dropping...", err);
|
||||
return NETWORK_RECV_STATUS_MALFORMED_PACKET;
|
||||
}
|
||||
|
||||
/* The server did send us this command..
|
||||
* queue it in our own queue, so we can handle it in the upcoming frame! */
|
||||
NetworkAddCommandQueue(cp);
|
||||
MY_CLIENT->incoming_queue.Append(&cp);
|
||||
|
||||
return NETWORK_RECV_STATUS_OKAY;
|
||||
}
|
||||
|
Reference in New Issue
Block a user