PennMUSH Community

Changeset 853

Show
Ignore:
Timestamp:
05/16/07 22:15:24 (2 years ago)
Author:
penndev
Message:

PennMUSH 1.8.2p4 release candidate.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • 1.8.2/trunk/CHANGES.182

    r716 r853  
    1515========================================================================== 
    1616 
     17Version 1.8.2 patchlevel 4                      May 16, 2007 
     18 
     19Minor 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 
     29Fixes: 
     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  
    1759Version 1.8.2 patchlevel 3                      March 11, 2007 
    1860 
  • 1.8.2/trunk/Patchlevel

    r716 r853  
    11Do not edit this file. It is maintained by the official PennMUSH patches. 
    2 This is PennMUSH 1.8.2p3 
     2This is PennMUSH 1.8.2p4 
  • 1.8.2/trunk/README

    r557 r853  
    1414II.   Getting Help, Reporting Bugs 
    1515III.  Getting a .pennmush.org hostname and mailing lists 
    16 IV.   Comments 
     16IV.   Miscellaneous 
     17V.    Comments 
    1718 
    1819You may also want to take a look at Javelin's Guide for PennMUSH Gods, 
     
    132133   at http://www.pennmush.org/mailman/listinfo/pennmush-announce) 
    133134 
    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. 
     1352. 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. 
    157157 
    158158============================================================================ 
     
    179179============================================================================ 
    180180 
    181 IV. Comments 
    182  
    183 IV.a. Amberyl's Comments 
     181IV. Miscellaneous 
     182 
     183V.a Announcing when a mush is down 
     184 
     185If your mush is no longer running on a given port or server and 
     186you want to and are able to leave a programming running listening 
     187on that port, you can tell people about a new location or other news. 
     188 
     189Run: 
     190 
     191% make portmsg 
     192 
     193Then start the port announcer with: 
     194 
     195% ./src/portmsg message.txt port# 
     196 
     197Any connections to the given port will see the contents of the message 
     198file and then be disconnected after a few seconds. 
     199 
     200V. Comments 
     201 
     202V.a. Amberyl's Comments 
    184203 
    185204These are in the first person.  :) 
     
    214233          "Amberyl" just about everywhere 
    215234 
    216 IV.b. Paul/Javelin's Comments 
     235V.b. Paul/Javelin's Comments 
    217236 
    218237And let me recognize T. Alexander Popiel, Shawn Wagner, Nick Gammon, 
     
    231250 
    232251 
    233 IV.c. Alex/Talek's Comments 
     252V.c. Alex/Talek's Comments 
    234253 
    235254I would like to thank Ralph, Amberyl, Moonchilde, and all the others 
  • 1.8.2/trunk/game/txt/hlp/penncmd.hlp

    r716 r853  
    147147  also checked for an @aconnect. If one is found, it will be executed 
    148148  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. 
    150151 
    151152See also: @adisconnect, ACTION LISTS 
     
    189190  checked for an @adisconnect. If one is found, it will be executed 
    190191  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. 
    192194 
    193195  Several descriptor variables are passed to @adisconnect: 
     
    35693571  all attributes which match that pattern. Note that the restrictions 
    35703572  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. 
    35713576& @wizwall 
    35723577  @wizwall[/emit] <message> 
  • 1.8.2/trunk/game/txt/hlp/pennflag.hlp

    r651 r853  
    430430  the object. Objects which have ^ listen patterns but are not set MONITOR 
    431431  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 
    432438& MORTAL 
    433439  The MORTAL flag is no longer available in PennMUSH. Please see help 
  • 1.8.2/trunk/game/txt/hlp/pennfunc.hlp

    r651 r853  
    373373  Examples: 
    374374   
    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
    377377      (M) Walker     Tree 
    378378      (F) Jane Doe   Nowhere 
  • 1.8.2/trunk/game/txt/hlp/pennv181.hlp

    r557 r853  
    11& 1.8.1p10 
    22Version 1.8.1 patchlevel 10                     September 13, 2006 
    3  
    43Fixes: 
    54  * Cleaned up some compiler warnings. [SW] 
     
    1110  * Trying to ignore signals could crash on Win32. Reported by Intrevis. 
    1211  * Fixed parse errors in non-C99 compilers. Reported by Intrevis. 
    13   * Help fixes by Talvo, Sketch. 
     12  * Help fixes by Talvo, Sketch 
    1413  * Fixes for 64-bit platforms [SW] 
    1514  * @dump/paranoid produced corrupt databases.  
     
    2928  * The above is used in db.c, function.c and plyrlist.c [SW] 
    3029  * @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] 
    3231  * restart copies log files from the last time the mush was running to 
    3332    game/save/ instead of deleting them. [SW] 
     
    172171  * NT_TCP code has been removed from the server. It was deemed 
    173172    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. 
    175174Flags: 
    176175  * New LOUD flag (admin-settable) causes an object to bypass 
  • 1.8.2/trunk/game/txt/hlp/pennv182.hlp

    r716 r853  
    1 & 1.8.2p3 
     1& 1.8.2p4 
    22& changes 
    33This is a list of changes in this patchlevel which are probably of 
     
    1212be read in 'help patchlevels'. 
    1313 
     14Version 1.8.2 patchlevel 4                      May 16, 2007 
     15 
     16Minor 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 
     26Fixes: 
     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 
    1457Version 1.8.2 patchlevel 3                      March 11, 2007 
    1558 
     
    5497    of the name for @ahear/@aahear/@amhear. [SW] 
    5598  * Fixed the distribution of random numbers with a huge range. Reported 
    56     by Luke. 
     99    by Luke.  
    57100 
    58101& 1.8.2p1 
  • 1.8.2/trunk/game/txt/hlp/pennvOLD.hlp

    r651 r853  
    44184418type 'help <version>p<patchlevel>'. For example, 'help 1.7.2p3' 
    44194419 
    4420 1.8.2: 0, 1 
     44201.8.2: 0, 1, 2, 3, 4 
    442144211.8.1: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 
    442244221.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 
    17#ifndef _ATTRIB_H 
    28#define _ATTRIB_H 
     
    1117struct attr { 
    1218  char const *name;     /**< Name of attribute */ 
    13   int flags;          /**< Attribute flags */ 
     19  unsigned int flags;         /**< Attribute flags */ 
    1420  chunk_reference_t data;   /**< The attribute's value, compressed */ 
    1521  dbref creator;        /**< The attribute's creator's dbref */ 
     
    3137 
    3238/* From attrib.c */ 
     39 
     40/** atr_add(), atr_clr() error codes */ 
     41typedef 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 
    3352extern int good_atr_name(char const *s); 
    3453extern ATTR *atr_match(char const *string); 
    3554extern ATTR *atr_sub_branch(ATTR *branch); 
    3655extern 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); 
     58extern atr_err atr_add(dbref thing, char const *RESTRICT atr, 
     59               char const *RESTRICT s, dbref player, 
     60               unsigned int flags); 
     61extern atr_err atr_clr(dbref thing, char const *atr, dbref player); 
     62extern atr_err wipe_atr(dbref thing, char const *atr, dbref player); 
    4263extern ATTR *atr_get(dbref thing, char const *atr); 
    4364extern ATTR *atr_get_noparent(dbref thing, char const *atr); 
     
    5071                 int doparent, int mortal); 
    5172extern ATTR *atr_complete_match(dbref player, char const *atr, dbref privs); 
    52 extern void atr_free(dbref thing); 
     73extern void atr_free_all(dbref thing); 
    5374extern void atr_cpy(dbref dest, dbref source); 
    5475extern char const *convert_atr(int oldatr); 
     
    5980              const char *str); 
    6081extern 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); 
    6283extern void do_atrlock(dbref player, char const *arg1, char const *arg2); 
    6384extern void do_atrchown(dbref player, char const *arg1, char const *arg2); 
     
    7899 
    79100/* 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 
    104129                       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 */ 
    109135 
    110 /* external predefined attributes. */ 
     136#define AF_MAXVAL       0x100000000 /**< Largest attribute flag value. */ 
     137 
     138/*** external predefined attributes. */ 
    111139    extern ATTR attr[]; 
    112  
    113 /* external @wipe indicator (changes atr_clr() behaviour) */ 
    114     extern int we_are_wiping; 
    115140 
    116141#define AL_ATTR(alist)          (alist) 
     
    122147#define AL_DEREFS(alist)        ((alist)->data?chunk_derefs((alist)->data):0) 
    123148 
    124 /* Errors from ok_player_alias */ 
     149/** Errors from ok_player_alias */ 
     150/** Success */ 
    125151#define OPAE_SUCCESS    1 
     152/** Invalid alias */ 
    126153#define OPAE_INVALID    -1 
     154/** Too many aliases already set */ 
    127155#define OPAE_TOOMANY    -2 
     156/** Null alias */ 
    128157#define OPAE_NULL       -3 
    129158 
  • 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 */ 
    32 
    43#ifndef _CHUNK_H_ 
  • 1.8.2/trunk/hdrs/log.h

    r463 r853  
    1515extern void start_all_logs(void); 
    1616extern void end_all_logs(void); 
    17 extern void redirect_stderr(void); 
     17extern void redirect_streams(void); 
    1818extern void WIN32_CDECL do_log 
    1919  (int logtype, dbref player, dbref object, const char *fmt, ...) 
  • 1.8.2/trunk/hdrs/mushtype.h

    r523 r853  
    22#define MUSH_TYPES_H 
    33#include "copyrite.h" 
    4 #include "options.h" 
    5 #include <stdio.h> 
    6 #ifdef WIN32 
    7 #include <windows.h> 
    8 #endif 
    94#ifdef HAS_OPENSSL 
    105#include <openssl/ssl.h> 
  • 1.8.2/trunk/hdrs/parse.h

    r651 r853  
    5353 
    5454 
    55 /* The following routines all take varoius arguments, and return 
     55/* The following routines all take various arguments, and return 
    5656 * string representations of same.  The string representations 
    5757 * are stored in static buffers, so the next call to each function 
     
    6868 
    6969/* The following routines all take strings as arguments, and return 
    70  * true iff the string is a valid representation of the appropriate type. 
     70 * true if the string is a valid representation of the appropriate type. 
    7171 */ 
    7272int is_dbref(char const *str); 
     
    206206 * 
    207207 * PE_FUNCTION_MANDATORY causes an error to be reported if a function call 
    208  * is attempted for a non-existant function.  Otherwise, the function call 
     208 * is attempted for a non-existent function.  Otherwise, the function call 
    209209 * is not evaluated, but rather treated as normal text. 
    210210 * 
     
    233233 * If the character corresponding to a set flag is encountered, then 
    234234 * process_expression() will exit, with *str pointing at the terminating 
    235  * charater.  '\0' is always a terminating character. 
     235 * character.  '\0' is always a terminating character. 
    236236 * 
    237237 * PT_DEFAULT, below, is provided as syntactic sugar. 
  • 1.8.2/trunk/hdrs/version.h

    r716 r853  
    11#define VERSION "1.8.2" 
    2 #define PATCHLEVEL "3
    3 #define PATCHDATE "[03/11/2007]" 
    4 #define NUMVERSION 1008002003 
     2#define PATCHLEVEL "4
     3#define PATCHDATE "[04/16/2007]" 
     4#define NUMVERSION 1008002004 
  • 1.8.2/trunk/src/Makefile.SH

    r519 r853  
    212212    /usr/bin/expand $$file > tmpfile; mv -f tmpfile $$file; \ 
    213213    /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 \ 
    215215    -T NVAL -T i_rec -T f_rec -T USERFN_ENTRY -T PRIV -T FLAG \ 
    216216    -T FLAGENT -T FLAG_ALIAS -T tlist -T u -T stat -T tcheck -T ATTR \ 
     
    236236    $(CC) $(CFLAGS) -o test_compress -DSTANDALONE comp_h.c 
    237237 
    238 portmsg: portmsg.c 
    239     $(CC) $(CFLAGS) -o portmsg portmsg.c $(LIBS) 
     238portmsg: portmsg.c mysocket.c sig.o 
     239    $(CC) $(CCFLAGS) -DINFOSLAVE -o portmsg portmsg.c mysocket.c sig.o \ 
     240     $(LDFLAGS) $(LIBS) 
    240241 
    241242# Some dependencies that make depend doesn't handle well 
  • 1.8.2/trunk/src/atr_tab.c

    r527 r853  
    8585  {"amhear", 'M', AF_MHEAR, AF_MHEAR}, 
    8686  {"aahear", 'A', AF_AHEAR, AF_AHEAR}, 
     87  {"root", '`', AF_ROOT, AF_ROOT}, 
    8788  {NULL, '\0', 0, 0} 
    8889}; 
  • 1.8.2/trunk/src/attrib.c

    r716 r853  
    3232#endif 
    3333 
    34 /** Attribute error - too many attribs */ 
    35 #define AE_TOOMANY -4 
    36 /** Attribute error - invalid name */ 
    37 #define AE_BADNAME -3 
    38 /** Attribute error - attempt to overwrite a safe attribute */ 
    39 #define AE_SAFE -2 
    40 /** Attribute error - general failure */ 
    41 #define AE_ERROR -1 
    42  
    4334/** A string tree of attribute names in use, to save us memory since 
    4435 * many are duplicated. 
     
    4940extern PRIV attr_privs_view[]; 
    5041 
    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; 
     42static int real_atr_clr(dbref thinking, char const *atr, dbref player, 
     43            int we_are_wiping); 
     44 
    5845 
    5946/** A string to hold the name of a missing prefix branch, set by 
     
    7663} ATTRPAGE; 
    7764 
    78 static ATTR *atr_free_list; 
    79 static ATTR *get_atr_free_list(void); 
     65static ATTR *atr_free_list = NULL; 
     66static ATTR *alloc_atr(void); 
     67static ATTR *pop_free_list(void); 
     68static void push_free_list(ATTR *); 
     69static void atr_free_one(ATTR *); 
    8070static ATTR *find_atr_pos_in_list(ATTR ***pos, char const *name); 
    81 static int can_create_attr(dbref player, dbref obj, char const *atr_name, 
    82                int flags); 
     71static atr_err can_create_attr(dbref player, dbref obj, char const *atr_name, 
     72                   unsigned int flags); 
    8373static ATTR *find_atr_in_list(ATTR *atr, char const *name); 
    8474static ATTR *atr_get_with_parent(dbref obj, char const *atrname, dbref *parent); 
     
    181171} 
    182172 
    183 /** Find the place to insert/delete an attribute with the specified name. 
     173/** Find the place to insert an attribute with the specified name. 
    184174 * \param pos a pointer to the ATTR ** holding the list position 
    185175 * \param name the attribute name to look for 
     
    412402  do { \ 
    413403    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)))) {   
    415405      AL_FLAGS(atr) = AL_FLAGS(std); \ 
    416406    } else { \ 
    417       AL_FLAGS(atr) = 0; \ 
    418       if (flags != NOTHING) \ 
    419         AL_FLAGS(atr) |= flags; \ 
     407      AL_FLAGS(atr) = flags; \ 
    420408    } \ 
    421409  } while (0) 
     
    428416 * \param obj the object targetted for the write. 
    429417 * \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. 
    431420 * \retval 0 if the player cannot write the attribute. 
    432421 * \retval 1 if the player can write the attribute. 
    433422 */ 
    434423static int 
    435 can_create_attr(dbref player, dbref obj, char const *atr_name, int flags) 
     424can_create_attr(dbref player, dbref obj, char const *atr_name, 
     425        unsigned int flags) 
    436426{ 
    437427  char *p; 
     
    484474  } 
    485475 
    486   return 1
     476  return AE_OKAY
    487477} 
    488478 
     
    506496 
    507497  /* 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  } 
    510503 
    511504  /* initialize atr */ 
    512505  AL_NAME(ptr) = name; 
    513506  ptr->data = NULL_CHUNK_REFERENCE; 
     507  AL_FLAGS(ptr) = 0; 
    514508 
    515509  /* link it in */ 
     
    537531void 
    538532atr_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) 
    540534{ 
    541535  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)) 
    544539    return; 
    545540 
     
    553548    return; 
    554549 
    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; 
    556577  AL_FLAGS(ptr) &= ~AF_COMMAND & ~AF_LISTEN; 
    557578  AL_CREATOR(ptr) = player; 
     
    564585    if (!t) 
    565586      return; 
     587 
    566588    ptr->data = chunk_create(t, u_strlen(t), derefs); 
    567589    free(t); 
     
    584606 * \param s value of the attribute to set. 
    585607 * \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 */ 
     612atr_err 
    593613atr_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
    597617  char *p; 
    598618 
     
    614634  /* make a new atr, if needed */ 
    615635  if (!ptr) { 
    616     int res = 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
    618638      return res; 
    619639 
     
    623643      *p = '\0'; 
    624644 
    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
    631651 
    632652    /* update modification time here, because from now on, 
    633653     * we modify even if we fail */ 
    634     if (!IsPlayer(thing) && !AF_Nodump(ptr)) 
     654    if (!IsPlayer(thing) && !AF_Nodump(root)) 
    635655      ModTime(thing) = mudtime; 
    636656 
    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); 
    640661    if (!EMPTY_ATTRS) { 
    641662      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); 
    645666      free(t); 
    646667    } 
    647       } 
     668      } else 
     669    AL_FLAGS(root) |= AF_ROOT; 
    648670 
    649671      *p = '`'; 
     
    686708  } 
    687709 
    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 */ 
     720static int 
     721atr_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 
    689756} 
    690757 
     
    695762 * \param atr name of attribute to remove. 
    696763 * \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 */ 
     767static atr_err 
     768real_atr_clr(dbref thing, char const *atr, dbref player, int we_are_wiping) 
     769
     770  ATTR *ptr, **prev; 
     771  int can_clear = 1; 
    706772 
    707773  prev = &List(thing); 
     
    709775 
    710776  if (!ptr) 
    711     return 0
     777    return AE_NOTFOUND
    712778 
    713779  if (ptr && AF_Safe(ptr)) 
     
    716782    return AE_ERROR; 
    717783 
    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