Crossfire Server, Branch 1.12  R12190
Data Structures | Functions
c_misc.c File Reference

Various functions. More...

#include <global.h>
#include <loader.h>
#include <shstr.h>
#include <sproto.h>
#include <assert.h>
#include <sounds.h>
Include dependency graph for c_misc.c:

Go to the source code of this file.

Data Structures

struct  chars_names
 Utility structure for the 'who' command. More...

Functions

int command_afk (object *op, char *params)
 Toggles the afk status of a player.
int command_applymode (object *op, char *params)
 Players wants to change the apply mode, ie how to handle applying an item when no body slot available.
int command_archs (object *op, char *params)
 Archetype-related statistics.
int command_body (object *op, char *params)
 This command dumps the body information for object *op.
int command_bowmode (object *op, char *params)
 Player wants to change the bowmode, how arrows are fired.
int command_brace (object *op, char *params)
 Player toggles her braced status.
int command_debug (object *op, char *params)
 Player wants to see/change the debug level.
int command_dumpallarchetypes (object *op, char *params)
 Various archetypes-related statistics.
int command_dumpallmaps (object *op, char *params)
 Various map-related statistics.
int command_dumpallobjects (object *op, char *params)
 Various object-related statistics.
int command_dumpbelow (object *op, char *params)
 Player wants to dump object below her.
int command_dumpfriendlyobjects (object *op, char *params)
 Various friendly object-related statistics.
int command_dumpmap (object *op, char *params)
 Various map-related statistics.
int command_explore (object *op, char *params)
 Player wants to enter explore mode, that is never-dying mode.
int command_fix_me (object *op, char *params)
 Wrapper to fix a player.
int command_help (object *op, char *params)
 Player is asking for some help.
int command_hiscore (object *op, char *params)
 Player is asking for the hiscore.
int command_kill_pets (object *op, char *params)
 Player wants to get rid of pets.
int command_language (object *op, char *params)
 This is the 'language' command.
int command_listen (object *op, char *params)
 Change the player's listen level.
int command_malloc (object *op, char *params)
 Display memory information.
int command_mapinfo (object *op, char *params)
 'mapinfo' command.
int command_maps (object *op, char *params)
 'maps' command.
int command_motd (object *op, char *params)
 Display the message of the day.
int command_news (object *op, char *params)
 Display the server news.
int command_output_count (object *op, char *params)
 output-count command.
int command_output_sync (object *op, char *params)
 Output-sync command.
int command_passwd (object *pl, char *params)
 Player is asking to change password.
int command_peaceful (object *op, char *params)
 Player toggles her peaceful status.
int command_petmode (object *op, char *params)
 Player wants to change how her pets behave.
int command_players (object *op, char *params)
 Display all known players.
int command_printlos (object *op, char *params)
 Various LOS-related statistics.
int command_quit (object *op, char *params)
 Player wants to totally delete her character.
int command_resistances (object *op, char *params)
 Players wants to know her resistances.
int command_rules (object *op, char *params)
 Display the server rules.
int command_save (object *op, char *params)
 Player wants to get saved.
int command_showpets (object *op, char *params)
 Players wants to know her pets.
int command_sound (object *op, char *params)
 Player wants to change sound status.
int command_ssdumptable (object *op, char *params)
 Various string-related statistics.
int command_statistics (object *pl, char *params)
 Prints out some useful information for the character.
int command_strings (object *op, char *params)
 Various string-related statistics.
int command_time (object *op, char *params)
 Players asks for the time.
int command_title (object *op, char *params)
 Player wishes to change her title.
int command_usekeys (object *op, char *params)
 Player wants to change how keys are used.
int command_version (object *op, char *params)
 Server version.
int command_whereabouts (object *op, char *params)
 'whereabouts' command.
int command_whereami (object *op, char *params)
 'whereami' command.
int command_who (object *op, char *params)
 'who' command.
int command_wimpy (object *op, char *params)
 Player wants to change how soon she'll flee.
int command_wizcast (object *op, char *params)
 Wizard toggling "cast everywhere" ability.
int command_wizpass (object *op, char *params)
 Wizard toggling wall-crossing.
void current_map_info (object *op)
 'mapinfo' command.
void current_region_info (object *op)
 'whereami' command.
void display_who_entry (object *op, player *pl, const char *format)
 Display a line of 'who' to op, about pl, using the formatting specified by format.
