Go to the documentation of this file.
65 assert(!existing->second.empty());
66 if (existing->second.back()->type !=
type) {
77 add->
extra = extra ? strdup(extra) :
nullptr;
84 if (strcmp(
params,
"1") == 0 || strcmp(
params,
"on") == 0) {
85 op->contr->partial_commands = 1;
87 if (strcmp(
params,
"0") == 0 || strcmp(
params,
"off") == 0) {
88 op->contr->partial_commands = 0;
110 #define RN(name, func, time) command_register(name, COMMAND_TYPE_NORMAL, func, time)
111 #define RC(name, func, time) command_register(name, COMMAND_TYPE_COMMUNICATION, func, time)
112 #define RW(name, func, time) command_register(name, COMMAND_TYPE_WIZARD, func, time)
179 #ifdef DEBUG_MALLOC_LEVEL
180 RN(
"verify", command_malloc_verify, 0.0);
348 for (
auto h = cmd->second.begin(); h != cmd->second.end(); h++) {
376 if (cmd.second.back()->type == type) {
377 strcat(line, cmd.first.c_str());
412 "'%s' is not a valid command.",
name);
415 return existing->second.back();
418 if (
pl->contr->partial_commands) {
419 size_t len = strlen(
name);
422 bool multiple =
false;
429 candidate =
command.second.back();
436 "'%s' is ambiguous and may be %s.",
name,
matches.c_str());
444 "'%s' is not a valid command.",
name);
460 pl->contr->has_hit = 0;
466 while ((cp >=
command) && (*cp ==
' ')) {
483 for (low =
command; *low; low++)
488 if (csp ==
nullptr) {
492 pl->speed_left -= csp->
time;
504 if (csp->
time &&
pl->speed_left < -2.0) {
505 LOG(
llevDebug,
"execute_newclient_command: Player issued command that takes more time than he has left.\n");
537 for (
auto h = cmd->second.begin(); h != cmd->second.end(); h++) {
538 if ((*h)->registration ==
command) {
541 cmd->second.erase(h);
542 if (cmd->second.empty()) {
command_registration registration
void command_stack_pop(object *op, const char *params)
void command_style_map_info(object *op, const char *params)
void command_dance(object *op, const char *params)
void command_shutdown(object *op, const char *params)
void command_cackle(object *op, const char *params)
void command_stack_push(object *op, const char *params)
void command_northeast(object *op, const char *params)
void command_sound(object *op, const char *params)
void command_bleed(object *op, const char *params)
void command_glare(object *op, const char *params)
void command_delete(object *op, const char *params)
void command_dumpallmaps(object *op, const char *params)
void command_players(object *op, const char *params)
void command_nowiz(object *op, const char *params)
void command_snore(object *op, const char *params)
void command_remove(object *op, const char *params)
void command_dumpfriendlyobjects(object *op, const char *params)
void command_wizcast(object *op, const char *params)
void command_growl(object *op, const char *params)
void command_search_items(object *op, const char *params)
void command_say(object *op, const char *params)
void LOG(LogLevel logLevel, const char *format,...)
void command_sulk(object *op, const char *params)
void command_whistle(object *op, const char *params)
void command_cringe(object *op, const char *params)
void command_unarmed_skill(object *op, const char *params)
void command_clap(object *op, const char *params)
void command_cough(object *op, const char *params)
static command_registration next_registration
void command_spit(object *op, const char *params)
void command_poke(object *op, const char *params)
#define QUERY_FLAG(xyz, p)
void command_shrug(object *op, const char *params)
void command_time(object *op, const char *params)
void command_groan(object *op, const char *params)
void command_wave(object *op, const char *params)
void command_beg(object *op, const char *params)
void command_hiccup(object *op, const char *params)
void command_me(object *op, const char *params)
void command_south(object *op, const char *params)
void command_kiss(object *op, const char *params)
void command_shout(object *op, const char *params)
void command_thank(object *op, const char *params)
void command_disarm(object *op, const char *params)
void command_snap(object *op, const char *params)
void command_party(object *op, const char *params)
void command_wink(object *op, const char *params)
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)
void command_recollect(object *op, const char *params)
void command_run_stop(object *op, const char *params)
static void show_commands(object *op, uint8_t type, const char *legend)
void command_printlos(object *op, const char *params)
void command_usekeys(object *op, const char *params)
void command_party_rejoin(object *op, const char *params)
static void command_partial_commands(object *op, const char *params)
void command_lock_item(object *op, const char *params)
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...) PRINTF_ARGS(6
#define COMMAND_TYPE_COMMUNICATION
void command_hiscore(object *op, const char *params)
void command_invoke(object *op, const char *params)
void command_twiddle(object *op, const char *params)
void command_statistics(object *pl, const char *params)
void command_northwest(object *op, const char *params)
void command_diff(object *op, const char *params)
void command_who(object *op, const char *params)
void command_overlay_reset(object *op, const char *params)
void command_throw(object *op, const char *params)
static std::map< std::string, std::vector< registered_command * > > registered_commands
void command_puke(object *op, const char *params)
#define COMMAND_TYPE_NORMAL
void command_debug(object *op, const char *params)
void command_execute(object *pl, char *command)
void command_whereami(object *op, const char *params)
#define MSG_TYPE_COMMAND_ERROR
void command_overlay_save(object *op, const char *params)
void command_arrest(object *op, const char *params)
void command_hug(object *op, const char *params)
void command_face(object *op, const char *params)
void command_rename_item(object *op, const char *params)
void command_petmode(object *op, const char *params)
void command_rules(object *op, const char *params)
void command_grin(object *op, const char *params)
void command_stack_clear(object *op, const char *params)
void command_nod(object *op, const char *params)
void command_west(object *op, const char *params)
void command_quit(object *op, const char *params)
void command_rskill(object *pl, const char *params)
void command_unregister(command_registration command)
void command_malloc(object *op, const char *params)
void command_banish(object *op, const char *params)
void command_inventory(object *op, const char *params)
void command_kill_pets(object *op, const char *params)
void command_accountpasswd(object *op, const char *params)
void command_forget_spell(object *op, const char *params)
void command_mark(object *op, const char *params)
void command_teleport(object *op, const char *params)
void command_uskill(object *pl, const char *params)
void command_dump(object *op, const char *params)
void command_take(object *op, const char *params)
void command_north(object *op, const char *params)
void command_save(object *op, const char *params)
void command_mon_aggr(object *op, const char *params)
void command_dropall(object *op, const char *params)
void command_ssdumptable(object *op, const char *params)
#define MSG_TYPE_COMMAND_INFO
void command_listen(object *op, const char *params)
void command_loadplugin(object *op, const char *params)
void command_scream(object *op, const char *params)
void command_follow(object *op, const char *params)
void command_strut(object *op, const char *params)
void command_chuckle(object *op, const char *params)
void command_unloadplugin(object *op, const char *params)
void command_think(object *op, const char *params)
void command_help(object *op, const char *params)
void command_examine(object *op, const char *params)
void command_free(object *op, const char *params)
#define RN(name, func, time)
void command_cry(object *op, const char *params)
#define RW(name, func, time)
void command_kick(object *op, const char *params)
void command_pout(object *op, const char *params)
void command_orcknuckle(object *op, const char *params)
void command_search(object *op, const char *params)
void command_abil(object *op, const char *params)
void command_flip(object *op, const char *params)
void command_language(object *op, const char *params)
void command_dumpallobjects(object *op, const char *params)
void command_giggle(object *op, const char *params)
void command_hide(object *op, const char *params)
void command_accuse(object *op, const char *params)
void command_stay(object *op, const char *params)
void command_dumpmap(object *op, const char *params)
void command_settings(object *op, const char *ignored)
void command_purge_quest_definitions(object *op, const char *param)
void command_east(object *op, const char *params)
#define COMMAND_TYPE_WIZARD
void command_dumpbelow(object *op, const char *params)
void command_peaceful(object *op, const char *params)
void command_list(object *pl, bool is_dm)
void command_wimpy(object *op, const char *params)
void command_bow(object *op, const char *params)
void command_drop(object *op, const char *params)
void command_shake(object *op, const char *params)
void command_use(object *op, const char *params)
void command_fire_stop(object *op, const char *params)
void command_motd(object *op, const char *params)
void command_loadtest(object *op, const char *params)
void command_smile(object *op, const char *params)
void command_learn_special_prayer(object *op, const char *params)
void command_applymode(object *op, const char *params)
void command_news(object *op, const char *params)
void command_quest(object *op, const char *params)
void command_whereabouts(object *op, const char *params)
void command_afk(object *op, const char *params)
void command_summon(object *op, const char *params)
void command_knowledge(object *pl, const char *params)
void command_reset(object *op, const char *params)
void command_learn_spell(object *op, const char *params)
void command_version(object *op, const char *params)
void command_frown(object *op, const char *params)
void command_toggle_shout(object *op, const char *params)
void command_snicker(object *op, const char *params)
void command_reply(object *op, const char *params)
void command_strings(object *op, const char *params)
void command_yawn(object *op, const char *params)
void command_setgod(object *op, const char *params)
void command_pickup(object *op, const char *params)
void command_skills(object *op, const char *params)
void command_patch(object *op, const char *params)
void command_dmtell(object *op, const char *params)
void command_rotateshoottype(object *op, const char *params)
void command_shiver(object *op, const char *params)
void command_stats(object *op, const char *params)
void command_lick(object *op, const char *params)
void command_chat(object *op, const char *params)
void command_southwest(object *op, const char *params)
void command_bounce(object *op, const char *params)
void command_smirk(object *op, const char *params)
void command_resistances(object *op, const char *params)
void command_slap(object *op, const char *params)
void command_stack_list(object *op, const char *params)
void command_fire(object *op, const char *params)
static registered_command * command_find(const char *name, object *pl)
void command_invisible(object *op, const char *params)
void command_purge_quest(object *op, const char *param)
void command_run(object *op, const char *params)
void command_freeze(object *op, const char *params)
command_registration command_register_extra(const char *name, const char *extra, uint8_t type, command_function_extra func, float time)
void draw_ext_info(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *message)
void command_maps(object *op, const char *params)
void command_dumpabove(object *op, const char *params)
void(* command_function_extra)(object *op, const char *params, const char *extra)
void command_dumpallarchetypes(object *op, const char *params)
void command_speed(object *op, const char *params)
void command_fix_me(object *op, const char *params)
void command_swap(object *op, const char *params)
uint64_t command_registration
void command_dm(object *op, const char *params)
void command_addexp(object *op, const char *params)
void command_goto(object *op, const char *params)
void command_empty(object *op, const char *params)
void command_cointoss(object *op, const char *params)
void command_tell(object *op, const char *params)
void command_showpets(object *op, const char *params)
void command_gsay(object *op, const char *params)
void command_mapinfo(object *op, const char *params)
void command_gasp(object *op, const char *params)
void command_brace(object *op, const char *params)
void command_body(object *op, const char *params)
void command_passwd(object *pl, const char *params)
void(* command_function)(object *op, const char *params)
command_function func_std
void command_sniff(object *op, const char *params)
void command_insert_into(object *op, const char *params)
#define RC(name, func, time)
void command_apply(object *op, const char *params)
void command_cast(object *op, const char *params)
void command_listplugins(object *op, const char *params)
void command_bowmode(object *op, const char *params)
void command_title(object *op, const char *params)
static int matches(const char *exp, const char *text)
void command_wizpass(object *op, const char *params)
command_function_extra func_extra
void command_create(object *op, const char *params)
void command_dmhide(object *op, const char *params)
void command_blush(object *op, const char *params)
command_registration command_register(const char *name, uint8_t type, command_function func, float time)
void command_sneeze(object *op, const char *params)
void command_burp(object *op, const char *params)
void command_southeast(object *op, const char *params)
void command_laugh(object *op, const char *params)
void command_sigh(object *op, const char *params)