(svn r20549) -Codechange: centralise the handling of the incoming commands (from clients and the server)

This commit is contained in:
rubidium
2010-08-18 22:40:17 +00:00
parent e8e22c99fd
commit b594990071
6 changed files with 73 additions and 61 deletions

View File

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