00001
00002
00003
00004
00005
00006 #ifndef EXTERNS_H
00007 #define EXTERNS_H
00008
00009 #include "db.h"
00010 #include "match.h"
00011 #include "mudconf.h"
00012 #include "svdrand.h"
00013
00014
00015
00016 void boot_slave(dbref executor, dbref caller, dbref enactor, int key);
00017 void close_sockets(bool emergency, char *message);
00018 void CleanUpSlaveSocket(void);
00019 void CleanUpSlaveProcess(void);
00020 #ifdef QUERY_SLAVE
00021 void CleanUpSQLSlaveSocket(void);
00022 void CleanUpSQLSlaveProcess(void);
00023 #endif // QUERY_SLAVE
00024 #ifdef WIN32
00025 extern HANDLE CompletionPort;
00026 extern CRITICAL_SECTION csDescriptorList;
00027 #endif // WIN32
00028
00029 #ifdef QUERY_SLAVE
00030 void boot_sqlslave(dbref executor, dbref caller, dbref enactor, int key);
00031 #endif // QUERY_SLAVE
00032
00033 extern NAMETAB sigactions_nametab[];
00034
00035
00036
00037 void cf_log_notfound(dbref, char *, const char *, char *);
00038 int cf_modify_bits(int *, char *, void *, UINT32, dbref, char *);
00039 void DCL_CDECL cf_log_syntax(dbref player, char *cmd, const char *fmt, ...);
00040 void ValidateConfigurationDbrefs(void);
00041 int cf_read(void);
00042 void cf_init(void);
00043 void cf_list(dbref, char *, char **);
00044 void cf_display(dbref, char *, char *, char **);
00045 void list_cf_access(dbref);
00046 int cf_set(char *, char *, dbref);
00047 CF_HAND(cf_cf_access);
00048 CF_HAND(cf_access);
00049 CF_HAND(cf_cmd_alias);
00050 CF_HAND(cf_acmd_access);
00051 CF_HAND(cf_attr_access);
00052 CF_HAND(cf_func_access);
00053 CF_HAND(cf_flag_access);
00054 CF_HAND(cf_flag_name);
00055 CF_HAND(cf_art_rule);
00056
00057
00058
00059 void local_startup(void);
00060 void local_presync_database(void);
00061 void local_presync_database_sigsegv(void);
00062 void local_dump_database(int);
00063 void local_dump_complete_signal(void);
00064 void local_shutdown(void);
00065 void local_dbck(void);
00066 void local_connect(dbref, int, int);
00067 void local_disconnect(dbref, int);
00068 void local_data_create(dbref);
00069 void local_data_clone(dbref, dbref);
00070 void local_data_free(dbref);
00071
00072
00073
00074 void load_mail(FILE *);
00075 int dump_mail(FILE *);
00076 struct mail *mail_fetch(dbref, int);
00077
00078
00079
00080 void DCL_CDECL raw_broadcast(int, char *, ...);
00081 void list_siteinfo(dbref);
00082 void logged_out0(dbref executor, dbref caller, dbref enactor, int key);
00083 void logged_out1(dbref executor, dbref caller, dbref enactor, int key, char *arg);
00084 void init_logout_cmdtab(void);
00085 void desc_reload(dbref);
00086 void make_portlist(dbref, dbref, char *, char **);
00087
00088
00089 int nfy_que(dbref, int, int, int);
00090 int halt_que(dbref, dbref);
00091 void wait_que(dbref executor, dbref caller, dbref enactor, bool,
00092 CLinearTimeAbsolute&, dbref, int, char *, char *[],int, char *[]);
00093
00094 #ifdef WIN32
00095 #include "crypt/crypt.h"
00096 #else // WIN32
00097 extern "C" char *crypt(const char *inptr, const char *inkey);
00098 #endif // WIN32
00099 extern bool break_called;
00100
00101
00102 void tcache_init(void);
00103 char *parse_to(char **, char, int);
00104 char *parse_arglist(dbref executor, dbref caller, dbref enactor, char *,
00105 char, int, char *[], int, char*[], int, int *);
00106 int get_gender(dbref);
00107 void mux_exec(char *buff, char **bufc, dbref executor, dbref caller,
00108 dbref enactor, int eval, char **dstr, char *cargs[],
00109 int ncargs);
00110 void save_global_regs(const char *, char *[], int []);
00111 void save_and_clear_global_regs(const char *, char *[], int[]);
00112 void restore_global_regs(const char *, char *[], int []);
00113 char **PushPointers(int nNeeded);
00114 void PopPointers(char **p, int nNeeded);
00115 int *PushIntegers(int nNeeded);
00116 void PopIntegers(int *pi, int nNeeded);
00117 extern const signed char mux_RegisterSet[256];
00118 extern const char *ColorTable[256];
00119
00120
00121 #define notify(p,m) notify_check(p,p,m, MSG_PUP_ALWAYS|MSG_ME_ALL|MSG_F_DOWN)
00122 #define notify_saypose(p,m) notify_check(p,p,m, MSG_PUP_ALWAYS|MSG_ME_ALL|MSG_F_DOWN|MSG_SAYPOSE)
00123 #define notify_html(p,m) notify_check(p,p,m, MSG_PUP_ALWAYS|MSG_ME_ALL|MSG_F_DOWN|MSG_HTML)
00124 #define notify_quiet(p,m) notify_check(p,p,m, MSG_PUP_ALWAYS|MSG_ME)
00125 #define notify_with_cause(p,c,m) notify_check(p,c,m, MSG_PUP_ALWAYS|MSG_ME_ALL|MSG_F_DOWN)
00126 #define notify_with_cause_ooc(p,c,m) notify_check(p,c,m, MSG_PUP_ALWAYS|MSG_ME_ALL|MSG_F_DOWN|MSG_OOC)
00127 #define notify_with_cause_html(p,c,m) notify_check(p,c,m, MSG_PUP_ALWAYS|MSG_ME_ALL|MSG_F_DOWN|MSG_HTML)
00128 #define notify_quiet_with_cause(p,c,m) notify_check(p,c,m, MSG_PUP_ALWAYS|MSG_ME)
00129
00130
00131 #define notify_all(p,c,m) notify_check(p,c,m, MSG_ME_ALL|MSG_NBR_EXITS|MSG_F_UP|MSG_F_CONTENTS)
00132 #define notify_all_from_inside(p,c,m) notify_check(p,c,m, MSG_ME_ALL|MSG_NBR_EXITS_A|MSG_F_UP|MSG_F_CONTENTS|MSG_S_INSIDE)
00133 #define notify_all_from_inside_saypose(p,c,m) notify_check(p,c,m, MSG_ME_ALL|MSG_NBR_EXITS_A|MSG_F_UP|MSG_F_CONTENTS|MSG_S_INSIDE|MSG_SAYPOSE)
00134 #define notify_all_from_inside_html(p,c,m) notify_check(p,c,m, MSG_ME_ALL|MSG_NBR_EXITS_A|MSG_F_UP|MSG_F_CONTENTS|MSG_S_INSIDE|MSG_HTML)
00135
00136
00137 void notify_except(dbref, dbref, dbref, const char *, int key);
00138 void notify_except2(dbref, dbref, dbref, dbref, const char *);
00139
00140 void notify_check(dbref, dbref, const char *, int);
00141
00142 bool Hearer(dbref);
00143 void report(void);
00144
00145 bool atr_match
00146 (
00147 dbref thing,
00148 dbref player,
00149 char type,
00150 char *str,
00151 char *raw_str,
00152 bool check_parents
00153 );
00154
00155 bool regexp_match
00156 (
00157 char *pattern,
00158 char *str,
00159 int case_opt,
00160 char *args[],
00161 int nargs
00162 );
00163
00164 bool list_check
00165 (
00166 dbref thing,
00167 dbref player,
00168 char type,
00169 char *str,
00170 char *raw_str,
00171 bool check_parent
00172 );
00173 bool html_escape(const char *src, char *dest, char **destp);
00174
00175 #define DUMP_I_NORMAL 0 // OUTPUT to the outdb through a temporary file.
00176 #define DUMP_I_PANIC 1 // UNLOAD to a crashdb
00177 #define DUMP_I_RESTART 2 // OUTPUT to the inputdb
00178 #define DUMP_I_FLAT 3 // UNLOAD to a .FLAT file
00179 #define DUMP_I_SIGNAL 4 // UNLOAD to a .FLAT file from signal.
00180 #define NUM_DUMP_TYPES 5
00181 void dump_database_internal(int);
00182 void fork_and_dump(int key);
00183
00184
00185 void helpindex_clean(int);
00186 void helpindex_load(dbref);
00187 void helpindex_init(void);
00188 void help_helper(dbref executor, int iHelpfile, char *topic_arg, char *buff, char **bufc);
00189
00190
00191 int cf_ntab_access(int *, char *, void *, UINT32, dbref, char *);
00192
00193
00194 #ifdef WIN32
00195 #define ENDLINE "\r\n"
00196 #else // WIN32
00197 #define ENDLINE "\n"
00198 #endif // WIN32
00199 bool start_log(const char *primary, const char *secondary);
00200 void end_log(void);
00201 void log_perror(const char *, const char *,const char *,
00202 const char *);
00203 void log_text(const char *);
00204 void log_number(int);
00205 void DCL_CDECL log_printf(const char *fmt, ...);
00206 void log_name(dbref);
00207 void log_name_and_loc(dbref);
00208 void log_type_and_name(dbref);
00209
00210
00211 void look_in(dbref,dbref, int);
00212 void show_vrml_url(dbref, dbref);
00213 size_t decode_attr_flags(int aflags, char *buff);
00214
00215
00216 void move_object(dbref, dbref);
00217 void move_via_generic(dbref, dbref, dbref, int);
00218 bool move_via_teleport(dbref, dbref, dbref, int);
00219 void move_exit(dbref, dbref, bool, const char *, int);
00220 void do_enter_internal(dbref, dbref, bool);
00221
00222
00223 dbref start_home(void);
00224 dbref default_home(void);
00225 bool can_set_home(dbref, dbref, dbref);
00226 dbref new_home(dbref);
00227 dbref clone_home(dbref, dbref);
00228 void divest_object(dbref);
00229 dbref create_obj(dbref, int, const char *, int);
00230 void destroy_obj(dbref);
00231 void empty_obj(dbref);
00232
00233
00234 dbref create_player(char *name, char *pass, dbref executor, bool isrobot, const char **pmsg);
00235 void AddToPublicChannel(dbref player);
00236 bool add_player_name(dbref, const char *);
00237 bool delete_player_name(dbref, const char *);
00238 dbref lookup_player(dbref, char *, bool);
00239 void load_player_names(void);
00240 void badname_add(char *);
00241 void badname_remove(char *);
00242 bool badname_check(char *);
00243 void badname_list(dbref, const char *);
00244 void ChangePassword(dbref player, const char *szPassword);
00245 const char *mux_crypt(const char *szPassword, const char *szSalt, int *piType);
00246 int QueueMax(dbref);
00247 int a_Queue(dbref, int);
00248 void pcache_reload(dbref);
00249 void pcache_init(void);
00250
00251
00252 char * DCL_CDECL tprintf(const char *, ...);
00253 void DCL_CDECL safe_tprintf_str(char *, char **, const char *, ...);
00254 dbref insert_first(dbref, dbref);
00255 dbref remove_first(dbref, dbref);
00256 dbref reverse_list(dbref);
00257 bool member(dbref, dbref);
00258 bool could_doit(dbref, dbref, int);
00259 bool can_see(dbref, dbref, bool);
00260 void add_quota(dbref, int);
00261 bool canpayfees(dbref, dbref, int, int);
00262 void giveto(dbref,int);
00263 bool payfor(dbref,int);
00264 char *MakeCanonicalObjectName(const char *pName, int *pnName, bool *pbValid);
00265 char *MakeCanonicalExitName(const char *pName, int *pnName, bool *pbValid);
00266 bool ValidatePlayerName(const char *pName);
00267 bool ok_password(const char *szPassword, const char **pmsg);
00268 void handle_ears(dbref, bool, bool);
00269 dbref match_possessed(dbref, dbref, char *, dbref, bool);
00270 void parse_range(char **, dbref *, dbref *);
00271 bool parse_thing_slash(dbref, char *, char **, dbref *);
00272 bool get_obj_and_lock(dbref, char *, dbref *, ATTR **, char *, char **);
00273 dbref where_is(dbref);
00274 dbref where_room(dbref);
00275 bool locatable(dbref, dbref, dbref);
00276 bool nearby(dbref, dbref);
00277 bool exit_visible(dbref, dbref, int);
00278 bool exit_displayable(dbref, dbref, int);
00279 void did_it(dbref, dbref, int, const char *, int, const char *, int, char *[], int);
00280 bool bCanReadAttr(dbref executor, dbref target, ATTR *tattr, bool bParentCheck);
00281 bool bCanSetAttr(dbref executor, dbref target, ATTR *tattr);
00282 bool bCanLockAttr(dbref executor, dbref target, ATTR *tattr);
00283
00284
00285 bool parse_attrib(dbref, char *, dbref *, ATTR **);
00286 bool parse_attrib_wild(dbref, char *, dbref *, bool, bool, bool);
00287 void edit_string(char *, char **, char *, char *);
00288 dbref match_controlled_handler(dbref player, const char *name, bool bQuiet);
00289 #define match_controlled(player,name) match_controlled_handler(player, name, false)
00290 #define match_controlled_quiet(player,name) match_controlled_handler(player, name, true)
00291 void set_modified(dbref thing);
00292
00293
00294 bool eval_boolexp(dbref, dbref, dbref, BOOLEXP *);
00295 BOOLEXP *parse_boolexp(dbref, const char *, bool);
00296 bool eval_boolexp_atr(dbref, dbref, dbref, char *);
00297
00298
00299 bool xlate(char *);
00300
00301 #define IEEE_MAKE_NAN 1
00302 #define IEEE_MAKE_IND 2
00303 #define IEEE_MAKE_PINF 3
00304 #define IEEE_MAKE_NINF 4
00305
00306 double MakeSpecialFloat(int iWhich);
00307
00308
00309 char *unparse_boolexp(dbref, BOOLEXP *);
00310 char *unparse_boolexp_quiet(dbref, BOOLEXP *);
00311 char *unparse_boolexp_decompile(dbref, BOOLEXP *);
00312 char *unparse_boolexp_function(dbref, BOOLEXP *);
00313
00314
00315 int chown_all(dbref from_player, dbref to_player, dbref acting_player, int key);
00316 void olist_push(void);
00317 void olist_pop(void);
00318 void olist_add(dbref);
00319 dbref olist_first(void);
00320 dbref olist_next(void);
00321
00322
00323 bool wild(char *, char *, char *[], int);
00324 bool wild_match(char *, const char *);
00325 bool quick_wild(const char *, const char *);
00326
00327
00328 bool check_access(dbref player, int mask);
00329 void set_prefix_cmds(void);
00330 char *process_command(dbref executor, dbref caller, dbref enactor, bool,
00331 char *, char *[], int);
00332
00333 #define Protect(f) (cmdp->perms & f)
00334
00335 #define Invalid_Objtype(x) \
00336 ((Protect(CA_LOCATION) && !Has_location(x)) || \
00337 (Protect(CA_CONTENTS) && !Has_contents(x)) || \
00338 (Protect(CA_PLAYER) && !isPlayer(x)))
00339
00340
00341 bool Commer(dbref);
00342 void s_Pass(dbref, const char *);
00343 void s_Name(dbref, const char *);
00344 void s_Moniker(dbref thing, const char *s);
00345 const char *Name(dbref thing);
00346 const char *PureName(dbref thing);
00347 const char *Moniker(dbref thing);
00348 int fwdlist_load(FWDLIST *, dbref, char *);
00349 void fwdlist_set(dbref, FWDLIST *);
00350 void fwdlist_clr(dbref);
00351 int fwdlist_rewrite(FWDLIST *, char *);
00352 FWDLIST *fwdlist_get(dbref);
00353 void atr_push(void);
00354 void atr_pop(void);
00355 int atr_head(dbref, char **);
00356 int atr_next(char **);
00357 int init_dbfile(char *game_dir_file, char *game_pag_file, int nCachePages);
00358 void atr_cpy(dbref dest, dbref source, bool bInternal);
00359 void atr_chown(dbref);
00360 void atr_clr(dbref, int);
00361 void atr_add_raw_LEN(dbref, int, const char *, int);
00362 void atr_add_raw(dbref, int, const char *);
00363 void atr_add(dbref, int, char *, dbref, int);
00364 void atr_set_flags(dbref, int, int);
00365 const char *atr_get_raw_LEN(dbref, int, size_t *);
00366 const char *atr_get_raw(dbref, int);
00367 char *atr_get_LEN(dbref, int, dbref *, int *, size_t *);
00368 char *atr_get_real(dbref, int, dbref *, int *, const char *, const int);
00369 #define atr_get(t,a,o,f) atr_get_real(t,a,o,f, __FILE__, __LINE__)
00370 char *atr_pget_LEN(dbref, int, dbref *, int *, size_t *);
00371 char *atr_pget_real(dbref, int, dbref *, int *, const char *, const int);
00372 #define atr_pget(t,a,o,f) atr_pget_real(t,a,o,f, __FILE__, __LINE__)
00373 char *atr_get_str_LEN(char *s, dbref, int, dbref *, int *, size_t *);
00374 char *atr_get_str(char *, dbref, int, dbref *, int *);
00375 char *atr_pget_str_LEN(char *, dbref, int, dbref *, int *, size_t *);
00376 char *atr_pget_str(char *, dbref, int, dbref *, int *);
00377 bool atr_get_info(dbref, int, dbref *, int *);
00378 bool atr_pget_info(dbref, int, dbref *, int *);
00379 void atr_free(dbref);
00380 bool check_zone_handler(dbref player, dbref thing, bool bPlayerCheck);
00381 #define check_zone(player, thing) check_zone_handler(player, thing, false)
00382 void ReleaseAllResources(dbref obj);
00383 bool fwdlist_ck(dbref player, dbref thing, int anum, char *atext);
00384
00385 extern int anum_alc_top;
00386
00387
00388
00389 #define ATTRIB_ACCESS 1
00390 #define ATTRIB_RENAME 2
00391 #define ATTRIB_DELETE 4
00392 #define ATTRIB_INFO 8
00393 #define BOOT_QUIET 1
00394 #define BOOT_PORT 2
00395 #define CEMIT_NOHEADER 1
00396 #define CHOWN_ONE 1
00397 #define CHOWN_ALL 2
00398
00399 #define CHOWN_NOZONE 8
00400 #define CLIST_FULL 1
00401 #define CLIST_HEADERS 2
00402 #define CLONE_LOCATION 0
00403 #define CLONE_INHERIT 1
00404 #define CLONE_PRESERVE 2
00405 #define CLONE_INVENTORY 4
00406 #define CLONE_SET_COST 8
00407 #define CLONE_SET_LOC 16
00408 #define CLONE_SET_NAME 32
00409 #define CLONE_FROM_PARENT 64
00410 #define CBOOT_QUIET 1 // Cboot without a message
00411 #define COMTITLE_ON 1 // Turn Comtitles on.
00412 #define COMTITLE_OFF 2 // Turn Comtitles off.
00413 #define CRE_INVENTORY 0
00414 #define CRE_LOCATION 1
00415 #define CRE_SET_LOC 2
00416 #define CSET_PUBLIC 0
00417 #define CSET_PRIVATE 1
00418 #define CSET_LOUD 2
00419 #define CSET_QUIET 3
00420 #define CSET_LIST 4
00421 #define CSET_OBJECT 5
00422 #define CSET_SPOOF 6
00423 #define CSET_NOSPOOF 7
00424 #define CSET_HEADER 8
00425 #define CSET_LOG 9 // Set maximum number of messages to log.
00426 #define DBCK_DEFAULT 1
00427 #define DBCK_FULL 2
00428 #define DECOMP_DBREF 1
00429
00430 #define DEST_ONE 1
00431 #define DEST_OVERRIDE 4
00432 #define DEST_INSTANT 8
00433 #define DIG_TELEPORT 1
00434 #define DOLIST_SPACE 0
00435 #define DOLIST_DELIMIT 1
00436 #define DOLIST_NOTIFY 2
00437 #define DOING_MESSAGE 0
00438 #define DOING_HEADER 1
00439 #define DOING_POLL 2
00440 #define DOING_UNIQUE 3 // Set DOING message for current port only
00441 #define DOING_MASK 15 // Lower four bits form non-SW_MULTIPLE part.
00442 #define DOING_QUIET 16 // Set DOING messages without 'Set.' message.
00443 #define DROP_QUIET 1
00444 #define DUMP_STRUCT 1
00445 #define DUMP_TEXT 2
00446 #define DUMP_FLATFILE 4
00447 #define EXAM_DEFAULT 0
00448 #define EXAM_BRIEF 1
00449 #define EXAM_LONG 2
00450 #define EXAM_DEBUG 4
00451 #define EXAM_PARENT 8
00452
00453
00454 #define FIXDB_OWNER 1
00455 #define FIXDB_LOC 2
00456 #define FIXDB_CON 4
00457 #define FIXDB_EXITS 8
00458 #define FIXDB_NEXT 16
00459 #define FIXDB_PENNIES 32
00460 #define FIXDB_ZONE 64
00461 #define FIXDB_LINK 128
00462 #define FIXDB_PARENT 256
00463 #define FIXDB_NAME 2048
00464 #define FLAG_REMOVE 1 // Remove a flag alias
00465 #define GET_QUIET 1
00466 #define GIVE_QUIET 64
00467 #define GLOB_ENABLE 1
00468 #define GLOB_DISABLE 2
00469
00470 #define HALT_ALL 1
00471
00472 #define HOOK_BEFORE 1
00473 #define HOOK_AFTER 2
00474 #define HOOK_PERMIT 4
00475 #define HOOK_IGNORE 8
00476 #define HOOK_IGSWITCH 16
00477 #define HOOK_AFAIL 32
00478 #define HOOK_CLEAR 64
00479 #define HOOK_LIST 128
00480 #define ICMD_DISABLE 0
00481 #define ICMD_IGNORE 1
00482 #define ICMD_ON 2
00483 #define ICMD_OFF 4
00484 #define ICMD_CLEAR 8
00485 #define ICMD_CHECK 16
00486 #define ICMD_DROOM 32
00487 #define ICMD_IROOM 64
00488 #define ICMD_CROOM 128
00489 #define ICMD_LROOM 256
00490 #define ICMD_LALLROOM 512
00491 #define KILL_KILL 1
00492 #define KILL_SLAY 2
00493 #define LOOK_LOOK 1
00494 #define LOOK_OUTSIDE 8
00495 #define MAIL_STATS 1
00496 #define MAIL_DSTATS 2
00497 #define MAIL_FSTATS 3
00498 #define MAIL_DEBUG 4
00499 #define MAIL_NUKE 5
00500 #define MAIL_FOLDER 6
00501 #define MAIL_LIST 7
00502 #define MAIL_READ 8
00503 #define MAIL_CLEAR 9
00504 #define MAIL_UNCLEAR 10
00505 #define MAIL_PURGE 11
00506 #define MAIL_FILE 12
00507 #define MAIL_TAG 13
00508 #define MAIL_UNTAG 14
00509 #define MAIL_FORWARD 15
00510 #define MAIL_SEND 16
00511 #define MAIL_EDIT 17
00512 #define MAIL_URGENT 18
00513 #define MAIL_ALIAS 19
00514 #define MAIL_ALIST 20
00515 #define MAIL_PROOF 21
00516 #define MAIL_ABORT 22
00517 #define MAIL_QUICK 23
00518 #define MAIL_REVIEW 24
00519 #define MAIL_RETRACT 25
00520 #define MAIL_CC 26
00521 #define MAIL_SAFE 27
00522 #define MAIL_REPLY 28
00523 #define MAIL_REPLYALL 29
00524 #define MAIL_BCC 30 // Blind Carbon Copy. Don't show the recipient list to these.
00525 #define MAIL_QUOTE 0x100
00526
00527 #define MALIAS_DESC 1
00528 #define MALIAS_CHOWN 2
00529 #define MALIAS_ADD 3
00530 #define MALIAS_REMOVE 4
00531 #define MALIAS_DELETE 5
00532 #define MALIAS_RENAME 6
00533 #define MALIAS_LIST 8
00534 #define MALIAS_STATUS 9
00535 #define MARK_SET 0
00536 #define MARK_CLEAR 1
00537 #define MOTD_ALL 0
00538 #define MOTD_WIZ 1
00539 #define MOTD_DOWN 2
00540 #define MOTD_FULL 4
00541 #define MOTD_LIST 8
00542 #define MOTD_BRIEF 16
00543 #define MOVE_QUIET 1
00544 #define NFY_NFY 0
00545 #define NFY_NFYALL 1
00546 #define NFY_DRAIN 2
00547 #define NFY_QUIET 3
00548 #define OPEN_LOCATION 0
00549 #define OPEN_INVENTORY 1
00550 #define PCRE_PLAYER 1
00551 #define PCRE_ROBOT 2
00552 #define PEMIT_PEMIT 1
00553 #define PEMIT_OEMIT 2
00554 #define PEMIT_WHISPER 3
00555 #define PEMIT_FSAY 4
00556 #define PEMIT_FEMIT 5
00557 #define PEMIT_FPOSE 6
00558 #define PEMIT_FPOSE_NS 7
00559 #define PEMIT_CONTENTS 8
00560 #define PEMIT_HERE 16
00561 #define PEMIT_ROOM 32
00562 #define PEMIT_LIST 64
00563 #define PEMIT_HTML 128
00564 #define PS_BRIEF 0
00565 #define PS_LONG 1
00566 #define PS_SUMM 2
00567 #define PS_ALL 4
00568 #define QUERY_SQL 1
00569 #define QUEUE_KICK 1
00570 #define QUEUE_WARP 2
00571 #define QUOTA_SET 1
00572 #define QUOTA_FIX 2
00573 #define QUOTA_TOT 4
00574 #define QUOTA_REM 8
00575 #define QUOTA_ALL 16
00576
00577
00578
00579
00580 #define SAY_SAY 1
00581 #define SAY_NOSPACE 1
00582 #define SAY_POSE 2
00583 #define SAY_POSE_NOSPC 3
00584 #define SAY_PREFIX 4
00585 #define SAY_EMIT 5
00586 #define SAY_NOEVAL 8 // Don't eval message
00587 #define SHOUT_SHOUT 1
00588 #define SHOUT_WALLPOSE 2
00589 #define SHOUT_WALLEMIT 3
00590 #define SHOUT_WIZSHOUT 4
00591 #define SHOUT_WIZPOSE 5
00592 #define SHOUT_WIZEMIT 6
00593 #define SHOUT_ADMINSHOUT 7
00594
00595
00596 #define SAY_NOTAG 32
00597 #define SAY_HERE 64
00598 #define SAY_ROOM 128
00599 #define SAY_HTML 256
00600 #define SET_QUIET 1
00601 #define SHOUT_DEFAULT 0
00602 #define SHOUT_WIZARD 1
00603 #define SHOUT_ADMIN 2
00604 #define SHUTDN_NORMAL 0
00605 #define SHUTDN_PANIC 1
00606 #define SHUTDN_EXIT 2
00607 #define SHUTDN_COREDUMP 4
00608 #define SRCH_SEARCH 1
00609 #define SRCH_MARK 2
00610 #define SRCH_UNMARK 3
00611 #define STAT_PLAYER 0
00612 #define STAT_ALL 1
00613 #define STAT_ME 2
00614 #define SWITCH_DEFAULT 0
00615 #define SWITCH_ANY 1
00616 #define SWITCH_ONE 2
00617 #define SWEEP_ME 1
00618 #define SWEEP_HERE 2
00619 #define SWEEP_COMMANDS 4
00620 #define SWEEP_LISTEN 8
00621 #define SWEEP_PLAYER 16
00622 #define SWEEP_CONNECT 32
00623 #define SWEEP_EXITS 64
00624 #define SWEEP_SCAN 128
00625 #define SWEEP_VERBOSE 256
00626 #define TELEPORT_DEFAULT 1
00627 #define TELEPORT_QUIET 2
00628 #define TELEPORT_LIST 4
00629 #define TIMECHK_RESET 1
00630 #define TIMECHK_SCREEN 2
00631 #define TIMECHK_LOG 4
00632 #define TOAD_NO_CHOWN 1
00633 #define TRIG_QUIET 1
00634 #define TWARP_QUEUE 1
00635 #define TWARP_DUMP 2
00636 #define TWARP_CLEAN 4
00637 #define TWARP_IDLE 8
00638
00639 #define TWARP_EVENTS 32
00640 #define WAIT_UNTIL 1 // Absolute UTC seconds instead of delta.
00641
00642
00643
00644 #define HUSH_ENTER 1
00645 #define HUSH_LEAVE 2
00646 #define HUSH_EXIT 4
00647
00648
00649
00650 #define EV_FIGNORE 0x00000000
00651 #define EV_FMAND 0x00000100
00652 #define EV_FCHECK 0x00000200
00653 #define EV_STRIP_CURLY 0x00000400
00654 #define EV_EVAL 0x00000800
00655 #define EV_STRIP_TS 0x00001000
00656 #define EV_STRIP_LS 0x00002000
00657 #define EV_STRIP_ESC 0x00004000
00658 #define EV_STRIP_AROUND 0x00008000
00659 #define EV_TOP 0x00010000
00660 #define EV_NOTRACE 0x00020000
00661 #define EV_NO_COMPRESS 0x00040000
00662 #define EV_NO_LOCATION 0x00080000
00663 #define EV_NOFCHECK 0x00100000
00664
00665
00666
00667 #define MSG_PUP_ALWAYS 0x00000001UL
00668 #define MSG_INV 0x00000002UL
00669 #define MSG_INV_L 0x00000004UL
00670 #define MSG_INV_EXITS 0x00000008UL
00671 #define MSG_NBR 0x00000010UL
00672 #define MSG_NBR_A 0x00000020UL
00673 #define MSG_NBR_EXITS 0x00000040UL
00674 #define MSG_NBR_EXITS_A 0x00000080UL
00675 #define MSG_LOC 0x00000100UL
00676 #define MSG_LOC_A 0x00000200UL
00677 #define MSG_FWDLIST 0x00000400UL
00678 #define MSG_ME 0x00000800UL
00679 #define MSG_S_INSIDE 0x00001000UL
00680 #define MSG_S_OUTSIDE 0x00002000UL
00681 #define MSG_HTML 0x00004000UL
00682 #define MSG_OOC 0x00008000UL
00683 #define MSG_SAYPOSE 0x00010000UL
00684
00685 #define MSG_ME_ALL (MSG_ME|MSG_INV_EXITS|MSG_FWDLIST)
00686 #define MSG_F_CONTENTS (MSG_INV)
00687 #define MSG_F_UP (MSG_NBR_A|MSG_LOC_A)
00688 #define MSG_F_DOWN (MSG_INV_L)
00689
00690
00691
00692 #define LK_IDESC 0x0001
00693 #define LK_OBEYTERSE 0x0002
00694 #define LK_SHOWATTR 0x0004
00695 #define LK_SHOWEXIT 0x0008
00696 #define LK_SHOWVRML 0x0010
00697
00698
00699
00700
00701
00702
00703
00704
00705
00706
00707 #define VE_LOC_XAM 0x01
00708 #define VE_LOC_DARK 0x02
00709 #define VE_LOC_LIGHT 0x04
00710
00711 #define VE_BASE_DARK 0x10
00712
00713
00714
00715
00716 #define SA_EXIT 1
00717 #define SA_DFLT 2
00718
00719 #define STARTLOG(key,p,s) \
00720 if ((((key) & mudconf.log_options) != 0) && start_log(p, s)) {
00721 #define ENDLOG \
00722 end_log(); }
00723 #define LOG_SIMPLE(key,p,s,m) \
00724 STARTLOG(key,p,s) \
00725 log_text(m); \
00726 ENDLOG
00727
00728 extern const char *NOMATCH_MESSAGE;
00729 extern const char *AMBIGUOUS_MESSAGE;
00730 extern const char *NOPERM_MESSAGE;
00731 extern const char *FUNC_FAIL_MESSAGE;
00732 extern const char *FUNC_NOMATCH_MESSAGE;
00733 extern const char *OUT_OF_RANGE;
00734 extern const char *FUNC_NOT_FOUND;
00735 extern const char *FUNC_AMBIGUOUS;
00736 extern const char *FUNC_NOPERM_MESSAGE;
00737
00738 #define safe_nothing(b,p) safe_copy_buf(FUNC_FAIL_MESSAGE,3,(b),(p))
00739 #define safe_noperm(b,p) safe_copy_buf(FUNC_NOPERM_MESSAGE,21,(b),(p))
00740 #define safe_nomatch(b,p) safe_copy_buf(FUNC_NOMATCH_MESSAGE,12,(b),(p))
00741 #define safe_range(b,p) safe_copy_buf(OUT_OF_RANGE,16,(b),(p))
00742 #define safe_ambiguous(b,p) safe_copy_buf(FUNC_AMBIGUOUS,13,(b),(p))
00743 #define safe_notfound(b,p) safe_copy_buf(FUNC_NOT_FOUND,13,(b),(p))
00744
00745 int ReplaceFile(char *old_name, char *new_name);
00746 void RemoveFile(char *name);
00747 void destroy_player(dbref agent, dbref victim);
00748 void do_pemit_list
00749 (
00750 dbref player,
00751 int key,
00752 bool bDoContents,
00753 int pemit_flags,
00754 char *list,
00755 int chPoseType,
00756 char *message
00757 );
00758 void do_pemit_single
00759 (
00760 dbref player,
00761 int key,
00762 bool bDoContents,
00763 int pemit_flags,
00764 char *recipient,
00765 int chPoseType,
00766 char *message
00767 );
00768 void do_say(dbref executor, dbref caller, dbref enactor, int key,
00769 char *message);
00770
00771 int boot_off(dbref player, const char *message);
00772 void do_mail_clear(dbref player, char *msglist);
00773 void do_mail_purge(dbref player);
00774 void malias_cleanup(dbref player);
00775 void count_mail(dbref player, int folder, int *rcount, int *ucount, int *ccount);
00776 void check_mail_expiration(void);
00777 void check_mail(dbref player, int folder, bool silent);
00778 const char *mail_fetch_message(dbref player, int num);
00779 int mail_fetch_from(dbref player, int num);
00780 void raw_notify_html(dbref player, const char *msg);
00781 void do_lock(dbref executor, dbref caller, dbref enactor, int key,
00782 int nargs, char *name, char *keytext);
00783 void check_events(void);
00784 void list_system_resources(dbref player);
00785
00786 #if defined(WOD_REALMS) || defined(REALITY_LVLS)
00787
00788 #define ACTION_IS_STATIONARY 0
00789 #define ACTION_IS_MOVING 1
00790 #define ACTION_IS_TALKING 2
00791 #define NUMBER_OF_ACTIONS 3 // A count, n, of the number of possible actions 0...n-1
00792
00793 #define REALM_DO_NORMALLY_SEEN 1
00794 #define REALM_DO_HIDDEN_FROM_YOU 2
00795 #define REALM_DO_SHOW_OBFDESC 3
00796 #define REALM_DO_SHOW_WRAITHDESC 4
00797 #define REALM_DO_SHOW_UMBRADESC 5
00798 #define REALM_DO_SHOW_MATRIXDESC 6
00799 #define REALM_DO_SHOW_FAEDESC 7
00800 #define REALM_DO_MASK 7
00801 #define REALM_DISABLE_ADESC 0x00000008L
00802 int DoThingToThingVisibility(dbref looker, dbref lookee, int action_state);
00803 #endif // WOD_REALMS
00804
00805 typedef struct
00806 {
00807 int port;
00808 SOCKET socket;
00809 } PortInfo;
00810
00811 #define MAX_LISTEN_PORTS 10
00812 extern PortInfo aMainGamePorts[MAX_LISTEN_PORTS];
00813 extern int nMainGamePorts;
00814
00815 #ifdef WIN32
00816 extern DWORD platform;
00817 #else // WIN32
00818 extern int maxd;
00819 #endif // WIN32
00820
00821 extern unsigned int ndescriptors;
00822
00823 extern long DebugTotalFiles;
00824 extern long DebugTotalSockets;
00825
00826 #ifdef WIN32
00827 extern int game_pid;
00828 extern long DebugTotalThreads;
00829 extern long DebugTotalSemaphores;
00830 extern HANDLE hGameProcess;
00831 typedef BOOL __stdcall FCANCELIO(HANDLE hFile);
00832 typedef BOOL __stdcall FGETPROCESSTIMES(HANDLE hProcess,
00833 LPFILETIME pftCreate, LPFILETIME pftExit, LPFILETIME pftKernel,
00834 LPFILETIME pftUser);
00835 extern FCANCELIO *fpCancelIo;
00836 extern FGETPROCESSTIMES *fpGetProcessTimes;
00837 #else // WIN32
00838 extern pid_t game_pid;
00839 #endif // WIN32
00840
00841
00842
00843 void init_timer(void);
00844 #ifdef WIN32
00845 void Task_FreeDescriptor(void *arg_voidptr, int arg_Integer);
00846 void Task_DeferredClose(void *arg_voidptr, int arg_Integer);
00847 #endif
00848 void dispatch_DatabaseDump(void *pUnused, int iUnused);
00849 void dispatch_FreeListReconstruction(void *pUnused, int iUnused);
00850 void dispatch_IdleCheck(void *pUnused, int iUnused);
00851 void dispatch_CheckEvents(void *pUnused, int iUnused);
00852 #ifndef MEMORY_BASED
00853 void dispatch_CacheTick(void *pUnused, int iUnused);
00854 #endif
00855
00856
00857
00858
00859
00860
00861
00862
00863
00864
00865
00866
00867 typedef void FTASK(void *, int);
00868
00869 typedef struct
00870 {
00871 CLinearTimeAbsolute ltaWhen;
00872
00873 int iPriority;
00874 int m_Ticket;
00875 FTASK *fpTask;
00876 void *arg_voidptr;
00877 int arg_Integer;
00878 int m_iVisitedMark;
00879 } TASK_RECORD, *PTASK_RECORD;
00880
00881 #define PRIORITY_SYSTEM 100
00882 #define PRIORITY_PLAYER 200
00883 #define PRIORITY_OBJECT 300
00884 #define PRIORITY_SUSPEND 400
00885
00886
00887
00888 #define PRIORITY_CF_DEQUEUE_ENABLED PRIORITY_OBJECT
00889 #define PRIORITY_CF_DEQUEUE_DISABLED (PRIORITY_PLAYER-1)
00890
00891 typedef int SCHCMP(PTASK_RECORD, PTASK_RECORD);
00892 typedef int SCHLOOK(PTASK_RECORD);
00893
00894 class CTaskHeap
00895 {
00896 private:
00897 int m_nAllocated;
00898 int m_nCurrent;
00899 PTASK_RECORD *m_pHeap;
00900
00901 int m_iVisitedMark;
00902
00903 bool Grow(void);
00904 void SiftDown(int, SCHCMP *);
00905 void SiftUp(int, SCHCMP *);
00906 PTASK_RECORD Remove(int, SCHCMP *);
00907 void Update(int iNode, SCHCMP *pfCompare);
00908 void Sort(SCHCMP *pfCompare);
00909 void Remake(SCHCMP *pfCompare);
00910
00911 public:
00912 CTaskHeap();
00913 ~CTaskHeap();
00914
00915 bool Insert(PTASK_RECORD, SCHCMP *);
00916 PTASK_RECORD PeekAtTopmost(void);
00917 PTASK_RECORD RemoveTopmost(SCHCMP *);
00918 void CancelTask(FTASK *fpTask, void *arg_voidptr, int arg_Integer);
00919
00920 #define IU_DONE 0
00921 #define IU_NEXT_TASK 1
00922 #define IU_REMOVE_TASK 2
00923 #define IU_UPDATE_TASK 3
00924 int TraverseUnordered(SCHLOOK *pfLook, SCHCMP *pfCompare);
00925 int TraverseOrdered(SCHLOOK *pfLook, SCHCMP *pfCompare);
00926 };
00927
00928 class CScheduler
00929 {
00930 private:
00931 CTaskHeap m_WhenHeap;
00932 CTaskHeap m_PriorityHeap;
00933 int m_Ticket;
00934 int m_minPriority;
00935
00936 public:
00937 void TraverseUnordered(SCHLOOK *pfLook);
00938 void TraverseOrdered(SCHLOOK *pfLook);
00939 CScheduler(void) { m_Ticket = 0; m_minPriority = PRIORITY_CF_DEQUEUE_ENABLED; }
00940 void DeferTask(const CLinearTimeAbsolute& ltWhen, int iPriority, FTASK *fpTask, void *arg_voidptr, int arg_Integer);
00941 void DeferImmediateTask(int iPriority, FTASK *fpTask, void *arg_voidptr, int arg_Integer);
00942 bool WhenNext(CLinearTimeAbsolute *);
00943 int RunTasks(int iCount);
00944 int RunAllTasks(void);
00945 int RunTasks(const CLinearTimeAbsolute& tNow);
00946 void ReadyTasks(const CLinearTimeAbsolute& tNow);
00947 void CancelTask(FTASK *fpTask, void *arg_voidptr, int arg_Integer);
00948
00949 void SetMinPriority(int arg_minPriority);
00950 int GetMinPriority(void) { return m_minPriority; }
00951 };
00952
00953 extern CScheduler scheduler;
00954
00955 int fetch_cmds(dbref target);
00956 void fetch_ConnectionInfoFields(dbref target, long anFields[4]);
00957 long fetch_ConnectionInfoField(dbref target, int iField);
00958 void put_ConnectionInfoFields
00959 (
00960 dbref target,
00961 long anFields[4],
00962 CLinearTimeAbsolute <aLogout
00963 );
00964
00965
00966
00967
00968
00969
00970
00971
00972
00973
00974
00975 #define CIF_TOTALTIME 0
00976 #define CIF_LONGESTCONNECT 1
00977 #define CIF_LASTCONNECT 2
00978 #define CIF_NUMCONNECTS 3
00979 #define fetch_totaltime(t) (fetch_ConnectionInfoField((t), CIF_TOTALTIME))
00980 #define fetch_longestconnect(t) (fetch_ConnectionInfoField((t), CIF_LONGESTCONNECT))
00981 #define fetch_lastconnect(t) (fetch_ConnectionInfoField((t), CIF_LASTCONNECT))
00982 #define fetch_numconnections(t) (fetch_ConnectionInfoField((t), CIF_NUMCONNECTS))
00983 CLinearTimeAbsolute fetch_logouttime(dbref target);
00984
00985
00986
00987 void FLOAT_Initialize(void);
00988 void mux_FPInit();
00989 void mux_FPSet();
00990 void mux_FPRestore();
00991 double ulp(double);
00992 double mux_strtod(const char *s00, char **se);
00993 char *mux_dtoa(double d, int mode, int ndigits, int *decpt, int *sign,
00994 char **rve);
00995
00996
00997
00998 extern NAMETAB enable_names[];
00999
01000
01001
01002 void build_version(void);
01003 void init_version(void);
01004
01005
01006
01007 void pcache_sync(void);
01008 void pcache_trim(void);
01009
01010
01011
01012 void cache_redirect(void);
01013 void cache_pass2(void);
01014 extern CLinearTimeAbsolute cs_ltime;
01015
01016
01017
01018 char *modSpeech(dbref player, char *message, bool bWhich, char *command);
01019
01020
01021
01022 void stack_clr(dbref obj);
01023 bool parse_and_get_attrib(dbref, char *[], char **, dbref *, char *, char **);
01024
01025 #endif // EXTERNS_H