Crossfire Client, Trunk  R20223
p_cmd.c
Go to the documentation of this file.
1 /*
2  * Crossfire -- cooperative multi-player graphical RPG and adventure game
3  *
4  * Copyright (c) 1999-2013 Mark Wedel and the Crossfire Development Team
5  * Copyright (c) 1992 Frank Tore Johansen
6  *
7  * Crossfire is free software and comes with ABSOLUTELY NO WARRANTY. You are
8  * welcome to redistribute it under certain conditions. For details, please
9  * see COPYING and LICENSE.
10  *
11  * The authors can be reached via e-mail at <crossfire@metalforge.org>.
12  */
13 
19 #include <ctype.h>
20 
21 #include "client.h"
22 #include "external.h"
23 #include "p_cmd.h"
24 #include "script.h"
25 
31 #define H1(a) draw_ext_info(NDI_BLACK, MSG_TYPE_CLIENT, MSG_TYPE_CLIENT_NOTICE, a)
32 #define H2(a) draw_ext_info(NDI_BLACK, MSG_TYPE_CLIENT, MSG_TYPE_CLIENT_NOTICE, a)
33 #define LINE(a) draw_ext_info(NDI_BLACK, MSG_TYPE_CLIENT, MSG_TYPE_CLIENT_NOTICE, a)
34 
35 /* TODO Help topics other than commands? Refer to other documents? */
36 
37 static int get_num_commands(void);
38 
39 static void do_clienthelp_list() {
40  ConsoleCommand **sorted_cmds = get_cat_sorted_commands();
41  CommCat category = COMM_CAT_MISC;
42  GString *line = g_string_new(NULL);
43 
44  H1("Client commands:");
45  for (int i = 0; i < get_num_commands(); i++) {
46  ConsoleCommand *cmd = sorted_cmds[i];
47  if (cmd->cat != category) {
48  // If moving on to next category, dump line_buf and print header.
49  char buf[MAX_BUF];
50  snprintf(buf, sizeof(buf), "%s commands:",
51  get_category_name(cmd->cat));
52  LINE(line->str);
53  H2(buf);
54 
55  category = cmd->cat;
56  g_string_free(line, true);
57  line = g_string_new(NULL);
58  }
59  g_string_append_printf(line, "%s ", cmd->name);
60  }
61 
62  LINE(line->str);
63  g_string_free(line, true);
64 }
65 
66 static void show_help(const ConsoleCommand *cc) {
67  char buf[MAX_BUF];
68  if (cc->desc != NULL) {
69  snprintf(buf, MAX_BUF - 1, "%s - %s", cc->name, cc->desc);
70  } else {
71  snprintf(buf, MAX_BUF - 1, "Help for '%s':", cc->name);
72  }
73  H2(buf);
74 
75  if (cc->helpfunc != NULL) {
76  const char *long_help = NULL;
77  long_help = cc->helpfunc();
78 
79  if (long_help != NULL) {
80  LINE(long_help);
81  } else {
82  LINE("Extended help for this command is broken.");
83  }
84  } else {
85  LINE("No extended help is available for this command.");
86  }
87 }
88 
89 static void command_help(const char *cpnext) {
90  if (cpnext) {
91  const ConsoleCommand * cc;
92  char buf[MAX_BUF];
93 
94  cc = find_command(cpnext);
95  if (cc != NULL) {
96  show_help(cc);
97  } else {
98  snprintf(buf, sizeof(buf), "help %s", cpnext);
99  /* maybe not a must send, but we probably don't want to drop it */
100  send_command(buf, -1, 1);
101  }
102  } else {
104  /* Now fetch (in theory) command list from the server.
105  TODO Protocol command - feed it to the tab completer.
106 
107  Nope! It effectivey fetches '/help commands for commands'.
108  */
109  send_command("help", -1, 1); /* TODO make install in server branch doesn't install def_help. */
110  }
111 }
112 
113 static const char * help_help(void) {
114  return
115  "Syntax:\n"
116  "\n"
117  " help\n"
118  " help <topic>\n"
119  "\n"
120  "Without any arguments, displays a list of client-side "
121  "commands, and fetches the without-arguments help from "
122  "the server.\n"
123  "\n"
124  "With arguments, first checks if there's a client command "
125  "named <topic>. If there is, display it's help. If there "
126  "isn't, send the topic to the server.";
127 }
128  /* EndOf PCmdHelpCommands
131  */
132 
133 static void set_command_window(const char *cpnext) {
134  if (!cpnext) {
136  "cwindow command requires a number parameter");
137  } else {
138  want_config[CONFIG_CWINDOW] = atoi(cpnext);
141  } else {
143  }
144  }
145 }
146 
147 static void command_foodbeep() {
151  "Warning bell when low on food disabled");
152  } else {
155  "Warning bell when low on food enabled");
156  }
158 }
159 
160 const char * get_category_name(CommCat cat) {
161  const char * cat_name;
162 
163  /* HACK Need to keep this in sync. with player.h */
164  switch(cat) {
165  case COMM_CAT_MISC:
166  cat_name = "Miscellaneous";
167  break;
168  case COMM_CAT_INFO:
169  cat_name = "Informational";
170  break;
171  case COMM_CAT_SETUP:
172  cat_name = "Configuration";
173  break;
174  case COMM_CAT_SCRIPT:
175  cat_name = "Scripting";
176  break;
177  case COMM_CAT_DEBUG:
178  cat_name = "Debugging";
179  break;
180  default:
181  cat_name = "PROGRAMMER ERROR";
182  break;
183  }
184 
185  return cat_name;
186 }
187 
188 /*
189  * Command table.
190  *
191  * Implementation basically stolen verbatim from the server.
192  */
193 
194 static void do_script_list() { script_list(); }
195 
196 static void do_clearinfo() { menu_clear(); }
197 
198 static void do_disconnect() { client_disconnect(); }
199 
200 
201 static void do_inv() { print_inventory(cpl.ob); }
202 
203 static void do_magicmap() {
204  draw_magic_map();
205 }
206 
207 static void do_savedefaults() { save_defaults(); }
208 
209 static void do_savewinpos() { save_winpos(); }
210 
211 static void do_take(const char *used) {
212  command_take("take", used); /* I dunno why they want it. */
213 }
214 
215 static void do_num_free_items() {
216  LOG(LOG_INFO, "common::extended_command", "num_free_items=%d",
217  num_free_items());
218 }
219 
220 /* Help "typecasters". */
221 #include "chelp.h"
222 
223 static const char * help_bind(void) {
224  return HELP_BIND_LONG;
225 }
226 
227 static const char * help_unbind(void) {
228  return HELP_UNBIND_LONG;
229 }
230 
231 static const char * help_magicmap(void) {
232  return HELP_MAGICMAP_LONG;
233 }
234 
235 static const char * help_inv(void) {
236  return HELP_INV_LONG;
237 }
238 
239 static const char * help_cwindow(void) {
240  return
241  "Syntax:\n"
242  "\n"
243  " cwindow <val>\n"
244  "\n"
245  "set size of command"
246  "window (if val is exceeded"
247  "client won't send new"
248  "commands to server\n\n"
249  "(What does this mean, 'put a lid on it'?) TODO";
250 }
251 
252 static const char * help_script(void) {
253  return
254  "Syntax: script <path>\n\n"
255  "Start an executable client script located at <path>. For details on "
256  "client-side scripting, please see the Crossfire Wiki.";
257 }
258 
259 static const char * help_scripttell(void) {
260  return
261  "Syntax:\n"
262  "\n"
263  " scripttell <yourname> <data>\n"
264  "\n"
265  "?";
266 }
267 
268 /* Toolkit-dependent. */
269 
270 static const char * help_savewinpos(void) {
271  return
272  "Syntax:\n"
273  "\n"
274  " savewinpos\n"
275  "\n"
276  "save window positions - split windows mode only.";
277 }
278 
279 static const char * help_scriptkill(void) {
280  return
281  "Syntax:\n"
282  "\n"
283  " scriptkill <name>\n"
284  "\n"
285  "Stop scripts named <name>.\n"
286  "(Not guaranteed to work?)";
287 }
288 
289 static void cmd_raw(const char *cmd) {
290  cs_print_string(csocket.fd, "%s", cmd);
291 }
292 
294  {"cmd", COMM_CAT_DEBUG, cmd_raw, NULL, "Send a raw command to the server"},
295 
297 
298  {"script", COMM_CAT_SCRIPT, script_init, help_script, NULL},
299 #ifdef HAVE_LUA
300  {"lua_load", COMM_CAT_SCRIPT, script_lua_load, NULL, NULL},
301 
302  {"lua_list", COMM_CAT_SCRIPT, script_lua_list, NULL, NULL},
303 
304  {"lua_kill", COMM_CAT_SCRIPT, script_lua_kill, NULL, NULL},
305 #endif
306  {"scripts", COMM_CAT_SCRIPT, do_script_list, NULL, "List running scripts"},
307 
308  {"scriptkill", COMM_CAT_SCRIPT, script_kill, help_scriptkill, NULL},
309 
310  {"scripttell", COMM_CAT_SCRIPT, script_tell, help_scripttell, NULL},
311 
312  {"clearinfo", COMM_CAT_MISC, do_clearinfo, NULL, "Clear message window"},
313 
314  {"cwindow", COMM_CAT_SETUP, set_command_window, help_cwindow, NULL},
315 
316  {"disconnect", COMM_CAT_MISC, do_disconnect, NULL, NULL},
317 
318 
319  {"foodbeep", COMM_CAT_SETUP, command_foodbeep, NULL,
320  "toggle audible low on food warning"},
321 
322  {"help", COMM_CAT_MISC, command_help, help_help, NULL},
323 
325 
326  {"magicmap", COMM_CAT_MISC, do_magicmap, help_magicmap,
328 
329  {"savedefaults", COMM_CAT_SETUP, do_savedefaults, NULL,
331 
332  {
334  "Saves the position and sizes of windows." /* Panes? */
335  },
336 
337  {"take", COMM_CAT_MISC, do_take, NULL, NULL},
338 
339  {"unbind", COMM_CAT_SETUP, unbind_key, help_unbind, NULL},
340 
341  {"num_free_items", COMM_CAT_DEBUG, do_num_free_items, NULL,
342  "log the number of free items?"},
343  {"show", COMM_CAT_SETUP, command_show, NULL,
344  "Change what items to show in inventory"},
345 };
346 
347 const size_t num_commands = sizeof(CommonCommands) / sizeof(ConsoleCommand);
348 static int get_num_commands() {
349  return num_commands;
350 }
351 
353 
354 static int sort_by_name(const void * a_, const void * b_) {
355  ConsoleCommand * a = *((ConsoleCommand **)a_);
356  ConsoleCommand * b = *((ConsoleCommand **)b_);
357  return strcmp(a->name, b->name);
358 }
359 
361 
362 /* Sort by category, then by name. */
363 
364 static int sort_by_category(const void *a_, const void *b_) {
365  /* Typecasts, so it goes. */
366  ConsoleCommand * a = *((ConsoleCommand **)a_);
367  ConsoleCommand * b = *((ConsoleCommand **)b_);
368 
369  if (a->cat == b->cat) {
370  return strcmp(a->name, b->name);
371  }
372 
373  return a->cat - b->cat;
374 }
375 
377  /* XXX Leak! */
378  name_sorted_commands = g_malloc(sizeof(ConsoleCommand *) * num_commands);
379 
380  for (size_t i = 0; i < num_commands; i++) {
381  name_sorted_commands[i] = &CommonCommands[i];
382  }
383 
384  /* Sort them. */
385  qsort(name_sorted_commands, num_commands, sizeof(ConsoleCommand *), sort_by_name);
386 
387  /* Copy the list, then sort it by category. */
388  cat_sorted_commands = g_malloc(sizeof(ConsoleCommand *) * num_commands);
389 
390  memcpy(cat_sorted_commands, name_sorted_commands, sizeof(ConsoleCommand *) * num_commands);
391 
392  qsort(cat_sorted_commands, num_commands, sizeof(ConsoleCommand *), sort_by_category);
393 
394  /* TODO Add to the list of tab-completion items. */
395 }
396 
397 const ConsoleCommand * find_command(const char *cmd) {
398  ConsoleCommand ** asp_p = NULL, dummy;
399  ConsoleCommand * dummy_p;
400  ConsoleCommand * asp;
401  char *cp, *cmd_cpy;
402  cmd_cpy = g_strdup(cmd);
403 
404  for (cp=cmd_cpy; *cp; cp++) {
405  *cp =tolower(*cp);
406  }
407 
408  dummy.name = cmd_cpy;
409  dummy_p = &dummy;
410  asp_p = bsearch(
411  (void *)&dummy_p,
412  (void *)name_sorted_commands,
413  num_commands,
414  sizeof(ConsoleCommand *),
415  sort_by_name);
416 
417  if (asp_p == NULL) {
418  free(cmd_cpy);
419  return NULL;
420  }
421 
422  asp = *asp_p;
423 
424  /* TODO The server's find_command() searches first the commands,
425  then the emotes. We might have to do something similar someday, too. */
426  /* if (asp == NULL) search something else? */
427 
428  free(cmd_cpy);
429 
430  return asp;
431 }
432 
438  return cat_sorted_commands;
439 }
440 
450 int handle_local_command(const char* cp, const char *cpnext) {
451  const ConsoleCommand * cc = NULL;
452 
453  cc = find_command(cp);
454 
455  if (cc == NULL) {
456  return FALSE;
457  }
458 
459  if (cc->dofunc == NULL) {
460  char buf[MAX_BUF];
461 
462  snprintf(buf, MAX_BUF - 1, "Client command %s has no implementation!", cc->name);
464 
465  return FALSE;
466  }
467 
468  cc->dofunc(cpnext);
469 
470  return TRUE;
471 }
472 
484 void extended_command(const char *ocommand) {
485  const char *cp = ocommand;
486  char *cpnext, command[MAX_BUF];
487 
488  if ((cpnext = strchr(cp, ' '))!=NULL) {
489  int len = cpnext - ocommand;
490  if (len > (MAX_BUF -1 )) {
491  len = MAX_BUF-1;
492  }
493 
494  strncpy(command, ocommand, len);
495  command[len] = '\0';
496  cp = command;
497  while (*cpnext == ' ') {
498  cpnext++;
499  }
500  if (*cpnext == 0) {
501  cpnext = NULL;
502  }
503  }
504  /*
505  * Try to prevent potential client hang by trying to delete a
506  * character when there is no character to delete.
507  * Thus, only send quit command if there is a player to delete.
508  */
509  if (cpl.title[0] == '\0' && strcmp(cp, "quit") == 0){
510  // Bail here, there isn't anything this should be doing.
511  return;
512  }
513 
514  /* cp now contains the command (everything before first space),
515  * and cpnext contains everything after that first space. cpnext
516  * could be NULL.
517  */
518 #ifdef HAVE_LUA
519  if ( script_lua_command(cp, cpnext) ) {
520  return;
521  }
522 #endif
523 
524  /* If this isn't a client-side command, send it to the server. */
525  if (!handle_local_command(cp, cpnext)) {
526  /* just send the command(s) (if `ocommand' is a compound command */
527  /* then split it and send each part seperately */
528  /* TODO Remove this from the server; end of commands.c. */
529  strncpy(command, ocommand, MAX_BUF-1);
530  command[MAX_BUF-1]=0;
531  cp = strtok(command, ";");
532  while ( cp ) {
533  while( *cp == ' ' ) {
534  cp++;
535  } /* throw out leading spaces; server
536  does not like them */
537  send_command(cp, cpl.count, 0);
538  cp = strtok(NULL, ";");
539  }
540  }
541 }
542 
543 /* ------------------------------------------------------------------ */
544 
545 /* This list is used for the 'tab' completion, and nothing else.
546  * Therefore, if it is out of date, it isn't that terrible, but
547  * ideally it should stay somewhat up to date with regards to
548  * the commands the server supports.
549  */
550 
551 /* TODO Dynamically generate. */
552 
553 static const char *const commands[] = {
554  "accuse", "afk", "apply", "applymode", "archs", "beg", "bleed", "blush",
555  "body", "bounce", "bow", "bowmode", "brace", "build", "burp", "cackle", "cast",
556  "chat", "chuckle", "clap", "cointoss", "cough", "cringe", "cry", "dance",
557  "disarm", "dm", "dmhide", "drop", "dropall", "east", "examine", "explore",
558  "fire", "fire_stop", "fix_me", "flip", "frown", "gasp", "get", "giggle",
559  "glare", "grin", "groan", "growl", "gsay", "help", "hiccup", "hiscore", "hug",
560  "inventory", "invoke", "killpets", "kiss", "laugh", "lick", "listen", "logs",
561  "mapinfo", "maps", "mark", "me", "motd", "nod", "north", "northeast",
562  "northwest", "orcknuckle", "output-count", "output-sync", "party", "peaceful",
563  "petmode", "pickup", "players", "poke", "pout", "prepare", "printlos", "puke",
564  "quests", "quit", "ready_skill", "rename", "reply", "resistances",
565  "rotateshoottype", "run", "run_stop", "save", "say", "scream", "search",
566  "search-items", "shake", "shiver", "shout", "showpets", "shrug", "shutdown",
567  "sigh", "skills", "slap", "smile", "smirk", "snap", "sneeze", "snicker",
568  "sniff", "snore", "sound", "south", "southeast", "southwest", "spit",
569  "statistics", "stay", "strings", "strut", "sulk", "take", "tell", "thank",
570  "think", "throw", "time", "title", "twiddle", "use_skill", "usekeys",
571  "version", "wave", "weather", "west", "whereabouts", "whereami", "whistle",
572  "who", "wimpy", "wink", "yawn",
573 };
574 const size_t num_server_commands = sizeof(commands) / sizeof(char *);
575 
583 const char * complete_command(const char *command) {
584  int len, display = 0;
585  const char *match;
586  static char result[64];
587  char list[500];
588 
589  len = strlen(command);
590 
591  if (len == 0) {
592  return NULL;
593  }
594 
595  strcpy(list, "Matching commands:");
596 
597  /* TODO Partial match, e.g.:
598  If the completion list was:
599  wear
600  wet #?
601 
602  If we type 'w' then hit tab, put in the e.
603 
604  Basically part of bash (readline?)'s behaviour.
605  */
606 
607  match = NULL;
608 
609  /* check server side commands */
610  for (size_t i = 0; i < num_server_commands; i++) {
611  if (!strncmp(command, commands[i], len)) {
612  if (display) {
613  snprintf(list + strlen(list), 499 - strlen(list), " %s", commands[i]);
614  } else if (match != NULL) {
615  display = 1;
616  snprintf(list + strlen(list), 499 - strlen(list), " %s %s", match, commands[i]);
617  match = NULL;
618  } else {
619  match = commands[i];
620  }
621  }
622  }
623 
624  /* check client side commands */
625  for (size_t i = 0; i < num_commands; i++) {
626  if (!strncmp(command, CommonCommands[i].name, len)) {
627  if (display) {
628  snprintf(list + strlen(list), 499 - strlen(list), " %s", CommonCommands[i].name);
629  } else if (match != NULL) {
630  display = 1;
631  snprintf(list + strlen(list), 499 - strlen(list), " %s %s", match, CommonCommands[i].name);
632  match = NULL;
633  } else {
634  match = CommonCommands[i].name;
635  }
636  }
637  }
638 
639  if (match == NULL) {
640  if (display) {
641  strncat(list, "\n", 499 - strlen(list));
644  } else
646  "No matching command.\n");
647  /* No match. */
648  return NULL;
649  }
650 
651  /*
652  * Append a space to allow typing arguments. For commands without arguments
653  * the excess space should be stripped off automatically.
654  */
655  snprintf(result, sizeof(result), "%s ", match);
656  return result;
657 }
#define HELP_BIND_SHORT
Definition: chelp.h:6
int num_free_items(void)
Definition: item.c:458
void script_lua_list(const char *param)
#define COMMAND_WINDOW
Do not send more than this many outstanding commands to the server this is only a default value...
Definition: client.h:74
int script_lua_command(const char *command, const char *param)
int handle_local_command(const char *cp, const char *cpnext)
Tries to handle command cp (with optional params in cpnext, which may be null) as a local command...
Definition: p_cmd.c:450
static const char * help_unbind(void)
Definition: p_cmd.c:227
void command_take(const char *command, const char *cpnext)
Definition: player.c:227
gint16 use_config[CONFIG_NUMS]
Definition: init.c:40
static int get_num_commands(void)
Definition: p_cmd.c:348
static void do_clienthelp_list()
Definition: p_cmd.c:39
#define H1(a)
Definition: p_cmd.c:31
void script_lua_kill(const char *param)
#define HELP_MAGICMAP_SHORT
Definition: chelp.h:54
const size_t num_server_commands
Definition: p_cmd.c:574
#define H2(a)
Definition: p_cmd.c:32
#define HELP_BIND_LONG
Definition: chelp.h:7
CommFunc dofunc
Definition: p_cmd.h:59
#define HELP_MAGICMAP_LONG
Definition: chelp.h:55
item * ob
Player object.
Definition: client.h:335
static void cmd_raw(const char *cmd)
Definition: p_cmd.c:289
const char * get_category_name(CommCat cat)
Definition: p_cmd.c:160
static const char *const commands[]
Definition: p_cmd.c:553
ClientSocket csocket
Definition: client.c:70
CommCat cat
Definition: p_cmd.h:58
#define CONFIG_FOODBEEP
Definition: client.h:204
#define MSG_TYPE_CLIENT
Client originated Messages.
Definition: newclient.h:420
static void set_command_window(const char *cpnext)
Definition: p_cmd.c:133
static const char * help_savewinpos(void)
Definition: p_cmd.c:270
Contains external calls that the common area makes callbacks to.
#define NDI_BLACK
Definition: newclient.h:249
CommCat
Definition: p_cmd.h:44
#define HELP_UNBIND_LONG
Definition: chelp.h:45
void LOG(LogLevel level, const char *origin, const char *format,...)
Log messages of a certain importance to stderr.
Definition: misc.c:112
void client_disconnect()
Closes the connection to the server.
Definition: client.c:187
void script_init(const char *cparams)
Definition: script.c:205
#define NDI_RED
Definition: newclient.h:252
const char * desc
Definition: p_cmd.h:62
static const char * help_scripttell(void)
Definition: p_cmd.c:259
static void do_script_list()
Definition: p_cmd.c:194
void init_commands()
Fills some internal arrays.
Definition: p_cmd.c:376
static const char * help_help(void)
Definition: p_cmd.c:113
Includes and prototypes for p_cmd.c for player-commands like &#39;/magicmap&#39;.
#define MSG_TYPE_CLIENT_NOTICE
Non-critical note to player.
Definition: newclient.h:689
int cs_print_string(int fd, const char *str,...)
Send a printf-formatted packet to the socket.
Definition: newsocket.c:311
static void command_foodbeep()
Definition: p_cmd.c:147
int send_command(const char *command, int repeat, int must_send)
Definition: player.c:154
void save_winpos(void)
Save client window positions to a file unique to each layout.
Definition: config.c:771
#define HELP_SAVEDEFAULTS_SHORT
Definition: chelp.h:59
const char * name
Definition: p_cmd.h:57
Client_Player cpl
Player object.
Definition: client.c:69
static void do_num_free_items()
Definition: p_cmd.c:215
#define CONFIG_CWINDOW
Definition: client.h:187
static const char * help_scriptkill(void)
Definition: p_cmd.c:279
#define MAX_BUF
Definition: client.h:38
static const char * help_magicmap(void)
Definition: p_cmd.c:231
const size_t num_commands
Definition: p_cmd.c:347
void extended_command(const char *ocommand)
This is an extended command (ie, &#39;who, &#39;whatever, etc).
Definition: p_cmd.c:484
static void do_clearinfo()
Definition: p_cmd.c:196
gint16 want_config[CONFIG_NUMS]
Definition: init.c:40
static void do_take(const char *used)
Definition: p_cmd.c:211
static void command_help(const char *cpnext)
Definition: p_cmd.c:89
CommHelpFunc helpfunc
Definition: p_cmd.h:61
const char * complete_command(const char *command)
Player has entered &#39;command&#39; and hit tab to complete it.
Definition: p_cmd.c:583
guint32 count
Repeat count on command.
Definition: client.h:358
static void do_inv()
Definition: p_cmd.c:201
#define HELP_INV_SHORT
Definition: chelp.h:66
static void do_disconnect()
Definition: p_cmd.c:198
void script_list(void)
Definition: script.c:494
static int sort_by_category(const void *a_, const void *b_)
Definition: p_cmd.c:364
#define HELP_INV_LONG
Definition: chelp.h:67
void save_defaults(void)
This function saves user settings chosen using the configuration popup dialog.
Definition: config.c:437
void bind_key(const char *params)
static ConsoleCommand ** name_sorted_commands
Definition: p_cmd.c:352
static void do_savedefaults()
Definition: p_cmd.c:207
static void do_magicmap()
Definition: p_cmd.c:203
static ConsoleCommand CommonCommands[]
Definition: p_cmd.c:293
void print_inventory(item *op)
Definition: item.c:678
const ConsoleCommand * find_command(const char *cmd)
Definition: p_cmd.c:397
#define LINE(a)
Definition: p_cmd.c:33
void script_tell(const char *params)
Definition: script.c:947
static const char * help_bind(void)
Definition: p_cmd.c:223
void menu_clear(void)
Clears all the message panels.
Definition: info.c:1311
void script_kill(const char *params)
Definition: script.c:516
void draw_ext_info(int orig_color, int type, int subtype, const char *message)
A message processor that accepts messages along with meta information color and type.
Definition: info.c:931
static void do_savewinpos()
Definition: p_cmd.c:209
void command_show(const char *params)
Definition: inventory.c:589
static void show_help(const ConsoleCommand *cc)
Definition: p_cmd.c:66
void script_lua_load(const char *name)
void draw_magic_map(void)
Definition: magicmap.c:24
char title[MAX_BUF]
Title of character.
Definition: client.h:350
Includes various dependencies header files needed by most everything.
char * name
Definition: image.c:39
static int sort_by_name(const void *a_, const void *b_)
Definition: p_cmd.c:354
static const char * help_script(void)
Definition: p_cmd.c:252
void unbind_key(const char *params)
Definition: keys.c:1452
static ConsoleCommand ** cat_sorted_commands
Definition: p_cmd.c:360
static const char * help_inv(void)
Definition: p_cmd.c:235
Minor, non-harmful issues.
Definition: client.h:441
static const char * help_cwindow(void)
Definition: p_cmd.c:239
ConsoleCommand ** get_cat_sorted_commands(void)
Returns a pointer to the head of an array of ConsoleCommands sorted by category, then by name...
Definition: p_cmd.c:437