This is the main command for a client to control its units: perform movements and directing attacks.
struct c2s_unit_command_t {
char type; // MSG_C2S_UNIT_COMMAND;
unsigned char command; // Command to be performed by the unit
int unit_id; // ID of the unit which is unique across all units
};
The following commands are supported:
const unsigned char UCMD_MOVE_TO = 0;
UCMD_MOVE_TO
Unit is requested to be perform the movement. Unit must be in STOPPED
state. If successful and server does not reject the command, then unit will be transitioned to the state MOVING
. Right after this structure follows
int path_length;
and then right after path_length
structures:
struct path_point_t {
int row; // (row, column) - point on unit path
int column;
};
Path should be valid from server perspective (see Unit Navigation for rules).