Crossfire Server, Trunk
commands.cpp
Go to the documentation of this file.
1 /*
2  * Crossfire -- cooperative multi-player graphical RPG and adventure game
3  *
4  * Copyright (c) 1999-2022 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 "global.h"
20 
21 #include <ctype.h>
22 #include <stdlib.h>
23 #include <string.h>
24 
25 #include "commands.h"
26 #include "sproto.h"
27 #include "assert.h"
28 
29 #include <map>
30 #include <vector>
31 #include <string>
32 #include <algorithm>
33 
39  char *extra;
40  float time;
41  uint8_t type;
42 };
43 
47 static std::map<std::string, std::vector<registered_command *> > registered_commands;
48 
61 static command_registration do_register(const char *name, uint8_t type, command_function func_std, command_function_extra func_extra, const char *extra, float time) {
62  if (type > COMMAND_TYPE_WIZARD) {
64  }
65  auto existing = registered_commands.find(name);
66  if (existing != registered_commands.end()) {
67  assert(!existing->second.empty());
68  if (existing->second.back()->type != type) {
69  return 0;
70  }
71  }
72 
76  add->type = type;
77  add->func_std = func_std;
78  add->func_extra = func_extra;
79  add->extra = extra ? strdup(extra) : nullptr;
80  add->time = time;
81  registered_commands[name].push_back(add);
82  return add->registration;
83 }
84 
85 static void command_partial_commands(object *op, const char *params) {
86  if (strcmp(params, "1") == 0 || strcmp(params, "on") == 0) {
87  op->contr->partial_commands = 1;
88  }
89  if (strcmp(params, "0") == 0 || strcmp(params, "off") == 0) {
90  op->contr->partial_commands = 0;
91  }
92  draw_ext_info_format(NDI_UNIQUE, 0, op, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_INFO, "Partial commands %s.", op->contr->partial_commands ? "enabled" : "disabled");
93 }
94 
104 command_registration command_register(const char *name, uint8_t type, command_function func, float time) {
105  return do_register(name, type, func, nullptr, nullptr, time);
106 }
107 
111 void commands_init(void) {
112 #define RN(name, func, time) command_register(name, COMMAND_TYPE_NORMAL, func, time)
113 #define RC(name, func, time) command_register(name, COMMAND_TYPE_COMMUNICATION, func, time)
114 #define RW(name, func, time) command_register(name, COMMAND_TYPE_WIZARD, func, time)
115 
116  /* Normal game commands. */
117  RN("afk", command_afk, 0.0);
118  RN("apply", command_apply, 1.0); /* should be variable */
119  RN("applymode", command_applymode, 1.0); /* should be variable */
120  RN("body", command_body, 0.0);
121  RN("bowmode", command_bowmode, 0.0);
122  RN("brace", command_brace, 0.0);
123  RN("cast", command_cast, 0.2); /* Is this right? */
124  RN("delete", command_delete, 0.0);
125  RN("disarm", command_disarm, 1.0);
126  RN("dm", command_dm, 0.0);
127  RN("dmhide", command_dmhide, 0.0); /* Like dm, but don't tell a dm arrived, hide player */
128  RN("drop", command_drop, 1.0);
129  RN("dropall", command_dropall, 1.0);
130  RN("empty", command_empty, 1.0);
131  RN("examine", command_examine, 0.5);
132  RN("fix_me", command_fix_me, 0.0);
133  RN("follow", command_follow, 0.0);
134  RN("forget_spell", command_forget_spell, 0.0);
135  RN("get", command_take, 1.0);
136  RN("help", command_help, 0.0);
137  RN("hiscore", command_hiscore, 0.0);
138  RN("inventory", command_inventory, 0.0);
139  RN("invoke", command_invoke, 1.0);
140  RN("killpets", command_kill_pets, 0.0);
141  RN("language", command_language, 0.0);
142  RN("listen", command_listen, 0.0);
143  RN("lock", command_lock_item, 0.0);
144  RN("maps", command_maps, 0.0);
145  RN("mapinfo", command_mapinfo, 0.0);
146  RN("mark", command_mark, 0.0);
147  RN("motd", command_motd, 0.0);
148  RN("news", command_news, 0.0);
149  RN("partial_commands", command_partial_commands, 0.0);
150  RN("party", command_party, 0.0);
151  RN("party_rejoin", command_party_rejoin, 0.0);
152  RN("passwd", command_passwd, 0.0);
153  RN("peaceful", command_peaceful, 0.0);
154  RN("petmode", command_petmode, 0.0);
155  RN("pickup", command_pickup, 1.0);
156  RN("prepare", command_cast, 1.0);
157  RN("printlos", command_printlos, 0.0);
158  RN("quit", command_quit, 0.0);
159  RN("ready_skill", command_rskill, 1.0);
160  RN("rename", command_rename_item, 0.0);
161  RN("resistances", command_resistances, 0.0);
162  RN("rotateshoottype", command_rotateshoottype, 0.0);
163  RN("rules", command_rules, 0.0);
164  RN("save", command_save, 0.0);
165  RN("skills", command_skills, 0.0); /* shows player list of skills */
166  RN("use_skill", command_uskill, 1.0);
167  RN("search", command_search, 1.0);
168  RN("search-items", command_search_items, 0.0);
169  RN("showpets", command_showpets, 1.0);
170  RN("sound", command_sound, 0.0);
171  RN("statistics", command_statistics, 0.0);
172  RN("take", command_take, 1.0);
173  RN("throw", command_throw, 1.0);
174  RN("time", command_time, 0.0);
175  RN("title", command_title, 0.0);
176  RN("use", command_use, 1.0);
177  RN("usekeys", command_usekeys, 0.0);
178  RN("whereabouts", command_whereabouts, 0.0);
179  RN("whereami", command_whereami, 0.0);
180  RN("unarmed_skill", command_unarmed_skill, 0.0);
181 #ifdef DEBUG_MALLOC_LEVEL
182  RN("verify", command_malloc_verify, 0.0);
183 #endif
184  RN("version", command_version, 0.0);
185  RN("wimpy", command_wimpy, 0.0);
186  RN("who", command_who, 0.0);
187  /*
188  * directional commands
189  */
190  RN("stay", command_stay, 1.0); /* 1.0 because it is used when using a
191  * skill on yourself */
192  RN("north", command_north, 1.0);
193  RN("east", command_east, 1.0);
194  RN("south", command_south, 1.0);
195  RN("west", command_west, 1.0);
196  RN("northeast", command_northeast, 1.0);
197  RN("southeast", command_southeast, 1.0);
198  RN("southwest", command_southwest, 1.0);
199  RN("northwest", command_northwest, 1.0);
200  RN("run", command_run, 1.0);
201  RN("run_stop", command_run_stop, 0.0);
202  RN("fire", command_fire, 1.0);
203  RN("fire_stop", command_fire_stop, 0.0);
204  RN("face", command_face, 0.0);
205  RN("quest", command_quest, 0.0);
206  RN("knowledge", command_knowledge, 0.0);
207 
208  /* Chat/shout related commands. */
209  RC("tell", command_tell, 0.1);
210  RC("reply", command_reply, 0.0);
211  RC("say", command_say, 0.1);
212  RC("gsay", command_gsay, 1.0);
213  RC("shout", command_shout, 0.1);
214  RC("chat", command_chat, 0.1);
215  RC("me", command_me, 0.1);
216  RC("cointoss", command_cointoss, 0.0);
217  RC("orcknuckle", command_orcknuckle, 0.0);
218  /*
219  * begin emotions
220  */
221  RC("nod", command_nod, 0.0);
222  RC("dance", command_dance, 0.0);
223  RC("kiss", command_kiss, 0.0);
224  RC("bounce", command_bounce, 0.0);
225  RC("smile", command_smile, 0.0);
226  RC("cackle", command_cackle, 0.0);
227  RC("laugh", command_laugh, 0.0);
228  RC("giggle", command_giggle, 0.0);
229  RC("shake", command_shake, 0.0);
230  RC("puke", command_puke, 0.0);
231  RC("growl", command_growl, 0.0);
232  RC("scream", command_scream, 0.0);
233  RC("sigh", command_sigh, 0.0);
234  RC("sulk", command_sulk, 0.0);
235  RC("hug", command_hug, 0.0);
236  RC("cry", command_cry, 0.0);
237  RC("poke", command_poke, 0.0);
238  RC("accuse", command_accuse, 0.0);
239  RC("grin", command_grin, 0.0);
240  RC("bow", command_bow, 0.0);
241  RC("clap", command_clap, 0.0);
242  RC("blush", command_blush, 0.0);
243  RC("burp", command_burp, 0.0);
244  RC("chuckle", command_chuckle, 0.0);
245  RC("cough", command_cough, 0.0);
246  RC("flip", command_flip, 0.0);
247  RC("frown", command_frown, 0.0);
248  RC("gasp", command_gasp, 0.0);
249  RC("glare", command_glare, 0.0);
250  RC("groan", command_groan, 0.0);
251  RC("hiccup", command_hiccup, 0.0);
252  RC("lick", command_lick, 0.0);
253  RC("pout", command_pout, 0.0);
254  RC("shiver", command_shiver, 0.0);
255  RC("shrug", command_shrug, 0.0);
256  RC("slap", command_slap, 0.0);
257  RC("smirk", command_smirk, 0.0);
258  RC("snap", command_snap, 0.0);
259  RC("sneeze", command_sneeze, 0.0);
260  RC("snicker", command_snicker, 0.0);
261  RC("sniff", command_sniff, 0.0);
262  RC("snore", command_snore, 0.0);
263  RC("spit", command_spit, 0.0);
264  RC("strut", command_strut, 0.0);
265  RC("thank", command_thank, 0.0);
266  RC("twiddle", command_twiddle, 0.0);
267  RC("wave", command_wave, 0.0);
268  RC("whistle", command_whistle, 0.0);
269  RC("wink", command_wink, 0.0);
270  RC("yawn", command_yawn, 0.0);
271  RC("beg", command_beg, 0.0);
272  RC("bleed", command_bleed, 0.0);
273  RC("cringe", command_cringe, 0.0);
274  RC("think", command_think, 0.0);
275 
277  RW("abil", command_abil, 0.0);
278  RW("accountpasswd", command_accountpasswd, 0.0);
279  RW("addexp", command_addexp, 0.0);
280  RW("arrest", command_arrest, 0.0);
281  RW("banish", command_banish, 0.0);
282  RW("create", command_create, 0.0);
283  RW("debug", command_debug, 0.0);
284  RW("diff", command_diff, 0.0);
285  RW("dmtell", command_dmtell, 0.0);
286  RW("dump", command_dump, 0.0);
287  RW("dumpabove", command_dumpabove, 0.0);
288  RW("dumpbelow", command_dumpbelow, 0.0);
289  RW("dumpfriendlyobjects", command_dumpfriendlyobjects, 0.0);
290  RW("dumpallarchetypes", command_dumpallarchetypes, 0.0);
291  RW("dumpallmaps", command_dumpallmaps, 0.0);
292  RW("dumpallobjects", command_dumpallobjects, 0.0);
293  RW("dumpmap", command_dumpmap, 0.0);
294  RW("free", command_free, 0.0);
295  RW("freeze", command_freeze, 0.0);
296  RW("goto", command_goto, 0.0);
297  RW("hide", command_hide, 0.0);
298  RW("insert_into", command_insert_into, 0.0);
299  RW("invisible", command_invisible, 0.0);
300  RW("kick", command_kick, 0.0);
301  RW("learn_special_prayer", command_learn_special_prayer, 0.0);
302  RW("learn_spell", command_learn_spell, 0.0);
303  RW("malloc", command_malloc, 0.0);
304  RW("nodm", command_nowiz, 0.0);
305  RW("nowiz", command_nowiz, 0.0);
306  RW("patch", command_patch, 0.0);
307  RW("players", command_players, 0.0);
308  RW("plugin", command_loadplugin, 0.0);
309  RW("pluglist", command_listplugins, 0.0);
310  RW("plugout", command_unloadplugin, 0.0);
311  RW("purge_quest_state", command_purge_quest, 0.0);
312  RW("purge_quests", command_purge_quest_definitions, 0.0);
313  RW("recollect", command_recollect, 0.0);
314  RW("remove", command_remove, 0.0);
315  RW("reset", command_reset, 0.0);
316  RW("set_god", command_setgod, 0.0);
317  RW("settings", command_settings, 0.0);
318  RW("server_speed", command_speed, 0.0);
319  RW("shutdown", command_shutdown, 0.0);
320  RW("ssdumptable", command_ssdumptable, 0.0);
321  RW("stack_clear", command_stack_clear, 0.0);
322  RW("stack_list", command_stack_list, 0.0);
323  RW("stack_pop", command_stack_pop, 0.0);
324  RW("stack_push", command_stack_push, 0.0);
325  RW("stats", command_stats, 0.0);
326  RW("strings", command_strings, 0.0);
327  RW("style_info", command_style_map_info, 0.0); /* Costly command, so make it wiz only */
328  RW("summon", command_summon, 0.0);
329  RW("teleport", command_teleport, 0.0);
330  RW("toggle_shout", command_toggle_shout, 0.0);
331  RW("wizpass", command_wizpass, 0.0);
332  RW("wizcast", command_wizcast, 0.0);
333  RW("overlay_save", command_overlay_save, 0.0);
334  RW("overlay_reset", command_overlay_reset, 0.0);
335  /* RW("possess", command_possess, 0.0); */
336  RW("mon_aggr", command_mon_aggr, 0.0);
337  RW("loadtest", command_loadtest, 0.0);
338 
339 #undef RN
340 #undef RC
341 #undef RW
342 }
343 
348  for (auto cmd = registered_commands.begin(); cmd != registered_commands.end(); cmd++) {
349  for (auto h = cmd->second.begin(); h != cmd->second.end(); h++) {
350  free((*h)->extra);
351  delete *h;
352  }
353  cmd->second.clear();
354  }
355  registered_commands.clear();
356 
357  next_registration = 1;
358 }
359 
370 static void show_commands(object *op, uint8_t type, const char *legend) {
371  char line[HUGE_BUF];
372 
374 
375  line[0] = '\0';
376  std::for_each(registered_commands.begin(), registered_commands.end(), [&type, &line] (auto cmd) {
377  if (cmd.second.back()->type == type) {
378  strcat(line, cmd.first.c_str());
379  strcat(line, " ");
380  }
381  });
383 }
384 
391 void command_list(object *pl, bool is_dm) {
392  show_commands(pl, COMMAND_TYPE_NORMAL, " Commands:");
394  show_commands(pl, COMMAND_TYPE_COMMUNICATION, " Communication commands:");
395  if (is_dm) {
397  show_commands(pl, COMMAND_TYPE_WIZARD, " Wiz commands:");
398  }
399 }
400 
408 static registered_command *command_find(const char *name, object *pl) {
409  auto existing = registered_commands.find(name);
410  if (existing != registered_commands.end()) {
411  if (!QUERY_FLAG(pl, FLAG_WIZ) && existing->second.back()->type == COMMAND_TYPE_WIZARD) {
413  "'%s' is not a valid command.", name);
414  return nullptr;
415  }
416  return existing->second.back();
417  }
418 
419  if (pl->contr->partial_commands) {
420  size_t len = strlen(name);
421  registered_command *candidate = nullptr;
422  std::string matches;
423  bool multiple = false;
424  for (auto command : registered_commands) {
425  if ((command.second.back()->type != COMMAND_TYPE_WIZARD || QUERY_FLAG(pl, FLAG_WIZ)) && command.first.length() >= len && command.first.compare(0, len, name) == 0) {
426  if (candidate) {
427  matches += ", " + command.first;
428  multiple = true;
429  } else {
430  candidate = command.second.back();
431  matches = command.first;
432  }
433  }
434  }
435  if (multiple) {
437  "'%s' is ambiguous and may be %s.", name, matches.c_str());
438  return nullptr;
439  }
440  if (candidate) {
441  return candidate;
442  }
443  }
445  "'%s' is not a valid command.", name);
446  return nullptr;
447 }
448 
457 void command_execute(object *pl, char *command) {
458  registered_command *csp;
459  char *cp, *low;
460 
461  pl->contr->has_hit = 0;
462 
463  /*
464  * remove trailing spaces from commant
465  */
466  cp = command+strlen(command)-1;
467  while ((cp >= command) && (*cp == ' ')) {
468  *cp = '\0';
469  cp--;
470  }
471  cp = strchr(command, ' ');
472  if (cp) {
473  *(cp++) = '\0';
474  while (*cp == ' ')
475  cp++;
476  } else {
477  cp = strchr(command, '\0');
478  }
479 
480  if (strlen(command) == 0) {
481  return;
482  }
483 
484  for (low = command; *low; low++)
485  *low = tolower(*low);
486 
487  csp = command_find(command, pl);
488 
489  if (csp == nullptr) {
490  return;
491  }
492 
493  pl->speed_left -= csp->time;
494 
495  /* A character time can never exceed his speed (which in many cases,
496  * if wearing armor, is less than one.) Thus, in most cases, if
497  * the command takes 1.0, the player's speed will be less than zero.
498  * it is only really an issue if time goes below -1
499  * Due to various reasons that are too long to go into here, we will
500  * actually still execute player even if his time is less than 0,
501  * but greater than -1. This is to improve the performance of the
502  * new client/server. In theory, it shouldn't make much difference.
503  */
504 
505  if (csp->time && pl->speed_left < -2.0) {
506  LOG(llevDebug, "execute_newclient_command: Player issued command that takes more time than he has left.\n");
507  }
508  if (csp->extra) {
509  csp->func_extra(pl, cp, csp->extra);
510  } else {
511  csp->func_std(pl, cp);
512  }
513 }
514 
527 command_registration command_register_extra(const char *name, const char *extra, uint8_t type, command_function_extra func, float time) {
528  assert(extra);
529  return do_register(name, type, nullptr, func, extra, time);
530 }
531 
537  for (auto cmd = registered_commands.begin(); cmd != registered_commands.end(); cmd++) {
538  for (auto h = cmd->second.begin(); h != cmd->second.end(); h++) {
539  if ((*h)->registration == command) {
540  free((*h)->extra);
541  delete (*h);
542  cmd->second.erase(h);
543  if (cmd->second.empty()) {
544  registered_commands.erase(cmd);
545  }
546  return;
547  }
548  }
549  }
550 }
registered_command::registration
command_registration registration
Definition: commands.cpp:36
command_stack_pop
void command_stack_pop(object *op, const char *params)
Definition: c_wiz.cpp:2497
command_style_map_info
void command_style_map_info(object *op, const char *params)
Definition: c_wiz.cpp:2726
command_dance
void command_dance(object *op, const char *params)
Definition: c_chat.cpp:733
global.h
command_shutdown
void command_shutdown(object *op, const char *params)
Definition: c_wiz.cpp:657
command_cackle
void command_cackle(object *op, const char *params)
Definition: c_chat.cpp:777
command_stack_push
void command_stack_push(object *op, const char *params)
Definition: c_wiz.cpp:2510
command_northeast
void command_northeast(object *op, const char *params)
Definition: c_move.cpp:79
command_sound
void command_sound(object *op, const char *params)
Definition: c_misc.cpp:1911
command_bleed
void command_bleed(object *op, const char *params)
Definition: c_chat.cpp:1283
command_glare
void command_glare(object *op, const char *params)
Definition: c_chat.cpp:1030
command_delete
void command_delete(object *op, const char *params)
Definition: c_misc.cpp:1890
command_dumpallmaps
void command_dumpallmaps(object *op, const char *params)
Definition: c_misc.cpp:1048
command_players
void command_players(object *op, const char *params)
Definition: c_misc.cpp:1228
command_nowiz
void command_nowiz(object *op, const char *params)
Definition: c_wiz.cpp:2042
command_snore
void command_snore(object *op, const char *params)
Definition: c_chat.cpp:1173
command_remove
void command_remove(object *op, const char *params)
Definition: c_wiz.cpp:1541
command_dumpfriendlyobjects
void command_dumpfriendlyobjects(object *op, const char *params)
Definition: c_misc.cpp:992
command_wizcast
void command_wizcast(object *op, const char *params)
Definition: c_misc.cpp:948
command_growl
void command_growl(object *op, const char *params)
Definition: c_chat.cpp:832
command_search_items
void command_search_items(object *op, const char *params)
Definition: c_object.cpp:2331
command_say
void command_say(object *op, const char *params)
Definition: c_chat.cpp:34
LOG
void LOG(LogLevel logLevel, const char *format,...)
Definition: logger.cpp:51
command_sulk
void command_sulk(object *op, const char *params)
Definition: c_chat.cpp:865
command_whistle
void command_whistle(object *op, const char *params)
Definition: c_chat.cpp:1239
command_cringe
void command_cringe(object *op, const char *params)
Definition: c_chat.cpp:1294
command_unarmed_skill
void command_unarmed_skill(object *op, const char *params)
Definition: c_misc.cpp:1382
command_clap
void command_clap(object *op, const char *params)
Definition: c_chat.cpp:942
command_cough
void command_cough(object *op, const char *params)
Definition: c_chat.cpp:986
next_registration
static command_registration next_registration
Definition: commands.cpp:45
command_spit
void command_spit(object *op, const char *params)
Definition: c_chat.cpp:1184
command_poke
void command_poke(object *op, const char *params)
Definition: c_chat.cpp:898
QUERY_FLAG
#define QUERY_FLAG(xyz, p)
Definition: define.h:226
command_shrug
void command_shrug(object *op, const char *params)
Definition: c_chat.cpp:1096
command_time
void command_time(object *op, const char *params)
Definition: c_misc.cpp:869
command_groan
void command_groan(object *op, const char *params)
Definition: c_chat.cpp:1041
command_wave
void command_wave(object *op, const char *params)
Definition: c_chat.cpp:1228
command_beg
void command_beg(object *op, const char *params)
Definition: c_chat.cpp:1272
command_hiccup
void command_hiccup(object *op, const char *params)
Definition: c_chat.cpp:1052
command_me
void command_me(object *op, const char *params)
Definition: c_chat.cpp:47
command_south
void command_south(object *op, const char *params)
Definition: c_move.cpp:101
command_kiss
void command_kiss(object *op, const char *params)
Definition: c_chat.cpp:744
command_shout
void command_shout(object *op, const char *params)
Definition: c_chat.cpp:210
command_thank
void command_thank(object *op, const char *params)
Definition: c_chat.cpp:1206
command_disarm
void command_disarm(object *op, const char *params)
Definition: c_object.cpp:224
command_snap
void command_snap(object *op, const char *params)
Definition: c_chat.cpp:1129
command_party
void command_party(object *op, const char *params)
Definition: c_party.cpp:97
command_wink
void command_wink(object *op, const char *params)
Definition: c_chat.cpp:1250
do_register
static command_registration do_register(const char *name, uint8_t type, command_function func_std, command_function_extra func_extra, const char *extra, float time)
Definition: commands.cpp:61
pl
Definition: player.h:105
command_recollect
void command_recollect(object *op, const char *params)
Definition: c_wiz.cpp:1512
command_run_stop
void command_run_stop(object *op, const char *params)
Definition: c_new.cpp:64
show_commands
static void show_commands(object *op, uint8_t type, const char *legend)
Definition: commands.cpp:370
command_printlos
void command_printlos(object *op, const char *params)
Definition: c_misc.cpp:1062
command_usekeys
void command_usekeys(object *op, const char *params)
Definition: c_misc.cpp:1557
command_party_rejoin
void command_party_rejoin(object *op, const char *params)
Definition: c_party.cpp:307
command_partial_commands
static void command_partial_commands(object *op, const char *params)
Definition: commands.cpp:85
command_lock_item
void command_lock_item(object *op, const char *params)
Definition: c_object.cpp:2562
draw_ext_info_format
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...) PRINTF_ARGS(6
COMMAND_TYPE_COMMUNICATION
#define COMMAND_TYPE_COMMUNICATION
Definition: commands.h:37
command_hiscore
void command_hiscore(object *op, const char *params)
Definition: c_misc.cpp:882
command_invoke
void command_invoke(object *op, const char *params)
Definition: c_range.cpp:38
command_twiddle
void command_twiddle(object *op, const char *params)
Definition: c_chat.cpp:1217
command_statistics
void command_statistics(object *pl, const char *params)
Definition: c_misc.cpp:1122
command_northwest
void command_northwest(object *op, const char *params)
Definition: c_move.cpp:90
command_diff
void command_diff(object *op, const char *params)
Definition: c_wiz.cpp:2585
command_who
void command_who(object *op, const char *params)
Definition: c_misc.cpp:624
command_overlay_reset
void command_overlay_reset(object *op, const char *params)
Definition: c_wiz.cpp:588
command_throw
void command_throw(object *op, const char *params)
Definition: c_object.cpp:239
tolower
#define tolower(C)
Definition: c_new.cpp:30
registered_commands
static std::map< std::string, std::vector< registered_command * > > registered_commands
Definition: commands.cpp:47
command_puke
void command_puke(object *op, const char *params)
Definition: c_chat.cpp:821
pl::partial_commands
uint32_t partial_commands
Definition: player.h:150
COMMAND_TYPE_NORMAL
#define COMMAND_TYPE_NORMAL
Definition: commands.h:35
command_debug
void command_debug(object *op, const char *params)
Definition: c_misc.cpp:894
command_execute
void command_execute(object *pl, char *command)
Definition: commands.cpp:457
command_whereami
void command_whereami(object *op, const char *params)
Definition: c_misc.cpp:823
MSG_TYPE_COMMAND_ERROR
#define MSG_TYPE_COMMAND_ERROR
Definition: newclient.h:529
command_overlay_save
void command_overlay_save(object *op, const char *params)
Definition: c_wiz.cpp:567
command_arrest
void command_arrest(object *op, const char *params)
Definition: c_wiz.cpp:820
command_hug
void command_hug(object *op, const char *params)
Definition: c_chat.cpp:876
command_face
void command_face(object *op, const char *params)
Definition: c_new.cpp:111
command_rename_item
void command_rename_item(object *op, const char *params)
Definition: c_object.cpp:2376
command_petmode
void command_petmode(object *op, const char *params)
Definition: c_misc.cpp:1438
command_rules
void command_rules(object *op, const char *params)
Definition: c_misc.cpp:230
HUGE_BUF
#define HUGE_BUF
Definition: define.h:37
command_grin
void command_grin(object *op, const char *params)
Definition: c_chat.cpp:920
MSG_TYPE_COMMAND
#define MSG_TYPE_COMMAND
Definition: newclient.h:404
command_stack_clear
void command_stack_clear(object *op, const char *params)
Definition: c_wiz.cpp:2559
command_nod
void command_nod(object *op, const char *params)
Definition: c_chat.cpp:722
command_west
void command_west(object *op, const char *params)
Definition: c_move.cpp:134
command_quit
void command_quit(object *op, const char *params)
Definition: c_misc.cpp:1874
command_rskill
void command_rskill(object *pl, const char *params)
Definition: c_object.cpp:161
command_unregister
void command_unregister(command_registration command)
Definition: commands.cpp:536
command_malloc
void command_malloc(object *op, const char *params)
Definition: c_misc.cpp:797
command_banish
void command_banish(object *op, const char *params)
Definition: c_wiz.cpp:501
command_inventory
void command_inventory(object *op, const char *params)
Definition: c_wiz.cpp:1316
command_kill_pets
void command_kill_pets(object *op, const char *params)
Definition: c_misc.cpp:2197
is_valid_types_gen.line
line
Definition: is_valid_types_gen.py:34
command_accountpasswd
void command_accountpasswd(object *op, const char *params)
Definition: c_wiz.cpp:1614
command_forget_spell
void command_forget_spell(object *op, const char *params)
Definition: c_wiz.cpp:2378
command_mark
void command_mark(object *op, const char *params)
Definition: c_object.cpp:1567
command_teleport
void command_teleport(object *op, const char *params)
Definition: c_wiz.cpp:912
command_uskill
void command_uskill(object *pl, const char *params)
Definition: c_object.cpp:144
command_dump
void command_dump(object *op, const char *params)
Definition: c_wiz.cpp:1358
command_take
void command_take(object *op, const char *params)
Definition: c_object.cpp:845
command_north
void command_north(object *op, const char *params)
Definition: c_move.cpp:68
command_save
void command_save(object *op, const char *params)
Definition: c_misc.cpp:2099
commands_clear
void commands_clear()
Definition: commands.cpp:347
command_mon_aggr
void command_mon_aggr(object *op, const char *params)
Definition: c_wiz.cpp:1386
command_dropall
void command_dropall(object *op, const char *params)
Definition: c_object.cpp:1230
command_ssdumptable
void command_ssdumptable(object *op, const char *params)
Definition: c_misc.cpp:1020
MSG_TYPE_COMMAND_INFO
#define MSG_TYPE_COMMAND_INFO
Definition: newclient.h:526
command_listen
void command_listen(object *op, const char *params)
Definition: c_misc.cpp:1091
command_loadplugin
void command_loadplugin(object *op, const char *params)
Definition: c_wiz.cpp:2421
command_scream
void command_scream(object *op, const char *params)
Definition: c_chat.cpp:843
command_follow
void command_follow(object *op, const char *params)
Definition: c_wiz.cpp:2772
command_strut
void command_strut(object *op, const char *params)
Definition: c_chat.cpp:1195
command_chuckle
void command_chuckle(object *op, const char *params)
Definition: c_chat.cpp:975
command_unloadplugin
void command_unloadplugin(object *op, const char *params)
Definition: c_wiz.cpp:2453
command_think
void command_think(object *op, const char *params)
Definition: c_chat.cpp:1305
command_help
void command_help(object *op, const char *params)
Definition: c_misc.cpp:1773
command_examine
void command_examine(object *op, const char *params)
Definition: c_object.cpp:1489
registered_command::time
float time
Definition: commands.cpp:40
command_free
void command_free(object *op, const char *params)
Definition: c_wiz.cpp:1588
RN
#define RN(name, func, time)
command_cry
void command_cry(object *op, const char *params)
Definition: c_chat.cpp:887
RW
#define RW(name, func, time)
pl::has_hit
uint32_t has_hit
Definition: player.h:144
command_kick
void command_kick(object *op, const char *params)
Definition: c_wiz.cpp:555
command_pout
void command_pout(object *op, const char *params)
Definition: c_chat.cpp:1074
command_orcknuckle
void command_orcknuckle(object *op, const char *params)
Definition: c_chat.cpp:108
command_search
void command_search(object *op, const char *params)
Definition: c_object.cpp:212
command_abil
void command_abil(object *op, const char *params)
Definition: c_wiz.cpp:1795
command_flip
void command_flip(object *op, const char *params)
Definition: c_chat.cpp:997
sproto.h
command_language
void command_language(object *op, const char *params)
Definition: c_misc.cpp:132
command_dumpallobjects
void command_dumpallobjects(object *op, const char *params)
Definition: c_misc.cpp:978
devourers.command
command
Definition: devourers.py:16
command_giggle
void command_giggle(object *op, const char *params)
Definition: c_chat.cpp:799
command_hide
void command_hide(object *op, const char *params)
Definition: c_wiz.cpp:388
command_accuse
void command_accuse(object *op, const char *params)
Definition: c_chat.cpp:909
command_stay
void command_stay(object *op, const char *params)
Definition: c_move.cpp:145
command_dumpmap
void command_dumpmap(object *op, const char *params)
Definition: c_misc.cpp:1034
command_settings
void command_settings(object *op, const char *ignored)
Definition: c_wiz.cpp:2877
command_purge_quest_definitions
void command_purge_quest_definitions(object *op, const char *param)
Definition: c_wiz.cpp:2822
command_east
void command_east(object *op, const char *params)
Definition: c_move.cpp:57
COMMAND_TYPE_WIZARD
#define COMMAND_TYPE_WIZARD
Definition: commands.h:39
command_dumpbelow
void command_dumpbelow(object *op, const char *params)
Definition: c_wiz.cpp:2850
command_peaceful
void command_peaceful(object *op, const char *params)
Definition: c_misc.cpp:2125
command_list
void command_list(object *pl, bool is_dm)
Definition: commands.cpp:391
command_wimpy
void command_wimpy(object *op, const char *params)
Definition: c_misc.cpp:2143
command_bow
void command_bow(object *op, const char *params)
Definition: c_chat.cpp:931
command_drop
void command_drop(object *op, const char *params)
Definition: c_object.cpp:1354
command_shake
void command_shake(object *op, const char *params)
Definition: c_chat.cpp:810
command_use
void command_use(object *op, const char *params)
Definition: c_object.cpp:2605
command_fire_stop
void command_fire_stop(object *op, const char *params)
Definition: c_new.cpp:98
command_motd
void command_motd(object *op, const char *params)
Definition: c_misc.cpp:217
command_loadtest
void command_loadtest(object *op, const char *params)
Definition: c_wiz.cpp:305
command_smile
void command_smile(object *op, const char *params)
Definition: c_chat.cpp:766
command_learn_special_prayer
void command_learn_special_prayer(object *op, const char *params)
Definition: c_wiz.cpp:2365
command_applymode
void command_applymode(object *op, const char *params)
Definition: c_misc.cpp:1278
FLAG_WIZ
#define FLAG_WIZ
Definition: define.h:231
command_news
void command_news(object *op, const char *params)
Definition: c_misc.cpp:243
command_quest
void command_quest(object *op, const char *params)
Definition: quest.cpp:750
command_whereabouts
void command_whereabouts(object *op, const char *params)
Definition: c_misc.cpp:484
NDI_UNIQUE
#define NDI_UNIQUE
Definition: newclient.h:262
command_afk
void command_afk(object *op, const char *params)
Definition: c_misc.cpp:776
command_summon
void command_summon(object *op, const char *params)
Definition: c_wiz.cpp:865
command_knowledge
void command_knowledge(object *pl, const char *params)
Definition: knowledge.cpp:1210
command_reset
void command_reset(object *op, const char *params)
Definition: c_wiz.cpp:1861
command_learn_spell
void command_learn_spell(object *op, const char *params)
Definition: c_wiz.cpp:2353
command_version
void command_version(object *op, const char *params)
Definition: c_misc.cpp:1077
command_frown
void command_frown(object *op, const char *params)
Definition: c_chat.cpp:1008
command_toggle_shout
void command_toggle_shout(object *op, const char *params)
Definition: c_wiz.cpp:614
registered_command::extra
char * extra
Definition: commands.cpp:39
command_snicker
void command_snicker(object *op, const char *params)
Definition: c_chat.cpp:1151
registered_command
Definition: commands.cpp:35
command_reply
void command_reply(object *op, const char *params)
Definition: c_chat.cpp:336
command_strings
void command_strings(object *op, const char *params)
Definition: c_misc.cpp:848
command_yawn
void command_yawn(object *op, const char *params)
Definition: c_chat.cpp:1261
command_setgod
void command_setgod(object *op, const char *params)
Definition: c_wiz.cpp:417
command_pickup
void command_pickup(object *op, const char *params)
Definition: c_object.cpp:2213
give.op
op
Definition: give.py:33
command_skills
void command_skills(object *op, const char *params)
Definition: c_wiz.cpp:1346
command_patch
void command_patch(object *op, const char *params)
Definition: c_wiz.cpp:1474
command_dmtell
void command_dmtell(object *op, const char *params)
Definition: c_chat.cpp:320
command_rotateshoottype
void command_rotateshoottype(object *op, const char *params)
Definition: c_range.cpp:351
command_shiver
void command_shiver(object *op, const char *params)
Definition: c_chat.cpp:1085
command_stats
void command_stats(object *op, const char *params)
Definition: c_wiz.cpp:1738
command_lick
void command_lick(object *op, const char *params)
Definition: c_chat.cpp:1063
roll-o-matic.params
params
Definition: roll-o-matic.py:193
command_chat
void command_chat(object *op, const char *params)
Definition: c_chat.cpp:221
command_southwest
void command_southwest(object *op, const char *params)
Definition: c_move.cpp:123
command_bounce
void command_bounce(object *op, const char *params)
Definition: c_chat.cpp:755
command_smirk
void command_smirk(object *op, const char *params)
Definition: c_chat.cpp:1118
command_resistances
void command_resistances(object *op, const char *params)
Definition: c_misc.cpp:1598
command_slap
void command_slap(object *op, const char *params)
Definition: c_chat.cpp:1107
command_stack_list
void command_stack_list(object *op, const char *params)
Definition: c_wiz.cpp:2528
command_fire
void command_fire(object *op, const char *params)
Definition: c_new.cpp:77
command_find
static registered_command * command_find(const char *name, object *pl)
Definition: commands.cpp:408
command_invisible
void command_invisible(object *op, const char *params)
Definition: c_wiz.cpp:2188
command_purge_quest
void command_purge_quest(object *op, const char *param)
Definition: c_wiz.cpp:2816
command_run
void command_run(object *op, const char *params)
Definition: c_new.cpp:41
command_freeze
void command_freeze(object *op, const char *params)
Definition: c_wiz.cpp:744
command_register_extra
command_registration command_register_extra(const char *name, const char *extra, uint8_t type, command_function_extra func, float time)
Definition: commands.cpp:527
draw_ext_info
void draw_ext_info(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *message)
Definition: main.cpp:308
command_maps
void command_maps(object *op, const char *params)
Definition: c_misc.cpp:836
command_dumpabove
void command_dumpabove(object *op, const char *params)
Definition: c_wiz.cpp:2865
command_function_extra
void(* command_function_extra)(object *op, const char *params, const char *extra)
Definition: commands.h:29
command_dumpallarchetypes
void command_dumpallarchetypes(object *op, const char *params)
Definition: c_misc.cpp:1006
command_speed
void command_speed(object *op, const char *params)
Definition: c_wiz.cpp:1708
command_fix_me
void command_fix_me(object *op, const char *params)
Definition: c_misc.cpp:1214
command_registration
uint64_t command_registration
Definition: commands.h:32
command_dm
void command_dm(object *op, const char *params)
Definition: c_wiz.cpp:2176
command_addexp
void command_addexp(object *op, const char *params)
Definition: c_wiz.cpp:1652
command_goto
void command_goto(object *op, const char *params)
Definition: c_wiz.cpp:723
command_empty
void command_empty(object *op, const char *params)
Definition: c_object.cpp:1450
commands.h
command_cointoss
void command_cointoss(object *op, const char *params)
Definition: c_chat.cpp:64
command_tell
void command_tell(object *op, const char *params)
Definition: c_chat.cpp:308
commands_init
void commands_init(void)
Definition: commands.cpp:111
command_showpets
void command_showpets(object *op, const char *params)
Definition: c_misc.cpp:1482
command_gsay
void command_gsay(object *op, const char *params)
Definition: c_party.cpp:75
command_mapinfo
void command_mapinfo(object *op, const char *params)
Definition: c_misc.cpp:810
command_gasp
void command_gasp(object *op, const char *params)
Definition: c_chat.cpp:1019
command_brace
void command_brace(object *op, const char *params)
Definition: c_misc.cpp:2173
command_body
void command_body(object *op, const char *params)
Definition: c_misc.cpp:175
command_passwd
void command_passwd(object *pl, const char *params)
Definition: c_misc.cpp:2240
command_function
void(* command_function)(object *op, const char *params)
Definition: commands.h:17
registered_command::func_std
command_function func_std
Definition: commands.cpp:37
command_sniff
void command_sniff(object *op, const char *params)
Definition: c_chat.cpp:1162
command_insert_into
void command_insert_into(object *op, const char *params)
Definition: c_wiz.cpp:2649
RC
#define RC(name, func, time)
command_apply
void command_apply(object *op, const char *params)
Definition: c_object.cpp:251
command_cast
void command_cast(object *op, const char *params)
Definition: c_range.cpp:50
command_listplugins
void command_listplugins(object *op, const char *params)
Definition: c_wiz.cpp:2406
command_bowmode
void command_bowmode(object *op, const char *params)
Definition: c_misc.cpp:1319
command_title
void command_title(object *op, const char *params)
Definition: c_misc.cpp:2048
matches
static int matches(const char *exp, const char *text)
Definition: dialog.cpp:79
command_wizpass
void command_wizpass(object *op, const char *params)
Definition: c_misc.cpp:918
registered_command::func_extra
command_function_extra func_extra
Definition: commands.cpp:38
command_create
void command_create(object *op, const char *params)
Definition: c_wiz.cpp:978
llevDebug
@ llevDebug
Definition: logger.h:13
command_dmhide
void command_dmhide(object *op, const char *params)
Definition: c_wiz.cpp:2482
command_blush
void command_blush(object *op, const char *params)
Definition: c_chat.cpp:953
is_valid_types_gen.type
list type
Definition: is_valid_types_gen.py:25
command_register
command_registration command_register(const char *name, uint8_t type, command_function func, float time)
Definition: commands.cpp:104
command_sneeze
void command_sneeze(object *op, const char *params)
Definition: c_chat.cpp:1140
command_burp
void command_burp(object *op, const char *params)
Definition: c_chat.cpp:964
registered_command::type
uint8_t type
Definition: commands.cpp:41
give.name
name
Definition: give.py:27
command_southeast
void command_southeast(object *op, const char *params)
Definition: c_move.cpp:112
command_laugh
void command_laugh(object *op, const char *params)
Definition: c_chat.cpp:788
command_sigh
void command_sigh(object *op, const char *params)
Definition: c_chat.cpp:854