int do_harvest (object *pl, int dir, object *skill)
 Player is trying to harvest something.
void get_who_escape_code_value (char *return_val, int size, const char letter, player *pl)
 Returns the value of the escape code used in the who format specifier.
static void help_topics (object *op, int what)
 Player wants to know available help topics.
void list_players (object *op, region *reg, partylist *party)
 Displays the players in a region or party.
void malloc_info (object *op)
 Sends various memory-related statistics.
void map_info (object *op, char *search)
 This is the 'maps' command.
static int name_cmp (const chars_names *c1, const chars_names *c2)
 Local function for qsort comparison.
int onoff_value (const char *line)
 Utility function to convert a reply to a yes/no or on/off value.
void receive_player_name (object *op)
 A player just entered her name.
void receive_player_password (object *op)
 A player just entered her password, including for changing it.
static void show_commands (object *op, int what)
 Helper function to display commands.

Detailed Description

Various functions.

Handles misc. input request - things like hash table, malloc, maps, who, etc.

Definition in file c_misc.c.


Function Documentation

int command_afk ( object *  op,
char *  params 
)

Toggles the afk status of a player.

'afk' command.

Parameters:
opplayer to toggle status for.
paramsunused.
Returns:
1.

Definition at line 795 of file c_misc.c.

References CLEAR_FLAG, draw_ext_info(), FLAG_AFK, get_language(), I18N_MSG_CMISC_056, I18N_MSG_CMISC_057, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, QUERY_FLAG, and SET_FLAG.

Here is the call graph for this function:

int command_applymode ( object *  op,
char *  params 
)

Players wants to change the apply mode, ie how to handle applying an item when no body slot available.

Parameters:
opplayer asking for change.
paramsnew mode.
Returns:
1.

Definition at line 1443 of file c_misc.c.

References draw_ext_info_format(), get_language(), I18N_MSG_CMISC_132, I18N_MSG_CMISC_133, I18N_MSG_CMISC_134, I18N_MSG_CMISC_135, i18n_translate(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, types, unapply_always, unapply_never, and unapply_nochoice.

Here is the call graph for this function:

int command_archs ( object *  op,
char *  params 
)

Archetype-related statistics.

Wizard 'archs' command.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
1.

Definition at line 915 of file c_misc.c.

References arch_info().

Here is the call graph for this function:

int command_body ( object *  op,
char *  params 
)

This command dumps the body information for object *op.

it doesn't care what the params are.

This is mostly meant as a debug command.

This is the 'body' command.

Parameters:
opplayer to display body info for.
paramsunused
Return values:
1.

Definition at line 157 of file c_misc.c.

References body_locations, draw_ext_info(), draw_ext_info_format(), FLAG_USE_ARMOUR, FLAG_USE_WEAPON, get_language(), I18N_MSG_CMISC_007, I18N_MSG_CMISC_008, I18N_MSG_CMISC_009, I18N_MSG_CMISC_010, I18N_MSG_CMISC_011, I18N_MSG_CMISC_012, I18N_MSG_CMISC_013, i18n_translate(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_BODY, NDI_UNIQUE, and QUERY_FLAG.

Here is the call graph for this function:

int command_bowmode ( object *  op,
char *  params 
)

Player wants to change the bowmode, how arrows are fired.

Parameters:
opplayer asking for change.
paramsnew mode.
Returns:
1.

Definition at line 1491 of file c_misc.c.

References bow_bestarrow, bow_nw, draw_ext_info(), draw_ext_info_format(), get_language(), I18N_MSG_CMISC_136, I18N_MSG_CMISC_137, i18n_translate(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, snprintf(), and types.

Here is the call graph for this function:

int command_brace ( object *  op,
char *  params 
)

Player toggles her braced status.

Parameters:
opplayer.
paramsbrace status (on/off).
Returns:
1.

Definition at line 2382 of file c_misc.c.

References draw_ext_info(), fix_object(), get_language(), I18N_MSG_CMISC_212, I18N_MSG_CMISC_213, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, and onoff_value().

Here is the call graph for this function:

int command_debug ( object *  op,
char *  params 
)

Player wants to see/change the debug level.

Parameters:
opplayer asking for information.
paramsnew debug value.
Returns:
1.

Definition at line 945 of file c_misc.c.

References Settings::debug, draw_ext_info(), draw_ext_info_format(), FABS, FLAG_WIZ, get_language(), I18N_MSG_CMISC_092, I18N_MSG_CMISC_093, I18N_MSG_CMISC_094, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, QUERY_FLAG, and settings.

Here is the call graph for this function:

int command_dumpallarchetypes ( object *  op,
char *  params 
)

Various archetypes-related statistics.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
0.

Definition at line 1102 of file c_misc.c.

References dump_all_archetypes().

Here is the call graph for this function:

int command_dumpallmaps ( object *  op,
char *  params 
)

Various map-related statistics.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
0.

Definition at line 1148 of file c_misc.c.

References dump_all_maps().

Here is the call graph for this function:

int command_dumpallobjects ( object *  op,
char *  params 
)

Various object-related statistics.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
0.

Definition at line 1072 of file c_misc.c.

References dump_all_objects().

Here is the call graph for this function:

int command_dumpbelow ( object *  op,
char *  params 
)

Player wants to dump object below her.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
0.

Definition at line 979 of file c_misc.c.

References dm_stack_push(), draw_ext_info(), dump_object(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, stringbuffer_finish(), and stringbuffer_new().

Here is the call graph for this function:

int command_dumpfriendlyobjects ( object *  op,
char *  params 
)

Various friendly object-related statistics.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
0.

Definition at line 1087 of file c_misc.c.

References dump_friendly_objects().

Here is the call graph for this function:

int command_dumpmap ( object *  op,
char *  params 
)

Various map-related statistics.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
0.

Definition at line 1132 of file c_misc.c.

References dump_map().

Here is the call graph for this function:

int command_explore ( object *  op,
char *  params 
)

Player wants to enter explore mode, that is never-dying mode.

Don't allow people to exit explore mode. It otherwise becomes really easy to abuse this.

Parameters:
opplayer asking for explore mode.
paramsunused.
Returns:
1.

Definition at line 2086 of file c_misc.c.

References draw_ext_info(), Settings::explore_mode, FALSE, first_player, get_language(), I18N_MSG_CMISC_182, I18N_MSG_CMISC_183, I18N_MSG_CMISC_184, I18N_MSG_CMISC_185, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, pl::next, and settings.

Here is the call graph for this function:

int command_fix_me ( object *  op,
char *  params 
)

Wrapper to fix a player.

Parameters:
opplayer asking to be fixed.
paramsunused.
Returns:
1.

Definition at line 1374 of file c_misc.c.

References fix_object(), and sum_weight().

Here is the call graph for this function:

int command_help ( object *  op,
char *  params 
)

Player is asking for some help.

Parameters:
opplayer asking for information.
paramswhat kind of help to ask for.
Returns:
0.

Definition at line 1900 of file c_misc.c.

References Settings::datadir, draw_ext_info(), draw_ext_info_format(), FLAG_WIZ, get_language(), help_topics(), I18N_MSG_CMISC_178, I18N_MSG_CMISC_179, I18N_MSG_CMISC_180, i18n_translate(), language_codes, llevError, LOG(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_INFO, NDI_UNIQUE, QUERY_FLAG, S_ISREG, settings, show_commands(), snprintf(), and strerror_local().

Here is the call graph for this function:

int command_hiscore ( object *  op,
char *  params 
)

Player is asking for the hiscore.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
1.

Definition at line 930 of file c_misc.c.

References display_high_score().

Here is the call graph for this function:

int command_kill_pets ( object *  op,
char *  params 
)

Player wants to get rid of pets.

Parameters:
opplayer.
paramsunused.
Returns:
0.

Definition at line 2410 of file c_misc.c.

References draw_ext_info(), draw_ext_info_format(), first_friendly_object, FLAG_REMOVED, free_object(), get_language(), get_owner(), I18N_MSG_CMISC_214, I18N_MSG_CMISC_215, I18N_MSG_CMISC_216, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, QUERY_FLAG, remove_friendly_object(), remove_ob(), strcasecmp(), and terminate_all_pets().

Here is the call graph for this function:

int command_language ( object *  op,
char *  params 
)

This is the 'language' command.

Parameters:
opplayer requesting the information.
paramsoptional language code ("en", "fr", etc.)

Definition at line 97 of file c_misc.c.

References draw_ext_info_format(), get_language(), I18N_MSG_CMISC_005, I18N_MSG_CMISC_006, I18N_MSG_CMISC_051, i18n_translate(), language_codes, language_names, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, and NUM_LANGUAGES.

Here is the call graph for this function:

int command_listen ( object *  op,
char *  params 
)

Change the player's listen level.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
1.

Definition at line 1264 of file c_misc.c.

References draw_ext_info_format(), get_language(), I18N_MSG_CMISC_105, I18N_MSG_CMISC_106, I18N_MSG_CMISC_107, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, and NDI_UNIQUE.

Here is the call graph for this function:

int command_malloc ( object *  op,
char *  params 
)

Display memory information.

Parameters:
opplayer requesting information.
paramsunused.
Returns:
1.

Definition at line 818 of file c_misc.c.

References malloc_info().

Here is the call graph for this function:

int command_mapinfo ( object *  op,
char *  params 
)

'mapinfo' command.

Parameters:
opplayer requesting the information.
paramsunused.
Returns:
1.

Definition at line 833 of file c_misc.c.

References current_map_info().

Here is the call graph for this function:

int command_maps ( object *  op,
char *  params 
)

'maps' command.

Parameters:
opplayer requesting the information.
paramsregion to restrict to.

Definition at line 861 of file c_misc.c.

References map_info().

Here is the call graph for this function:

int command_motd ( object *  op,
char *  params 
)

Display the message of the day.

Parameters:
opplayer requesting the motd.
paramsunused.
Return values:
1.

Definition at line 203 of file c_misc.c.

References display_motd().

Here is the call graph for this function:

int command_news ( object *  op,
char *  params 
)

Display the server news.

Parameters:
opplayer requesting the news.
paramsunused.
Return values:
1.

Definition at line 233 of file c_misc.c.

References send_news().

Here is the call graph for this function:

int command_output_count ( object *  op,
char *  params 
)

output-count command.

Parameters:
opplayer asking for information.
paramsnew value.
Returns:
1.

Definition at line 1230 of file c_misc.c.

References draw_ext_info(), draw_ext_info_format(), get_language(), I18N_MSG_CMISC_102, I18N_MSG_CMISC_103, I18N_MSG_CMISC_104, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, and NDI_UNIQUE.

Here is the call graph for this function:

int command_output_sync ( object *  op,
char *  params 
)

Output-sync command.

Parameters:
opplayer asking for information.
paramsnew value.
Returns:
1.

Definition at line 1196 of file c_misc.c.

References draw_ext_info(), draw_ext_info_format(), get_language(), I18N_MSG_CMISC_099, I18N_MSG_CMISC_100, I18N_MSG_CMISC_101, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, and NDI_UNIQUE.

Here is the call graph for this function:

int command_passwd ( object *  pl,
char *  params 
)

Player is asking to change password.

Parameters:
plplayer.
paramsunused.
Returns:
1.

Definition at line 2454 of file c_misc.c.

References CS_QUERY_HIDEINPUT, get_language(), I18N_MSG_CMISC_217, i18n_translate(), send_query(), and ST_CHANGE_PASSWORD_OLD.

Here is the call graph for this function:

int command_peaceful ( object *  op,
char *  params 
)

Player toggles her peaceful status.

Parameters:
opplayer.
paramsunused.
Returns:
1.

Definition at line 2333 of file c_misc.c.

References draw_ext_info(), get_language(), I18N_MSG_CMISC_208, I18N_MSG_CMISC_209, i18n_translate(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, and NDI_UNIQUE.

Here is the call graph for this function:

int command_petmode ( object *  op,
char *  params 
)

Player wants to change how her pets behave.

Parameters:
opplayer asking for change.
paramsnew mode.
Returns:
1.

Definition at line 1556 of file c_misc.c.

References draw_ext_info_format(), get_language(), I18N_MSG_CMISC_138, I18N_MSG_CMISC_139, I18N_MSG_CMISC_140, i18n_translate(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, pet_arena, pet_defend, pet_normal, pet_sad, and types.

Here is the call graph for this function:

int command_players ( object *  op,
char *  params 
)

Display all known players.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
0.

Definition at line 1390 of file c_misc.c.

References closedir(), dirent::d_name, draw_ext_info_format(), get_language(), I18N_MSG_CMISC_130, I18N_MSG_CMISC_131, i18n_translate(), Settings::localdir, MAX_BUF, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, opendir(), Settings::playerdir, readdir(), S_ISDIR, settings, and snprintf().

Here is the call graph for this function:

int command_printlos ( object *  op,
char *  params 
)

Various LOS-related statistics.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
0.

Definition at line 1163 of file c_misc.c.

References print_los().

Here is the call graph for this function:

int command_quit ( object *  op,
char *  params 
)

Player wants to totally delete her character.

Parameters:
opplayer wanting to delete her character.
paramsunused.
Returns:
1.

Definition at line 2065 of file c_misc.c.

References CS_QUERY_SINGLECHAR, get_language(), I18N_MSG_CMISC_181, i18n_translate(), send_query(), and ST_CONFIRM_QUIT.

Here is the call graph for this function:

int command_resistances ( object *  op,
char *  params 
)

Players wants to know her resistances.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
0.

Definition at line 1740 of file c_misc.c.

References ATNR_INTERNAL, atnr_is_dragon_enabled(), attacktype_desc, change_resist_msg, draw_ext_info(), draw_ext_info_format(), FORCE, get_language(), I18N_MSG_CMISC_168, I18N_MSG_CMISC_169, I18N_MSG_CMISC_170, I18N_MSG_CMISC_171, i18n_translate(), is_dragon_pl(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_INFO, NDI_UNIQUE, and NROFATTACKS.

Here is the call graph for this function:

int command_rules ( object *  op,
char *  params 
)

Display the server rules.

Parameters:
opplayer requesting the rules.
paramsunused.
Return values:
1.

Definition at line 218 of file c_misc.c.

References send_rules().

Here is the call graph for this function:

int command_save ( object *  op,
char *  params 
)

Player wants to get saved.

Parameters:
opplayer.
paramsunused.
Returns:
1.

Definition at line 2305 of file c_misc.c.

References draw_ext_info(), get_language(), get_map_flags(), I18N_MSG_CMISC_204, I18N_MSG_CMISC_205, I18N_MSG_CMISC_206, I18N_MSG_CMISC_207, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, P_NO_CLERIC, and save_player().

Here is the call graph for this function:

int command_showpets ( object *  op,
char *  params 
)
int command_sound ( object *  op,
char *  params 
)

Player wants to change sound status.

Parameters:
opplayer asking for change.
paramsunused.
Returns:
1.

Definition at line 2120 of file c_misc.c.

References draw_ext_info(), get_language(), I18N_MSG_CMISC_186, I18N_MSG_CMISC_187, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, and SND_MUTE.

Here is the call graph for this function:

int command_ssdumptable ( object *  op,
char *  params 
)

Various string-related statistics.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
0.

Definition at line 1117 of file c_misc.c.

References SS_DUMP_TABLE, and ss_dump_table().

Here is the call graph for this function:

int command_statistics ( object *  pl,
char *  params 
)

Prints out some useful information for the character.

Everything we print out can be determined by the docs, so we aren't revealing anything extra - rather, we are making it convenient to find the values. params have no meaning here.

Parameters:
plplayer asking for information.
paramsunused.
Returns:
1.

Definition at line 1300 of file c_misc.c.

References draw_ext_info(), draw_ext_info_format(), get_language(), I18N_MSG_CMISC_108, I18N_MSG_CMISC_109, I18N_MSG_CMISC_110, I18N_MSG_CMISC_111, I18N_MSG_CMISC_112, I18N_MSG_CMISC_113, I18N_MSG_CMISC_114, I18N_MSG_CMISC_115, I18N_MSG_CMISC_116, I18N_MSG_CMISC_117, I18N_MSG_CMISC_118, I18N_MSG_CMISC_119, I18N_MSG_CMISC_120, I18N_MSG_CMISC_121, I18N_MSG_CMISC_122, I18N_MSG_CMISC_123, I18N_MSG_CMISC_124, I18N_MSG_CMISC_125, I18N_MSG_CMISC_126, I18N_MSG_CMISC_127, I18N_MSG_CMISC_128, I18N_MSG_CMISC_129, i18n_translate(), level_exp(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_STATISTICS, and NDI_UNIQUE.

Here is the call graph for this function:

int command_strings ( object *  op,
char *  params 
)

Various string-related statistics.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
1.

Definition at line 876 of file c_misc.c.

References draw_ext_info(), draw_ext_info_format(), HUGE_BUF, MSG_TYPE_COMMAND, MSG_TYPE_LAST, NDI_UNIQUE, ss_dump_statistics(), ss_dump_table(), and SS_DUMP_TOTALS.

Here is the call graph for this function:

int command_time ( object *  op,
char *  params 
)

Players asks for the time.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
1.

Definition at line 900 of file c_misc.c.

References time_info().

Here is the call graph for this function:

int command_title ( object *  op,
char *  params 
)

Player wishes to change her title.

Parameters:
opplayer asking for change.
paramsnew title.
Returns:
1.

Definition at line 2250 of file c_misc.c.

References draw_ext_info(), FALSE, get_language(), I18N_MSG_CMISC_197, I18N_MSG_CMISC_198, I18N_MSG_CMISC_199, I18N_MSG_CMISC_200, I18N_MSG_CMISC_201, I18N_MSG_CMISC_202, I18N_MSG_CMISC_203, i18n_translate(), is_dragon_pl(), MAX_BUF, MAX_NAME, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, replace_unprintable_chars(), Settings::set_title, settings, and snprintf().

Here is the call graph for this function:

int command_usekeys ( object *  op,
char *  params 
)

Player wants to change how keys are used.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
1.

Definition at line 1692 of file c_misc.c.

References containers, draw_ext_info_format(), get_language(), I18N_MSG_CMISC_165, I18N_MSG_CMISC_166, I18N_MSG_CMISC_167, i18n_translate(), key_inventory, keyrings, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, and types.

Here is the call graph for this function:

int command_version ( object *  op,
char *  params 
)

Server version.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
0.

Definition at line 1180 of file c_misc.c.

References version().

Here is the call graph for this function:

int command_whereabouts ( object *  op,
char *  params 
)

'whereabouts' command.

Displays how many players are in which regions.

Parameters:
opplayer requesting information.
paramsunused.
Returns:
1.

Definition at line 482 of file c_misc.c.

References regiondef::counter, draw_ext_info(), draw_ext_info_format(), first_player, first_region, get_language(), get_region_by_map(), get_region_longname(), I18N_MSG_CMISC_049, I18N_MSG_CMISC_050, i18n_translate(), llevError, LOG(), regiondef::longname, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, regiondef::name, NDI_UNIQUE, pl::next, regiondef::next, pl::ob, and regiondef::parent.

Here is the call graph for this function:

int command_whereami ( object *  op,
char *  params 
)

'whereami' command.

Parameters:
opplayer requesting the information.
paramsunused.
Returns:
1.

Definition at line 848 of file c_misc.c.

References current_region_info().

Here is the call graph for this function:

int command_who ( object *  op,
char *  params 
)

'who' command.

Parameters:
opplayer requesting the information.
paramsoptional region to limit the information to.
Returns:
1.

Definition at line 629 of file c_misc.c.

References get_region_from_string(), and list_players().

Here is the call graph for this function:

int command_wimpy ( object *  op,
char *  params 
)

Player wants to change how soon she'll flee.

Parameters:
opplayer.
paramsnew value.
Returns:
1.

Definition at line 2353 of file c_misc.c.

References draw_ext_info_format(), get_language(), I18N_MSG_CMISC_210, I18N_MSG_CMISC_211, i18n_translate(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, and NDI_UNIQUE.

Here is the call graph for this function:

int command_wizcast ( object *  op,
char *  params 
)

Wizard toggling "cast everywhere" ability.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
0.

Definition at line 1039 of file c_misc.c.

References CLEAR_FLAG, draw_ext_info(), FLAG_WIZCAST, get_language(), I18N_MSG_CMISC_097, I18N_MSG_CMISC_098, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, onoff_value(), QUERY_FLAG, and SET_FLAG.

Here is the call graph for this function:

int command_wizpass ( object *  op,
char *  params 
)

Wizard toggling wall-crossing.

Parameters:
opplayer asking for information.
paramsunused.
Returns:
0.

Definition at line 1006 of file c_misc.c.

References CLEAR_FLAG, draw_ext_info(), FLAG_WIZPASS, get_language(), I18N_MSG_CMISC_095, I18N_MSG_CMISC_096, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, onoff_value(), QUERY_FLAG, and SET_FLAG.

Here is the call graph for this function:

void current_map_info ( object *  op)

'mapinfo' command.

Parameters:
opplayer requesting the information.

Definition at line 421 of file c_misc.c.

References mapdef::difficulty, draw_ext_info(), draw_ext_info_format(), FLAG_WIZ, get_language(), get_region_by_map(), get_region_longname(), I18N_MSG_CMISC_046, i18n_translate(), MAP_ENTER_X, MAP_ENTER_Y, MAP_HEIGHT, MAP_TIMEOUT, MAP_WIDTH, mapdef::msg, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, mapdef::name, NDI_UNIQUE, mapdef::path, mapdef::players, and QUERY_FLAG.

Referenced by command_mapinfo().

Here is the call graph for this function:

Here is the caller graph for this function:

void current_region_info ( object *  op)

'whereami' command.

Pretty much identical to current map_info(), but on a bigger scale

This function returns the name of the players current region, and a description of it. It is there merely for flavour text.

Parameters:
opplayer wanting information.

Definition at line 398 of file c_misc.c.

References draw_ext_info_format(), get_language(), get_name_of_region_for_map(), get_region_by_name(), get_region_longname(), get_region_msg(), I18N_MSG_CMISC_045, i18n_translate(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, and NDI_UNIQUE.

Referenced by command_whereami().

Here is the call graph for this function:

Here is the caller graph for this function:

void display_who_entry ( object *  op,
player pl,
const char *  format 
)

Display a line of 'who' to op, about pl, using the formatting specified by format.

Parameters:
opplayer getting the information.
plplayer to display information for.
formatformat to display.

Definition at line 648 of file c_misc.c.

References draw_ext_info(), get_who_escape_code_value(), llevError, LOG(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_WHO, NDI_UNIQUE, and snprintf().

Referenced by list_players().

Here is the call graph for this function:

Here is the caller graph for this function:

int do_harvest ( object *  pl,
int  dir,
object *  skill 
)

Player is trying to harvest something.

Parameters:
plplayer trying to harvest.
dirdirection.
skillskill being used.
Returns:
0

Definition at line 2472 of file c_misc.c.

References change_exp(), copy_object_with_inv(), draw_ext_info_format(), find_free_spot(), FLAG_MONSTER, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, get_ob_key_value(), get_object(), insert_ob_in_map(), insert_ob_in_ob(), llevError, LOG(), MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, NDI_WHITE, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, random_roll(), remove_ob(), rndm(), set_ob_key_value(), SIZEOFFREE, and SK_EXP_ADD_SKILL.

Referenced by do_skill().

Here is the call graph for this function:

Here is the caller graph for this function:

void get_who_escape_code_value ( char *  return_val,
int  size,
const char  letter,
player pl 
)

Returns the value of the escape code used in the who format specifier.

Specifier values are:

  • N Name of character
  • t title of character
  • T the optional "the " sequence value (depend if player has own_title or not)
  • c count
  • n newline
  • h <Hostile> if character is hostile, nothing otherwise
  • d <WIZ> if character is a dm, nothing otherwise
  • a <AFK> if character is afk, nothing otherwise
  • b <BOT> if character is a bot, nothing otherwise
  • l the level of the character
  • m the map path the character is currently on
  • M the map name of the map the character is currently on
  • r the region name (eg scorn, wolfsburg)
  • R the regional title (eg The Kingdom of Scorn, The Port of Wolfsburg)
  • i player's ip address
  • % a literal %
  • _ a literal underscore
Parameters:
[out]return_valbuffer that will contain the information.
sizelength of return_val.
letterformat specifier.
plplayer to get information for.

Definition at line 709 of file c_misc.c.

References FLAG_AFK, FLAG_WIZ, get_name_of_region_for_map(), get_region_by_map(), get_region_longname(), socket_struct::host, socket_struct::is_bot, pl::ob, pl::own_title, pl::peaceful, QUERY_FLAG, snprintf(), pl::socket, and pl::title.

Referenced by display_who_entry().

Here is the call graph for this function:

Here is the caller graph for this function:

static void help_topics ( object *  op,
int  what 
) [static]

Player wants to know available help topics.

Parameters:
opplayer asking for information.
what
  • 1: wizard topics.
  • 3: misc topics.
  • other: regular commands.

Definition at line 1791 of file c_misc.c.

References closedir(), dirent::d_name, Settings::datadir, draw_ext_info(), get_language(), HUGE_BUF, I18N_MSG_CMISC_172, I18N_MSG_CMISC_173, I18N_MSG_CMISC_174, i18n_translate(), language_codes, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_INFO, NAMLEN, NDI_UNIQUE, opendir(), readdir(), settings, and snprintf().

Referenced by command_help().

Here is the call graph for this function:

Here is the caller graph for this function:

void list_players ( object *  op,
region reg,
partylist party 
)

Displays the players in a region or party.

If both are NULL, all players are listed.

Parameters:
opwho is asking for player list.
regregion to display players of.
partyparty to list.

Definition at line 550 of file c_misc.c.

References display_who_entry(), draw_ext_info(), draw_ext_info_format(), find_player(), first_player, FLAG_AFK, FLAG_WIZ, get_language(), get_region_by_map(), pl::hidden, I18N_MSG_CMISC_052, I18N_MSG_CMISC_053, I18N_MSG_CMISC_054, I18N_MSG_CMISC_055, i18n_translate(), socket_struct::is_bot, chars_names::login_order, regiondef::longname, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_WHO, regiondef::name, name_cmp(), NDI_UNIQUE, pl::next, pl::ob, pl::party, party_struct::partyname, QUERY_FLAG, region_is_child_of_region(), settings, pl::socket, ST_GET_PARTY_PASSWORD, ST_PLAYING, pl::state, Settings::who_format, and Settings::who_wiz_format.

Referenced by command_party(), and command_who().

Here is the call graph for this function:

Here is the caller graph for this function:

void malloc_info ( object *  op)
void map_info ( object *  op,
char *  search 
)

This is the 'maps' command.

Parameters:
opplayer requesting the information.
searchoptional substring to search for.

Definition at line 55 of file c_misc.c.

References mapdef::difficulty, draw_ext_info(), draw_ext_info_format(), FALSE, first_map, get_language(), I18N_MSG_CMISC_000, I18N_MSG_CMISC_001, I18N_MSG_CMISC_002, I18N_MSG_CMISC_003, I18N_MSG_CMISC_004, i18n_translate(), mapdef::in_memory, MAP_WHEN_RESET, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_MAPS, NDI_UNIQUE, mapdef::next, mapdef::path, mapdef::players, players_on_map(), seconds(), and mapdef::timeout.

Referenced by command_maps().

Here is the call graph for this function:

Here is the caller graph for this function:

static int name_cmp ( const chars_names c1,
const chars_names c2 
) [static]

Local function for qsort comparison.

Parameters:
c1
c2players to compare.
Returns:
-1, 0 or 1 depending on c1 and c2's order.

Definition at line 536 of file c_misc.c.

References chars_names::namebuf, and strcasecmp().

Referenced by list_players().

Here is the call graph for this function:

Here is the caller graph for this function:

int onoff_value ( const char *  line)

Utility function to convert a reply to a yes/no or on/off value.

Parameters:
linestring to check.
Return values:
1line is one of on y k s d.
0other value.

Definition at line 2026 of file c_misc.c.

Referenced by command_brace(), command_wizcast(), and command_wizpass().

Here is the caller graph for this function:

void receive_player_name ( object *  op)

A player just entered her name.

Perhaps these should be in player.c, but that file is already a bit big.

Parameters:
opplayer we're getting the name of.

Definition at line 2142 of file c_misc.c.

References check_name(), draw_ext_info(), FREE_AND_COPY, get_name(), get_password(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, and NDI_UNIQUE.

Referenced by reply_cmd().

Here is the call graph for this function:

Here is the caller graph for this function:

void receive_player_password ( object *  op)
static void show_commands ( object *  op,
int  what 
) [static]

Helper function to display commands.

Parameters:
opplayer asking for information.
what
  • 1: display wizard commands.
  • 2: display communication commands.
  • other: display regular commands.

Definition at line 1852 of file c_misc.c.

References Commands, CommandsSize, CommunicationCommands, CommunicationCommandSize, draw_ext_info(), get_language(), HUGE_BUF, I18N_MSG_CMISC_175, I18N_MSG_CMISC_176, I18N_MSG_CMISC_177, i18n_translate(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_INFO, NDI_UNIQUE, WizCommands, and WizCommandsSize.

Referenced by command_help().

Here is the call graph for this function:

Here is the caller graph for this function: