Changeset 853
- Timestamp:
- 05/16/07 22:15:24 (2 years ago)
- Files:
-
- 1.8.2/trunk/CHANGES.182 (modified) (1 diff)
- 1.8.2/trunk/Patchlevel (modified) (1 diff)
- 1.8.2/trunk/README (modified) (5 diffs)
- 1.8.2/trunk/game/txt/hlp/penncmd.hlp (modified) (3 diffs)
- 1.8.2/trunk/game/txt/hlp/pennflag.hlp (modified) (1 diff)
- 1.8.2/trunk/game/txt/hlp/pennfunc.hlp (modified) (1 diff)
- 1.8.2/trunk/game/txt/hlp/pennv181.hlp (modified) (4 diffs)
- 1.8.2/trunk/game/txt/hlp/pennv182.hlp (modified) (3 diffs)
- 1.8.2/trunk/game/txt/hlp/pennvOLD.hlp (modified) (1 diff)
- 1.8.2/trunk/hdrs/attrib.h (modified) (7 diffs)
- 1.8.2/trunk/hdrs/chunk.h (modified) (1 diff)
- 1.8.2/trunk/hdrs/log.h (modified) (1 diff)
- 1.8.2/trunk/hdrs/mushtype.h (modified) (1 diff)
- 1.8.2/trunk/hdrs/parse.h (modified) (4 diffs)
- 1.8.2/trunk/hdrs/version.h (modified) (1 diff)
- 1.8.2/trunk/src/Makefile.SH (modified) (2 diffs)
- 1.8.2/trunk/src/atr_tab.c (modified) (1 diff)
- 1.8.2/trunk/src/attrib.c (modified) (26 diffs)
- 1.8.2/trunk/src/bsd.c (modified) (7 diffs)
- 1.8.2/trunk/src/cmds.c (modified) (2 diffs)
- 1.8.2/trunk/src/command.c (modified) (1 diff)
- 1.8.2/trunk/src/conf.c (modified) (1 diff)
- 1.8.2/trunk/src/cque.c (modified) (7 diffs)
- 1.8.2/trunk/src/db.c (modified) (1 diff)
- 1.8.2/trunk/src/destroy.c (modified) (1 diff)
- 1.8.2/trunk/src/flags.c (modified) (1 diff)
- 1.8.2/trunk/src/fundb.c (modified) (1 diff)
- 1.8.2/trunk/src/funlist.c (modified) (1 diff)
- 1.8.2/trunk/src/funmisc.c (modified) (2 diffs)
- 1.8.2/trunk/src/funstr.c (modified) (7 diffs)
- 1.8.2/trunk/src/funtime.c (modified) (1 diff)
- 1.8.2/trunk/src/game.c (modified) (7 diffs)
- 1.8.2/trunk/src/log.c (modified) (2 diffs)
- 1.8.2/trunk/src/look.c (modified) (5 diffs)
- 1.8.2/trunk/src/move.c (modified) (6 diffs)
- 1.8.2/trunk/src/parse.c (modified) (2 diffs)
- 1.8.2/trunk/src/player.c (modified) (6 diffs)
- 1.8.2/trunk/src/plyrlist.c (modified) (1 diff)
- 1.8.2/trunk/src/portmsg.c (modified) (7 diffs)
- 1.8.2/trunk/src/predicat.c (modified) (2 diffs)
- 1.8.2/trunk/src/rob.c (modified) (3 diffs)
- 1.8.2/trunk/src/set.c (modified) (3 diffs)
- 1.8.2/trunk/src/speech.c (modified) (1 diff)
- 1.8.2/trunk/src/timer.c (modified) (2 diffs)
- 1.8.2/trunk/src/unparse.c (modified) (3 diffs)
- 1.8.2/trunk/src/wiz.c (modified) (6 diffs)
- 1.8.2/trunk/test/PennMUSH.pm (modified) (1 diff)
- 1.8.2/trunk/utils/mkvershlp.pl (modified) (1 diff)
- 1.8.2/trunk/win32/README.cygwin (copied) (copied from 1.8.2/tags/p4rc2/win32/README.cygwin)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
1.8.2/trunk/CHANGES.182
r716 r853 15 15 ========================================================================== 16 16 17 Version 1.8.2 patchlevel 4 May 16, 2007 18 19 Minor changes: 20 * speak() uses accented names. Sketch. 21 * config() no longer lists options that can't be set 22 with @config/set. Suggested by Trispis. [SW] 23 * 'page foo\=bar' pages the last person you paged. Fix by Nathan 24 Baum. 25 * Receipt of a SIGUSR1 (Causing a shutdown/reboot) is explictly 26 logged. Suggested by Interloper. [SW] 27 * @wipe reports the number of attributes deleted. [183] 28 29 Fixes: 30 * You can no longer save objects slated to be destroyed 31 by using @set foo=!GOING (The help file for GOING now tells 32 the truth) Reported by Cooee. [SW] 33 * Useless variable in real_unparse() removed. Reported by 34 Taladan. [SW] 35 * 'make portmsg' works, and portmsg.c rewritten to current 36 Penn standards. [SW] 37 * case() would replace #$ in the default argument, contrary 38 to the help file. Reported by Talvo. [SW] 39 * Memory leak in grep(). [SW] 40 * Quotes can be around the player name on the login screen 41 always, instead of just when player_name_spaces was 42 on. Suggested by Dan Widdis. [SW] 43 * '{think foo} bar' exhibited odd behavior. [GM] 44 * 'make test' wouldn't work right unless '.' was in you path. 45 Fix by Nathan Baum. 46 * stdin and stdout weren't getting closed, potentially causing 47 problems when trying to log out of a shell after starting 48 a mush. Reported by K Moon. [SW] 49 * NetBSD compile and general warning fixes. [SW] 50 * Favor difftime(3) over subtraction of time_t variables. [SW] 51 * Clarification of attribute trees in HELP @WIPE. Suggested by 52 Talvo. 53 * Loading a db with empty attributes used as the roots of 54 attribute trees didn't work if empty_attrs is set to no. 55 Reported by Kevin. [SW] 56 * Bugs in wiping attribute trees with attributes the wiper 57 doesn't have permission to delete fixed. [SW] 58 17 59 Version 1.8.2 patchlevel 3 March 11, 2007 18 60 1.8.2/trunk/Patchlevel
r716 r853 1 1 Do not edit this file. It is maintained by the official PennMUSH patches. 2 This is PennMUSH 1.8.2p 32 This is PennMUSH 1.8.2p4 1.8.2/trunk/README
r557 r853 14 14 II. Getting Help, Reporting Bugs 15 15 III. Getting a .pennmush.org hostname and mailing lists 16 IV. Comments 16 IV. Miscellaneous 17 V. Comments 17 18 18 19 You may also want to take a look at Javelin's Guide for PennMUSH Gods, … … 132 133 at http://www.pennmush.org/mailman/listinfo/pennmush-announce) 133 134 134 2. pennmush-bugs@pennmush.org is the bug reporting address 135 for the PennMUSH developers (suggestions go to pennmush-developers, 136 bugs to pennmush-bugs). This will generally give you the fastest 137 response and is ideal for unusual bugs. A web-based submission 138 form is at http://www.pennmush.org/jitterbug/pennmush 139 140 When reporting a problem, please always include the following 141 information: 142 143 1. PennMUSH version number 144 2. The type of machine you are using (Sun SparcStation, IBM RS/6000, etc.) 145 3. The operating system and version (SunOS 4.1.2, AIX 3.2.4, etc.), 146 4. The compiler and compiler version (gcc 2.4.5, SGI cc 2.10, etc. -- the 147 'file' command usually tells you the compiler version, if there's no 148 built-in option like '-v' or '-V' to give it), 149 5. Whether or not you have made any changes to the code. 150 151 If the problem resulted in a crash and a core dump, a stack trace of 152 the core dump (see the section above) should also be included. 153 154 If I need additional stuff (like a log of the Configure or make), I'll 155 ask for it, but if you know that it's relevant, you can send it along, 156 too. 135 2. The PennMUSH bug-tracking site is http://dev.pennmush.org/ 136 To file a new report, click on the 'New Ticket' link. If 137 you want to get emails about updates to the bug report, put your 138 email address in the appropriate field. For 'type', please select 139 the most appropriate category: Bug, suggested feature, documetation 140 issue, build/compliation problems, etc. Be sure to include what version 141 of PennMUSH you found the problem on. 142 143 If the problem resulted in a crash and a core dump, a stack trace of 144 the core dump (see the section above) should also be included. 145 146 If we need additional stuff (like a log of the Configure or make), we'll 147 ask for it, but if you know that it's relevant, you can send it along, 148 too. 149 150 You can also search to see if anyone else has already reported the issue,' 151 see what issues have been fixed for upcoming releases, and much more at 152 the site. 153 154 The old way of emailing pennmush-bugs@pennmush.org still works, but using 155 the web interface allows you to specifically give an issue type when 156 reporting something. 157 157 158 158 ============================================================================ … … 179 179 ============================================================================ 180 180 181 IV. Comments 182 183 IV.a. Amberyl's Comments 181 IV. Miscellaneous 182 183 V.a Announcing when a mush is down 184 185 If your mush is no longer running on a given port or server and 186 you want to and are able to leave a programming running listening 187 on that port, you can tell people about a new location or other news. 188 189 Run: 190 191 % make portmsg 192 193 Then start the port announcer with: 194 195 % ./src/portmsg message.txt port# 196 197 Any connections to the given port will see the contents of the message 198 file and then be disconnected after a few seconds. 199 200 V. Comments 201 202 V.a. Amberyl's Comments 184 203 185 204 These are in the first person. :) … … 214 233 "Amberyl" just about everywhere 215 234 216 IV.b. Paul/Javelin's Comments235 V.b. Paul/Javelin's Comments 217 236 218 237 And let me recognize T. Alexander Popiel, Shawn Wagner, Nick Gammon, … … 231 250 232 251 233 IV.c. Alex/Talek's Comments252 V.c. Alex/Talek's Comments 234 253 235 254 I would like to thank Ralph, Amberyl, Moonchilde, and all the others 1.8.2/trunk/game/txt/hlp/penncmd.hlp
r716 r853 147 147 also checked for an @aconnect. If one is found, it will be executed 148 148 when a player connects in that location or zone (or, in the case of 149 the master room, anywhere). 149 the master room, anywhere). This is only done if the room_connects 150 config option is enabled. 150 151 151 152 See also: @adisconnect, ACTION LISTS … … 189 190 checked for an @adisconnect. If one is found, it will be executed 190 191 when a player disconnects in that location or zone (or, in the case of 191 the master room, anywhere). 192 the master room, anywhere). This is only done if the room_connects 193 config option is enabled. 192 194 193 195 Several descriptor variables are passed to @adisconnect: … … 3569 3571 all attributes which match that pattern. Note that the restrictions 3570 3572 above still apply. 3573 3574 When wiping an attribute that is the root of an attribute tree, all 3575 attributes in that tree will also be removed. 3571 3576 & @wizwall 3572 3577 @wizwall[/emit] <message> 1.8.2/trunk/game/txt/hlp/pennflag.hlp
r651 r853 430 430 the object. Objects which have ^ listen patterns but are not set MONITOR 431 431 do not check those patterns. 432 433 When using the LISTEN Attribute Tree, you must set the Root Attribute 434 !NO_COMMAND. By default this Attribute/Attribute Root has been set 435 NO_COMMAND by the system. Attributes which are set HALT or NO_COMMAND 436 will not be evaluated for purposes of the ^ listen patterns 437 432 438 & MORTAL 433 439 The MORTAL flag is no longer available in PennMUSH. Please see help 1.8.2/trunk/game/txt/hlp/pennfunc.hlp
r651 r853 373 373 Examples: 374 374 375 > &line me=align(<5 10 20,\([left(xget(%0,sex),1)]\),name(%0),name(%L))376 > th iter(lwho(),u(line,##))375 > &line me=align(<5 10 20,\([left(xget(%0,sex),1)]\),name(%0),name(loc(%0))) 376 > th iter(lwho(),u(line,##),%b,%r) 377 377 (M) Walker Tree 378 378 (F) Jane Doe Nowhere 1.8.2/trunk/game/txt/hlp/pennv181.hlp
r557 r853 1 1 & 1.8.1p10 2 2 Version 1.8.1 patchlevel 10 September 13, 2006 3 4 3 Fixes: 5 4 * Cleaned up some compiler warnings. [SW] … … 11 10 * Trying to ignore signals could crash on Win32. Reported by Intrevis. 12 11 * Fixed parse errors in non-C99 compilers. Reported by Intrevis. 13 * Help fixes by Talvo, Sketch .12 * Help fixes by Talvo, Sketch 14 13 * Fixes for 64-bit platforms [SW] 15 14 * @dump/paranoid produced corrupt databases. … … 29 28 * The above is used in db.c, function.c and plyrlist.c [SW] 30 29 * @config compile reports if MySQL support is present. (This does not 31 mean the game is configured to use it.) 30 mean the game is configured to use it.) [SW] 32 31 * restart copies log files from the last time the mush was running to 33 32 game/save/ instead of deleting them. [SW] … … 172 171 * NT_TCP code has been removed from the server. It was deemed 173 172 less useful than keeping the networking code unitary and 174 <the ability to @shutdown/reboot. Patch by Nathan Baum.173 the ability to @shutdown/reboot. Patch by Nathan Baum. 175 174 Flags: 176 175 * New LOUD flag (admin-settable) causes an object to bypass 1.8.2/trunk/game/txt/hlp/pennv182.hlp
r716 r853 1 & 1.8.2p 31 & 1.8.2p4 2 2 & changes 3 3 This is a list of changes in this patchlevel which are probably of … … 12 12 be read in 'help patchlevels'. 13 13 14 Version 1.8.2 patchlevel 4 May 16, 2007 15 16 Minor changes: 17 * speak() uses accented names. Sketch. 18 * config() no longer lists options that can't be set 19 with @config/set. Suggested by Trispis. [SW] 20 * 'page foo\=bar' pages the last person you paged. Fix by Nathan 21 Baum. 22 * Receipt of a SIGUSR1 (Causing a shutdown/reboot) is explictly 23 logged. Suggested by Interloper. [SW] 24 * @wipe reports the number of attributes deleted. [183] 25 26 Fixes: 27 * You can no longer save objects slated to be destroyed 28 by using @set foo=!GOING (The help file for GOING now tells 29 the truth) Reported by Cooee. [SW] 30 * Useless variable in real_unparse() removed. Reported by 31 Taladan. [SW] 32 * 'make portmsg' works, and portmsg.c rewritten to current 33 Penn standards. [SW] 34 * case() would replace #$ in the default argument, contrary 35 to the help file. Reported by Talvo. [SW] 36 * Memory leak in grep(). [SW] 37 * Quotes can be around the player name on the login screen 38 always, instead of just when player_name_spaces was 39 on. Suggested by Dan Widdis. [SW] 40 * '{think foo} bar' exhibited odd behavior. [GM] 41 * 'make test' wouldn't work right unless '.' was in you path. 42 Fix by Nathan Baum. 43 * stdin and stdout weren't getting closed, potentially causing 44 problems when trying to log out of a shell after starting 45 a mush. Reported by K Moon. [SW] 46 * NetBSD compile and general warning fixes. [SW] 47 * Favor difftime(3) over subtraction of time_t variables. [SW] 48 * Clarification of attribute trees in HELP @WIPE. Suggested by 49 Talvo. 50 * Loading a db with empty attributes used as the roots of 51 attribute trees didn't work if empty_attrs is set to no. 52 Reported by Kevin. [SW] 53 * Bugs in wiping attribute trees with attributes the wiper 54 doesn't have permission to delete fixed. [SW] 55 56 & 1.8.2p3 14 57 Version 1.8.2 patchlevel 3 March 11, 2007 15 58 … … 54 97 of the name for @ahear/@aahear/@amhear. [SW] 55 98 * Fixed the distribution of random numbers with a huge range. Reported 56 by Luke. 99 by Luke. 57 100 58 101 & 1.8.2p1 1.8.2/trunk/game/txt/hlp/pennvOLD.hlp
r651 r853 4418 4418 type 'help <version>p<patchlevel>'. For example, 'help 1.7.2p3' 4419 4419 4420 1.8.2: 0, 1 4420 1.8.2: 0, 1, 2, 3, 4 4421 4421 1.8.1: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 4422 4422 1.8.0: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 1.8.2/trunk/hdrs/attrib.h
r527 r853 1 /** 2 * \file attrib.h 3 * 4 * \brief Attribute-related prototypes and constants. 5 */ 6 1 7 #ifndef _ATTRIB_H 2 8 #define _ATTRIB_H … … 11 17 struct attr { 12 18 char const *name; /**< Name of attribute */ 13 int flags; /**< Attribute flags */19 unsigned int flags; /**< Attribute flags */ 14 20 chunk_reference_t data; /**< The attribute's value, compressed */ 15 21 dbref creator; /**< The attribute's creator's dbref */ … … 31 37 32 38 /* From attrib.c */ 39 40 /** atr_add(), atr_clr() error codes */ 41 typedef enum { 42 AE_OKAY = 0, /**< Success */ 43 AE_ERROR = -1, /**< general failure */ 44 AE_SAFE = -2, /**< attempt to overwrite a safe attribute */ 45 AE_BADNAME = -3, /**< invalid name */ 46 AE_TOOMANY = -4, /**< too many attribs */ 47 AE_TREE = -5, /**< unable to delete/create entire tree */ 48 AE_NOTFOUND = -6 /** No such attribute */ 49 } atr_err; 50 51 33 52 extern int good_atr_name(char const *s); 34 53 extern ATTR *atr_match(char const *string); 35 54 extern ATTR *atr_sub_branch(ATTR *branch); 36 55 extern void atr_new_add(dbref thing, char const *RESTRICT atr, 37 char const *RESTRICT s, dbref player, int flags, 38 unsigned char derefs); 39 extern int atr_add(dbref thing, char const *RESTRICT atr, 40 char const *RESTRICT s, dbref player, int flags); 41 extern int atr_clr(dbref thing, char const *atr, dbref player); 56 char const *RESTRICT s, dbref player, 57 unsigned int flags, unsigned char derefs); 58 extern atr_err atr_add(dbref thing, char const *RESTRICT atr, 59 char const *RESTRICT s, dbref player, 60 unsigned int flags); 61 extern atr_err atr_clr(dbref thing, char const *atr, dbref player); 62 extern atr_err wipe_atr(dbref thing, char const *atr, dbref player); 42 63 extern ATTR *atr_get(dbref thing, char const *atr); 43 64 extern ATTR *atr_get_noparent(dbref thing, char const *atr); … … 50 71 int doparent, int mortal); 51 72 extern ATTR *atr_complete_match(dbref player, char const *atr, dbref privs); 52 extern void atr_free (dbref thing);73 extern void atr_free_all(dbref thing); 53 74 extern void atr_cpy(dbref dest, dbref source); 54 75 extern char const *convert_atr(int oldatr); … … 59 80 const char *str); 60 81 extern int do_set_atr(dbref thing, char const *RESTRICT atr, 61 char const *RESTRICT s, dbref player, int flags);82 char const *RESTRICT s, dbref player, unsigned int flags); 62 83 extern void do_atrlock(dbref player, char const *arg1, char const *arg2); 63 84 extern void do_atrchown(dbref player, char const *arg1, char const *arg2); … … 78 99 79 100 /* possible attribute flags */ 80 #define AF_ODARK 0x1 /* OBSOLETE! Leave here but don't use */ 81 #define AF_INTERNAL 0x2 /* no one can see it or set it */ 82 #define AF_WIZARD 0x4 /* Wizard only can change it */ 83 #define AF_NUKED 0x8 /* OBSOLETE! Leave here but don't use */ 84 #define AF_LOCKED 0x10 /* Only creator of attrib can change it. */ 85 #define AF_NOPROG 0x20 /* won't be searched for $ commands. */ 86 #define AF_MDARK 0x40 /* Only wizards can see it */ 87 #define AF_PRIVATE 0x80 /* Children don't inherit it */ 88 #define AF_NOCOPY 0x100 /* atr_cpy (for @clone) doesn't copy it */ 89 #define AF_VISUAL 0x200 /* Everyone can see this attribute */ 90 #define AF_REGEXP 0x400 /* Match $/^ patterns using regexps */ 91 #define AF_CASE 0x800 /* Match $/^ patterns case-sensitive */ 92 #define AF_SAFE 0x1000 /* This attribute may not be modified */ 93 #define AF_STATIC 0x10000 /* OBSOLETE! Leave here but don't use */ 94 #define AF_COMMAND 0x20000 /* INTERNAL: value starts with $ */ 95 #define AF_LISTEN 0x40000 /* INTERNAL: value starts with ^ */ 96 #define AF_NODUMP 0x80000 /* INTERNAL: attribute is not saved */ 97 #define AF_LISTED 0x100000 /* INTERNAL: Used in @list attribs */ 98 #define AF_PREFIXMATCH 0x200000 /* Subject to prefix-matching */ 99 #define AF_VEILED 0x400000 /* On ex, show presence, not value */ 100 #define AF_DEBUG 0x800000 /* Show debug when evaluated */ 101 #define AF_NEARBY 0x1000000 /* Override AF_VISUAL if remote */ 102 #define AF_PUBLIC 0x2000000 /* Override SAFER_UFUN */ 103 #define AF_ANON 0x4000000 /* INTERNAL: Attribute doesn't really 101 #define AF_EMPTY_FLAGS 0x0 /**< No flag at all */ 102 #define AF_ODARK 0x1 /**< OBSOLETE! Leave here but don't use */ 103 #define AF_INTERNAL 0x2 /**< no one can see it or set it */ 104 #define AF_WIZARD 0x4 /**< Wizard only can change it */ 105 #define AF_NUKED 0x8 /**< OBSOLETE! Leave here but don't use */ 106 #define AF_LOCKED 0x10 /**< Only creator of attrib can change it. */ 107 #define AF_NOPROG 0x20 /**< won't be searched for $ commands. */ 108 #define AF_MDARK 0x40 /**< Only wizards can see it */ 109 #define AF_PRIVATE 0x80 /**< Children don't inherit it */ 110 #define AF_NOCOPY 0x100 /**< atr_cpy (for @clone) doesn't copy it */ 111 #define AF_VISUAL 0x200 /**< Everyone can see this attribute */ 112 #define AF_REGEXP 0x400 /**< Match $/^ patterns using regexps */ 113 #define AF_CASE 0x800 /**< Match $/^ patterns case-sensitive */ 114 #define AF_SAFE 0x1000 /**< This attribute may not be modified */ 115 #define AF_ROOT 0x2000 /**< Root of an attribute tree */ 116 #define AF_UNDEF1 0x4000 /**< Undefined; reserved for a future flag */ 117 #define AF_UNDEF2 0x8000 /**< Undefined; reserved for a future flag */ 118 #define AF_STATIC 0x10000 /**< OBSOLETE! Leave here but don't use */ 119 #define AF_COMMAND 0x20000 /**< INTERNAL: value starts with $ */ 120 #define AF_LISTEN 0x40000 /**< INTERNAL: value starts with ^ */ 121 #define AF_NODUMP 0x80000 /**< INTERNAL: attribute is not saved */ 122 #define AF_LISTED 0x100000 /**< INTERNAL: Used in @list attribs */ 123 #define AF_PREFIXMATCH 0x200000 /**< Subject to prefix-matching */ 124 #define AF_VEILED 0x400000 /**< On ex, show presence, not value */ 125 #define AF_DEBUG 0x800000 /**< Show debug when evaluated */ 126 #define AF_NEARBY 0x1000000 /**< Override AF_VISUAL if remote */ 127 #define AF_PUBLIC 0x2000000 /**< Override SAFER_UFUN */ 128 #define AF_ANON 0x4000000 /**< INTERNAL: Attribute doesn't really 104 129 exist in the database */ 105 #define AF_NONAME 0x8000000 /* No name in did_it */ 106 #define AF_NOSPACE 0x10000000 /* No space in did_it */ 107 #define AF_MHEAR 0x20000000 /* ^-listens can be triggered by %! */ 108 #define AF_AHEAR 0x40000000 /* ^-listens can be triggered by anyone */ 130 #define AF_NONAME 0x8000000 /**< No name in did_it */ 131 #define AF_NOSPACE 0x10000000 /**< No space in did_it */ 132 #define AF_MHEAR 0x20000000 /**< ^-listens can be triggered by %! */ 133 #define AF_AHEAR 0x40000000 /**< ^-listens can be triggered by anyone */ 134 #define AF_UNDEF3 0x80000000 /**< Undefined; reserved for a future flag */ 109 135 110 /* external predefined attributes. */ 136 #define AF_MAXVAL 0x100000000 /**< Largest attribute flag value. */ 137 138 /*** external predefined attributes. */ 111 139 extern ATTR attr[]; 112 113 /* external @wipe indicator (changes atr_clr() behaviour) */114 extern int we_are_wiping;115 140 116 141 #define AL_ATTR(alist) (alist) … … 122 147 #define AL_DEREFS(alist) ((alist)->data?chunk_derefs((alist)->data):0) 123 148 124 /* Errors from ok_player_alias */ 149 /** Errors from ok_player_alias */ 150 /** Success */ 125 151 #define OPAE_SUCCESS 1 152 /** Invalid alias */ 126 153 #define OPAE_INVALID -1 154 /** Too many aliases already set */ 127 155 #define OPAE_TOOMANY -2 156 /** Null alias */ 128 157 #define OPAE_NULL -3 129 158 1.8.2/trunk/hdrs/chunk.h
r465 r853 1 /* This must be first, otherwise dbref will be undefined */ 2 #include "attrib.h" 1 /* Must be included after mushtype.h to get dbref typedef */ 3 2 4 3 #ifndef _CHUNK_H_ 1.8.2/trunk/hdrs/log.h
r463 r853 15 15 extern void start_all_logs(void); 16 16 extern void end_all_logs(void); 17 extern void redirect_st derr(void);17 extern void redirect_streams(void); 18 18 extern void WIN32_CDECL do_log 19 19 (int logtype, dbref player, dbref object, const char *fmt, ...) 1.8.2/trunk/hdrs/mushtype.h
r523 r853 2 2 #define MUSH_TYPES_H 3 3 #include "copyrite.h" 4 #include "options.h"5 #include <stdio.h>6 #ifdef WIN327 #include <windows.h>8 #endif9 4 #ifdef HAS_OPENSSL 10 5 #include <openssl/ssl.h> 1.8.2/trunk/hdrs/parse.h
r651 r853 53 53 54 54 55 /* The following routines all take var oius arguments, and return55 /* The following routines all take various arguments, and return 56 56 * string representations of same. The string representations 57 57 * are stored in static buffers, so the next call to each function … … 68 68 69 69 /* The following routines all take strings as arguments, and return 70 * true if fthe string is a valid representation of the appropriate type.70 * true if the string is a valid representation of the appropriate type. 71 71 */ 72 72 int is_dbref(char const *str); … … 206 206 * 207 207 * PE_FUNCTION_MANDATORY causes an error to be reported if a function call 208 * is attempted for a non-exist ant function. Otherwise, the function call208 * is attempted for a non-existent function. Otherwise, the function call 209 209 * is not evaluated, but rather treated as normal text. 210 210 * … … 233 233 * If the character corresponding to a set flag is encountered, then 234 234 * process_expression() will exit, with *str pointing at the terminating 235 * chara ter. '\0' is always a terminating character.235 * character. '\0' is always a terminating character. 236 236 * 237 237 * PT_DEFAULT, below, is provided as syntactic sugar. 1.8.2/trunk/hdrs/version.h
r716 r853 1 1 #define VERSION "1.8.2" 2 #define PATCHLEVEL " 3"3 #define PATCHDATE "[0 3/11/2007]"4 #define NUMVERSION 100800200 32 #define PATCHLEVEL "4" 3 #define PATCHDATE "[04/16/2007]" 4 #define NUMVERSION 1008002004 1.8.2/trunk/src/Makefile.SH
r519 r853 212 212 /usr/bin/expand $$file > tmpfile; mv -f tmpfile $$file; \ 213 213 /usr/bin/indent -npro -kr -ci2 -ss -psl -ip4 -i2 -cs -l80 -lc75 \ 214 -T ATRALIAS -T DESC -T CNode -T CONF -T BQUE -T FUN \214 -T atr_err -T ATRALIAS -T DESC -T CNode -T CONF -T BQUE -T FUN \ 215 215 -T NVAL -T i_rec -T f_rec -T USERFN_ENTRY -T PRIV -T FLAG \ 216 216 -T FLAGENT -T FLAG_ALIAS -T tlist -T u -T stat -T tcheck -T ATTR \ … … 236 236 $(CC) $(CFLAGS) -o test_compress -DSTANDALONE comp_h.c 237 237 238 portmsg: portmsg.c 239 $(CC) $(CFLAGS) -o portmsg portmsg.c $(LIBS) 238 portmsg: portmsg.c mysocket.c sig.o 239 $(CC) $(CCFLAGS) -DINFOSLAVE -o portmsg portmsg.c mysocket.c sig.o \ 240 $(LDFLAGS) $(LIBS) 240 241 241 242 # Some dependencies that make depend doesn't handle well 1.8.2/trunk/src/atr_tab.c
r527 r853 85 85 {"amhear", 'M', AF_MHEAR, AF_MHEAR}, 86 86 {"aahear", 'A', AF_AHEAR, AF_AHEAR}, 87 {"root", '`', AF_ROOT, AF_ROOT}, 87 88 {NULL, '\0', 0, 0} 88 89 }; 1.8.2/trunk/src/attrib.c
r716 r853 32 32 #endif 33 33 34 /** Attribute error - too many attribs */35 #define AE_TOOMANY -436 /** Attribute error - invalid name */37 #define AE_BADNAME -338 /** Attribute error - attempt to overwrite a safe attribute */39 #define AE_SAFE -240 /** Attribute error - general failure */41 #define AE_ERROR -142 43 34 /** A string tree of attribute names in use, to save us memory since 44 35 * many are duplicated. … … 49 40 extern PRIV attr_privs_view[]; 50 41 51 /** A flag to show if we're in the middle of a @wipe (this changes 52 * behaviour for atr_clr()). Yes, this is gross and ugly, but it 53 * seemed like a better idea than propogating signature changes 54 * for atr_clr() and do_set_atr() through the entire codebase. If 55 * you come up with a better way, PLEASE fix this... 56 */ 57 int we_are_wiping; 42 static int real_atr_clr(dbref thinking, char const *atr, dbref player, 43 int we_are_wiping); 44 58 45 59 46 /** A string to hold the name of a missing prefix branch, set by … … 76 63 } ATTRPAGE; 77 64 78 static ATTR *atr_free_list; 79 static ATTR *get_atr_free_list(void); 65 static ATTR *atr_free_list = NULL; 66 static ATTR *alloc_atr(void); 67 static ATTR *pop_free_list(void); 68 static void push_free_list(ATTR *); 69 static void atr_free_one(ATTR *); 80 70 static ATTR *find_atr_pos_in_list(ATTR ***pos, char const *name); 81 static intcan_create_attr(dbref player, dbref obj, char const *atr_name,82 int flags);71 static atr_err can_create_attr(dbref player, dbref obj, char const *atr_name, 72 unsigned int flags); 83 73 static ATTR *find_atr_in_list(ATTR *atr, char const *name); 84 74 static ATTR *atr_get_with_parent(dbref obj, char const *atrname, dbref *parent); … … 181 171 } 182 172 183 /** Find the place to insert /deletean attribute with the specified name.173 /** Find the place to insert an attribute with the specified name. 184 174 * \param pos a pointer to the ATTR ** holding the list position 185 175 * \param name the attribute name to look for … … 412 402 do { \ 413 403 ATTR *std = atr_match(AL_NAME((atr))); \ 414 if (std && ! strcmp(AL_NAME(std), AL_NAME((atr)))) {\404 if (std && !(flags) && !strcmp(AL_NAME(std), AL_NAME((atr)))) { \ 415 405 AL_FLAGS(atr) = AL_FLAGS(std); \ 416 406 } else { \ 417 AL_FLAGS(atr) = 0; \ 418 if (flags != NOTHING) \ 419 AL_FLAGS(atr) |= flags; \ 407 AL_FLAGS(atr) = flags; \ 420 408 } \ 421 409 } while (0) … … 428 416 * \param obj the object targetted for the write. 429 417 * \param atr the attribute being interrogated. 430 * \param flags the default flags to add to the attribute. 418 * \param flags the default flags to add to the attribute. 419 * 0 for default flags if it's a builtin attribute. 431 420 * \retval 0 if the player cannot write the attribute. 432 421 * \retval 1 if the player can write the attribute. 433 422 */ 434 423 static int 435 can_create_attr(dbref player, dbref obj, char const *atr_name, int flags) 424 can_create_attr(dbref player, dbref obj, char const *atr_name, 425 unsigned int flags) 436 426 { 437 427 char *p; … … 484 474 } 485 475 486 return 1;476 return AE_OKAY; 487 477 } 488 478 … … 506 496 507 497 /* allocate a new page, if needed */ 508 ptr = get_atr_free_list(); 509 atr_free_list = AL_NEXT(ptr); 498 ptr = pop_free_list(); 499 if (ptr == NULL) { 500 st_delete(name, &atr_names); 501 return NULL; 502 } 510 503 511 504 /* initialize atr */ 512 505 AL_NAME(ptr) = name; 513 506 ptr->data = NULL_CHUNK_REFERENCE; 507 AL_FLAGS(ptr) = 0; 514 508 515 509 /* link it in */ … … 537 531 void 538 532 atr_new_add(dbref thing, const char *RESTRICT atr, const char *RESTRICT s, 539 dbref player, int flags, unsigned char derefs)533 dbref player, unsigned int flags, unsigned char derefs) 540 534 { 541 535 ATTR *ptr; 542 543 if (!EMPTY_ATTRS && !*s) 536 char *p, root_name[ATTRIBUTE_NAME_LIMIT + 1]; 537 538 if (!EMPTY_ATTRS && !*s && !(flags & AF_ROOT)) 544 539 return; 545 540 … … 553 548 return; 554 549 555 AL_FLAGS(ptr) = (flags != NOTHING) ? flags : 0; 550 strcpy(root_name, atr); 551 if ((p = strrchr(root_name, '`'))) { 552 ATTR *root = NULL; 553 *p = '\0'; 554 root = find_atr_in_list(List(thing), root_name); 555 if (!root) { 556 do_rawlog(LT_ERR, T("Missing root attribute '%s' on object #%d!\n"), 557 root_name, thing); 558 root = create_atr(thing, root_name); 559 set_default_flags(root, 0); 560 AL_FLAGS(root) |= AF_ROOT; 561 AL_CREATOR(root) = player; 562 if (!EMPTY_ATTRS) { 563 unsigned char *t = compress(" "); 564 if (!t) { 565 mush_panic(T("Unable to allocate memory in atr_new_add()!")); 566 } 567 root->data = chunk_create(t, u_strlen(t), 0); 568 free(t); 569 } 570 } else { 571 if (!AL_FLAGS(root) & AF_ROOT) /* Upgrading old database */ 572 AL_FLAGS(root) |= AF_ROOT; 573 } 574 } 575 576 AL_FLAGS(ptr) = flags; 556 577 AL_FLAGS(ptr) &= ~AF_COMMAND & ~AF_LISTEN; 557 578 AL_CREATOR(ptr) = player; … … 564 585 if (!t) 565 586 return; 587 566 588 ptr->data = chunk_create(t, u_strlen(t), derefs); 567 589 free(t); … … 584 606 * \param s value of the attribute to set. 585 607 * \param player the attribute creator. 586 * \param flags bitmask of attribute flags for this attribute. 587 * \retval AE_BADNAME invalid attribute name. 588 * \retval AE_SAFE attempt to overwrite a SAFE attribute. 589 * \retval AE_ERROR general failure. 590 * \retval 1 success. 591 */ 592 int 608 * \param flags bitmask of attribute flags for this attribute. 0 will use 609 * default. 610 * \return AE_OKAY or an AE_* error code. 611 */ 612 atr_err 593 613 atr_add(dbref thing, const char *RESTRICT atr, const char *RESTRICT s, 594 dbref player, int flags)595 { 596 ATTR *ptr ;614 dbref player, unsigned int flags) 615 { 616 ATTR *ptr, *root = NULL; 597 617 char *p; 598 618 … … 614 634 /* make a new atr, if needed */ 615 635 if (!ptr) { 616 intres = can_create_attr(player, thing, atr, flags);617 if (res < 0)636 atr_err res = can_create_attr(player, thing, atr, flags); 637 if (res != AE_OKAY) 618 638 return res; 619 639 … … 623 643 *p = '\0'; 624 644 625 ptr= find_atr_in_list(ptr, missing_name);626 627 if (! ptr) {628 ptr= create_atr(thing, missing_name);629 if (! ptr)630 return AE_ ERROR;645 root = find_atr_in_list(ptr, missing_name); 646 647 if (!root) { 648 root = create_atr(thing, missing_name); 649 if (!root) 650 return AE_TREE; 631 651 632 652 /* update modification time here, because from now on, 633 653 * we modify even if we fail */ 634 if (!IsPlayer(thing) && !AF_Nodump( ptr))654 if (!IsPlayer(thing) && !AF_Nodump(root)) 635 655 ModTime(thing) = mudtime; 636 656 637 set_default_flags(ptr, flags); 638 AL_FLAGS(ptr) &= ~AF_COMMAND & ~AF_LISTEN; 639 AL_CREATOR(ptr) = Owner(player); 657 set_default_flags(root, flags); 658 AL_FLAGS(root) &= ~AF_COMMAND & ~AF_LISTEN; 659 AL_FLAGS(root) |= AF_ROOT; 660 AL_CREATOR(root) = Owner(player); 640 661 if (!EMPTY_ATTRS) { 641 662 unsigned char *t = compress(" "); 642 if (!t) 643 return AE_ERROR;644 ptr->data = chunk_create(t, u_strlen(t), 0);663 if (!t) 664 mush_panic(T("Unable to allocate memory in atr_add()!")); 665 root->data = chunk_create(t, u_strlen(t), 0); 645 666 free(t); 646 667 } 647 } 668 } else 669 AL_FLAGS(root) |= AF_ROOT; 648 670 649 671 *p = '`'; … … 686 708 } 687 709 688 return 1; 710 return AE_OKAY; 711 } 712 713 714 /** Remove all child attributes from root attribute that can be. 715 * \param player object doing a @wipe. 716 * \param thing object being @wiped. 717 * \param root root of attribute tree. 718 * \return 1 if all children were deleted, 0 if some were left. 719 */ 720 static int 721 atr_clear_children(dbref player, dbref thing, ATTR *root) 722 { 723 ATTR *sub, *next = NULL, *prev; 724 int skipped = 0; 725 726 prev = root; 727 728 for (sub = atr_sub_branch(root); 729 sub && string_prefix(AL_NAME(sub), AL_NAME(root)); sub = next) { 730 if (AL_FLAGS(sub) & AF_ROOT) { 731 if (!atr_clear_children(player, thing, sub)) { 732 skipped++; 733 next = AL_NEXT(sub); 734 prev = sub; 735 continue; 736 } 737 } 738 739 next = AL_NEXT(sub); 740 741 if (!Can_Write_Attr(player, thing, sub)) { 742 skipped++; 743 prev = sub; 744 continue; 745 } 746 747 /* Can safely delete attribute. */ 748 AL_NEXT(prev) = next; 749 atr_free_one(sub); 750 AttrCount(thing)--; 751 752 } 753 754 return !skipped; 755 689 756 } 690 757 … … 695 762 * \param atr name of attribute to remove. 696 763 * \param player enactor attempting to remove attribute. 697 * \retval 0 no attribute found to reset 698 * \retval AE_SAFE attribute is safe 699 * \retval AE_ERROR other failure 700 */ 701 int 702 atr_clr(dbref thing, char const *atr, dbref player) 703 { 704 ATTR *ptr, **prev, *sub; 705 size_t len; 764 * \param we_are_wiping true if called by \@wipe. 765 * \return AE_OKAY or AE_* error code. 766 */ 767 static atr_err 768 real_atr_clr(dbref thing, char const *atr, dbref player, int we_are_wiping) 769 { 770 ATTR *ptr, **prev; 771 int can_clear = 1; 706 772 707 773 prev = &List(thing); … … 709 775 710 776 if (!ptr) 711 return 0;777 return AE_NOTFOUND; 712 778 713 779 if (ptr && AF_Safe(ptr)) … … 716 782 return AE_ERROR; 717 783 718 sub = atr_sub_branch(ptr); 719 if (!we_are_wiping && sub) 720 return AE_ERROR; 721 722 if (!IsPlayer(thing) && !AF_Nodump(ptr)) 723 ModTime(thing) = mudtime; 724 725 *prev = AL_NEXT(ptr); 726 727 if (ptr->data) 728 chunk_delete(ptr->data); 729 730 len = strlen(AL_NAME(ptr)); 731 st_delete(AL_NAME(ptr), &atr_names); 732 733 AL_NEXT(ptr) = atr_free_list; 734 AL_FLAGS(ptr) = 0; 735 atr_free_list = ptr; 736 AttrCount(thing)--; 737 738 if (we_are_wiping && sub) { 739 &n
