Crossfire Server, Trunk
|
#include "global.h"
#include <assert.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 "assets.h"
#include "AssetsManager.h"
Go to the source code of this file.
Data Structures | |
struct | chars_names |
Macros | |
#define | WANT_UNARMED_SKILLS |
Functions | |
void | command_afk (object *op, const char *params) |
void | command_applymode (object *op, const char *params) |
void | command_body (object *op, const char *params) |
void | command_bowmode (object *op, const char *params) |
void | command_brace (object *op, const char *params) |
void | command_debug (object *op, const char *params) |
void | command_delete (object *op, const char *params) |
void | command_dumpallarchetypes (object *op, const char *params) |
void | command_dumpallmaps (object *op, const char *params) |
void | command_dumpallobjects (object *op, const char *params) |
void | command_dumpfriendlyobjects (object *op, const char *params) |
void | command_dumpmap (object *op, const char *params) |
void | command_fix_me (object *op, const char *params) |
void | command_help (object *op, const char *params) |
void | command_hiscore (object *op, const char *params) |
void | command_kill_pets (object *op, const char *params) |
void | command_language (object *op, const char *params) |
void | command_listen (object *op, const char *params) |
void | command_malloc (object *op, const char *params) |
void | command_mapinfo (object *op, const char *params) |
void | command_maps (object *op, const char *params) |
void | command_motd (object *op, const char *params) |
void | command_news (object *op, const char *params) |
void | command_passwd (object *pl, const char *params) |
void | command_peaceful (object *op, const char *params) |
void | command_petmode (object *op, const char *params) |
void | command_players (object *op, const char *params) |
void | command_printlos (object *op, const char *params) |
void | command_quit (object *op, const char *params) |
void | command_resistances (object *op, const char *params) |
void | command_rules (object *op, const char *params) |
void | command_save (object *op, const char *params) |
void | command_showpets (object *op, const char *params) |
void | command_sound (object *op, const char *params) |
void | command_ssdumptable (object *op, const char *params) |
void | command_statistics (object *pl, const char *params) |
void | command_strings (object *op, const char *params) |
void | command_time (object *op, const char *params) |
void | command_title (object *op, const char *params) |
void | command_unarmed_skill (object *op, const char *params) |
void | command_usekeys (object *op, const char *params) |
void | command_version (object *op, const char *params) |
void | command_whereabouts (object *op, const char *params) |
void | command_whereami (object *op, const char *params) |
void | command_who (object *op, const char *params) |
void | command_wimpy (object *op, const char *params) |
void | command_wizcast (object *op, const char *params) |
void | command_wizpass (object *op, const char *params) |
static void | current_map_info (object *op) |
static void | current_region_info (object *op) |
static void | display_help_file (object *op, const char *filename) |
static void | display_who_entry (object *op, player *pl, const char *format) |
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 int | find_help_file_in (const char *dir, const char *name, const char *language, char *path, int length) |
static void | get_who_escape_code_value (char *return_val, int size, const char letter, player *pl) |
static void | help_topics (object *op, int what) |
void | list_players (object *op, region *reg, partylist *party) |
static void | malloc_info (object *op) |
static void | map_info (object *op, const char *search) |
static int | name_cmp (const chars_names *c1, const chars_names *c2) |
static int | onoff_value (const char *line) |
void | receive_player_name (object *op, const char *name) |
void | receive_player_password (object *op, const char *password) |
Various functions. Handles misc. input request - things like hash table, malloc, maps, who, etc.
Definition in file c_misc.cpp.
#define WANT_UNARMED_SKILLS |
Definition at line 20 of file c_misc.cpp.
void command_afk | ( | object * | op, |
const char * | params | ||
) |
Toggles the afk status of a player. 'afk' command.
op | player to toggle status for. |
params | unused. |
Definition at line 775 of file c_misc.cpp.
References CLEAR_FLAG, draw_ext_info(), FLAG_AFK, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, give::op, roll-o-matic::params, QUERY_FLAG, SET_FLAG, and nlohmann::detail::void().
Referenced by commands_init().
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.
op | player asking for change. |
params | new mode. |
Definition at line 1277 of file c_misc.cpp.
References draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, give::op, roll-o-matic::params, types, unapply_always, unapply_never, and unapply_nochoice.
Referenced by commands_init().
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.
op | player to display body info for. |
params | unused |
Definition at line 175 of file c_misc.cpp.
References body_locations, 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, give::op, roll-o-matic::params, QUERY_FLAG, and nlohmann::detail::void().
Referenced by commands_init().
void command_bowmode | ( | object * | op, |
const char * | params | ||
) |
Player wants to change the bowmode, how arrows are fired.
op | player asking for change. |
params | new mode. |
Definition at line 1318 of file c_misc.cpp.
References bow_bestarrow, bow_nw, buf, draw_ext_info(), draw_ext_info_format(), is_valid_types_gen::found, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, give::op, roll-o-matic::params, rotate-tower::result, stringbuffer_append_printf(), stringbuffer_append_string(), stringbuffer_finish(), stringbuffer_new(), and types.
Referenced by commands_init().
void command_brace | ( | object * | op, |
const char * | params | ||
) |
Player toggles her braced status.
op | player. |
params | brace status (on/off). |
Definition at line 2172 of file c_misc.cpp.
References draw_ext_info(), fix_object(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, onoff_value(), give::op, and roll-o-matic::params.
Referenced by commands_init().
void command_debug | ( | object * | op, |
const char * | params | ||
) |
Player wants to see/change the debug level.
op | player asking for information. |
params | new debug value. |
Definition at line 893 of file c_misc.cpp.
References Settings::debug, draw_ext_info_format(), FABS, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, give::op, roll-o-matic::params, and settings.
Referenced by commands_init().
void command_delete | ( | object * | op, |
const char * | params | ||
) |
Player wants to totally delete her character.
op | player wanting to delete her character. |
params | unused. |
Definition at line 1889 of file c_misc.cpp.
References CS_QUERY_SINGLECHAR, draw_ext_info(), FLAG_WIZ, i18n(), MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, NDI_UNIQUE, give::op, roll-o-matic::params, player_set_state(), QUERY_FLAG, send_query(), ST_CONFIRM_QUIT, and nlohmann::detail::void().
Referenced by commands_init().
void command_dumpallarchetypes | ( | object * | op, |
const char * | params | ||
) |
Various archetypes-related statistics.
op | player asking for information. |
params | unused. |
Definition at line 1005 of file c_misc.cpp.
References dump_all_archetypes(), give::op, roll-o-matic::params, and nlohmann::detail::void().
Referenced by commands_init().
void command_dumpallmaps | ( | object * | op, |
const char * | params | ||
) |
Various map-related statistics.
op | player asking for information. |
params | unused. |
Definition at line 1047 of file c_misc.cpp.
References dump_all_maps(), give::op, roll-o-matic::params, and nlohmann::detail::void().
Referenced by commands_init().
void command_dumpallobjects | ( | object * | op, |
const char * | params | ||
) |
Various object-related statistics.
op | player asking for information. |
params | unused. |
Definition at line 977 of file c_misc.cpp.
References object_dump_all(), give::op, roll-o-matic::params, and nlohmann::detail::void().
Referenced by commands_init().
void command_dumpfriendlyobjects | ( | object * | op, |
const char * | params | ||
) |
Various friendly object-related statistics.
op | player asking for information. |
params | unused. |
Definition at line 991 of file c_misc.cpp.
References dump_friendly_objects(), give::op, roll-o-matic::params, and nlohmann::detail::void().
Referenced by commands_init().
void command_dumpmap | ( | object * | op, |
const char * | params | ||
) |
Various map-related statistics.
op | player asking for information. |
params | unused. |
Definition at line 1033 of file c_misc.cpp.
References dump_map(), give::op, roll-o-matic::params, and nlohmann::detail::void().
Referenced by commands_init().
void command_fix_me | ( | object * | op, |
const char * | params | ||
) |
Wrapper to fix a player.
op | player asking to be fixed. |
params | unused. |
Definition at line 1213 of file c_misc.cpp.
References fix_object(), object_sum_weight(), give::op, roll-o-matic::params, and nlohmann::detail::void().
Referenced by commands_init().
void command_help | ( | object * | op, |
const char * | params | ||
) |
Player is asking for some help.
op | player asking for information. |
params | what kind of help to ask for. |
Definition at line 1772 of file c_misc.cpp.
References command_list(), Settings::datadir, display_help_file(), draw_ext_info_format(), npc_dialog::filename, find_help_file(), FLAG_WIZ, help_topics(), i18n_get_language_code(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_INFO, NDI_UNIQUE, give::op, roll-o-matic::params, QUERY_FLAG, and settings.
void command_hiscore | ( | object * | op, |
const char * | params | ||
) |
Player is asking for the hiscore.
op | player asking for information. |
params | options for the hiscore command (typically a match for the names) |
Definition at line 881 of file c_misc.cpp.
References hiscore_display(), give::op, and roll-o-matic::params.
Referenced by commands_init().
void command_kill_pets | ( | object * | op, |
const char * | params | ||
) |
Player wants to get rid of pets.
op | player. |
params | unused. |
Definition at line 2196 of file c_misc.cpp.
References draw_ext_info(), draw_ext_info_format(), FLAG_REMOVED, free_objectlink(), get_friends_of(), guildoracle::list, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, objectlink::next, guildjoin::ob, objectlink::ob, object_free_drop_inventory(), object_get_owner(), object_remove(), give::op, roll-o-matic::params, pets_terminate_all(), QUERY_FLAG, remove_friendly_object(), and strcasecmp().
Referenced by commands_init().
void command_language | ( | object * | op, |
const char * | params | ||
) |
This is the 'language' command.
op | player requesting the information. |
params | optional language code ("en", "fr", etc.) |
Definition at line 132 of file c_misc.cpp.
References draw_ext_info(), draw_ext_info_format(), i18n_find_language_by_code(), i18n_list_languages(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, give::op, and roll-o-matic::params.
Referenced by commands_init().
void command_listen | ( | object * | op, |
const char * | params | ||
) |
Change the player's listen level.
op | player asking for information. |
params | unused. |
Definition at line 1090 of file c_misc.cpp.
References draw_ext_info_format(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, give::op, and roll-o-matic::params.
Referenced by commands_init().
void command_malloc | ( | object * | op, |
const char * | params | ||
) |
Display memory information.
op | player requesting information. |
params | unused. |
Definition at line 796 of file c_misc.cpp.
References malloc_info(), give::op, roll-o-matic::params, and nlohmann::detail::void().
Referenced by commands_init().
void command_mapinfo | ( | object * | op, |
const char * | params | ||
) |
'mapinfo' command.
op | player requesting the information. |
params | unused. |
Definition at line 809 of file c_misc.cpp.
References current_map_info(), give::op, roll-o-matic::params, and nlohmann::detail::void().
Referenced by commands_init().
void command_maps | ( | object * | op, |
const char * | params | ||
) |
'maps' command.
op | player requesting the information. |
params | region to restrict to. |
Definition at line 835 of file c_misc.cpp.
References map_info(), give::op, and roll-o-matic::params.
Referenced by commands_init().
void command_motd | ( | object * | op, |
const char * | params | ||
) |
Display the message of the day.
op | player requesting the motd. |
params | unused. |
Definition at line 217 of file c_misc.cpp.
References display_motd(), give::op, roll-o-matic::params, and nlohmann::detail::void().
Referenced by commands_init().
void command_news | ( | object * | op, |
const char * | params | ||
) |
Display the server news.
op | player requesting the news. |
params | unused. |
Definition at line 243 of file c_misc.cpp.
References give::op, roll-o-matic::params, send_news(), and nlohmann::detail::void().
Referenced by commands_init().
void command_passwd | ( | object * | pl, |
const char * | params | ||
) |
Player is asking to change password.
pl | player. |
params | unused. |
Definition at line 2239 of file c_misc.cpp.
References CS_QUERY_HIDEINPUT, draw_ext_info(), i18n(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, roll-o-matic::params, altar_valkyrie::pl, player_set_state(), send_query(), ST_CHANGE_PASSWORD_OLD, and nlohmann::detail::void().
Referenced by commands_init().
void command_peaceful | ( | object * | op, |
const char * | params | ||
) |
Player toggles her peaceful status.
op | player. |
params | unused. |
Definition at line 2124 of file c_misc.cpp.
References draw_ext_info(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, give::op, roll-o-matic::params, and nlohmann::detail::void().
Referenced by commands_init().
void command_petmode | ( | object * | op, |
const char * | params | ||
) |
Player wants to change how her pets behave.
op | player asking for change. |
params | new mode. |
Definition at line 1437 of file c_misc.cpp.
References draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, give::op, roll-o-matic::params, pet_arena, pet_defend, pet_normal, pet_sad, and types.
Referenced by commands_init().
void command_players | ( | object * | op, |
const char * | params | ||
) |
Display all known players.
op | player asking for information. |
params | unused. |
Definition at line 1227 of file c_misc.cpp.
References buf, closedir(), draw_ext_info_format(), Settings::localdir, MAX_BUF, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, give::op, opendir(), roll-o-matic::params, Settings::playerdir, readdir(), settings, Floor::t, and nlohmann::detail::void().
Referenced by commands_init().
void command_printlos | ( | object * | op, |
const char * | params | ||
) |
Various LOS-related statistics.
op | player asking for information. |
params | unused. |
Definition at line 1061 of file c_misc.cpp.
References give::op, roll-o-matic::params, print_los(), and nlohmann::detail::void().
Referenced by commands_init().
void command_quit | ( | object * | op, |
const char * | params | ||
) |
Tell players to use the 'delete' command. Too many new players have accidentally deleted their characters because they didn't carefully read the warning that the original 'quit' command gave.
Definition at line 1873 of file c_misc.cpp.
References draw_ext_info(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, give::op, roll-o-matic::params, and nlohmann::detail::void().
Referenced by commands_init().
void command_resistances | ( | object * | op, |
const char * | params | ||
) |
Players wants to know her resistances.
op | player asking for information. |
params | unused. |
Definition at line 1597 of file c_misc.cpp.
References ATNR_INTERNAL, atnr_is_dragon_enabled(), attacktype_desc, change_resist_msg, draw_ext_info(), draw_ext_info_format(), FORCE, is_dragon_pl(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_INFO, NDI_UNIQUE, NROFATTACKS, object_find_by_type_and_arch_name(), give::op, roll-o-matic::params, Ice::tmp, and nlohmann::detail::void().
Referenced by commands_init().
void command_rules | ( | object * | op, |
const char * | params | ||
) |
Display the server rules.
op | player requesting the rules. |
params | unused. |
Definition at line 230 of file c_misc.cpp.
References give::op, roll-o-matic::params, send_rules(), and nlohmann::detail::void().
Referenced by commands_init().
void command_save | ( | object * | op, |
const char * | params | ||
) |
Player wants to get saved.
op | player. |
params | unused. |
Definition at line 2098 of file c_misc.cpp.
References draw_ext_info(), get_map_flags(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, give::op, P_NO_CLERIC, roll-o-matic::params, save_player(), and nlohmann::detail::void().
Referenced by commands_init().
void command_showpets | ( | object * | op, |
const char * | params | ||
) |
Players wants to know her pets.
op | player asking for information. |
params | unused. |
Definition at line 1481 of file c_misc.cpp.
References draw_ext_info(), draw_ext_info_format(), free_objectlink(), get_friends_of(), guildoracle::list, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, objectlink::next, guildjoin::ob, objectlink::ob, give::op, and roll-o-matic::params.
Referenced by commands_init().
void command_sound | ( | object * | op, |
const char * | params | ||
) |
Player wants to change sound status.
op | player asking for change. |
params | unused. |
Definition at line 1910 of file c_misc.cpp.
References draw_ext_info(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, give::op, roll-o-matic::params, SND_MUTE, and nlohmann::detail::void().
Referenced by commands_init().
void command_ssdumptable | ( | object * | op, |
const char * | params | ||
) |
Various string-related statistics.
op | player asking for information. |
params | unused. |
Definition at line 1019 of file c_misc.cpp.
References give::op, roll-o-matic::params, SS_DUMP_TABLE, ss_dump_table(), and nlohmann::detail::void().
Referenced by commands_init().
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.
pl | player asking for information. |
params | unused. |
Add preliminary damage per second calculations here
Definition at line 1121 of file c_misc.cpp.
References buf, draw_ext_info(), draw_ext_info_format(), FMT64, i18n(), level_exp(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_STATISTICS, NDI_UNIQUE, roll-o-matic::params, altar_valkyrie::pl, safe_strncpy, seconds(), tick_duration, and nlohmann::detail::void().
Referenced by commands_init().
void command_strings | ( | object * | op, |
const char * | params | ||
) |
Various string-related statistics.
op | player asking for information. |
params | unused. |
Definition at line 847 of file c_misc.cpp.
References draw_ext_info(), draw_ext_info_format(), HUGE_BUF, MSG_TYPE_COMMAND, MSG_TYPE_LAST, NDI_UNIQUE, give::op, roll-o-matic::params, ss_dump_statistics(), ss_dump_table(), SS_DUMP_TOTALS, and nlohmann::detail::void().
Referenced by commands_init().
void command_time | ( | object * | op, |
const char * | params | ||
) |
Players asks for the time.
op | player asking for information. |
params | unused. |
Definition at line 868 of file c_misc.cpp.
References give::op, roll-o-matic::params, time_info(), and nlohmann::detail::void().
Referenced by commands_init().
void command_title | ( | object * | op, |
const char * | params | ||
) |
Player wishes to change her title.
op | player asking for change. |
params | new title. |
Definition at line 2047 of file c_misc.cpp.
References buf, draw_ext_info(), FALSE, HUGE_BUF, is_dragon_pl(), MAX_BUF, MAX_NAME, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, give::op, roll-o-matic::params, player_get_title(), player_has_own_title(), player_set_own_title(), Settings::set_title, settings, and Ice::tmp.
Referenced by commands_init().
void command_unarmed_skill | ( | object * | op, |
const char * | params | ||
) |
Player wants to change prefered unarmed skill
op | player asking for change. |
params | new mode. |
Definition at line 1381 of file c_misc.cpp.
References add_string(), draw_ext_info_format(), find_skill_by_name(), free_string(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, MSG_TYPE_COMMAND_ERROR, object::name, NDI_UNIQUE, give::op, roll-o-matic::params, and object::subtype.
Referenced by commands_init().
void command_usekeys | ( | object * | op, |
const char * | params | ||
) |
Player wants to change how keys are used.
op | player asking for information. |
params | unused. |
Definition at line 1556 of file c_misc.cpp.
References containers, draw_ext_info_format(), key_inventory, keyrings, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, give::op, roll-o-matic::params, and types.
Referenced by commands_init().
void command_version | ( | object * | op, |
const char * | params | ||
) |
Server version.
op | player asking for information. |
params | unused. |
Definition at line 1076 of file c_misc.cpp.
References draw_ext_info_format(), FULL_VERSION, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_VERSION, NDI_UNIQUE, give::op, roll-o-matic::params, and nlohmann::detail::void().
Referenced by commands_init().
void command_whereabouts | ( | object * | op, |
const char * | params | ||
) |
'whereabouts' command.
Displays how many players are in which regions.
op | player requesting information. |
params | unused. |
Definition at line 484 of file c_misc.cpp.
References all_regions, region::counter, draw_ext_info(), draw_ext_info_format(), first_player, get_region_by_map(), get_region_longname(), llevError, LOG(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, give::op, roll-o-matic::params, altar_valkyrie::pl, and nlohmann::detail::void().
Referenced by commands_init().
void command_whereami | ( | object * | op, |
const char * | params | ||
) |
'whereami' command.
op | player requesting the information. |
params | unused. |
Definition at line 822 of file c_misc.cpp.
References current_region_info(), give::op, roll-o-matic::params, and nlohmann::detail::void().
Referenced by commands_init().
void command_who | ( | object * | op, |
const char * | params | ||
) |
'who' command.
op | player requesting the information. |
params | optional region to limit the information to. |
Definition at line 623 of file c_misc.cpp.
References get_region_from_string(), list_players(), give::op, and roll-o-matic::params.
Referenced by commands_init().
void command_wimpy | ( | object * | op, |
const char * | params | ||
) |
Player wants to change how soon she'll flee.
op | player. |
params | new value. |
Definition at line 2142 of file c_misc.cpp.
References draw_ext_info(), draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, give::op, and roll-o-matic::params.
Referenced by commands_init().
void command_wizcast | ( | object * | op, |
const char * | params | ||
) |
Wizard toggling "cast everywhere" ability.
op | player asking for information. |
params | unused. |
Definition at line 947 of file c_misc.cpp.
References CLEAR_FLAG, draw_ext_info(), FLAG_WIZCAST, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, onoff_value(), give::op, roll-o-matic::params, QUERY_FLAG, and SET_FLAG.
Referenced by commands_init().
void command_wizpass | ( | object * | op, |
const char * | params | ||
) |
Wizard toggling wall-crossing.
op | player asking for information. |
params | unused. |
Definition at line 917 of file c_misc.cpp.
References CLEAR_FLAG, draw_ext_info(), FLAG_WIZPASS, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, onoff_value(), give::op, roll-o-matic::params, QUERY_FLAG, and SET_FLAG.
Referenced by commands_init().
|
static |
'mapinfo' command.
op | player requesting the information. |
Definition at line 429 of file c_misc.cpp.
References draw_ext_info(), draw_ext_info_format(), FLAG_WIZ, get_region_by_map(), get_region_longname(), m, MAP_ENTER_X, MAP_ENTER_Y, MAP_HEIGHT, MAP_TIMEOUT, MAP_WIDTH, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, give::op, and QUERY_FLAG.
Referenced by command_mapinfo().
|
static |
'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.
op | player wanting information. |
Definition at line 407 of file c_misc.cpp.
References draw_ext_info_format(), get_name_of_region_for_map(), get_region_by_name(), get_region_longname(), get_region_msg(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, give::op, and ring_occidental_mages::r.
Referenced by command_whereami().
|
static |
Attempt to send the contents of the specified file to the player. If the file does not exist, then an error is logged to the server, and nothing is sent to the player.
op | who to send the file to. |
filename | full help filename. |
Definition at line 1749 of file c_misc.cpp.
References bufferreader_destroy(), bufferreader_init_from_file(), bufferreader_next_line(), draw_ext_info(), npc_dialog::filename, is_valid_types_gen::line, llevError, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_INFO, NDI_UNIQUE, and give::op.
Referenced by command_help().
Display a line of 'who' to op, about pl, using the formatting specified by format.
op | player getting the information. |
pl | player to display information for. |
format | format to display. |
Definition at line 640 of file c_misc.cpp.
References draw_ext_info(), get_who_escape_code_value(), llevError, LOG(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_WHO, NDI_UNIQUE, give::op, and altar_valkyrie::pl.
Referenced by list_players().
Player is trying to harvest something.
pl | player trying to harvest. |
dir | direction. |
skill | skill being used. |
In the past, things were made harvestable by adding randomitems. This is not ideal, because randomitems are treasurelist-generated on map load, which means that if common items (e.g. mountains) are harvestable, then we have to do a lot of extra work generating junk that probably nobody will use.
Instead of doing that, check for a harvestitems field. The value will be used as the name of a treasurelist and we only generate it when it is being harvested.
We still have to keep the old way of treasurelist harvestables working, even though this can be much slower.
Definition at line 2263 of file c_misc.cpp.
References change_exp(), disinfect::count, create_treasure(), draw_ext_info_format(), find_treasurelist(), FLAG_MONSTER, FOR_INV_FINISH, FOR_INV_PREPARE, is_valid_types_gen::found, FREE_OBJ_FREE_INVENTORY, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, get_weight_limit(), i18n(), INS_BELOW_ORIGINATOR, commongive::inv, IS_PLAYER(), say::item, object::level, level, llevError, LOG(), disinfect::map, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, object::name, NDI_WHITE, object_create_arch(), object_find_free_spot(), object_free(), object_get_value(), object_insert_in_map_at(), object_insert_in_ob(), object_remove(), object_set_value(), object_split(), object_value_set(), P_OUT_OF_MAP, altar_valkyrie::pl, QUERY_FLAG, random_roll(), rndm(), SIZEOFFREE, SK_EXP_ADD_SKILL, object::skill, object::slaying, sstring, Floor::t, try_find_archetype(), diamondslots::x, and diamondslots::y.
Referenced by do_skill().
|
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. Wizard help is searched first, to allow a different syntax of a regular command when run in DM.
name | command name. | |
language | player language. | |
wiz | if 1 the wizard-related files are searched, else no. | |
[out] | path | buffer to contain the found help file, modified. |
length | length of path. |
Definition at line 1726 of file c_misc.cpp.
References find_help_file_in(), give::name, and python_init::path.
Referenced by command_help().
|
static |
Find a (help) file in the specified subdirectory of data.
dir | subdirectory to search, 'help' or 'wizhelp'. | |
name | file name to look for. | |
language | language prefix. | |
[out] | path | modified to contain the full path of the tested file. |
length | maximum length of path. |
Definition at line 1703 of file c_misc.cpp.
References Settings::datadir, give::name, python_init::path, and settings.
Referenced by find_help_file().
|
static |
Returns the value of the escape code used in the who format specifier.
Specifier values are:
[out] | return_val | buffer that will contain the information. |
size | length of return_val. | |
letter | format specifier. | |
pl | player to get information for. |
Definition at line 696 of file c_misc.cpp.
References FLAG_AFK, FLAG_WIZ, get_name_of_region_for_map(), get_region_by_map(), get_region_longname(), altar_valkyrie::pl, player_get_title(), QUERY_FLAG, and strlcpy().
Referenced by display_who_entry().
|
static |
Player wants to know available help topics.
op | player asking for information. |
what |
|
Definition at line 1643 of file c_misc.cpp.
References closedir(), Settings::datadir, draw_ext_info(), npc_dialog::filename, HUGE_BUF, i18n_get_language_code(), is_valid_types_gen::line, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_INFO, NAMLEN, NDI_UNIQUE, give::op, opendir(), readdir(), settings, and castle_read::suffix.
Referenced by command_help().
Displays the players in a region or party. If both are NULL, all players are listed.
op | who is asking for player list. |
reg | region to display players of. |
party | party to list. |
Definition at line 550 of file c_misc.cpp.
References display_who_entry(), draw_ext_info(), draw_ext_info_format(), find_player(), first_player, FLAG_AFK, FLAG_WIZ, get_region_by_map(), chars_names::login_order, region::longname, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_WHO, region::name, name_cmp(), NDI_UNIQUE, give::op, partylist::partyname, altar_valkyrie::pl, QUERY_FLAG, region_is_child_of_region(), settings, ST_GET_PARTY_PASSWORD, ST_PLAYING, Settings::who_format, and Settings::who_wiz_format.
Referenced by command_party(), and command_who().
|
static |
Sends various memory-related statistics.
op | player requesting the information. |
Definition at line 254 of file c_misc.cpp.
References AssetsManager::animations(), make_face_from_files::anims, AssetsManager::archetypes(), assets_number_of_treasurelists(), assets_number_of_treasures(), AssetsCollection< T, Key >::count(), draw_ext_info_format(), first_artifactlist, first_map, first_player, getManager(), m, MAP_IN_MEMORY, map_size(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_MALLOC, NDI_UNIQUE, artifactlist::next, nrofallocobjects, nrofallowedstr, nrofartifacts, nroffreeobjects, diamondslots::object, object_count_active(), object_count_free(), object_count_used(), give::op, altar_valkyrie::pl, and players.
Referenced by command_malloc().
|
static |
This is the 'maps' command.
op | player requesting the information. |
search | optional substring to search for. |
Definition at line 52 of file c_misc.cpp.
References draw_ext_info(), draw_ext_info_format(), FALSE, first_map, FLAG_WIZ, m, map_path(), MAP_WHEN_RESET, push::match, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_MAPS, NDI_UNIQUE, give::op, QUERY_FLAG, safe_strncpy, seconds(), set_map_reset_time(), split_string(), and TRUE.
Referenced by command_maps().
|
static |
Local function for qsort comparison.
c1 | |
c2 | players to compare. |
Definition at line 536 of file c_misc.cpp.
References chars_names::namebuf, and strcasecmp().
Referenced by list_players().
|
static |
Utility function to convert a reply to a yes/no or on/off value.
line | string to check. |
1 | line is one of on y k s d. |
0 | other value. |
Definition at line 1839 of file c_misc.cpp.
References is_valid_types_gen::line.
Referenced by command_brace(), command_wizcast(), and command_wizpass().
void receive_player_name | ( | object * | op, |
const char * | name | ||
) |
A player just entered her name.
Perhaps these should be in player.c, but that file is already a bit big.
op | player we're getting the name of. |
name | name the player entered. |
Definition at line 1935 of file c_misc.cpp.
References check_name(), draw_ext_info(), FREE_AND_COPY, get_name(), get_password(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, give::name, NDI_UNIQUE, and give::op.
Referenced by reply_cmd().
void receive_player_password | ( | object * | op, |
const char * | password | ||
) |
A player just entered her password, including for changing it.
op | player. |
password | password used. |
Definition at line 1955 of file c_misc.cpp.
References check_login(), check_password(), checkbanned(), CS_QUERY_HIDEINPUT, display_motd(), draw_ext_info(), get_name(), i18n(), llevInfo, LOG(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_RED, NDI_UNIQUE, newhash(), give::op, player_set_state(), roll_again(), safe_strncpy, send_query(), ST_CHANGE_PASSWORD_CONFIRM, ST_CHANGE_PASSWORD_NEW, ST_CHANGE_PASSWORD_OLD, ST_CONFIRM_PASSWORD, ST_PLAYING, and ST_ROLL_STAT.
Referenced by reply_cmd().