Crossfire Server, Trunk  R20513
Data Structures | Macros | Functions
c_misc.c File Reference

Various functions. More...

#include "global.h"
#include <assert.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include "loader.h"
#include "shstr.h"
#include "sounds.h"
#include "sproto.h"
#include "version.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...
 

Macros

#define WANT_UNARMED_SKILLS
 

Functions

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

Detailed Description

Various functions.

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

Definition in file c_misc.c.

Macro Definition Documentation

#define WANT_UNARMED_SKILLS

Definition at line 20 of file c_misc.c.

Function Documentation

void command_afk ( object op,
const char *  params 
)

Toggles the afk status of a player.

'afk' command.

Parameters
opplayer to toggle status for.
paramsunused.

Definition at line 706 of file c_misc.c.

References CLEAR_FLAG, draw_ext_info(), FLAG_AFK, i18n(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, QUERY_FLAG, and SET_FLAG.

Here is the call graph for this function:

void command_applymode ( object op,
const 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.

Definition at line 1198 of file c_misc.c.

References obj::contr, draw_ext_info_format(), i18n(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, types, pl::unapply, unapply_always, unapply_never, and unapply_nochoice.

Here is the call graph for this function:

void command_archs ( object op,
const char *  params 
)

Archetype-related statistics.

Wizard 'archs' command.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 806 of file c_misc.c.

References arch_info().

Here is the call graph for this function:

void command_body ( object op,
const 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

Definition at line 128 of file c_misc.c.

References obj::body_info, body_locations, obj::body_used, draw_ext_info(), draw_ext_info_format(), FLAG_USE_ARMOUR, FLAG_USE_WEAPON, i18n(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_BODY, NDI_UNIQUE, NUM_BODY_LOCATIONS, and QUERY_FLAG.

Here is the call graph for this function:

void command_bowmode ( object op,
const char *  params 
)

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

Parameters
opplayer asking for change.
paramsnew mode.

Definition at line 1239 of file c_misc.c.

References bow_bestarrow, bow_nw, pl::bowtype, obj::contr, draw_ext_info(), draw_ext_info_format(), i18n(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, snprintf, and types.

Here is the call graph for this function:

void command_brace ( object op,
const char *  params 
)

Player toggles her braced status.

Parameters
opplayer.
paramsbrace status (on/off).

Definition at line 2121 of file c_misc.c.

References pl::braced, obj::contr, draw_ext_info(), fix_object(), i18n(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, and onoff_value().

Here is the call graph for this function:

void command_debug ( object op,
const char *  params 
)

Player wants to see/change the debug level.

Parameters
opplayer asking for information.
paramsnew debug value.

Definition at line 830 of file c_misc.c.

References Settings::debug, draw_ext_info_format(), FABS, i18n(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, and settings.

Here is the call graph for this function:

void command_dumpallarchetypes ( object op,
const char *  params 
)

Various archetypes-related statistics.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 938 of file c_misc.c.

References dump_all_archetypes().

Here is the call graph for this function:

void command_dumpallmaps ( object op,
const char *  params 
)

Various map-related statistics.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 975 of file c_misc.c.

References dump_all_maps().

Here is the call graph for this function:

void command_dumpallobjects ( object op,
const char *  params 
)

Various object-related statistics.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 914 of file c_misc.c.

References object_dump_all().

Here is the call graph for this function:

void command_dumpfriendlyobjects ( object op,
const char *  params 
)

Various friendly object-related statistics.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 926 of file c_misc.c.

References dump_friendly_objects().

Here is the call graph for this function:

void command_dumpmap ( object op,
const char *  params 
)

Various map-related statistics.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 962 of file c_misc.c.

References dump_map(), and obj::map.

Here is the call graph for this function:

void command_fix_me ( object op,
const char *  params 
)

Wrapper to fix a player.

Parameters
opplayer asking to be fixed.
paramsunused.

Definition at line 1136 of file c_misc.c.

References fix_object(), and object_sum_weight().

Here is the call graph for this function:

void command_help ( object op,
const char *  params 
)

Player is asking for some help.

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

Definition at line 1706 of file c_misc.c.

References obj::contr, Settings::datadir, draw_ext_info(), draw_ext_info_format(), find_help_file(), FLAG_WIZ, help_topics(), i18n(), i18n_get_language_code(), pl::language, llevError, LOG(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_INFO, NDI_UNIQUE, QUERY_FLAG, settings, show_commands(), and snprintf.

Referenced by command_knowledge(), and command_shutdown().

Here is the call graph for this function:

Here is the caller graph for this function:

void command_hiscore ( object op,
const char *  params 
)

Player is asking for the hiscore.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 818 of file c_misc.c.

References hiscore_display().

Here is the call graph for this function:

void command_kill_pets ( object op,
const char *  params 
)
void command_language ( object op,
const char *  params 
)

This is the 'language' command.

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

Definition at line 85 of file c_misc.c.

References obj::contr, draw_ext_info(), draw_ext_info_format(), i18n(), i18n_find_language_by_code(), i18n_list_languages(), pl::language, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, and NDI_UNIQUE.

Here is the call graph for this function:

void command_listen ( object op,
const char *  params 
)

Change the player's listen level.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 1014 of file c_misc.c.

References obj::contr, draw_ext_info_format(), i18n(), pl::listening, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, and NDI_UNIQUE.

Here is the call graph for this function:

void command_malloc ( object op,
const char *  params 
)

Display memory information.

Parameters
opplayer requesting information.
paramsunused.

Definition at line 726 of file c_misc.c.

References malloc_info().

Here is the call graph for this function:

void command_mapinfo ( object op,
const char *  params 
)

'mapinfo' command.

Parameters
opplayer requesting the information.
paramsunused.

Definition at line 738 of file c_misc.c.

References current_map_info().

Here is the call graph for this function:

void command_maps ( object op,
const char *  params 
)

'maps' command.

Parameters
opplayer requesting the information.
paramsregion to restrict to.

Definition at line 762 of file c_misc.c.

References map_info().

Here is the call graph for this function:

void command_motd ( object op,
const char *  params 
)

Display the message of the day.

Parameters
opplayer requesting the motd.
paramsunused.

Definition at line 169 of file c_misc.c.

References display_motd().

Here is the call graph for this function:

void command_news ( object op,
const char *  params 
)

Display the server news.

Parameters
opplayer requesting the news.
paramsunused.

Definition at line 193 of file c_misc.c.

References send_news().

Here is the call graph for this function:

void command_passwd ( object pl,
const char *  params 
)

Player is asking to change password.

Parameters
plplayer.
paramsunused.

Definition at line 2185 of file c_misc.c.

References obj::contr, CS_QUERY_HIDEINPUT, draw_ext_info(), i18n(), socket_struct::login_method, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, player_set_state(), send_query(), pl::socket, and ST_CHANGE_PASSWORD_OLD.

Here is the call graph for this function:

void command_peaceful ( object op,
const char *  params 
)

Player toggles her peaceful status.

Parameters
opplayer.
paramsunused.

Definition at line 2073 of file c_misc.c.

References obj::contr, draw_ext_info(), i18n(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, and pl::peaceful.

Here is the call graph for this function:

void command_petmode ( object op,
const char *  params 
)

Player wants to change how her pets behave.

Parameters
opplayer asking for change.
paramsnew mode.

Definition at line 1356 of file c_misc.c.

References obj::contr, draw_ext_info_format(), i18n(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, pet_arena, pet_defend, pet_normal, pet_sad, pl::petmode, and types.

Here is the call graph for this function:

void command_players ( object op,
const char *  params 
)

Display all known players.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 1149 of file c_misc.c.

References closedir(), dirent::d_name, draw_ext_info_format(), i18n(), 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:

void command_printlos ( object op,
const char *  params 
)

Various LOS-related statistics.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 987 of file c_misc.c.

References print_los().

Here is the call graph for this function:

void command_quit ( object op,
const char *  params 
)

Player wants to totally delete her character.

Parameters
opplayer wanting to delete her character.
paramsunused.

Definition at line 1845 of file c_misc.c.

References obj::contr, CS_QUERY_SINGLECHAR, draw_ext_info(), FLAG_WAS_WIZ, i18n(), MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, NDI_UNIQUE, player_set_state(), QUERY_FLAG, send_query(), pl::socket, and ST_CONFIRM_QUIT.

Here is the call graph for this function:

void command_resistances ( object op,
const char *  params 
)

Players wants to know her resistances.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 1513 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, i18n(), is_dragon_pl(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_INFO, NDI_UNIQUE, NROFATTACKS, object_find_by_type_and_arch_name(), and obj::resist.

Here is the call graph for this function:

void command_rules ( object op,
const char *  params 
)

Display the server rules.

Parameters
opplayer requesting the rules.
paramsunused.

Definition at line 181 of file c_misc.c.

References send_rules().

Here is the call graph for this function:

void command_save ( object op,
const char *  params 
)

Player wants to get saved.

Parameters
opplayer.
paramsunused.

Definition at line 2048 of file c_misc.c.

References draw_ext_info(), liv::exp, get_map_flags(), i18n(), obj::map, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, P_NO_CLERIC, save_player(), obj::stats, obj::x, and obj::y.

Here is the call graph for this function:

void command_showpets ( object op,
const char *  params 
)

Players wants to know her pets.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 1400 of file c_misc.c.

References liv::ac, liv::Cha, liv::Con, liv::dam, liv::Dex, draw_ext_info(), draw_ext_info_format(), first_friendly_object, liv::hp, i18n(), liv::Int, obj::level, liv::maxhp, liv::maxsp, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, obj::name, NDI_UNIQUE, oblnk::next, archt::next, oblnk::ob, object_get_owner(), liv::Pow, liv::sp, obj::stats, liv::Str, liv::wc, and liv::Wis.

Here is the call graph for this function:

void command_sound ( object op,
const char *  params 
)

Player wants to change sound status.

Parameters
opplayer asking for change.
paramsunused.

Definition at line 1865 of file c_misc.c.

References obj::contr, draw_ext_info(), i18n(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, SND_MUTE, pl::socket, and socket_struct::sound.

Here is the call graph for this function:

void command_ssdumptable ( object op,
const char *  params 
)

Various string-related statistics.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 950 of file c_misc.c.

References SS_DUMP_TABLE, and ss_dump_table().

Here is the call graph for this function:

void command_statistics ( object pl,
const 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.

Add preliminary damage per second calculations here

Definition at line 1045 of file c_misc.c.

References obj::arch, liv::Cha, archt::clone, liv::Con, obj::contr, liv::dam, liv::Dex, draw_ext_info(), draw_ext_info_format(), liv::exp, obj::expmul, FMT64, i18n(), liv::Int, obj::level, level_exp(), MAX_BUF, max_time, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_STATISTICS, NDI_UNIQUE, pl::orig_stats, pl::peaceful, liv::Pow, safe_strncpy, seconds(), obj::stats, liv::Str, pl::ticks_played, obj::weapon_speed, and liv::Wis.

Here is the call graph for this function:

void command_strings ( object op,
const char *  params 
)

Various string-related statistics.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 774 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:

void command_time ( object op,
const char *  params 
)

Players asks for the time.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 794 of file c_misc.c.

References time_info().

Here is the call graph for this function:

void command_title ( object op,
const char *  params 
)

Player wishes to change her title.

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

Definition at line 1997 of file c_misc.c.

References obj::contr, draw_ext_info(), FALSE, i18n(), is_dragon_pl(), MAX_BUF, MAX_NAME, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, player_get_title(), player_has_own_title(), player_set_own_title(), Settings::set_title, settings, and snprintf.

Here is the call graph for this function:

void command_unarmed_skill ( object op,
const char *  params 
)

Player wants to change prefered unarmed skill.

Parameters
opplayer asking for change.
paramsnew mode.

Definition at line 1300 of file c_misc.c.

References add_string(), obj::contr, draw_ext_info_format(), find_skill_by_name(), free_string(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, obj::subtype, and pl::unarmed_skill.

Here is the call graph for this function:

void command_usekeys ( object op,
const char *  params 
)

Player wants to change how keys are used.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 1472 of file c_misc.c.

References containers, obj::contr, draw_ext_info_format(), i18n(), key_inventory, keyrings, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, types, and pl::usekeys.

Here is the call graph for this function:

void command_version ( object op,
const char *  params 
)

Server version.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 1001 of file c_misc.c.

References draw_ext_info_format(), FULL_VERSION, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_VERSION, and NDI_UNIQUE.

Here is the call graph for this function:

void command_whereabouts ( object op,
const char *  params 
)

'whereabouts' command.

Displays how many players are in which regions.

Parameters
opplayer requesting information.
paramsunused.

Definition at line 418 of file c_misc.c.

References regiondef::counter, draw_ext_info(), draw_ext_info_format(), first_player, first_region, get_region_by_map(), get_region_longname(), i18n(), llevError, LOG(), regiondef::longname, obj::map, 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:

void command_whereami ( object op,
const char *  params 
)

'whereami' command.

Parameters
opplayer requesting the information.
paramsunused.

Definition at line 750 of file c_misc.c.

References current_region_info().

Here is the call graph for this function:

void command_who ( object op,
const char *  params 
)

'who' command.

Parameters
opplayer requesting the information.
paramsoptional region to limit the information to.

Definition at line 557 of file c_misc.c.

References get_region_from_string(), and list_players().

Here is the call graph for this function:

void command_wimpy ( object op,
const char *  params 
)

Player wants to change how soon she'll flee.

Parameters
opplayer.
paramsnew value.

Definition at line 2090 of file c_misc.c.

References draw_ext_info_format(), i18n(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, and obj::run_away.

Here is the call graph for this function:

void command_wizcast ( object op,
const char *  params 
)

Wizard toggling "cast everywhere" ability.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 884 of file c_misc.c.

References CLEAR_FLAG, draw_ext_info(), FLAG_WIZCAST, i18n(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, onoff_value(), QUERY_FLAG, and SET_FLAG.

Here is the call graph for this function:

void command_wizpass ( object op,
const char *  params 
)

Wizard toggling wall-crossing.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 854 of file c_misc.c.

References CLEAR_FLAG, draw_ext_info(), FLAG_WIZPASS, i18n(), 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 363 of file c_misc.c.

References mapdef::difficulty, draw_ext_info(), draw_ext_info_format(), FLAG_WIZ, get_region_by_map(), get_region_longname(), i18n(), obj::map, 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 341 of file c_misc.c.

References draw_ext_info_format(), get_name_of_region_for_map(), get_region_by_name(), get_region_longname(), get_region_msg(), i18n(), obj::map, 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 574 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:

void do_harvest ( object pl,
int  dir,
object skill 
)
static int find_help_file ( const char *  name,
const char *  language,
int  wiz,
char *  path,
int  length 
)
static

Find an appropriate help file.

Will search regular commands, and wizard ones if asked for. Specified language is tried, as well as English. 'path' is altered whatever the return value.

Parameters
namecommand name.
languageplayer language.
wizif 1 the wizard-related files are searched, else no.
pathbuffer to contain the found help file.
lengthlength of path.
Returns
1 if a file was found in which case path contains the path, else 0.

Definition at line 1666 of file c_misc.c.

References Settings::datadir, S_ISREG, settings, and snprintf.

Referenced by command_help().

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
  • 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 630 of file c_misc.c.

References obj::count, FLAG_AFK, FLAG_WIZ, get_name_of_region_for_map(), get_region_by_map(), get_region_longname(), socket_struct::host, socket_struct::is_bot, obj::level, obj::map, obj::name, mapdef::name, pl::ob, mapdef::path, pl::peaceful, player_get_title(), QUERY_FLAG, snprintf, and pl::socket.

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 1558 of file c_misc.c.

References closedir(), obj::contr, dirent::d_name, Settings::datadir, draw_ext_info(), HUGE_BUF, i18n(), i18n_get_language_code(), pl::language, 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 484 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_region_by_map(), pl::hidden, i18n(), socket_struct::is_bot, chars_names::login_order, regiondef::longname, obj::map, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_WHO, regiondef::name, obj::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:

static void malloc_info ( object op)
static

Sends various memory-related statistics.

Parameters
opplayer requesting the information.

Definition at line 203 of file c_misc.c.

References animations, draw_ext_info_format(), first_archetype, first_artifactlist, first_map, first_player, first_treasurelist, i18n(), mapdef::in_memory, MAP_IN_MEMORY, map_size(), archt::more, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_MALLOC, NDI_UNIQUE, artifactliststruct::next, treasureliststruct::next, pl::next, mapdef::next, archt::next, nrofallowedstr, nrofartifacts, nroftreasures, num_animations, object_count_active(), object_count_free(), and object_count_used().

Referenced by command_malloc().

Here is the call graph for this function:

Here is the caller graph for this function:

void map_info ( object op,
const char *  search 
)

This is the 'maps' command.

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

Definition at line 45 of file c_misc.c.

References mapdef::difficulty, draw_ext_info(), draw_ext_info_format(), FALSE, first_map, i18n(), 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(), safe_strncpy, 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 470 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 1808 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 1887 of file c_misc.c.

References check_name(), obj::contr, draw_ext_info(), FREE_AND_COPY, get_name(), get_password(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, obj::name, pl::name_changed, obj::name_pl, NDI_UNIQUE, and pl::write_buf.

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 1619 of file c_misc.c.

References Commands, CommandsSize, CommunicationCommands, CommunicationCommandSize, draw_ext_info(), HUGE_BUF, i18n(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_INFO, archt::name, 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: