# # Patch name: lock_command.patch # Patch version: 1 # Author's name: Kurt Fitzner # Author's email: kfitzner@nexus.v-wave.com # Version of PennMUSH: 1.7.2p24 # Date patch made: Sat Jul 24 15:47:41 1999 # Author is willing to support (yes/no): yes # Patch format: diff -u5 # # # This is a contributed PennMUSH patch. Its use is subject to the # same restrictions found in PennMUSH's hdrs/copyrite.h file. # # No warranty is given for this patch. It is not necessarily going # to work on your system, with any version of PennMUSH other than # the one above, etc. # # If the author given above was willing to support the patch, you # should write to the author if you have any questions or problems. Do # *NOT* send email messages to Javelin or any PennMUSH mailing list about # this patch! # # Below this line is the author's description of the patch, # followed by the patch itself. If the patch is in context diff # format, you'll probably apply it by typing: patch < patchfile # in your top-level MUSH directory, unless instructed otherwise # below. # # lock_command.patch # Adds a new lock type. @lock/command. This restricts who can # use $ commands on an object. As opposed to @lock/use which # restricts who can use anything (including listens) on an object. # diff -u5r ../pennmush-vanilla/game/txt/hlp/penncmd.hlp ./game/txt/hlp/penncmd.hlp --- ../pennmush-vanilla/game/txt/hlp/penncmd.hlp Sun Jul 18 10:14:27 1999 +++ ./game/txt/hlp/penncmd.hlp Sat Jul 24 15:47:41 1999 @@ -1563,10 +1563,11 @@ Not all of these lock types may be enabled in your MUSH. When in doubt, try it out! @lock/speech Who can speak/pose/emit in this room @lock/listen Who can trigger my @ahear/^-pattern actions + @lock/command Who can trigger my $-pattern commands @lock/leave Who can leave this object @lock/drop Who can drop this object or in this room @lock/give Who can give this object @lock/follow Who can follow this object diff -u5r ../pennmush-vanilla/hdrs/lock.h ./hdrs/lock.h --- ../pennmush-vanilla/hdrs/lock.h Sun Jul 18 10:13:00 1999 +++ ./hdrs/lock.h Sat Jul 24 15:27:40 1999 @@ -35,10 +35,11 @@ extern const lock_type Zone_Lock; extern const lock_type Page_Lock; extern const lock_type Tport_Lock; extern const lock_type Speech_Lock; /* Who can speak aloud in me */ extern const lock_type Listen_Lock; /* Who can trigger ^s/ahears on me */ +extern const lock_type Command_Lock; /* Who can use $commands on me */ extern const lock_type Parent_Lock; /* Who can @parent to me */ extern const lock_type Link_Lock; /* Who can @link to me */ extern const lock_type Leave_Lock; /* Who can leave me */ extern const lock_type Drop_Lock; /* Who can drop me */ extern const lock_type Give_Lock; /* Who can give me */ diff -u5r ../pennmush-vanilla/options.h.dist ./options.h.dist --- ../pennmush-vanilla/options.h.dist Sun Jul 18 10:12:43 1999 +++ ./options.h.dist Sat Jul 24 15:26:04 1999 @@ -286,10 +286,16 @@ /* If defined, @lock/listen sets a lock which controls who can trigger * ^patterns and @ahears on the thing. */ #define LISTEN_LOCK /* */ +/* If defines, @lock/command sets a lock which controls who can use + * $commands on the thing. This is similar to @lock/use, except + * @lock/use also controls listens. + */ +#define COMMAND_LOCK /* */ + /* If defined, @lock/speech sets a lock which controls who can * speak/pose/emit in a room. */ #define SPEECH_LOCK /* */ diff -u5r ../pennmush-vanilla/src/attrib.c ./src/attrib.c --- ../pennmush-vanilla/src/attrib.c Sun Jul 18 10:13:10 1999 +++ ./src/attrib.c Sat Jul 24 15:42:09 1999 @@ -738,10 +738,13 @@ int match; dbref parent; /* check for lots of easy ways out */ if ((type != '$' && type != '^') || !GoodObject(thing) || Halted(thing) || +#ifdef COMMAND_LOCK + (type == '$' && !eval_lock(player, thing, Command_Lock)) || +#endif (NoCommand(thing) && type == '$') || !eval_lock(player, thing, Use_Lock)) return 0; if (type == '$') { flag_mask = AF_COMMAND; diff -u5r ../pennmush-vanilla/src/lock.c ./src/lock.c --- ../pennmush-vanilla/src/lock.c Sun Jul 18 10:13:34 1999 +++ ./src/lock.c Sat Jul 24 15:29:11 1999 @@ -54,10 +54,11 @@ const lock_type Zone_Lock = "Zone"; const lock_type Page_Lock = "Page"; const lock_type Tport_Lock = "Teleport"; const lock_type Speech_Lock = "Speech"; const lock_type Listen_Lock = "Listen"; +const lock_type Command_Lock = "Command"; const lock_type Parent_Lock = "Parent"; const lock_type Link_Lock = "Link"; const lock_type Leave_Lock = "Leave"; const lock_type Drop_Lock = "Drop"; const lock_type Give_Lock = "Give"; @@ -75,10 +76,13 @@ #ifdef SPEECH_LOCK "Speech", #endif #ifdef LISTEN_LOCK "Listen", +#endif +#ifdef COMMAND_LOCK + "Command", #endif "Parent", "Link", #ifdef LEAVE_LOCK "Leave",