30 #define tolower(C) (((C) >= 'A' && (C) <= 'Z') ? (C)-'A'+'a' : (C)) 46 static int compare_A(
const void *a,
const void *b) {
68 (
void *)commarray, commsize,
93 cp = command+strlen(command)-1;
94 while ((cp >= command) && (*cp ==
' ')) {
98 cp = strchr(command,
' ');
104 cp = strchr(command,
'\0');
107 for (low = command; *low; low++)
122 "'%s' is not a valid command.",
140 LOG(
llevDebug,
"execute_newclient_command: Player issued command that takes more time than he has left.\n");
157 if (dir < 0 || dir >= 9) {
159 "Can't run into a non adjacent square.");
192 if (dir < 0 || dir >= 9) {
194 "Can't fire to a non adjacent square.");
224 if ( !isdigit(*params) ) {
225 if ( strcmp(params,
"stay") == 0 || strcmp(params,
"down") == 0 ) dir=0;
226 else if ( strcmp(params,
"north") == 0 || strcmp(params,
"n") == 0 ) dir=1;
227 else if ( strcmp(params,
"northeast") == 0 || strcmp(params,
"ne") == 0 ) dir=2;
228 else if ( strcmp(params,
"east") == 0 || strcmp(params,
"e") == 0 ) dir=3;
229 else if ( strcmp(params,
"southeast") == 0 || strcmp(params,
"se") == 0 ) dir=4;
230 else if ( strcmp(params,
"south") == 0 || strcmp(params,
"s") == 0 ) dir=5;
231 else if ( strcmp(params,
"southwest") == 0 || strcmp(params,
"sw") == 0 ) dir=6;
232 else if ( strcmp(params,
"west") == 0 || strcmp(params,
"w") == 0 ) dir=7;
233 else if ( strcmp(params,
"northwest") == 0 || strcmp(params,
"nw") == 0 ) dir=8;
236 "Unknown direction to face: %s",params);
240 else dir = atoi(params);
241 if (dir < 0 || dir >= 9) {
243 "Can't face to a non adjacent square.");
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...)
command_array_struct * find_plugin_command(const char *cmd, command_array_struct *command)
command_array_struct Commands[]
int move_player(object *op, int dir)
const int WizCommandsSize
void draw_ext_info(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *message)
const int CommunicationCommandSize
#define MSG_TYPE_COMMAND_ERROR
static int compare_A(const void *a, const void *b)
void command_face(object *op, const char *params)
void command_run(object *op, const char *params)
void command_run_stop(object *op, const char *params)
#define QUERY_FLAG(xyz, p)
void execute_newserver_command(object *pl, char *command)
command_array_struct WizCommands[]
void command_fire(object *op, const char *params)
command_array_struct CommunicationCommands[]
void LOG(LogLevel logLevel, const char *format,...)
static command_array_struct * find_command_element(const char *cmd, command_array_struct *commarray, int commsize)
void command_fire_stop(object *op, const char *params)
int face_player(object *op, int dir)