Changeset 403
- Timestamp:
- 08/12/06 06:06:58 (2 years ago)
- Files:
-
- 1.7.7/CHANGES (modified) (1 diff)
- 1.7.7/INSTALL (modified) (1 diff)
- 1.7.7/Patchlevel (modified) (1 diff)
- 1.7.7/game/mushcnf.dst (modified) (1 diff)
- 1.7.7/game/txt/hlp/pennflag.hlp (modified) (1 diff)
- 1.7.7/game/txt/hlp/pennfunc.hlp (modified) (10 diffs)
- 1.7.7/game/txt/hlp/penntop.hlp (modified) (1 diff)
- 1.7.7/game/txt/hlp/pennvers.hlp (modified) (4 diffs)
- 1.7.7/hdrs/conf.h (modified) (3 diffs)
- 1.7.7/hdrs/dbdefs.h (modified) (5 diffs)
- 1.7.7/hdrs/extchat.h (modified) (1 diff)
- 1.7.7/hdrs/externs.h (modified) (2 diffs)
- 1.7.7/hdrs/flags.h (modified) (1 diff)
- 1.7.7/hdrs/version.h (modified) (1 diff)
- 1.7.7/options.h.dist (modified) (1 diff)
- 1.7.7/src/bsd.c (modified) (9 diffs)
- 1.7.7/src/command.c (modified) (1 diff)
- 1.7.7/src/create.c (modified) (7 diffs)
- 1.7.7/src/db.c (modified) (9 diffs)
- 1.7.7/src/destroy.c (modified) (2 diffs)
- 1.7.7/src/extchat.c (modified) (4 diffs)
- 1.7.7/src/extmail.c (modified) (3 diffs)
- 1.7.7/src/flags.c (modified) (1 diff)
- 1.7.7/src/function.c (modified) (2 diffs)
- 1.7.7/src/fundb.c (modified) (41 diffs)
- 1.7.7/src/funstr.c (modified) (2 diffs)
- 1.7.7/src/game.c (modified) (2 diffs)
- 1.7.7/src/local.dst (modified) (5 diffs)
- 1.7.7/src/look.c (modified) (2 diffs)
- 1.7.7/src/parse.c (modified) (1 diff)
- 1.7.7/src/player.c (modified) (1 diff)
- 1.7.7/src/speech.c (modified) (1 diff)
- 1.7.7/src/tables.c (modified) (2 diffs)
- 1.7.7/src/warnings.c (modified) (1 diff)
- 1.7.7/src/wiz.c (modified) (1 diff)
- 1.7.7/utils/gentables.c (modified) (3 diffs)
- 1.7.7/utils/mkcmds.sh.SH (modified) (4 diffs)
- 1.7.7/win32/funs.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
1.7.7/CHANGES
r401 r403 18 18 19 19 ========================================================================== 20 21 Version 1.7.7 patchlevel 2 December 22, 2002 22 23 Major Changes: 24 * The LOCAL_DATA define has been removed along with the pointer 25 in the object structure. The local functions called on creation, 26 destruction, and cloning are now always called. Objects can 27 now store data in a single hashtable using the set_objdata() 28 and get_objdata() functions. As a proof of concept, the transitory 29 channel lists on objects are now stored here, and the "channels" 30 pointer has been removed from the object structure. Design 31 and much of the implementation by Vadiv@M*U*S*H. 32 Powers: 33 * can_nspemit power can be used to provide access to @nspemit 34 without a Wizard bit. [SW] 35 Functions: 36 * lpos from Mux, TM3. [SW] 37 Fixes: 38 * Fix to some gcc-specific macros reported by Peter Bengston and 39 Michael Holbrook. [SW] 40 * Improvements to stripaccents/noaccents conversions. [SW] 41 * Fixes from 1.7.6p3. 42 20 43 21 44 Version 1.7.7 patchlevel 1 December 17, 2002 1.7.7/INSTALL
r399 r403 121 121 ./Configure -d 122 122 123 On cygwin systems :123 On cygwin systems, try ./Configure -d, but if it fails, try: 124 124 . Configure 125 125 (That's a single period, a space, and Configure) 1.7.7/Patchlevel
r401 r403 1 1 Do not edit this file. It is maintained by the official PennMUSH patches. 2 This is PennMUSH 1.7.7p 12 This is PennMUSH 1.7.7p2 1.7.7/game/mushcnf.dst
r401 r403 163 163 # which could be useful if your host limits your stack (it will prevent 164 164 # a crash). The higher your allowed stack size limit, the larger the 165 # mush process can grow, and the higher this can be set. 166 # But remember that you need to recurse for every [ or { or function call167 # in your code, and those add up quickly. So this must often be set quite168 # high (e.g. 18000), alas. Setting it to '0' means unlimited.169 call_limit 10000165 # mush process can grow, and the higher this can be set. Generally 166 # speaking, you won't ever see more than 8192 recursions, so that's 167 # probably an upper limit, but most sane code shouldn't need more 168 # than a couple thousand. Setting it to '0' means unlimited. 169 call_limit 5000 170 170 171 171 # The maximum number of milliseconds of CPU time that a single queue entry 1.7.7/game/txt/hlp/pennflag.hlp
r399 r403 419 419 $-commands; thus, any object which does not have $-commands on it should 420 420 be set NO_COMMAND. Many MUSHes choose to have all objects initially set 421 NO_COMMAND at creation. 421 NO_COMMAND at creation. The flag has no effect on exits. 422 422 423 423 See also: USER-DEFINED COMMANDS 1.7.7/game/txt/hlp/pennfunc.hlp
r401 r403 46 46 Communication functions: Send messages to objects (PEMIT, OEMIT) 47 47 Dbref functions: return dbref info related to objects (LOC, LEXITS) 48 Floating point functions: floating point math (SIN, ROUND)49 48 Global functions: local MUSH-specific functions defined with @function 49 Html functions: output html tags for Pueblo-compatible clients 50 50 Information functions: find out something about objects (FLAGS, MONEY) 51 51 List functions: manipulate lists (REVWORDS, FIRST) … … 109 109 on an object. 110 110 111 con() entrances() followers() following() home() 112 lcon() lexits() loc() locate() lparent() 113 lsearch() next() num() owner() parent() 111 con() entrances() exit() followers() following() 112 home() lcon() lexits() loc() locate() 113 lparent() lplayers() lsearch() lvcon() lvexits() 114 lvplayers() next() num() owner() parent() 114 115 pmatch() rloc() rnum() room() where() 115 116 zone() … … 135 136 mailstats() mailstatus() mailsubject() mailtime() 136 137 137 & Floating point functions138 Floating point functions operate on floating point numbers. Most of139 them return a floating-point number as a result. Floating point140 results can have at most 6 decimal places of precision.141 142 These functions only exist if floating point computation is enabled.143 Check "@config" to see if they are.144 145 acos() asin() atan() ceil() cos()146 e() exp() fdiv() floor() log()147 ln() pi() power() round() sin()148 sqrt() tan()149 150 138 & List functions 151 139 List functions take at least one list of elements and return transformed … … 160 148 replace() rest() revwords() setdiff() setinter() 161 149 setunion() shuffle() sort() sortby() splice() 162 wordpos() words()150 step() table() wordpos() words() 163 151 164 152 See also: LISTS … … 178 166 These functions operate only with floating point numbers: 179 167 acos() asin() atan() atan2() ceil() 180 cos() e() exp() fdiv() floor()181 f mod() ln() log() pi() power()182 round() sin() sqrt() tan()168 cos() ctu() e() exp() fdiv() 169 floor() fmod() ln() log() pi() 170 power() round() sin() sqrt() tan() 183 171 184 172 These functions operate on n-dimensional vectors. A vector … … 205 193 ifelse() lcstr() left() lit() ljust() 206 194 merge() mid() ord() pos() regedit() 207 regmatch() repeat() reverse() right() rjust()208 scramble() secure() sha1() space() spellnum()209 s quish() strcat() strinsert() stripaccent() stripansi()210 str len() strmatch() switch() trim() ucstr()211 wrap()195 lpos() regmatch() repeat() reverse() right() 196 rjust() scramble() secure() sha1() space() 197 spellnum() squish() strcat() strinsert() stripaccents() 198 stripansi() strlen() strmatch() switch() trim() 199 ucstr() wrap() 212 200 213 201 See also: STRINGS … … 1671 1659 regardless of whether or not you have objects in it. 1672 1660 1673 See also: lexits(), con(), next()1661 See also: lexits(), lplayers(), con(), next(), lvcon() 1674 1662 & LCSTR() 1675 1663 lcstr(<string>) … … 1896 1884 1897 1885 See also: lvplayers(), lcon() 1886 & LPOS() 1887 lpos(<string>, <character>) 1888 1889 This function returns a list of the positions where <character> occupies 1890 in <string>, with te first character of the string being 0. Note that 1891 this differs from the pos() function, but is consistent with other string 1892 functions like mid() and delete(). 1893 1894 If <character> is a null argument, space is used. 1895 If <character> is not found anywhere in <string>, an empty list is 1896 returned. 1897 1898 Example: 1899 > say lpos(a-bc-def-g, -) 1900 You say, "1 4 8" 1901 1902 See also: pos() 1898 1903 & LSEARCH() 1899 1904 & SEARCH() … … 2296 2301 acts just like @name <object>=<new name>. Consequently, if renaming 2297 2302 a player, you must use the player's password or be God. 2303 2304 name() with no arguments currently returns nothing. This should be an 2305 error, but enough old code has been written that expects this behavior 2306 that it will continue to do this for the time being. Don't rely on it. 2298 2307 2299 2308 Related functions: FULLNAME(), INAME() … … 3238 3247 See also: @tel 3239 3248 & TEXTFILE() 3249 & dynhelp() 3240 3250 textfile(<type>,<entry>) 3241 3251 1.7.7/game/txt/hlp/penntop.hlp
r399 r403 966 966 tport_anywhere Can @teleport to anywhere. 967 967 unkillable Can not be killed 968 can_nspemit Can use @nspemit and nspemit() 968 969 969 970 See also: @power 1.7.7/game/txt/hlp/pennvers.hlp
r401 r403 1 1 & changes 2 & 1.7.7p 12 & 1.7.7p2 3 3 This is a list of changes in this patchlevel which are probably of 4 4 interest to players. More information about new commands and functions … … 12 12 be read in 'help patchlevels'. 13 13 14 Version 1.7.7 patchlevel 2 December 22, 2002 15 16 Major Changes: 17 * The LOCAL_DATA define has been removed along with the pointer 18 in the object structure. The local functions called on creation, 19 destruction, and cloning are now always called. Objects can 20 now store data in a single hashtable using the set_objdata() 21 and get_objdata() functions. As a proof of concept, the transitory 22 channel lists on objects are now stored here, and the "channels" 23 pointer has been removed from the object structure. Design 24 and much of the implementation by Vadiv@M*U*S*H. 25 Powers: 26 * can_nspemit power can be used to provide access to @nspemit 27 without a Wizard bit. [SW] 28 Functions: 29 * lpos from Mux, TM3. [SW] 30 Fixes: 31 * Fix to some gcc-specific macros reported by Peter Bengston and 32 Michael Holbrook. [SW] 33 * Improvements to stripaccents/noaccents conversions. [SW] 34 * Fixes from 1.7.6p3. 35 36 37 & 1.7.7p1 14 38 Version 1.7.7 patchlevel 1 December 17, 2002 15 39 … … 547 571 * Indentation fixes [SW] 548 572 * Fixes up to 1.7.4p12 merged in. 573 574 & 1.7.6p3 575 Version 1.7.6 patchlevel 3 December 22, 2002 576 577 Minor changes: 578 * call_limit now controls the maximum recursion in process_expression, 579 instead of maximum calls to p_e per command cycle. This still 580 limits stack size, but doesn't get in the way of massive code 581 nearly as much. People using a very high call_limit value should 582 probably lower it significantly. Patch by Philip Mak. 583 * Improved error messages for many database information functions. 584 Notably, several functions that require at least one argument, 585 now complain if they don't get it rather than returning silently. 586 Suggested by Intrevis@M*U*S*H. [SW] 587 Fixes: 588 * @warnings are no longer shown on GOING objects. Suggested by 589 Philip Mak. 590 * Help fixes by Intrevis, Time, and Ambrosia@M*U*S*H 591 * Bug in @decomp/skipdefaults reported by Philip Mak. [SW] 592 * Tweaks to utils/mkcmds.sh [SW] 593 * home() on a room acts as described in the help. Reported by 594 Intrevis@M*U*S*H. [SW] 595 * whisper/noisy double-notified the whisperer. Reported by Philip Mak. 596 * Crash bug in @mail fixed. Reported by Titan@OtherSpace. 597 549 598 550 599 & 1.7.6p2 … … 5826 5875 type 'help <version>p<patchlevel>'. For example, 'help 1.7.2p3' 5827 5876 5828 1.7.7: 0, 1 5829 1.7.6: 0, 1, 2 5877 1.7.7: 0, 1, 2 5878 1.7.6: 0, 1, 2, 3 5830 5879 1.7.5: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 5831 5880 1.7.4: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 1.7.7/hdrs/conf.h
r399 r403 351 351 /* Compiler-specific stuff. */ 352 352 353 #ifndef __GNUC_PREREQ 354 #if defined __GNUC__ && defined __GNUC_MINOR__ 355 # define __GNUC_PREREQ(maj, min) \ 356 ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) 357 #else 358 # define __GNUC_PREREQ(maj, min) 0 359 #endif 360 #endif 361 353 362 /* For gcc 3 and up, this attribute lets the compiler know that the 354 363 * function returns a newly allocated value, for pointer aliasing 355 364 * optimizations. 356 365 */ 357 #ifndef __attribute_malloc__ 358 #if defined(__GNUC__) && __GNUC__ >= 3 366 #if !defined(__attribute_malloc__) && __GNUC_PREREQ(2, 96) 359 367 #define __attribute_malloc__ __attribute__ ((__malloc__)) 360 #el se368 #elif !defined(__attribute_malloc__) 361 369 #define __attribute_malloc__ 362 #endif363 370 #endif 364 371 … … 369 376 * This should be a Configure check sometime. 370 377 */ 371 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 378 #if __GNUC_PREREQ(2, 92) 379 #define RESTRICT __restrict 380 #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 372 381 #define RESTRICT restrict 373 #elif defined(__GNUC__)374 #define RESTRICT __restrict__375 382 #else 376 383 #define RESTRICT … … 381 388 #if defined(WIN32) && _MSC_VER >= 1200 382 389 #define NORETURN __declspec(noreturn) 383 #elif defined(HAS _ATTRIBUTE)390 #elif defined(HASATTRIBUTE) 384 391 #define NORETURN __attribute__ ((__noreturn__)) 385 392 #else 1.7.7/hdrs/dbdefs.h
r399 r403 9 9 #endif 10 10 #include <time.h> 11 #include "htab.h" 11 12 12 13 extern int depth; … … 62 63 63 64 #define AttrCount(x) (db[(x)].attrcount) 64 65 #ifdef LOCAL_DATA66 #define LocData(x) (db[(x)].local_data)67 #endif68 65 69 66 /* Moved from warnings.c because create.c needs it. */ … … 234 231 dbref zone; /* zone master object number */ 235 232 int penn; /* number of pennies object contains */ 236 #ifdef CHAT_SYSTEM237 CHANLIST *channels;238 #endif239 233 int warnings; /* bitflags of warning types */ 240 234 time_t creation_time; /* Time/date of object creation */ … … 243 237 * logins for players. */ 244 238 int attrcount; /* Number of attribs on the object */ 245 #ifdef LOCAL_DATA246 void *local_data;247 #endif248 239 object_flag_type flags; 249 240 object_flag_type toggles; … … 263 254 extern struct object *db; 264 255 extern dbref db_top; 256 257 extern void *get_objdata(dbref thing, const char *keybase); 258 extern void *set_objdata(dbref thing, const char *keybase, void *data); 259 extern void clear_objdata(dbref thing); 265 260 266 261 #define DOLIST(var, first)\ 1.7.7/hdrs/extchat.h
r399 r403 92 92 }; 93 93 94 #define Chanlist(x) db[(x)].channels 94 #define Chanlist(x) get_objdata(x, "CHANNELS") 95 #define s_Chanlist(x, y) set_objdata(x, "CHANNELS", y) 95 96 96 97 /* Channel type flags and macros */ 1.7.7/hdrs/externs.h
r401 r403 368 368 369 369 typedef struct { 370 unsigned charbase;370 const char *base; 371 371 const char *entity; 372 372 } accent_info; … … 474 474 void local_connect(dbref player, int isnew, int num); 475 475 void local_disconnect(dbref player, int num); 476 #ifdef LOCAL_DATA477 476 void local_data_create(dbref object); 478 477 void local_data_clone(dbref clone, dbref source); 479 478 void local_data_free(dbref object); 480 #endif481 479 482 480 /* funlist.c */ 1.7.7/hdrs/flags.h
r399 r403 272 272 #define LINK_ANYWHERE 0x20000000 /* Can @link an exit to any room */ 273 273 #define OPEN_ANYWHERE 0x40000000 /* Can @open an exit from any room */ 274 #define CAN_NSPEMIT 0x80000000 /* Can use @nspemit and nspemit() */ 274 275 275 276 /* These powers are obsolete, but are kept around to implement 1.7.7/hdrs/version.h
r401 r403 1 #define VERSION "PennMUSH version 1.7.7 patchlevel 1 [12/17/2002]"2 #define SHORTVN "PennMUSH 1.7.7p 1"1 #define VERSION "PennMUSH version 1.7.7 patchlevel 2 [12/22/2002]" 2 #define SHORTVN "PennMUSH 1.7.7p2" 1.7.7/options.h.dist
r399 r403 118 118 /* #define MEM_CHECK /* */ 119 119 120 /* Defining this will add 4 bytes to every object in memory, and that is121 * the local_data void *pointer.122 * Usefull for local hackers, who can store stuff like skills, languages,123 * combat stats etc in a record this points to, and then store/reload it124 * in the local_* hooks.125 * If you are NOT one of those who modify the local C source extensivly,126 * this will be COMPLETELY worthless to you.127 */128 /* #define LOCAL_DATA /* */129 130 120 /* If defined, use the info_slave to get information from identd, 131 121 * instead of having the MUSH do it directly. This may help reduce lag 1.7.7/src/bsd.c
r401 r403 352 352 void add_to_queue(struct text_queue *q, const char *b, int n); 353 353 int flush_queue(struct text_queue *q, int n); 354 int queue_write(DESC *d, const char *b, int n); 355 int queue_newwrite(DESC *d, const char *b, int n); 356 int queue_new_eol(DESC *d); 357 int queue_string(DESC *d, const char *s); 354 static int queue_write(DESC *d, const char *b, int n); 355 static int queue_newwrite(DESC *d, const unsigned char *b, int n); 356 static int queue_string(DESC *d, const char *s); 358 357 static int queue_string_eol(DESC *d, const char *s); 359 358 int process_output(DESC *d); … … 1064 1063 safe_str("\xFF\xFF", t, &o); 1065 1064 else if (strip) 1066 safe_ chr((char)accent_table[IAC].base, t, &o);1065 safe_str(accent_table[IAC].base, t, &o); 1067 1066 else 1068 1067 safe_chr((char) IAC, t, &o); … … 1082 1081 break; 1083 1082 default: 1084 if (strip )1085 safe_ chr((char)accent_table[(unsigned char) *p].base, t, &o);1083 if (strip && accent_table[(unsigned char) *p].base) 1084 safe_str(accent_table[(unsigned char) *p].base, t, &o); 1086 1085 else 1087 1086 safe_chr(*p, t, &o); … … 1205 1204 break; 1206 1205 default: 1207 safe_chr((char) accent_table[(unsigned char) *p].base, t, &o); 1206 if (accent_table[(unsigned char) *p].base) 1207 safe_str(accent_table[(unsigned char) *p].base, t, &o); 1208 else 1209 safe_chr(*p, t, &o); 1208 1210 break; 1209 1211 } … … 1242 1244 if (type == NA_TANSI || type == NA_TCOLOR) 1243 1245 safe_str("\xFF\xFF", t, &o); 1244 else if (strip )1245 safe_ chr(accent_table[IAC].base, t, &o);1246 else if (strip && accent_table[IAC].base) 1247 safe_str(accent_table[IAC].base, t, &o); 1246 1248 else 1247 1249 safe_chr((char) IAC, t, &o); … … 1270 1272 ansi_change_state(t, &o, color, state, newstate); 1271 1273 } 1272 if (strip )1273 safe_ chr((char)accent_table[(unsigned char) *p].base, t, &o);1274 if (strip && accent_table[(unsigned char) *p].base) 1275 safe_str(accent_table[(unsigned char) *p].base, t, &o); 1274 1276 else 1275 1277 safe_chr(*p, t, &o); … … 3072 3074 } 3073 3075 3074 int3076 static int 3075 3077 queue_write(DESC *d, const char *b, int n) 3076 3078 { … … 3111 3113 } 3112 3114 3113 int3114 queue_newwrite(DESC *d, const char *b, int n)3115 static int 3116 queue_newwrite(DESC *d, const unsigned char *b, int n) 3115 3117 { 3116 3118 int space; … … 3220 3222 } 3221 3223 3222 int3224 static int 3223 3225 queue_string(DESC *d, const char *s) 3224 3226 { 1.7.7/src/command.c
r399 r403 192 192 {"@NOTIFY", "ALL ANY", cmd_notify_drain, CMD_T_ANY | CMD_T_EQSPLIT, 0, 0, 0}, 193 193 {"@NSPEMIT", "LIST SILENT NOISY NOEVAL", cmd_nspemit, 194 CMD_T_ANY | CMD_T_EQSPLIT, WIZARD, 0, 0},194 CMD_T_ANY | CMD_T_EQSPLIT, WIZARD, 0, CAN_NSPEMIT}, 195 195 {"@NUKE", NULL, cmd_nuke, CMD_T_ANY | CMD_T_NOGAGGED, 0, 0, 0}, 196 196 1.7.7/src/create.c
r399 r403 141 141 } 142 142 current_state.exits++; 143 #ifdef LOCAL_DATA144 143 local_data_create(new_exit); 145 #endif146 144 return new_exit; 147 145 } … … 359 357 } 360 358 current_state.rooms++; 361 #ifdef LOCAL_DATA362 359 local_data_create(room); 363 #endif364 360 if (tport) { 365 361 /* We need to use the full command, because we need NO_TEL … … 424 420 notify_format(player, "Created: Object %s.", unparse_dbref(thing)); 425 421 current_state.things++; 426 #ifdef LOCAL_DATA427 422 local_data_create(thing); 428 #endif429 423 return thing; 430 424 } … … 442 436 memcpy(REFDB(clone), REFDB(thing), sizeof(struct object)); 443 437 Owner(clone) = Owner(player); 444 #ifdef CHAT_SYSTEM445 Chanlist(clone) = NULL;446 #endif447 438 Name(clone) = NULL; 448 439 if (newname && *newname) … … 519 510 moveto(clone, Location(player)); 520 511 current_state.things++; 521 #ifdef LOCAL_DATA522 LocData(clone) = NULL;523 512 local_data_clone(clone, thing); 524 #endif525 513 real_did_it(player, clone, NULL, NULL, NULL, NULL, "ACLONE", NOTHING, 526 514 wenv); … … 535 523 notify_format(player, T("Cloned: Room #%d."), clone); 536 524 current_state.rooms++; 537 #ifdef LOCAL_DATA538 LocData(clone) = NULL;539 525 local_data_clone(clone, thing); 540 #endif541 526 real_did_it(player, clone, NULL, NULL, NULL, NULL, "ACLONE", NOTHING, 542 527 wenv); … … 589 574 ("Warning: @CLONE/PRESERVE on an exit with WIZ, ROY, @Powers, or Warnings.")); 590 575 notify_format(player, T("Cloned: Exit #%d."), clone); 591 #ifdef LOCAL_DATA592 LocData(clone) = NULL;593 576 local_data_clone(clone, thing); 594 #endif595 577 return clone; 596 578 } 1.7.7/src/db.c
r399 r403 29 29 #include "strtree.h" 30 30 #include "parse.h" 31 #include "htab.h" 31 32 #include "confmagic.h" 32 33 … … 59 60 60 61 dbref db_size = DB_INITIAL_SIZE; 62 63 HASHTAB htab_objdata; 64 HASHTAB htab_objdata_keys; 61 65 62 66 extern char ccom[]; … … 75 79 int get_list(FILE * f, dbref i); 76 80 void db_free(void); 81 static void init_objdata_htab(int size); 77 82 78 83 StrTree object_names; … … 157 162 o->toggles = 0; 158 163 o->powers = 0; 159 #ifdef CHAT_SYSTEM160 /* initialize channels here, since it's not going to get done otherwise */161 o->channels = NULL;162 #endif163 164 o->warnings = 0; 164 165 o->modification_time = o->creation_time = mudtime; 165 #ifdef LOCAL_DATA166 o->local_data = NULL;167 #endif168 166 o->attrcount = 0; 169 167 initialized++; … … 199 197 o->toggles = 0; 200 198 o->powers = 0; 201 #ifdef CHAT_SYSTEM202 /* initialize channels here, since it's not going to get done otherwise */203 o->channels = NULL;204 #endif205 199 o->warnings = 0; 206 200 o->modification_time = o->creation_time = mudtime; 207 #ifdef LOCAL_DATA208 o->local_data = NULL;209 #endif210 201 o->attrcount = 0; 211 202 if (current_state.garbage) … … 1193 1184 case '~': 1194 1185 db_init = (getref(f) * 3) / 2; 1186 init_objdata_htab(db_init); 1195 1187 break; 1196 1188 /* Use the MUSH 2.0 header stuff to see what's in this db */ … … 1313 1305 else 1314 1306 temp = 0; 1315 #ifdef CHAT_SYSTEM1316 o->channels = NULL;1317 #endif /* CHAT_SYSTEM */1318 1307 1319 1308 /* If there are warnings in the db, read 'em in */ … … 1347 1336 Toggles(i) &= ~PLAYER_CONNECT; 1348 1337 } 1349 #ifdef LOCAL_DATA1350 o->local_data = NULL;1351 #endif1352 1338 break; 1353 1339 … … 1374 1360 } 1375 1361 } 1362 1363 static void 1364 init_objdata_htab(int size) 1365 { 1366 hashinit(&htab_objdata, size, 4); 1367 hashinit(&htab_objdata_keys, 8, 32); 1368 } 1369 1370 void * 1371 set_objdata(dbref thing, const char *keybase, void *data) 1372 { 1373 if (data) { 1374 if (hashadd(tprintf("%s_#%d", keybase, thing), data, &htab_objdata) < 0) 1375 return NULL; 1376 if (hash_find(&htab_objdata_keys, keybase) == NULL) { 1377 char *newkey = strdup(keybase); 1378 hashadd(keybase, (void *) &newkey, &htab_objdata_keys); 1379 } 1380 return data; 1381 } else { 1382 hashdelete(tprintf("%s_#%d", keybase, thing), &htab_objdata); 1383 return NULL; 1384 } 1385 } 1386 1387 void * 1388 get_objdata(dbref thing, const char *keybase) 1389 { 1390 return hashfind(tprintf("%s_#%d", keybase, thing), &htab_objdata); 1391 } 1392 1393 void 1394 clear_objdata(dbref thing) 1395 { 1396 char *p; 1397 /* Clear all data stored for this object. Used when the object is freed */ 1398 for (p = (char *) hash_firstentry(&htab_objdata_keys); 1399 p; p = (char *) hash_nextentry(&htab_objdata_keys)) { 1400 set_objdata(thing, p, NULL); 1401 } 1402 } 1.7.7/src/destroy.c
r399 r403 577 577 if (!GoodObject(thing)) 578 578 return; 579 #ifdef LOCAL_DATA580 579 local_data_free(thing); 581 #endif582 580 switch (Typeof(thing)) { 583 581 case TYPE_THING: … … 714 712 Exits(thing) = NOTHING; 715 713 Home(thing) = NOTHING; 714 715 clear_objdata(thing); 716 716 717 717 Next(thing) = first_free; 1.7.7/src/extchat.c
r399 r403 401 401 /* No channels? */ 402 402 if (!Chanlist(who)) { 403 Chanlist(who) = tmp;404 Chanlist(who)->next = NULL;403 tmp->next = NULL; 404 s_Chanlist(who, tmp); 405 405 return; 406 406 } … … 408 408 /* First channel? */ 409 409 if (strcasecoll(ChanName(p->chan), ChanName(*ch)) > 0) { 410 Chanlist(who) = tmp;411 Chanlist(who)->next = p;410 tmp->next = p; 411 s_Chanlist(who, tmp); 412 412 return; 413 413 } else if (!strcasecmp(ChanName(p->chan), ChanName(*ch))) { … … 441 441 if (!ch) 442 442 return; 443 if (!Chanlist(who))444 return;445 443 p = Chanlist(who); 444 if (!p) 445 return; 446 446 if (p->chan == ch) { 447 447 /* First channel */ 448 Chanlist(who) = p->next;448 s_Chanlist(who, p->next); 449 449 free_chanlist(p); 450 450 return; … … 2287 2287 } 2288 2288 2289 2289 2290 #endif /* CHAT_SYSTEM */ 1.7.7/src/extmail.c
r399 r403 2535 2535 struct mail_alias *m; 2536 2536 int i; 2537 char keepsub[BUFFER_LEN];2538 2537 2539 2538 /* send a mail message to each player on an alias */ … … 2548 2547 return 0; 2549 2548 2550 strcpy(keepsub, uncompress(subject));2551 2552 2549 /* If they are not allowed to see the people on the alias, then 2553 2550 * we must treat this as a case of silent mailing. … … 2562 2559 2563 2560 for (i = 0; i < m->size; i++) { 2564 send_mail(player, m->members[i], keepsub, message, flags, silent, nosig);2561 send_mail(player, m->members[i], subject, message, flags, silent, nosig); 2565 2562 } 2566 2563 return 1; /* Success */ 1.7.7/src/flags.c
r399 r403 187 187 {"Tport_Anywhere", TEL_ANYWHERE}, 188 188 {"Unkillable", UNKILLABLE}, 189 {"Can_nspemit", CAN_NSPEMIT}, 189 190 {NULL, 0} 190 191 }; 1.7.7/src/function.c
r401 r403 298 298 {"LPARENT", fun_lparent, 1, 1, FN_REG}, 299 299 {"LPLAYERS", fun_lplayers, 1, 1, FN_REG}, 300 {"LPOS", fun_lpos, 2, 2, FN_REG}, 300 301 {"LSEARCH", fun_lsearch, 1, 5, FN_REG}, 301 302 {"LSEARCHR", fun_lsearch, 1, 5, FN_REG}, … … 335 336 {"MUNGE", fun_munge, 3, 5, FN_REG}, 336 337 {"MWHO", fun_lwho, 0, 0, FN_REG}, 337 {"NAME", fun_name, 1, 2, FN_REG},338 {"NAME", fun_name, 0, 2, FN_REG}, 338 339 {"NAND", fun_nand, 1, INT_MAX, FN_REG}, 339 340 {"NATTR", fun_nattr, 1, 1, FN_REG}, 1.7.7/src/fundb.c
r399 r403 116 116 117 117 thing = match_thing(executor, args[0]); 118 if ( thing == NOTHING) {119 safe_str(T(e_ match), buff, bp);118 if (!GoodObject(thing)) { 119 safe_str(T(e_notvis), buff, bp); 120 120 return; 121 121 } … … 135 135 dbref thing; 136 136 thing = match_thing(executor, args[0]); 137 if ( thing == NOTHING) {138 safe_str(T(e_ match), buff, bp);137 if (!GoodObject(thing)) { 138 safe_str(T(e_notvis), buff, bp); 139 139 return; 140 140 } … … 153 153 154 154 thing = match_thing(executor, args[0]); 155 if ( thing == NOTHING) {155 if (!GoodObject(thing)) { 156 156 safe_str(T(e_notvis), buff, bp); 157 157 return; … … 187 187 *s++ = '\0'; 188 188 thing = match_thing(executor, args[0]); 189 if ( thing == NOTHING) {189 if (!GoodObject(thing)) { 190 190 safe_str(T(e_notvis), buff, bp); 191 191 return; … … 203 203 204 204 thing = match_thing(executor, args[0]); 205 if ( thing == NOTHING) {205 if (!GoodObject(thing)) { 206 206 safe_str(T(e_notvis), buff, bp); 207 207 return; … … 253 253 254 254 thing = match_thing(executor, args[0]); 255 if ( thing == NOTHING) {255 if (!GoodObject(thing)) { 256 256 safe_str(T(e_notvis), buff, bp); 257 257 return; … … 295 295 *s++ = '\0'; 296 296 thing = match_thing(executor, args[0]); 297 if ( thing == NOTHING) {297 if (!GoodObject(thing)) { 298 298 safe_str(T(e_notvis), buff, bp); 299 299 return; … … 424 424 *p++ = '\0'; 425 425 thing = match_thing(executor, args[0]); 426 if ( thing == NOTHING) {427 safe_str( "#-1", buff, bp);426 if (!GoodObject(thing)) { 427 safe_str(T(e_notvis), buff, bp); 428 428 return; 429 429 } … … 441 441 } 442 442 } 443 444 #ifdef WIN32 445 #pragma warning( disable : 4761) /* Disable bogus conversion warning */ 446 #endif 447 /* ARGSUSED */ 448 FUNCTION(fun_haspower) 449 { 450 dbref it; 451 object_flag_type pwr; 452 453 it = match_thing(executor, args[0]); 454 if (!GoodObject(it)) { 455 safe_str(T(e_notvis), buff, bp); 456 return; 457 } 458 if (HASPOWER_RESTRICTED) 459 if (!Can_Examine(executor, it)) { 460 notify(executor, 461 T("We could let you see that, but then we'd have to kill you.")); 462 safe_str("#-1", buff, bp); 463 return; 464 } 465 pwr = find_power(args[1]); 466 if (pwr == -1) 467 safe_str(T("#-1 NO SUCH POWER"), buff, bp); 468 else 469 safe_boolean(Powers(it) & pwr, buff, bp); 470 } 471 472 /* ARGSUSED */ 473 FUNCTION(fun_powers) 474 { 475 dbref it; 476 477 it = match_thing(executor, args[0]); 478 if (!GoodObject(it)) { 479 &
