#include "copyright.h"
#include "config.h"
#include "mudconf.h"
#include "db.h"
#include "externs.h"
#include "interface.h"
#include "command.h"
#include "htab.h"
#include "alloc.h"
#include "attrs.h"
#include "flags.h"
#include "powers.h"
Include dependency graph for conf.c:
Go to the source code of this file.
Data Structures | |
struct | confparm |
Defines | |
#define | CACHE_DEPTH 10 |
#define | CACHE_WIDTH 20 |
Typedefs | |
typedef confparm | CONF |
Functions | |
void | cf_init (void) |
void | cf_log_notfound (dbref player, char *cmd, const char *thingname, char *thing) |
void | cf_log_syntax (dbref player, char *cmd, const char *template, char *arg) |
int | cf_status_from_succfail (dbref player, char *cmd, int success, int failure) |
int | cf_int (int *vp, char *str, long extra, dbref player, char *cmd) |
int | cf_bool (int *vp, char *str, long extra, dbref player, char *cmd) |
int | cf_option (int *vp, char *str, long extra, dbref player, char *cmd) |
int | cf_string (int *vp, char *str, long extra, dbref player, char *cmd) |
int | cf_alias (int *vp, char *str, long extra, dbref player, char *cmd) |
int | cf_flagalias (int *vp, char *str, long extra, dbref player, char *cmd) |
int | cf_or_in_bits (int *vp, char *str, long extra, dbref player, char *cmd) |
int | cf_modify_bits (int *vp, char *str, long extra, dbref player, char *cmd) |
int | cf_set_bits (int *vp, char *str, long extra, dbref player, char *cmd) |
int | cf_set_flags (int *vp, char *str, long extra, dbref player, char *cmd) |
int | cf_badname (int *vp, char *str, long extra, dbref player, char *cmd) |
int | cf_site (long **vp, char *str, long extra, dbref player, char *cmd) |
int | cf_cf_access (int *vp, char *str, long extra, dbref player, char *cmd) |
int | cf_include (int *vp, char *str, long extra, dbref player, char *cmd) |
int | cf_access (long *, char *, long, dbref, char *) |
int | cf_cmd_alias (long *, char *, long, dbref, char *) |
int | cf_acmd_access (long *, char *, long, dbref, char *) |
int | cf_attr_access (long *, char *, long, dbref, char *) |
int | cf_func_access (long *, char *, long, dbref, char *) |
int | cf_set (char *cp, char *ap, dbref player) |
void | do_admin (dbref player, dbref cause, int extra, char *kw, char *value) |
int | cf_read (char *fn) |
void | list_cf_access (dbref player) |
void | fun_config (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
Variables | |
CONFDATA | mudconf |
STATEDATA | mudstate |
NAMETAB | logdata_nametab [] |
NAMETAB | logoptions_nametab [] |
NAMETAB | access_nametab [] |
NAMETAB | attraccess_nametab [] |
NAMETAB | list_names [] |
CONF | conftable [] |
NAMETAB | bool_names [] |
CONF | conftable [] |
int cf_access | ( | long * | , | |
char * | , | |||
long | , | |||
dbref | , | |||
char * | ||||
) |
int cf_acmd_access | ( | long * | , | |
char * | , | |||
long | , | |||
dbref | , | |||
char * | ||||
) |
int cf_alias | ( | int * | vp, | |
char * | str, | |||
long | extra, | |||
dbref | player, | |||
char * | cmd | |||
) |
Definition at line 583 of file conf.c.
References cf_log_notfound(), hashadd(), hashfind(), strtok(), ToLower, and ToUpper.
00584 { 00585 char *alias, *orig, *p; 00586 int *cp = NULL; 00587 00588 alias = strtok(str, " \t=,"); 00589 orig = strtok(NULL, " \t=,"); 00590 if(orig) { 00591 for(p = orig; *p; p++) 00592 *p = ToLower(*p); 00593 cp = hashfind(orig, (HASHTAB *) vp); 00594 if(cp == NULL) { 00595 for(p = orig; *p; p++) 00596 *p = ToUpper(*p); 00597 cp = hashfind(orig, (HASHTAB *) vp); 00598 if(cp == NULL) { 00599 cf_log_notfound(player, cmd, "Entry", orig); 00600 return -1; 00601 } 00602 } 00603 } 00604 00605 if(cp == NULL) { 00606 return -1; 00607 } 00608 00609 hashadd(alias, cp, (HASHTAB *) vp); 00610 return 0; 00611 }
int cf_attr_access | ( | long * | , | |
char * | , | |||
long | , | |||
dbref | , | |||
char * | ||||
) |
int cf_badname | ( | int * | vp, | |
char * | str, | |||
long | extra, | |||
dbref | player, | |||
char * | cmd | |||
) |
Definition at line 835 of file conf.c.
References badname_add(), and badname_remove().
00836 { 00837 if(extra) 00838 badname_remove(str); 00839 else 00840 badname_add(str); 00841 return 0; 00842 }
int cf_bool | ( | int * | vp, | |
char * | str, | |||
long | extra, | |||
dbref | player, | |||
char * | cmd | |||
) |
Definition at line 524 of file conf.c.
References bool_names, GOD, and search_nametab().
00525 { 00526 *vp = (int) search_nametab(GOD, bool_names, str); 00527 if(*vp < 0) 00528 *vp = (long) 0; 00529 return 0; 00530 }
int cf_cf_access | ( | int * | vp, | |
char * | str, | |||
long | extra, | |||
dbref | player, | |||
char * | cmd | |||
) |
Definition at line 915 of file conf.c.
References cf_modify_bits(), conftable, confparm::flags, and confparm::pname.
00916 { 00917 CONF *tp; 00918 char *ap; 00919 00920 for(ap = str; *ap && !isspace(*ap); ap++); 00921 if(*ap) 00922 *ap++ = '\0'; 00923 00924 for(tp = conftable; tp->pname; tp++) { 00925 if(!strcmp(tp->pname, str)) { 00926 return (cf_modify_bits(&tp->flags, ap, extra, player, cmd)); 00927 } 00928 } 00929 cf_log_notfound(player, cmd, "Config directive", str); 00930 return -1; 00931 }
int cf_cmd_alias | ( | long * | , | |
char * | , | |||
long | , | |||
dbref | , | |||
char * | ||||
) |
int cf_flagalias | ( | int * | vp, | |
char * | str, | |||
long | extra, | |||
dbref | player, | |||
char * | cmd | |||
) |
Definition at line 618 of file conf.c.
References cf_log_notfound(), statedata::flags_htab, hashadd(), hashfind(), mudstate, and strtok().
00619 { 00620 char *alias, *orig; 00621 int *cp, success; 00622 00623 success = 0; 00624 alias = strtok(str, " \t=,"); 00625 orig = strtok(NULL, " \t=,"); 00626 00627 cp = hashfind(orig, &mudstate.flags_htab); 00628 if(cp != NULL) { 00629 hashadd(alias, cp, &mudstate.flags_htab); 00630 success++; 00631 } 00632 if(!success) 00633 cf_log_notfound(player, cmd, "Flag", orig); 00634 return ((success > 0) ? 0 : -1); 00635 }
int cf_func_access | ( | long * | , | |
char * | , | |||
long | , | |||
dbref | , | |||
char * | ||||
) |
int cf_include | ( | int * | vp, | |
char * | str, | |||
long | extra, | |||
dbref | player, | |||
char * | cmd | |||
) |
Definition at line 938 of file conf.c.
References alloc_lbuf, cf_log_notfound(), cf_set(), free_lbuf, statedata::initializing, LBUF_SIZE, and mudstate.
Referenced by cf_read().
00939 { 00940 FILE *fp; 00941 char *cp, *ap, *zp, *buf; 00942 00943 extern int cf_set(char *, char *, dbref); 00944 00945 if(!mudstate.initializing) 00946 return -1; 00947 00948 fp = fopen(str, "r"); 00949 if(fp == NULL) { 00950 cf_log_notfound(player, cmd, "Config file", str); 00951 return -1; 00952 } 00953 buf = alloc_lbuf("cf_include"); 00954 while (1) { 00955 if(!fgets(buf, LBUF_SIZE, fp)) 00956 break; 00957 cp = buf; 00958 if(!cp || !*cp || *cp == '#' || *cp == '\n') 00959 continue; 00960 00961 /* 00962 * Not a comment line or an empty one. Strip off the NL and any 00963 * characters following it. Then, split the line into the command 00964 * and argument portions (separated by a space). Also, trim off the 00965 * trailing comment, if any (delimited by #) 00966 */ 00967 00968 for(cp = buf; *cp && *cp != '\n'; cp++); 00969 *cp = '\0'; /* strip \n */ 00970 00971 for(cp = buf; *cp && isspace(*cp); cp++); /* strip spaces */ 00972 if(*cp == '\0') /* skip line if nothing left */ 00973 continue; 00974 00975 for(ap = cp; *ap && !isspace(*ap); ap++); /* skip over command */ 00976 if(*ap) 00977 *ap++ = '\0'; /* trim command */ 00978 00979 for(; *ap && isspace(*ap); ap++); /* skip spaces */ 00980 00981 for(zp = ap; *zp && (*zp != '#'); zp++); /* find comment */ 00982 00983 if(*zp) 00984 *zp = '\0'; /* zap comment */ 00985 00986 for(zp = zp - 1; zp >= ap && isspace(*zp); zp--) 00987 *zp = '\0'; /* zap trailing spaces */ 00988 00989 cf_set(cp, ap, player); 00990 } 00991 if(ferror(fp)) 00992 fprintf(stderr, "Error reading config file: %s\n", strerror(errno)); 00993 free_lbuf(buf); 00994 fclose(fp); 00995 return 0; 00996 }
void cf_init | ( | void | ) |
Definition at line 65 of file conf.c.
References A_USER_START, statedata::access_list, confdata::active_q_chunk, AF_ODARK, confdata::afterlife_dbref, confdata::afterscen_dbref, confdata::allow_chanlurking, confdata::allow_unloggedwho, statedata::attr_next, statedata::badname_head, confdata::btech_critlevel, confdata::btech_defaultweapbv, confdata::btech_defaultweapdam, confdata::btech_dig_only_fs, confdata::btech_digbonus, confdata::btech_divrotordamage, confdata::btech_dynspeed, confdata::btech_erange, confdata::btech_exile_stun_code, confdata::btech_explode_ammo, confdata::btech_explode_reactor, confdata::btech_explode_stop, confdata::btech_explode_time, confdata::btech_extendedmovemod, confdata::btech_fasaadvvhlcrit, confdata::btech_fasaadvvhlfire, confdata::btech_fasaadvvtolcrit, confdata::btech_fasacrit, confdata::btech_fasaturn, confdata::btech_glancing_blows, confdata::btech_hotloadaddshalfbthmod, confdata::btech_ic, confdata::btech_idf_requires_spotter, confdata::btech_inferno_penalty, confdata::btech_limitedrepairs, confdata::btech_moddamagewithrange, confdata::btech_moddamagewithwoods, confdata::btech_mw_losmap, confdata::btech_newcharge, confdata::btech_newstagger, confdata::btech_newterrain, confdata::btech_nofusionvtolfuel, confdata::btech_oldxpsystem, confdata::btech_ooc_comsys, confdata::btech_parts, confdata::btech_perunit_xpmod, confdata::btech_phys_use_pskill, confdata::btech_roll_on_backwalk, confdata::btech_seismic_see_stopped, confdata::btech_skidcliff, confdata::btech_slowdown, confdata::btech_stackdamage, confdata::btech_stacking, confdata::btech_stackpole, confdata::btech_tankfriendly, confdata::btech_tankshield, confdata::btech_tl3_charge, confdata::btech_usedmechstore, confdata::btech_vcrit, confdata::btech_vtol_ice_causes_fire, confdata::btech_xp_ammomod, confdata::btech_xp_bthmod, confdata::btech_xp_missilemod, confdata::btech_xp_modifier, confdata::btech_xp_usePilotBVMod, confdata::btech_xp_vrtmod, confdata::btech_xploss, confdata::cache_depth, CACHE_DEPTH, confdata::cache_names, confdata::cache_trim, confdata::cache_width, CACHE_WIDTH, confdata::check_interval, confdata::check_offset, confdata::clone_copy_cost, confdata::cmd_quota_incr, confdata::cmd_quota_max, confdata::commac_db, confdata::compress, confdata::compress_db, confdata::conc_port, confdata::conn_dir, confdata::conn_file, confdata::conn_timeout, confdata::control_flags, confdata::crashdb, confdata::crea_file, confdata::createmax, confdata::createmin, confdata::creg_file, statedata::curr_enactor, statedata::curr_player, confdata::dark_sleepers, alist::data, statedata::db_size, statedata::db_top, statedata::debug_cmd, confdata::default_home, confdata::digcost, statedata::doing_hdr, confdata::down_file, confdata::downmotd_msg, confdata::dump_interval, confdata::dump_msg, confdata::dump_offset, statedata::dumping, statedata::epoch, confdata::events_daily_hour, statedata::events_flag, statedata::events_lasthour, confdata::ex_flags, confdata::exam_public, confdata::exit_flags, confdata::exit_parent, confdata::exit_quota, confdata::fascist_tport, confdata::fixed_home_msg, confdata::fixed_tel_msg, confdata::fork_dump, confdata::fork_vfork, statedata::freelist, confdata::full_file, confdata::fullmotd_msg, statedata::func_invk_ctr, confdata::func_invk_lim, statedata::func_nest_lev, confdata::func_nest_lim, confdata::gdbm, statedata::generation, statedata::global_regs, confdata::guest_char, confdata::guest_file, confdata::guest_nuker, confdata::guest_prefix, confdata::guests_channel, confdata::have_comsys, confdata::have_macros, confdata::have_mailer, confdata::have_specials, confdata::have_zones, confdata::hcode_db, confdata::help_file, confdata::help_indx, confdata::idle_interval, confdata::idle_timeout, confdata::idle_wiz_dark, confdata::indb, confdata::indent_desc, confdata::init_size, statedata::initializing, statedata::inpipe, statedata::iter_alist, confdata::killguarantee, confdata::killmax, confdata::killmin, alist::len, confdata::linkcost, statedata::lock_nest_lev, confdata::lock_nest_lim, LOG_ALWAYS, LOG_BUGS, LOG_CONFIGMODS, LOG_DBSAVES, confdata::log_info, LOG_LOGIN, LOG_NET, confdata::log_options, LOG_PCREATES, LOG_PROBLEMS, LOG_SECURITY, LOG_SHOUTS, LOG_STARTUP, LOG_WIZARD, statedata::logging, LOGOPT_LOC, LOGOPT_TIMESTAMP, confdata::machinecost, confdata::mail_db, statedata::mail_db_size, statedata::mail_db_top, confdata::mail_expiration, statedata::mail_freelist, confdata::many_coins, confdata::map_db, statedata::markbits, confdata::markdata, confdata::master_room, confdata::match_mine, confdata::match_mine_pl, MAX_GLOBAL_REGS, confdata::max_players, confdata::mech_db, statedata::min_size, statedata::mod_al_id, statedata::mod_alist, statedata::mod_size, confdata::motd_file, confdata::motd_msg, statedata::mstat_curr, statedata::mstat_idrss, statedata::mstat_isrss, statedata::mstat_ixrss, statedata::mstat_secs, confdata::mud_name, mudconf, mudstate, confdata::name_spaces, confdata::namechange_days, confdata::news_file, confdata::news_indx, alist::next, NOTHING, statedata::ntfy_nest_lev, confdata::ntfy_nest_lim, confdata::number_guests, statedata::olist, confdata::one_coin, confdata::opencost, confdata::outdb, confdata::output_limit, confdata::pagecost, statedata::panicking, confdata::paranoid_alloc, confdata::parent_nest_lim, confdata::paycheck, confdata::payfind, confdata::paylimit, confdata::paystart, confdata::pemit_any, confdata::pemit_players, confdata::player_flags, confdata::player_listen, confdata::player_quota, confdata::plushelp_file, confdata::plushelp_indx, confdata::port, confdata::postdump_msg, statedata::pout, statedata::poutbufc, statedata::poutnew, statedata::poutobj, confdata::pub_flags, confdata::public_channel, statedata::qhead, statedata::qsemfirst, statedata::qsemlast, statedata::qtail, confdata::queue_chunk, confdata::queuemax, confdata::quiet_look, confdata::quiet_whisper, confdata::quit_file, confdata::quotas, statedata::qwait, confdata::read_rem_desc, confdata::read_rem_name, confdata::regf_file, confdata::retry_limit, ROBOT, confdata::robot_flags, confdata::robot_speak, confdata::robotcost, confdata::room_flags, confdata::room_parent, confdata::room_quota, SA_DFLT, confdata::sacadjust, confdata::sacfactor, confdata::safe_unowned, confdata::searchcost, confdata::see_own_dark, statedata::shutdown_flag, confdata::sig_action, confdata::site_chars, confdata::site_file, confdata::space_compress, confdata::stack_limit, confdata::start_home, confdata::start_quota, confdata::start_room, confdata::status_file, StringCopy, statedata::suspect_list, confdata::sweep_dark, confdata::switch_df_all, confdata::terse_contents, confdata::terse_exits, confdata::terse_look, confdata::terse_movemsg, confdata::thing_flags, confdata::thing_quota, confdata::timeslice, confdata::trace_limit, confdata::trace_topdown, confdata::uncompress, confdata::use_hostname, confdata::use_http, confdata::vattr_flags, confdata::waitcost, confdata::whelp_file, confdata::whelp_indx, confdata::wizmotd_file, confdata::wizmotd_msg, confdata::wiznews_file, confdata::wiznews_indx, flagset::word1, flagset::word2, confdata::zone_nest_lim, and statedata::zone_nest_num.
Referenced by main().
00066 { 00067 int i; 00068 00069 StringCopy(mudconf.indb, "tinymush.db"); 00070 StringCopy(mudconf.outdb, ""); 00071 StringCopy(mudconf.crashdb, ""); 00072 StringCopy(mudconf.gdbm, ""); 00073 StringCopy(mudconf.mail_db, "mail.db"); 00074 StringCopy(mudconf.commac_db, "commac.db"); 00075 StringCopy(mudconf.hcode_db, "hcode.db"); 00076 #ifdef BT_ADVANCED_ECON 00077 StringCopy(mudconf.econ_db, "econ.db"); 00078 #endif 00079 StringCopy(mudconf.mech_db, "mechs"); 00080 StringCopy(mudconf.map_db, "maps"); 00081 mudconf.compress_db = 0; 00082 StringCopy(mudconf.compress, "gzip"); 00083 StringCopy(mudconf.uncompress, "gzip -d"); 00084 StringCopy(mudconf.status_file, "shutdown.status"); 00085 mudconf.allow_unloggedwho = 0; 00086 mudconf.btech_explode_reactor = 1; 00087 mudconf.btech_explode_time = 120; 00088 mudconf.btech_explode_ammo = 1; 00089 mudconf.btech_explode_stop = 0; 00090 mudconf.btech_stackpole = 1; 00091 mudconf.btech_phys_use_pskill = 1; 00092 mudconf.btech_erange = 1; 00093 mudconf.btech_dig_only_fs = 0; 00094 mudconf.btech_digbonus = 3; 00095 mudconf.btech_vcrit = 2; 00096 mudconf.btech_dynspeed = 1; 00097 mudconf.btech_ic = 1; 00098 mudconf.btech_parts = 1; 00099 mudconf.btech_slowdown = 2; 00100 mudconf.btech_fasaturn = 1; 00101 mudconf.btech_fasacrit = 0; 00102 mudconf.btech_fasaadvvtolcrit = 0; 00103 mudconf.btech_fasaadvvhlcrit = 0; 00104 mudconf.btech_fasaadvvhlfire = 0; 00105 mudconf.btech_divrotordamage = 0; 00106 mudconf.btech_moddamagewithrange = 0; 00107 mudconf.btech_moddamagewithwoods = 0; 00108 mudconf.btech_hotloadaddshalfbthmod = 0; 00109 mudconf.btech_nofusionvtolfuel = 0; 00110 mudconf.btech_tankfriendly = 0; 00111 mudconf.btech_newterrain = 0; 00112 mudconf.btech_skidcliff = 0; 00113 mudconf.btech_xp_bthmod = 0; 00114 mudconf.btech_xp_missilemod = 100; 00115 mudconf.btech_xp_ammomod = 100; 00116 mudconf.btech_defaultweapdam = 5; 00117 mudconf.btech_xp_modifier = 100; 00118 mudconf.btech_defaultweapbv = 120; 00119 mudconf.btech_xp_usePilotBVMod = 1; 00120 mudconf.btech_oldxpsystem = 1; 00121 mudconf.btech_xp_vrtmod = 0; 00122 mudconf.btech_limitedrepairs = 0; 00123 mudconf.btech_newcharge = 0; 00124 mudconf.btech_tl3_charge = 0; 00125 mudconf.btech_xploss = 666; 00126 mudconf.btech_critlevel = 100; 00127 mudconf.btech_tankshield = 0; 00128 mudconf.btech_newstagger = 0; 00129 mudconf.btech_extendedmovemod = 1; 00130 mudconf.btech_stacking = 2; 00131 mudconf.btech_stackdamage = 100; 00132 mudconf.btech_mw_losmap = 1; 00133 mudconf.btech_seismic_see_stopped = 0; 00134 mudconf.btech_exile_stun_code = 0; 00135 mudconf.btech_roll_on_backwalk = 1; 00136 mudconf.btech_usedmechstore = 0; 00137 mudconf.btech_ooc_comsys = 0; 00138 mudconf.btech_idf_requires_spotter = 1; 00139 mudconf.btech_vtol_ice_causes_fire = 1; 00140 mudconf.btech_glancing_blows = 1; 00141 mudconf.btech_inferno_penalty = 0; 00142 mudconf.btech_perunit_xpmod = 1; 00143 #ifdef BT_FREETECHTIME 00144 mudconf.btech_freetechtime = 0; 00145 #endif 00146 #ifdef BT_COMPLEXREPAIRS 00147 mudconf.btech_complexrepair = 1; 00148 #endif 00149 #ifdef HUDINFO_SUPPORT 00150 mudconf.hudinfo_show_mapinfo = 0; 00151 mudconf.hudinfo_enabled; 00152 #endif 00153 mudconf.namechange_days = 60; 00154 mudconf.allow_chanlurking = 0; 00155 mudconf.afterlife_dbref = 220; 00156 mudconf.afterscen_dbref = 801; 00157 mudconf.port = 6250; 00158 mudconf.conc_port = 6251; 00159 mudconf.init_size = 1000; 00160 mudconf.guest_char = -1; 00161 mudconf.guest_nuker = 1; 00162 mudconf.number_guests = 30; 00163 StringCopy(mudconf.guest_prefix, "Guest"); 00164 StringCopy(mudconf.guest_file, "text/guest.txt"); 00165 StringCopy(mudconf.conn_file, "text/connect.txt"); 00166 StringCopy(mudconf.conn_dir, ""); 00167 StringCopy(mudconf.creg_file, "text/register.txt"); 00168 StringCopy(mudconf.regf_file, "text/create_reg.txt"); 00169 StringCopy(mudconf.motd_file, "text/motd.txt"); 00170 StringCopy(mudconf.wizmotd_file, "text/wizmotd.txt"); 00171 StringCopy(mudconf.quit_file, "text/quit.txt"); 00172 StringCopy(mudconf.down_file, "text/down.txt"); 00173 StringCopy(mudconf.full_file, "text/full.txt"); 00174 StringCopy(mudconf.site_file, "text/badsite.txt"); 00175 StringCopy(mudconf.crea_file, "text/newuser.txt"); 00176 StringCopy(mudconf.help_file, "text/help.txt"); 00177 StringCopy(mudconf.help_indx, "text/help.indx"); 00178 StringCopy(mudconf.news_file, "text/news.txt"); 00179 StringCopy(mudconf.news_indx, "text/news.indx"); 00180 StringCopy(mudconf.whelp_file, "text/wizhelp.txt"); 00181 StringCopy(mudconf.whelp_indx, "text/wizhelp.indx"); 00182 StringCopy(mudconf.plushelp_file, "text/plushelp.txt"); 00183 StringCopy(mudconf.plushelp_indx, "text/plushelp.indx"); 00184 StringCopy(mudconf.wiznews_file, "text/wiznews.txt"); 00185 StringCopy(mudconf.wiznews_indx, "text/wiznews.indx"); 00186 StringCopy(mudconf.motd_msg, ""); 00187 StringCopy(mudconf.wizmotd_msg, ""); 00188 StringCopy(mudconf.downmotd_msg, ""); 00189 StringCopy(mudconf.fullmotd_msg, ""); 00190 StringCopy(mudconf.dump_msg, ""); 00191 StringCopy(mudconf.postdump_msg, ""); 00192 StringCopy(mudconf.fixed_home_msg, ""); 00193 StringCopy(mudconf.fixed_tel_msg, ""); 00194 StringCopy(mudconf.public_channel, "Public"); 00195 StringCopy(mudconf.guests_channel, "Guests"); 00196 mudconf.indent_desc = 0; 00197 mudconf.name_spaces = 1; 00198 mudconf.fork_dump = 1; 00199 mudconf.fork_vfork = 0; 00200 mudconf.have_specials = 1; 00201 mudconf.have_comsys = 1; 00202 mudconf.have_macros = 1; 00203 mudconf.have_mailer = 1; 00204 mudconf.have_zones = 1; 00205 mudconf.paranoid_alloc = 0; 00206 mudconf.sig_action = SA_DFLT; 00207 mudconf.max_players = -1; 00208 mudconf.dump_interval = 3600; 00209 mudconf.check_interval = 600; 00210 mudconf.events_daily_hour = 7; 00211 mudconf.dump_offset = 0; 00212 mudconf.check_offset = 300; 00213 mudconf.idle_timeout = 3600; 00214 mudconf.conn_timeout = 120; 00215 mudconf.idle_interval = 60; 00216 mudconf.retry_limit = 3; 00217 mudconf.output_limit = 16384; 00218 mudconf.paycheck = 0; 00219 mudconf.paystart = 0; 00220 mudconf.paylimit = 10000; 00221 mudconf.start_quota = 20; 00222 mudconf.site_chars = 25; 00223 mudconf.payfind = 0; 00224 mudconf.digcost = 10; 00225 mudconf.linkcost = 1; 00226 mudconf.opencost = 1; 00227 mudconf.createmin = 10; 00228 mudconf.createmax = 505; 00229 mudconf.killmin = 10; 00230 mudconf.killmax = 100; 00231 mudconf.killguarantee = 100; 00232 mudconf.robotcost = 1000; 00233 mudconf.pagecost = 10; 00234 mudconf.searchcost = 100; 00235 mudconf.waitcost = 10; 00236 mudconf.machinecost = 64; 00237 mudconf.exit_quota = 1; 00238 mudconf.player_quota = 1; 00239 mudconf.room_quota = 1; 00240 mudconf.thing_quota = 1; 00241 mudconf.mail_expiration = 14; 00242 mudconf.use_http = 0; 00243 mudconf.queuemax = 100; 00244 mudconf.queue_chunk = 10; 00245 mudconf.active_q_chunk = 10; 00246 mudconf.sacfactor = 5; 00247 mudconf.sacadjust = -1; 00248 mudconf.use_hostname = 1; 00249 mudconf.quotas = 0; 00250 mudconf.ex_flags = 1; 00251 mudconf.robot_speak = 1; 00252 mudconf.clone_copy_cost = 0; 00253 mudconf.pub_flags = 1; 00254 mudconf.quiet_look = 1; 00255 mudconf.exam_public = 1; 00256 mudconf.read_rem_desc = 0; 00257 mudconf.read_rem_name = 0; 00258 mudconf.sweep_dark = 0; 00259 mudconf.player_listen = 0; 00260 mudconf.quiet_whisper = 1; 00261 mudconf.dark_sleepers = 1; 00262 mudconf.see_own_dark = 1; 00263 mudconf.idle_wiz_dark = 0; 00264 mudconf.pemit_players = 0; 00265 mudconf.pemit_any = 0; 00266 mudconf.match_mine = 0; 00267 mudconf.match_mine_pl = 0; 00268 mudconf.switch_df_all = 1; 00269 mudconf.fascist_tport = 0; 00270 mudconf.terse_look = 1; 00271 mudconf.terse_contents = 1; 00272 mudconf.terse_exits = 1; 00273 mudconf.terse_movemsg = 1; 00274 mudconf.trace_topdown = 1; 00275 mudconf.trace_limit = 200; 00276 mudconf.safe_unowned = 0; 00277 /* 00278 * -- ??? Running SC on a non-SC DB may cause problems 00279 */ 00280 mudconf.space_compress = 1; 00281 mudconf.start_room = 0; 00282 mudconf.start_home = -1; 00283 mudconf.default_home = -1; 00284 mudconf.master_room = -1; 00285 mudconf.player_flags.word1 = 0; 00286 mudconf.player_flags.word2 = 0; 00287 mudconf.room_flags.word1 = 0; 00288 mudconf.room_flags.word2 = 0; 00289 mudconf.exit_flags.word1 = 0; 00290 mudconf.exit_flags.word2 = 0; 00291 mudconf.thing_flags.word1 = 0; 00292 mudconf.thing_flags.word2 = 0; 00293 mudconf.robot_flags.word1 = ROBOT; 00294 mudconf.robot_flags.word2 = 0; 00295 mudconf.vattr_flags = AF_ODARK; 00296 StringCopy(mudconf.mud_name, "TinyMUX"); 00297 StringCopy(mudconf.one_coin, "penny"); 00298 StringCopy(mudconf.many_coins, "pennies"); 00299 mudconf.timeslice = 100; 00300 mudconf.cmd_quota_max = 100; 00301 mudconf.cmd_quota_incr = 5; 00302 mudconf.control_flags = 0xffffffff; /* 00303 * Everything for now... 00304 */ 00305 mudconf.log_options = 00306 LOG_ALWAYS | LOG_BUGS | LOG_SECURITY | LOG_NET | LOG_LOGIN | 00307 LOG_DBSAVES | LOG_CONFIGMODS | LOG_SHOUTS | LOG_STARTUP | 00308 LOG_WIZARD | LOG_PROBLEMS | LOG_PCREATES; 00309 mudconf.log_info = LOGOPT_TIMESTAMP | LOGOPT_LOC; 00310 mudconf.markdata[0] = 0x01; 00311 mudconf.markdata[1] = 0x02; 00312 mudconf.markdata[2] = 0x04; 00313 mudconf.markdata[3] = 0x08; 00314 mudconf.markdata[4] = 0x10; 00315 mudconf.markdata[5] = 0x20; 00316 mudconf.markdata[6] = 0x40; 00317 mudconf.markdata[7] = 0x80; 00318 mudconf.func_nest_lim = 50; 00319 mudconf.func_invk_lim = 2500; 00320 mudconf.ntfy_nest_lim = 20; 00321 mudconf.lock_nest_lim = 20; 00322 mudconf.parent_nest_lim = 10; 00323 mudconf.zone_nest_lim = 20; 00324 mudconf.stack_limit = 50; 00325 mudconf.cache_trim = 0; 00326 mudconf.cache_depth = CACHE_DEPTH; 00327 mudconf.cache_width = CACHE_WIDTH; 00328 mudconf.cache_names = 1; 00329 00330 mudstate.events_flag = 0; 00331 mudstate.events_lasthour = -1; 00332 mudstate.initializing = 0; 00333 mudstate.panicking = 0; 00334 mudstate.dumping = 0; 00335 mudstate.logging = 0; 00336 mudstate.epoch = 0; 00337 mudstate.generation = 0; 00338 mudstate.curr_player = NOTHING; 00339 mudstate.curr_enactor = NOTHING; 00340 mudstate.shutdown_flag = 0; 00341 mudstate.attr_next = A_USER_START; 00342 mudstate.debug_cmd = (char *) "< init >"; 00343 StringCopy(mudstate.doing_hdr, "Doing"); 00344 mudstate.access_list = NULL; 00345 mudstate.suspect_list = NULL; 00346 mudstate.qhead = NULL; 00347 mudstate.qtail = NULL; 00348 mudstate.qwait = NULL; 00349 mudstate.qsemfirst = NULL; 00350 mudstate.qsemlast = NULL; 00351 mudstate.badname_head = NULL; 00352 mudstate.mstat_ixrss[0] = 0; 00353 mudstate.mstat_ixrss[1] = 0; 00354 mudstate.mstat_idrss[0] = 0; 00355 mudstate.mstat_idrss[1] = 0; 00356 mudstate.mstat_isrss[0] = 0; 00357 mudstate.mstat_isrss[1] = 0; 00358 mudstate.mstat_secs[0] = 0; 00359 mudstate.mstat_secs[1] = 0; 00360 mudstate.mstat_curr = 0; 00361 mudstate.iter_alist.data = NULL; 00362 mudstate.iter_alist.len = 0; 00363 mudstate.iter_alist.next = NULL; 00364 mudstate.mod_alist = NULL; 00365 mudstate.mod_size = 0; 00366 mudstate.mod_al_id = NOTHING; 00367 mudstate.olist = NULL; 00368 mudstate.min_size = 0; 00369 mudstate.db_top = 0; 00370 mudstate.db_size = 0; 00371 mudstate.mail_db_top = 0; 00372 mudstate.mail_db_size = 0; 00373 mudstate.mail_freelist = 0; 00374 mudstate.freelist = NOTHING; 00375 mudstate.markbits = NULL; 00376 mudstate.func_nest_lev = 0; 00377 mudstate.func_invk_ctr = 0; 00378 mudstate.ntfy_nest_lev = 0; 00379 mudstate.lock_nest_lev = 0; 00380 mudstate.zone_nest_num = 0; 00381 mudstate.inpipe = 0; 00382 mudstate.pout = NULL; 00383 mudstate.poutnew = NULL; 00384 mudstate.poutbufc = NULL; 00385 mudstate.poutobj = -1; 00386 for(i = 0; i < MAX_GLOBAL_REGS; i++) 00387 mudstate.global_regs[i] = NULL; 00388 #ifdef SQL_SUPPORT 00389 memset(mudconf.sqlDB_type_A, '\0', 128); 00390 memset(mudconf.sqlDB_hostname_A, '\0', 128); 00391 memset(mudconf.sqlDB_username_A, '\0', 128); 00392 memset(mudconf.sqlDB_password_A, '\0', 128); 00393 memset(mudconf.sqlDB_dbname_A, '\0', 128); 00394 memset(mudconf.sqlDB_type_B, '\0', 128); 00395 memset(mudconf.sqlDB_hostname_B, '\0', 128); 00396 memset(mudconf.sqlDB_username_B, '\0', 128); 00397 memset(mudconf.sqlDB_password_B, '\0', 128); 00398 memset(mudconf.sqlDB_dbname_B, '\0', 128); 00399 memset(mudconf.sqlDB_type_C, '\0', 128); 00400 memset(mudconf.sqlDB_hostname_C, '\0', 128); 00401 memset(mudconf.sqlDB_username_C, '\0', 128); 00402 memset(mudconf.sqlDB_password_C, '\0', 128); 00403 memset(mudconf.sqlDB_dbname_C, '\0', 128); 00404 memset(mudconf.sqlDB_type_D, '\0', 128); 00405 memset(mudconf.sqlDB_hostname_D, '\0', 128); 00406 memset(mudconf.sqlDB_username_D, '\0', 128); 00407 memset(mudconf.sqlDB_password_D, '\0', 128); 00408 memset(mudconf.sqlDB_dbname_D, '\0', 128); 00409 memset(mudconf.sqlDB_type_E, '\0', 128); 00410 memset(mudconf.sqlDB_hostname_E, '\0', 128); 00411 memset(mudconf.sqlDB_username_E, '\0', 128); 00412 memset(mudconf.sqlDB_password_E, '\0', 128); 00413 memset(mudconf.sqlDB_dbname_E, '\0', 128); 00414 mudconf.sqlDB_init_A = 0; 00415 mudconf.sqlDB_init_B = 0; 00416 mudconf.sqlDB_init_C = 0; 00417 mudconf.sqlDB_init_D = 0; 00418 mudconf.sqlDB_init_E = 0; 00419 mudconf.sqlDB_max_queries = 4; 00420 memset(mudconf.sqlDB_mysql_socket, '\0', 128); 00421 #endif 00422 mudconf.exit_parent = 0; 00423 mudconf.room_parent = 0; 00424 }
int cf_int | ( | int * | vp, | |
char * | str, | |||
long | extra, | |||
dbref | player, | |||
char * | cmd | |||
) |
void cf_log_notfound | ( | dbref | player, | |
char * | cmd, | |||
const char * | thingname, | |||
char * | thing | |||
) |
Definition at line 430 of file conf.c.
References alloc_lbuf, free_lbuf, statedata::initializing, log_error(), LOG_STARTUP, mudstate, and notify.
00432 { 00433 char *buff; 00434 00435 if(mudstate.initializing) { 00436 log_error(LOG_STARTUP, "CNF", "NFND", "%s: %s %s not found.", cmd, 00437 thingname, thing); 00438 } else { 00439 buff = alloc_lbuf("cf_log_notfound"); 00440 sprintf(buff, "%s %s not found", thingname, thing); 00441 notify(player, buff); 00442 free_lbuf(buff); 00443 } 00444 }
void cf_log_syntax | ( | dbref | player, | |
char * | cmd, | |||
const char * | template, | |||
char * | arg | |||
) |
Definition at line 451 of file conf.c.
References statedata::initializing, log_error(), LOG_STARTUP, mudstate, and notify_printf().
Referenced by cf_site().
00452 { 00453 if(mudstate.initializing) { 00454 log_error(LOG_STARTUP, "CNF", "SYNTX", "%s: %s %s", cmd, template, arg); 00455 } else { 00456 notify_printf(player, template, arg); 00457 } 00458 }
int cf_modify_bits | ( | int * | vp, | |
char * | str, | |||
long | extra, | |||
dbref | player, | |||
char * | cmd | |||
) |
Definition at line 681 of file conf.c.
References cf_log_notfound(), cf_status_from_succfail(), GOD, search_nametab(), and strtok().
Referenced by cf_access(), cf_acmd_access(), cf_attr_access(), cf_cf_access(), cf_func_access(), and cf_ntab_access().
00682 { 00683 char *sp; 00684 int f, negate, success, failure; 00685 00686 /* 00687 * Walk through the tokens 00688 */ 00689 00690 success = failure = 0; 00691 sp = strtok(str, " \t"); 00692 while (sp != NULL) { 00693 00694 /* 00695 * Check for negation 00696 */ 00697 00698 negate = 0; 00699 if(*sp == '!') { 00700 negate = 1; 00701 sp++; 00702 } 00703 /* 00704 * Set or clear the appropriate bit 00705 */ 00706 00707 f = search_nametab(GOD, (NAMETAB *) extra, sp); 00708 if(f > 0) { 00709 if(negate) 00710 *vp &= ~f; 00711 else 00712 *vp |= f; 00713 success++; 00714 } else { 00715 cf_log_notfound(player, cmd, "Entry", sp); 00716 failure++; 00717 } 00718 00719 /* 00720 * Get the next token 00721 */ 00722 00723 sp = strtok(NULL, " \t"); 00724 } 00725 return cf_status_from_succfail(player, cmd, success, failure); 00726 }
int cf_option | ( | int * | vp, | |
char * | str, | |||
long | extra, | |||
dbref | player, | |||
char * | cmd | |||
) |
Definition at line 537 of file conf.c.
References cf_log_notfound(), GOD, and search_nametab().
00538 { 00539 int i; 00540 00541 i = search_nametab(GOD, (NAMETAB *) extra, str); 00542 if(i < 0) { 00543 cf_log_notfound(player, cmd, "Value", str); 00544 return -1; 00545 } 00546 *vp = i; 00547 return 0; 00548 }
int cf_or_in_bits | ( | int * | vp, | |
char * | str, | |||
long | extra, | |||
dbref | player, | |||
char * | cmd | |||
) |
Definition at line 642 of file conf.c.
References cf_log_notfound(), cf_status_from_succfail(), GOD, search_nametab(), and strtok().
00643 { 00644 char *sp; 00645 int f, success, failure; 00646 00647 /* 00648 * Walk through the tokens 00649 */ 00650 00651 success = failure = 0; 00652 sp = strtok(str, " \t"); 00653 while (sp != NULL) { 00654 00655 /* 00656 * Set the appropriate bit 00657 */ 00658 00659 f = search_nametab(GOD, (NAMETAB *) extra, sp); 00660 if(f > 0) { 00661 *vp |= f; 00662 success++; 00663 } else { 00664 cf_log_notfound(player, cmd, "Entry", sp); 00665 failure++; 00666 } 00667 00668 /* 00669 * Get the next token 00670 */ 00671 00672 sp = strtok(NULL, " \t"); 00673 } 00674 return cf_status_from_succfail(player, cmd, success, failure); 00675 }
int cf_read | ( | char * | fn | ) |
Definition at line 1660 of file conf.c.
References cf_include(), confdata::config_file, confdata::crashdb, confdata::gdbm, confdata::indb, statedata::initializing, mudconf, mudstate, confdata::outdb, and StringCopy.
Referenced by main().
01661 { 01662 int retval; 01663 01664 StringCopy(mudconf.config_file, fn); 01665 mudstate.initializing = 1; 01666 retval = cf_include(NULL, fn, 0, 0, (char *) "init"); 01667 mudstate.initializing = 0; 01668 01669 /* 01670 * Fill in missing DB file names 01671 */ 01672 01673 if(!*mudconf.outdb) { 01674 StringCopy(mudconf.outdb, mudconf.indb); 01675 strcat(mudconf.outdb, ".out"); 01676 } 01677 if(!*mudconf.crashdb) { 01678 StringCopy(mudconf.crashdb, mudconf.indb); 01679 strcat(mudconf.crashdb, ".CRASH"); 01680 } 01681 if(!*mudconf.gdbm) { 01682 StringCopy(mudconf.gdbm, mudconf.indb); 01683 strcat(mudconf.gdbm, ".gdbm"); 01684 } 01685 return retval; 01686 }
int cf_set | ( | char * | cp, | |
char * | ap, | |||
dbref | player | |||
) |
Definition at line 1603 of file conf.c.
References alloc_lbuf, check_access(), conftable, confparm::extra, confparm::flags, free_lbuf, statedata::initializing, confparm::interpreter, confparm::loc, LOG_CONFIGMODS, log_error(), mudstate, Name(), notify, confparm::pname, and StringCopy.
Referenced by cf_include(), and do_admin().
01604 { 01605 CONF *tp; 01606 int i; 01607 char *buff = NULL; 01608 01609 /* 01610 * Search the config parameter table for the command. If we find it, 01611 * call the handler to parse the argument. 01612 */ 01613 01614 for(tp = conftable; tp->pname; tp++) { 01615 if(!strcmp(tp->pname, cp)) { 01616 if(!mudstate.initializing && !check_access(player, tp->flags)) { 01617 notify(player, "Permission denied."); 01618 return (-1); 01619 } 01620 buff = alloc_lbuf("cf_set"); 01621 StringCopy(buff, ap); 01622 i = tp->interpreter(tp->loc, ap, tp->extra, player, cp); 01623 if(!mudstate.initializing) { 01624 log_error(LOG_CONFIGMODS, "CFG", "UPDAT", 01625 "%s entered config directive: %s with args '%s'. Status: %s%s%s%s", 01626 Name(player), cp, buff, (i==0?"Success":(i==1?"Partial success":(i==-1?"Failure":"Strange")))); 01627 01628 } 01629 free_lbuf(buff); 01630 return i; 01631 } 01632 } 01633 01634 /* 01635 * Config directive not found. Complain about it. 01636 */ 01637 01638 cf_log_notfound(player, (char *) "Set", "Config directive", cp); 01639 return (-1); 01640 }
int cf_set_bits | ( | int * | vp, | |
char * | str, | |||
long | extra, | |||
dbref | player, | |||
char * | cmd | |||
) |
Definition at line 733 of file conf.c.
References cf_log_notfound(), cf_status_from_succfail(), GOD, search_nametab(), and strtok().
00734 { 00735 char *sp; 00736 int f, success, failure; 00737 00738 /* 00739 * Walk through the tokens 00740 */ 00741 00742 success = failure = 0; 00743 *vp = 0; 00744 sp = strtok(str, " \t"); 00745 while (sp != NULL) { 00746 00747 /* 00748 * Set the appropriate bit 00749 */ 00750 00751 f = search_nametab(GOD, (NAMETAB *) extra, sp); 00752 if(f > 0) { 00753 *vp |= f; 00754 success++; 00755 } else { 00756 cf_log_notfound(player, cmd, "Entry", sp); 00757 failure++; 00758 } 00759 00760 /* 00761 * Get the next token 00762 */ 00763 00764 sp = strtok(NULL, " \t"); 00765 } 00766 return cf_status_from_succfail(player, cmd, success, failure); 00767 }
int cf_set_flags | ( | int * | vp, | |
char * | str, | |||
long | extra, | |||
dbref | player, | |||
char * | cmd | |||
) |
Definition at line 774 of file conf.c.
References cf_log_notfound(), FLAG_WORD2, FLAG_WORD3, flag_entry::flagflag, statedata::flags_htab, flag_entry::flagvalue, hashfind(), mudstate, and strtok().
00775 { 00776 char *sp; 00777 FLAGENT *fp; 00778 FLAGSET *fset; 00779 00780 int success, failure; 00781 00782 /* 00783 * Walk through the tokens 00784 */ 00785 00786 success = failure = 0; 00787 sp = strtok(str, " \t"); 00788 fset = (FLAGSET *) vp; 00789 00790 while (sp != NULL) { 00791 00792 /* 00793 * Set the appropriate bit 00794 */ 00795 00796 fp = (FLAGENT *) hashfind(sp, &mudstate.flags_htab); 00797 if(fp != NULL) { 00798 if(success == 0) { 00799 (*fset).word1 = 0; 00800 (*fset).word2 = 0; 00801 } 00802 if(fp->flagflag & FLAG_WORD3) 00803 (*fset).word3 |= fp->flagvalue; 00804 else if(fp->flagflag & FLAG_WORD2) 00805 (*fset).word2 |= fp->flagvalue; 00806 else 00807 (*fset).word1 |= fp->flagvalue; 00808 success++; 00809 } else { 00810 cf_log_notfound(player, cmd, "Entry", sp); 00811 failure++; 00812 } 00813 00814 /* 00815 * Get the next token 00816 */ 00817 00818 sp = strtok(NULL, " \t"); 00819 } 00820 if((success == 0) && (failure == 0)) { 00821 (*fset).word1 = 0; 00822 (*fset).word2 = 0; 00823 return 0; 00824 } 00825 if(success > 0) 00826 return ((failure == 0) ? 0 : 1); 00827 return -1; 00828 }
int cf_site | ( | long ** | vp, | |
char * | str, | |||
long | extra, | |||
dbref | player, | |||
char * | cmd | |||
) |
Definition at line 849 of file conf.c.
References site_data::address, cf_log_syntax(), site_data::flag, statedata::initializing, site_data::mask, mudstate, site_data::next, and strtok().
00850 { 00851 SITE *site, *last, *head; 00852 char *addr_txt, *mask_txt; 00853 struct in_addr addr_num, mask_num; 00854 00855 addr_txt = strtok(str, " \t=,"); 00856 mask_txt = NULL; 00857 if(addr_txt) 00858 mask_txt = strtok(NULL, " \t=,"); 00859 if(!addr_txt || !*addr_txt || !mask_txt || !*mask_txt) { 00860 cf_log_syntax(player, cmd, "Missing host address or mask.", (char *) ""); 00861 return -1; 00862 } 00863 00864 addr_num.s_addr = inet_addr(addr_txt); 00865 mask_num.s_addr = inet_addr(mask_txt); 00866 00867 if(addr_num.s_addr == -1) { 00868 cf_log_syntax(player, cmd, "Bad host address: ", addr_txt); 00869 return -1; 00870 } 00871 head = (SITE *) * vp; 00872 /* 00873 * Parse the access entry and allocate space for it 00874 */ 00875 00876 site = (SITE *) malloc(sizeof(SITE)); 00877 00878 /* 00879 * Initialize the site entry 00880 */ 00881 00882 site->address.s_addr = addr_num.s_addr; 00883 site->mask.s_addr = mask_num.s_addr; 00884 site->flag = extra; 00885 site->next = NULL; 00886 00887 /* 00888 * Link in the entry. Link it at the start if not initializing, at * 00889 * 00890 * * * * * * * * * * the end if initializing. This is so that 00891 * entries * in * the * config * * * file are processed as you would 00892 * think they * * would be, * while * entries * * made while running 00893 * are processed * * first. 00894 */ 00895 00896 if(mudstate.initializing) { 00897 if(head == NULL) { 00898 *vp = (long *) site; 00899 } else { 00900 for(last = head; last->next; last = last->next); 00901 last->next = site; 00902 } 00903 } else { 00904 site->next = head; 00905 *vp = (long *) site; 00906 } 00907 return 0; 00908 }
int cf_status_from_succfail | ( | dbref | player, | |
char * | cmd, | |||
int | success, | |||
int | failure | |||
) |
Definition at line 465 of file conf.c.
References statedata::initializing, log_error(), LOG_STARTUP, mudstate, and notify.
Referenced by cf_modify_bits(), cf_or_in_bits(), and cf_set_bits().
00466 { 00467 char *buff; 00468 00469 /* 00470 * If any successes, return SUCCESS(0) if no failures or * * * * * 00471 * PARTIAL_SUCCESS(1) if any failures. 00472 */ 00473 00474 if(success > 0) 00475 return ((failure == 0) ? 0 : 1); 00476 00477 /* 00478 * No successes. If no failures indicate nothing done. Always return 00479 * 00480 * * * * * * * * * * FAILURE(-1) 00481 */ 00482 00483 if(failure == 0) { 00484 if(mudstate.initializing) { 00485 log_error(LOG_STARTUP, "CNF", "NDATA", "%s: Nothing to set", cmd); 00486 } else { 00487 notify(player, "Nothing to set"); 00488 } 00489 } 00490 return -1; 00491 }
int cf_string | ( | int * | vp, | |
char * | str, | |||
long | extra, | |||
dbref | player, | |||
char * | cmd | |||
) |
Definition at line 555 of file conf.c.
References statedata::initializing, log_error(), LOG_STARTUP, mudstate, notify, and StringCopy.
Referenced by fun_config().
00556 { 00557 int retval; 00558 char *buff; 00559 00560 /* 00561 * Copy the string to the buffer if it is not too big 00562 */ 00563 00564 retval = 0; 00565 if(strlen(str) >= extra) { 00566 str[extra - 1] = '\0'; 00567 if(mudstate.initializing) { 00568 log_error(LOG_STARTUP, "CNF", "NFND", "%s: String truncated", cmd); 00569 } else { 00570 notify(player, "String truncated"); 00571 } 00572 retval = 1; 00573 } 00574 StringCopy((char *) vp, str); 00575 return retval; 00576 }
void fun_config | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1710 of file conf.c.
References CA_DISABLED, cf_string(), conftable, confparm::flags, confparm::interpreter, confparm::loc, confparm::pname, and safe_str.
01712 { 01713 CONF *cp; 01714 01715 for(cp = conftable; cp->pname; ++cp) { 01716 if(!strcmp(cp->pname, fargs[0])) { 01717 /* ::FIX:: [cad] little hack. I don't think it's necessairy to need god privs 01718 ** to read options so check_access doesn't work 01719 */ 01720 if(cp->flags == CA_DISABLED) { 01721 safe_str("#-1 PERMISSION DENIED", buff, bufc); 01722 return; 01723 } 01724 if(cp->interpreter == cf_string) { 01725 safe_str((char *) cp->loc, buff, bufc); 01726 return; 01727 } 01728 01729 /* [cad] bool can be returned as 0|1 or true|false softcoders should 01730 decide how they want it */ 01731 if(cp->interpreter == cf_int || cp->interpreter == cf_bool) { 01732 safe_tprintf_str(buff, bufc, "%d", *(int *) cp->loc); 01733 return; 01734 } 01735 01736 /* [cad] no other idea what to do with the hashtables and stuff */ 01737 safe_str("#-1 UNCONVERTABLE CONF TYPE", buff, bufc); 01738 return; 01739 } 01740 } 01741 safe_str("#-1", buff, bufc); 01742 }
void list_cf_access | ( | dbref | player | ) |
Definition at line 1692 of file conf.c.
References access_nametab, alloc_mbuf, check_access(), conftable, confparm::flags, God, listset_nametab(), and confparm::pname.
Referenced by do_list().
01693 { 01694 CONF *tp; 01695 char *buff; 01696 01697 buff = alloc_mbuf("list_cf_access"); 01698 for(tp = conftable; tp->pname; tp++) { 01699 if(God(player) || check_access(player, tp->flags)) { 01700 sprintf(buff, "%s:", tp->pname); 01701 listset_nametab(player, access_nametab, tp->flags, buff, 1); 01702 } 01703 } 01704 free_mbuf(buff); 01705 }
Definition at line 1008 of file conf.c.
Referenced by cf_cf_access(), cf_set(), fun_config(), and list_cf_access().
Definition at line 1008 of file conf.c.
Referenced by cf_cf_access(), cf_set(), fun_config(), and list_cf_access().
Definition at line 46 of file conf.c.
Referenced by AccumulateGunXP(), AccumulateGunXPold(), ai_crash(), ammo_explosion(), announce_connect(), announce_disconnect(), anum_extend(), AttackMovementMods(), autoeject(), can_see(), canpayfees(), cf_init(), cf_read(), char_xp_bonus(), ChargeMech(), check_access(), check_connect(), check_dead_refs(), check_events(), check_floating(), check_idle(), check_mail_expiration(), check_read_perms(), check_zone(), check_zone_for_player(), CheckDamage(), CheckGenericFail(), CheckWeaponFailed(), chown_all(), connect_player(), count_quota(), create_guest(), create_obj(), create_player(), crittable(), DamageMech(), db_grow(), db_read(), DeathFromAbove(), default_home(), desc_reload(), destroy_guest(), destroy_obj(), destroyable(), DestroyMech(), DestroyParts(), determineDamageFromHit(), dispatch(), DisplayTarget(), do_addcom(), do_allcom(), do_cemit(), do_chanlist(), do_channelwho(), do_chanstatus(), do_chboot(), do_chopen(), do_chown(), do_chzone(), do_clearcom(), do_clone(), do_comlist(), do_command(), do_comtitle(), do_createchannel(), do_delcom(), do_destroychannel(), do_editchannel(), do_entrances(), do_examine(), do_find(), do_global(), do_help(), do_kill(), do_list(), do_look(), do_mail(), do_mail_stats(), do_malias(), do_motd(), do_move(), do_name(), do_pcreate(), do_pemit(), do_pemit_list(), do_postpend(), do_prepend(), do_processcom(), do_queue(), do_quota(), do_restart(), do_score(), do_second(), do_set(), do_shutdown(), do_sweep(), do_switch(), do_teleport(), do_top(), do_unauth_command(), do_verb(), domino_space(), dump_database(), dump_database_internal(), dump_item(), dump_users(), eval_boolexp(), exam_wildattrs(), exec(), fcache_load(), find_wild_attrs(), FindAdvFasaVehicleHitLocation(), FindBTHByC3Range(), FindBTHByRange(), FindFasaHitLocation(), FindHitLocation(), FindHitLocation_CritProof(), FindNormalBTH(), FireWeaponNumber(), fork_and_dump(), fun_btparttype(), fun_cemit(), fun_clist(), fun_cobj(), fun_create(), fun_cwho(), fun_flags(), fun_fullname(), fun_hasflag(), fun_haspower(), fun_inzone(), fun_mudname(), fun_name(), fun_push(), fun_rloc(), fun_room(), fun_zfun(), fun_zone(), fun_zplayers(), fun_zwho(), get_stats(), give_money(), halt_que(), HandleCritical(), HandleOverheat(), heat_effect(), helpindex_load(), HitTarget(), In_IC_Loc(), init_timer(), initializesock(), KillMechContentsIfIC(), link_exit(), list_costs(), list_df_flags(), list_options(), load_game(), load_restart_db(), load_restart_db_xdr(), load_template(), load_xcode(), log_error(), log_name(), log_name_and_loc(), look_contents(), look_in(), look_simple(), main(), make_guest(), match_master_exit(), mech_axe(), mech_club(), mech_disembark(), mech_eject(), mech_explode(), mech_kickortrip(), mech_lrsmap(), mech_mace(), mech_navigate(), mech_punch(), mech_saw(), mech_sword(), mech_tacmap(), Missile_Hit(), MissileHitTarget(), mkattr(), move_mech(), move_object(), move_via_exit(), move_via_teleport(), Name(), network_initialize_socket(), NewHexEntered(), nfy_que(), notify_checked(), ok_player_name(), open_exit(), page_check(), parse_connect(), parse_to(), parse_to_cleanup(), pcache_reload1(), PhysicalAttack(), process_cmdent(), process_command(), process_enter_loc(), process_leave_loc(), PureName(), QueueMax(), reactor_explosion(), record_login(), runqueues(), s_Name(), SaveSpecialObjects(), search_setup(), set_attr_internal(), setup_que(), shovechars(), show_a_desc(), signal_BUS(), signal_SEGV(), sp_ok(), start_home(), start_log(), string_compare(), sweep_check(), TargetMovementMods(), tcache_add(), tele_contents(), TFUNC_LOC(), trimmed_site(), u_comp(), update_oweight(), update_quotas(), UpdateHeading(), UpdateSpeed(), wait_que(), where_room(), and wspec_fun().
Definition at line 47 of file conf.c.
Referenced by _logcache_list(), accept_new_connection(), add_count(), add_mail_message(), add_mail_message_nosig(), add_player_name(), aero_ControlEffect(), aero_update(), ai_check_path(), announce_connect(), announce_disconnect(), atr_match(), atr_match1(), atr_str(), auto_sensor_event(), auto_update_profile_event(), badname_add(), badname_check(), badname_list(), badname_remove(), bind_and_queue(), cf_access(), cf_acmd_access(), cf_flagalias(), cf_include(), cf_init(), cf_log_notfound(), cf_log_syntax(), cf_read(), cf_set(), cf_set_flags(), cf_site(), cf_status_from_succfail(), cf_string(), char_gainxpbycode(), check_access(), check_command(), check_connect(), check_events(), check_idle(), check_mail_expiration(), check_zone(), check_zone_for_player(), count_mail(), cque_dump_restart(), cque_enqueue(), create_obj(), db_free(), db_grow(), db_read(), db_write(), db_write_object(), decode_power(), delete_mail_message(), delete_player_name(), desc_addhash(), desc_delhash(), did_it(), dispatch(), do_addcommand(), do_chanlist(), do_channelnuke(), do_command(), do_comprintf(), do_comsend(), do_createchannel(), do_dbclean(), do_delcommand(), do_destroychannel(), do_doing(), do_force(), do_function(), do_help(), do_listchannels(), do_listcommands(), do_macro(), do_mail_debug(), do_mail_file(), do_mail_flags(), do_mail_list(), do_mail_purge(), do_mail_read(), do_mail_retract(), do_mail_review(), do_name(), do_prog(), do_ps(), do_queue(), do_quitprog(), do_restart(), do_second(), do_show_com(), do_shutdown(), do_stats(), do_switch(), do_timewarp(), do_top(), do_ufun(), do_unauth_command(), do_version(), do_wait(), dump_bqe(), dump_database(), dump_database_internal(), dump_mail(), dump_restart_db(), dump_restart_db_xdr(), dump_users(), end_log(), eval_boolexp(), exec(), failconn(), fetch_connect(), fetch_idle(), find_flag(), find_power(), find_wild_attrs(), fork_and_dump(), fun_bttechtime(), fun_children(), fun_clist(), fun_connrecord(), fun_convtime(), fun_inzone(), fun_poll(), fun_r(), fun_regmatch(), fun_secs(), fun_setq(), fun_setr(), fun_startsecs(), fun_starttime(), fun_time(), fun_version(), fun_zplayers(), fun_zwho(), fwdlist_clr(), fwdlist_get(), fwdlist_set(), game_lag(), get_mail_message(), halt_que(), handle_prog(), Hearer(), helpindex_init(), helpindex_load(), init_attrtab(), init_chantab(), init_cmdtab(), init_flagtab(), init_functab(), init_logout_cmdtab(), init_mactab(), init_powertab(), init_timer(), init_version(), initializesock(), list_check(), list_options(), list_process(), list_siteinfo(), list_vattrs(), load_bqe(), load_comsystem(), load_mail(), load_restart_db(), load_restart_db_xdr(), LoadSpecialObjects(), log_error(), log_perror(), look_atrs(), look_atrs1(), lookup_player(), mail_db_grow(), mail_fetch(), main(), make_freelist(), make_mail_freelist(), mech_startup_event(), mmdb_db_read(), mmdb_db_write(), mytime(), Name(), network_initialize_socket(), new_mail_message(), nfy_que(), notify_checked(), olist_add(), olist_first(), olist_next(), olist_pop(), olist_push(), parse_attrib_wild(), parse_range(), process_cmdent(), process_command(), PureName(), QueueMax(), raw_notify_newline(), raw_notify_raw(), report(), save_comsystem(), save_template(), search_perform(), select_channel(), send_mail(), set_prefix_cmds(), show_que(), shutdownsock(), signal_BUS(), signal_SEGV(), start_log(), tech_addtechtime(), tech_status(), timer_callback(), u_comp(), UpdateSpecialObject_func(), UpdateSpecialObjects(), urgent_mail(), vattr_alloc(), vattr_define(), vattr_delete(), vattr_find(), vattr_first(), vattr_init(), vattr_next(), vattr_rename(), wait_que(), wakeup_wait_que(), and xml_db_write().