diff -rc pristine/Makefile.in current/Makefile.in *** pristine/Makefile.in Thu Aug 7 21:04:42 1997 --- current/Makefile.in Sun Aug 17 12:03:09 1997 *************** *** 163,168 **** --- 163,176 ---- NET_S = bsd.c NET_O = bsd.o + + # Use the first line if you wish to enable the space engine. Use the second + # line if you don't. If you use the engine, make sure that the #define SPACE + # line is uncommented in config.h. + + SPACE_O = space/space.o + #SPACE_O = + # ================== END OF CONFIGURATION SECTION ================= # Auxiliary source files: only used by offline utilities. *************** *** 196,202 **** $(COM_SRC) $(SA_SRC) $(AUX_SRC) $(LIB_SRC) ALLINC = $(D_INC) $(UDB_INC) $(VER_INC) $(NET_INC) $(LIB_INC) SRC = $(D_SRC) $(COM_SRC) $(UDB_S) $(MALLOC_S) $(CONC_S) ! OBJ = $(D_OBJ) $(COM_OBJ) $(UDB_O) $(MALLOC_O) $(CONC_O) # Files in the standard distribution DIST = $(ALLSRC) $(ALLINC) $(AUXIL) --- 204,210 ---- $(COM_SRC) $(SA_SRC) $(AUX_SRC) $(LIB_SRC) ALLINC = $(D_INC) $(UDB_INC) $(VER_INC) $(NET_INC) $(LIB_INC) SRC = $(D_SRC) $(COM_SRC) $(UDB_S) $(MALLOC_S) $(CONC_S) ! OBJ = $(D_OBJ) $(COM_OBJ) $(UDB_O) $(MALLOC_O) $(CONC_O) $(SPACE_O) # Files in the standard distribution DIST = $(ALLSRC) $(ALLINC) $(AUXIL) diff -rc pristine/attrs.h current/attrs.h *** pristine/attrs.h Thu Aug 7 21:04:42 1997 --- current/attrs.h Sun Aug 17 12:03:09 1997 *************** *** 160,165 **** --- 160,175 ---- #define A_TEMP 255 #define A_USER_START 256 /* Start of user-named attributes */ + + /* Space engine attributes */ + + #ifdef SPACE + + #define A_USER_DBREF 250 /* Console user */ + #define A_DATA_DBREF 251 /* Data object pertaining to ship */ + + #endif + #define ATR_BUF_CHUNK 100 /* Min size to allocate for attribute buffer */ #define ATR_BUF_INCR 6 /* Max size of one attribute */ diff -rc pristine/command.c current/command.c *** pristine/command.c Thu Aug 7 21:04:42 1997 --- current/command.c Sun Aug 17 12:03:09 1997 *************** *** 837,842 **** --- 837,850 ---- else fail++; } + #ifdef SPACE + if ((succ == 0) && (mask & CA_SPACE)) { + if (Space(player)) + succ++; + else + fail++; + } + #endif if (succ > 0) fail = 0; if (fail > 0) *************** *** 2229,2234 **** --- 2237,2247 ---- raw_notify(player, tprintf("%d commands are run from the queue when there is net activity.", mudconf.active_q_chunk)); + #ifdef SPACE + if (mudconf.space_char >= 0) + raw_notify(player, + tprintf("The space debug character is #%d.", mudconf.space_char)); + #endif if (mudconf.idle_wiz_dark) raw_notify(player, "Wizards idle for longer than the default timeout are automatically set DARK."); if (mudconf.safe_unowned) diff -rc pristine/command.h current/command.h *** pristine/command.h Thu Aug 7 21:04:42 1997 --- current/command.h Sun Aug 17 12:03:10 1997 *************** *** 194,199 **** --- 194,202 ---- #define CA_NO_SLAVE 0x00004000 /* Not by SLAVE players */ #define CA_NO_SUSPECT 0x00008000 /* Not by SUSPECT players */ #define CA_NO_GUEST 0x00010000 /* Not by GUEST players */ + #ifdef SPACE + #define CA_SPACE 0x00020000 /* Space objects only */ + #endif #define CA_GBL_BUILD 0x01000000 /* Requires the global BUILDING flag */ #define CA_GBL_INTERP 0x02000000 /* Requires the global INTERP flag */ diff -rc pristine/conf.c current/conf.c *** pristine/conf.c Thu Aug 7 21:04:42 1997 --- current/conf.c Sun Aug 17 12:03:10 1997 *************** *** 253,259 **** mudconf.cache_depth = CACHE_DEPTH; mudconf.cache_width = CACHE_WIDTH; mudconf.cache_names = 1; ! mudstate.events_flag = 0; mudstate.initializing = 0; mudstate.panicking = 0; --- 253,261 ---- mudconf.cache_depth = CACHE_DEPTH; mudconf.cache_width = CACHE_WIDTH; mudconf.cache_names = 1; ! #ifdef SPACE ! mudconf.space_char = -1; ! #endif mudstate.events_flag = 0; mudstate.initializing = 0; mudstate.panicking = 0; *************** *** 1375,1380 **** --- 1377,1386 ---- cf_string, CA_GOD, (int *)mudconf.wizmotd_msg, 4096}, {(char *)"zone_recursion_limit", cf_int, CA_GOD, &mudconf.zone_nest_lim, 0}, + #ifdef SPACE + {(char *)"space_debug_char", + cf_int, CA_WIZARD, &mudconf.space_char, 0}, + #endif { NULL, NULL, 0, NULL, 0}}; diff -rc pristine/config.h current/config.h *** pristine/config.h Thu Aug 7 21:04:42 1997 --- current/config.h Sun Aug 17 12:03:10 1997 *************** *** 33,38 **** --- 33,43 ---- #define StringCopy strcpy #define StringCopyTrunc strncpy + /* + * Enable space engine + */ + #define SPACE + /* Do NOT define these. */ /* #define DSPACE */ /* Lauren's hardcoded DSPACE */ diff -rc pristine/db.c current/db.c *** pristine/db.c Thu Aug 7 21:04:43 1997 --- current/db.c Sun Aug 17 12:03:10 1997 *************** *** 439,444 **** --- 439,448 ---- NULL}, {"*Money", A_MONEY, AF_DARK | AF_NOPROG | AF_NOCMD | AF_INTERNAL, NULL}, + #ifdef SPACE + {"UserDBREF", A_USER_DBREF, AF_ODARK, NULL}, + {"DataDBREF", A_DATA_DBREF, AF_ODARK, NULL}, + #endif {NULL, 0, 0, NULL}}; #ifndef STANDALONE diff -rc pristine/externs.h current/externs.h *** pristine/externs.h Thu Aug 7 21:04:43 1997 --- current/externs.h Tue Aug 19 00:44:54 1997 *************** *** 297,302 **** --- 297,313 ---- extern int FDECL(check_zone_for_player, (dbref, dbref)); extern void FDECL(toast_player, (dbref)); + /* Space update routine */ + #ifdef SPACE + extern void NDECL(spaceInit); + extern void NDECL(spaceUpdate); + extern void FDECL(spaceVersion, (dbref)); + extern dbref FDECL(getLocation, (dbref)); + extern int FDECL(validObject, (dbref)); + extern dbref FDECL(getDebugCharacter, ()); + extern int FDECL(isGoodObject, (dbref)); + #endif + /* Command handler keys */ #define ATTRIB_ACCESS 1 /* Change access to attribute */ diff -rc pristine/flags.c current/flags.c *** pristine/flags.c Thu Aug 7 21:04:43 1997 --- current/flags.c Sun Aug 17 12:03:10 1997 *************** *** 336,341 **** --- 336,345 ---- FLAG_WORD2, CA_GOD|CA_NO_DECOMP, fh_god}, {"HTML", HTML, '(', FLAG_WORD2, 0, fh_any}, + #ifdef SPACE + {"SPACE", SPACECOMPONENT, 'z', + FLAG_WORD3, CA_WIZARD, fh_wiz}, + #endif { NULL, 0, ' ', 0, 0, NULL}}; diff -rc pristine/flags.h current/flags.h *** pristine/flags.h Thu Aug 7 21:04:43 1997 --- current/flags.h Sun Aug 17 12:03:10 1997 *************** *** 243,248 **** --- 243,254 ---- #define MUD_ROBOT 0x00004000 #define MUD_CHOWN_OK 0x00008000 + /* Space Flag */ + + #ifdef SPACE + #define SPACECOMPONENT 0x00000001 + #endif + /* --------------------------------------------------------------------------- * FLAGENT: Information about object flags. */ *************** *** 431,436 **** --- 437,446 ---- (Typeof(x) == TYPE_PLAYER)) #define Slave(x) ((Flags2(Owner(x)) & SLAVE) != 0) #define Hidden(x) ((Flags(x) & DARK) != 0) + + #ifdef SPACE + #define Space(x) ((Flags3(x) & SPACECOMPONENT) != 0) + #endif #define H_Startup(x) ((Flags(x) & HAS_STARTUP) != 0) #define H_Fwdlist(x) ((Flags2(x) & HAS_FWDLIST) != 0) diff -rc pristine/functions.c current/functions.c *** pristine/functions.c Thu Aug 7 21:04:43 1997 --- current/functions.c Sun Aug 17 12:03:11 1997 *************** *** 116,121 **** --- 116,127 ---- XFUNCTION(fun_items); XFUNCTION(fun_lstack); + #ifdef SPACE + + XFUNCTION(fun_spacecall); + + #endif + /* * This is the prototype for functions */ *************** *** 5058,5063 **** --- 5064,5072 ---- {"ZFUN", fun_zfun, 0, FN_VARARGS, CA_PUBLIC}, {"ZONE", fun_zone, 1, 0, CA_PUBLIC}, {"ZWHO", fun_zwho, 1, 0, CA_PUBLIC}, + #ifdef SPACE + {"SC", fun_spacecall, 0, FN_VARARGS, CA_SPACE}, + #endif {NULL, NULL, 0, 0, 0}}; /* *INDENT-ON* */ diff -rc pristine/game.c current/game.c *** pristine/game.c Thu Aug 7 21:04:43 1997 --- current/game.c Sun Aug 17 14:10:16 1997 *************** *** 1464,1469 **** --- 1464,1476 ---- for (mindb = 0; mindb < MAX_GLOBAL_REGS; mindb++) mudstate.global_regs[mindb] = alloc_lbuf("main.global_reg"); mudstate.now = time(NULL); + + #ifdef SPACE + + /* Initialize space engine */ + spaceInit(); + + #endif process_preload(); load_restart_db(); *************** *** 1501,1506 **** --- 1508,1514 ---- #ifdef MCHECK mtrace(); #endif + /* * go do it diff -rc pristine/mudconf.h current/mudconf.h *** pristine/mudconf.h Thu Aug 7 21:04:44 1997 --- current/mudconf.h Sun Aug 17 12:03:11 1997 *************** *** 188,193 **** --- 188,196 ---- int lock_nest_lim; /* Max nesting of lock evals */ int parent_nest_lim;/* Max levels of parents */ int zone_nest_lim; /* Max nesting of zones */ + #ifdef SPACE + int space_char; /* Space debug character */ + #endif #else int paylimit; /* getting money gets hard over this much */ int digcost; /* cost of @dig command */ diff -rc pristine/predicates.c current/predicates.c *** pristine/predicates.c Thu Aug 7 21:04:44 1997 --- current/predicates.c Tue Aug 19 00:44:13 1997 *************** *** 1851,1856 **** --- 1851,1890 ---- } + #ifdef SPACE + + /* + * Space utility functions. These are required as accessing the DB structure + * directly produces unpredictable results. + */ + dbref getLocation(dbref obj) + { + return(db[obj].location); + } + + int validObject(dbref obj) + { + if (obj >= 0 && obj < mudstate.db_top && (db[obj].flags & TYPE_MASK) < NOTYPE) + return 1; + else + return 0; + } + + dbref getDebugCharacter() + { + return(mudconf.space_char); + + } + + int isGoodObject(dbref object) + { + return(Good_obj(object)); + } + + #endif + #endif /* * STANDALONE */ + + diff -rc pristine/timer.c current/timer.c *** pristine/timer.c Thu Aug 7 21:04:45 1997 --- current/timer.c Sun Aug 17 12:03:11 1997 *************** *** 139,144 **** --- 139,150 ---- } #endif + #ifdef SPACE + + spaceUpdate(); + + #endif + /* * reset alarm */ diff -rc pristine/version.c current/version.c *** pristine/version.c Thu Aug 7 21:04:45 1997 --- current/version.c Sun Aug 17 12:03:11 1997 *************** *** 58,63 **** --- 58,67 ---- buff = alloc_mbuf("do_version"); sprintf(buff, "Build date: %s", MUX_BUILD_DATE); notify(player, buff); + #ifdef SPACE + /* Show space version */ + spaceVersion(player); + #endif free_mbuf(buff); }