This is patch26 to PennMUSH 1.7.7. After applying this patch, you will have version 1.7.7p26 To apply this patch, save it to a file in your top-level MUSH directory, and do the following: patch -p1 < 1.7.7-patch26 make install If you use GNU patch 2.2, you probably want the above to be 'patch -b -p1', not just 'patch -p1'. Unix (or cygwin) users need not worry about failed hunks in src/switchinc.c, hdrs/switches.h, hdrs/cmds.h, or hdrs/funs.h. These files are automatically rebuilt on compile. On the off chance they appear not to be, simply rm them and re-run make. Then @shutdown and restart your MUSH. - Alan/Javelin In this patch: Commands: * Add /regexp switch to @switch and @select. Suggested by BladedThoth. [SW] * New /spoof switch to @pemit, @remit, @lemit, @oemit, @emit, causes the message to appear to be generated by the cause, rather than the enactor, which makes globals like $ooc show the right NOSPOOF information (instead of the name of the global command object). Patch by Philip Mak. Functions: * hostname(), ipaddr(), and cmds() take a dbref or descriptor number of a connected player and return the hostname, ipaddr, and number of commands executed. Suggested by Sholevi@M*U*S*H and Renee@ShoreSide, code by Sholevi@M*U*S*H. * Add reswitch*() functions. Suggested by BladedThoth. [SW] * insert() can take a negative position argument to insert from the right. Patch by Sholevi@M*U*S*H. * New firstof() and allof() functions return the first true value or all true values from a set of expressions. Patch by Sholevi@M*U*S*H. * tr() works like the Unix utility, translating characters. Patch by Walker@M*U*S*H. Attributes: * Attributes may be set DEBUG to cause their evaluation to be debugged selectively. Patch by Pozzo@SWForum. * @desc can no longer be gotten remotely without privileges. To implement this, a new attribute flag NEARBY was added, which prevents visual attributes from being remotely accessed. See new configuration directive 'read_remote_desc' if you prefer the old behavior. Patch by Philip Mak. * @desc on privileged objects can now be evaluated by mortals. To implement this, a new attribute flag PUBLIC was added, which overrides safer_ufun for that attribute. This flag is dangerous and should be avoided unless you are sure you know what you're doing. Patch by Philip Mak. Minor Changes: * "+ " complains if is ambiguous, and displays a list of matching channels. Patch by Luke@M*U*S*H. * Code cleanup around @oemit by Philip Mak. * If an object has an IDESCFORMAT but no IDESCRIBE, interior viewers now see the DESCRIBE formatted by IDESCFORMAT (instead of the DESCRIBE formatted by DESCFORMAT). Suggested by Philip Mak. * Ported to Win32 with the Mingw development environment. See win32/README.mingw for compile instructions. [EEH] * null() can now take any number of arguments. Patch by Walker@M*U*S*H. * Using @chan/quiet to control the quiet flag on a channel no longer works (Actually, it never did). Use @chan/priv instead. [SW] * The NO_WARN flag now prevents disconnected room warnings, too. Suggested by several people. Patch by Philip Mak. * @sitelock/name !name still unlocks a reserved name, but no longer removes that name from names.cnf. Suggested by Nymeria. [SW] * Some cleanup of fopen() calls. [SW] * The reference to channel Creator is now Owner in @chan/decomp. Suggested by Howie@NFTrekMUSH. [SW] * The name of the channel being tested is passed as %0 in channel locks. Suggested by Philip Mak. [SW] * help for @chownall mentions the /preserve switch. Warnings from @chown and @chownall tell which objects they're for. Suggested by Mordie@M*U*S*H. [SW] * Home wrecking is allowed again. Suggested by Philip Mak. Fixes: * Puppets in containers with @listen container=* now hear the outside world correctly. Patch by Philip Mak. * The email sent on player registration now double-quotes the player name in the example connect statement. Suggested by David Kali. * Two rooms should never be nearby() each other. Fix by Philip Mak. * can_look_at() now handles the look/out case, too. Fix by Philip Mak. * Help fixes by Viila@M*U*S*H, MetBoy@M*U*S*H, Cheetah@M*U*S*H. * @flag/alias or @flag/add without giving an alias no longer crashes the MUSH. Report by Wildfire. * Correctly retrieve user full name from /etc/passwd fields under Linux in Configure. Record it in config.sh. Reported by Vadiv@M*U*S*H. * Debian package changes. [EEH] * As the help promises, XCH_CMD and SEND attributes don't work for non-Wizards. Really. Prereq: 1.7.7p25 *** 1_7_7.712/Patchlevel Thu, 30 Oct 2003 10:00:54 -0600 dunemush (pennmush/5_Patchlevel 1.17.1.11.1.27 600) --- 1_7_7.757(w)/Patchlevel Mon, 15 Dec 2003 14:02:25 -0600 dunemush (pennmush/5_Patchlevel 1.17.1.11.1.27 600) *************** *** 1,2 **** Do not edit this file. It is maintained by the official PennMUSH patches. ! This is PennMUSH 1.7.7p25 --- 1,2 ---- Do not edit this file. It is maintained by the official PennMUSH patches. ! This is PennMUSH 1.7.7p26 *** 1_7_7.712/CHANGES.177 Thu, 30 Oct 2003 10:00:54 -0600 dunemush (pennmush/g/23_CHANGES 1.48.1.211 600) --- 1_7_7.757(w)/CHANGES.177 Mon, 15 Dec 2003 14:02:39 -0600 dunemush (pennmush/g/23_CHANGES 1.48.1.241 600) *************** *** 18,23 **** --- 18,100 ---- ========================================================================== + Version 1.7.7 patchlevel 26 December 15, 2003 + + Commands: + * Add /regexp switch to @switch and @select. Suggested by BladedThoth. [SW] + * New /spoof switch to @pemit, @remit, @lemit, @oemit, @emit, + causes the message to appear to be generated by the cause, rather + than the enactor, which makes globals like $ooc show the right + NOSPOOF information (instead of the name of the global command object). + Patch by Philip Mak. + Functions: + * hostname(), ipaddr(), and cmds() take a dbref or descriptor number + of a connected player and return the hostname, ipaddr, and number + of commands executed. Suggested by Sholevi@M*U*S*H and Renee@ShoreSide, + code by Sholevi@M*U*S*H. + * Add reswitch*() functions. Suggested by BladedThoth. [SW] + * insert() can take a negative position argument to insert from + the right. Patch by Sholevi@M*U*S*H. + * New firstof() and allof() functions return the first true value + or all true values from a set of expressions. Patch by Sholevi@M*U*S*H. + * tr() works like the Unix utility, translating characters. Patch + by Walker@M*U*S*H. + Attributes: + * Attributes may be set DEBUG to cause their evaluation to be + debugged selectively. Patch by Pozzo@SWForum. + * @desc can no longer be gotten remotely without privileges. + To implement this, a new attribute flag NEARBY was added, + which prevents visual attributes from being remotely accessed. + See new configuration directive 'read_remote_desc' if you prefer + the old behavior. Patch by Philip Mak. + * @desc on privileged objects can now be evaluated by mortals. + To implement this, a new attribute flag PUBLIC was added, + which overrides safer_ufun for that attribute. This flag is dangerous + and should be avoided unless you are sure you know what you're doing. + Patch by Philip Mak. + Minor Changes: + * "+ " complains if is ambiguous, and + displays a list of matching channels. Patch by Luke@M*U*S*H. + * Code cleanup around @oemit by Philip Mak. + * If an object has an IDESCFORMAT but no IDESCRIBE, interior viewers + now see the DESCRIBE formatted by IDESCFORMAT (instead of + the DESCRIBE formatted by DESCFORMAT). Suggested by Philip Mak. + * Ported to Win32 with the Mingw development environment. + See win32/README.mingw for compile instructions. [EEH] + * null() can now take any number of arguments. Patch by Walker@M*U*S*H. + * Using @chan/quiet to control the quiet flag on a channel no longer works + (Actually, it never did). Use @chan/priv instead. [SW] + * The NO_WARN flag now prevents disconnected room warnings, too. + Suggested by several people. Patch by Philip Mak. + * @sitelock/name !name still unlocks a reserved name, but no longer + removes that name from names.cnf. Suggested by Nymeria. [SW] + * Some cleanup of fopen() calls. [SW] + * The reference to channel Creator is now Owner in @chan/decomp. + Suggested by Howie@NFTrekMUSH. [SW] + * The name of the channel being tested is passed as %0 in channel locks. + Suggested by Philip Mak. [SW] + * help for @chownall mentions the /preserve switch. Warnings from @chown + and @chownall tell which objects they're for. Suggested by + Mordie@M*U*S*H. [SW] + * Home wrecking is allowed again. Suggested by Philip Mak. + Fixes: + * Puppets in containers with @listen container=* now hear the + outside world correctly. Patch by Philip Mak. + * The email sent on player registration now double-quotes the + player name in the example connect statement. Suggested by + David Kali. + * Two rooms should never be nearby() each other. Fix by Philip Mak. + * can_look_at() now handles the look/out case, too. Fix by Philip Mak. + * Help fixes by Viila@M*U*S*H, MetBoy@M*U*S*H, Cheetah@M*U*S*H. + * @flag/alias or @flag/add without giving an alias no longer crashes + the MUSH. Report by Wildfire. + * Correctly retrieve user full name from /etc/passwd fields under + Linux in Configure. Record it in config.sh. Reported by Vadiv@M*U*S*H. + * Debian package changes. [EEH] + * As the help promises, XCH_CMD and SEND attributes don't work + for non-Wizards. Really. + + Version 1.7.7 patchlevel 25 October 30, 2003 Fixes: *** 1_7_7.712/game/txt/hlp/pennfunc.hlp Sun, 19 Oct 2003 09:57:03 -0500 dunemush (pennmush/16_pennfunc.h 1.2.1.50.1.1.1.1.1.2.1.7.1.8.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.1.1.1.1.1.1.1.1.9.1.1.1.1.1.3.1.1.1.1.1.1.1.1.1.1.1.1.1.19 600) --- 1_7_7.757(w)/game/txt/hlp/pennfunc.hlp Thu, 11 Dec 2003 13:15:16 -0600 dunemush (pennmush/16_pennfunc.h 1.2.1.50.1.1.1.1.1.2.1.7.1.8.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.1.1.1.1.1.1.1.1.9.1.1.1.1.1.3.1.1.1.1.1.1.1.1.1.1.1.1.1.28 600) *************** *** 34,40 **** See also: MUSHCODE & FUNCTION LIST - Several major variants of functions are available. The help topics are listed below, together with a quick summary of the function type and some examples of that type of function. --- 34,39 ---- *************** *** 46,52 **** Communication functions: Send messages to objects (PEMIT, OEMIT) Connection functions: Get information about a player's connection (CONN) Dbref functions: return dbref info related to objects (LOC, LEXITS) - Global functions: local MUSH-specific functions defined with @function Html functions: output html tags for Pueblo-compatible clients Information functions: find out something about objects (FLAGS, MONEY) List functions: manipulate lists (REVWORDS, FIRST) --- 45,50 ---- *************** *** 58,64 **** Utility functions: general utilities (ISINT, COMP) The command "@config/functions" lists all of the game's built-in functions. ! The command "@function" lists all of the game's global functions. & Attribute functions All these functions access attributes on an object. --- 56,63 ---- Utility functions: general utilities (ISINT, COMP) The command "@config/functions" lists all of the game's built-in functions. ! The command "@function" lists all of the game's custom global functions ! defined via the @function command. & Attribute functions All these functions access attributes on an object. *************** *** 110,118 **** Connection functions return information about the connections open on a game, or about specific connections. ! conn() doing() height() hidden() idle() ! lports() lwho() mwho() ports() pueblo() ! ssl() terminfo() width() & Dbref functions Dbref functions return a dbref or list of dbrefs related to some value on an object. --- 109,118 ---- Connection functions return information about the connections open on a game, or about specific connections. ! cmds() conn() doing() height() hostname() ! hidden() idle() ipaddr() lports() lwho() ! mwho() ports() pueblo() ssl() terminfo() ! width() & Dbref functions Dbref functions return a dbref or list of dbrefs related to some value on an object. *************** *** 158,181 **** See also: LISTS & Math functions ! Math functions take one or more numbers and return a numeric value. ! What is allowed as a 'number' depends on @config settings (see help). ! These functions can taken both integers and floating point numbers: ! abs() add() bound() lmath() max() ! mean() median() min() mul() sign() ! stddev() sub() trunc() val() These functions operate only on integers (if passed floating point numbers, they will return an error or misbehave): ! dec() dist2d() dist3d() div() floordiv() ! inc() mod() ! ! These functions operate on floating point numbers: ! acos() asin() atan() atan2() ceil() ! cos() ctu() e() exp() fdiv() ! floor() fmod() fraction() ln() log() ! pi() power() root() round() sin() ! sqrt() tan() These functions operate on n-dimensional vectors. A vector is a delimiter-separated list of numbers (space-separated, by default): --- 158,177 ---- See also: LISTS & Math functions ! Math functions take one or more floating point numbers and return ! a numeric value. ! abs() acos() add() asin() atan() ! atan2() bound() ceil() cos() ctu() ! dist2d() dist3d() e() exp() fdiv() ! floor() fmod() fraction() ln() lmath() ! log() max() mean() median() min() ! mul() pi() power() root() round() ! sign() sin() sqrt() stddev() sub() ! tan() trunc() val() These functions operate only on integers (if passed floating point numbers, they will return an error or misbehave): ! dec() div() floordiv() inc() mod() These functions operate on n-dimensional vectors. A vector is a delimiter-separated list of numbers (space-separated, by default): *************** *** 187,193 **** regedit() regeditall() regeditalli() regediti() regmatch() regmatchi() regrab() regraball() regraballi() regrabi() ! regrep() regrepi() See also: string functions, regexp & String functions --- 183,190 ---- regedit() regeditall() regeditalli() regediti() regmatch() regmatchi() regrab() regraball() regraballi() regrabi() ! regrep() regrepi() reswitch() reswitchall() reswitchalli() ! reswitchi() See also: string functions, regexp & String functions *************** *** 217,240 **** & Utility functions These functions don't quite fit into any other category. ! ansi() atrlock() beep() checkpass() clone() ! create() die() dig() functions() isdbref() ! isint() isnum() isword() localize() link() ! list() lnum() mudname() null() objeval() ! open() pcreate() r-function rand() restarts() ! s-function scan() set() setq() setr() ! soundex() soundslike() tel() textfile() valid() ! version() wipe() @@() & @@() & NULL() @@() ! null() The @@() function does nothing and returns nothing. It could be used for commenting, perhaps. It does not evaluate its argument. ! The null() function is similar, but does evaluate its argument, so side-effects can occur within a null(). Useful for eating the output of functions when you don't use that output. & ABS() --- 214,237 ---- & Utility functions These functions don't quite fit into any other category. ! allof() ansi() atrlock() beep() checkpass() ! clone() create() die() dig() firstof() ! functions() isdbref() isint() isnum() isword() ! localize() link() list() lnum() mudname() ! null() objeval() open() pcreate() r-function ! rand() restarts() s-function scan() set() ! setq() setr() soundex() soundslike() tel() ! textfile() valid() version() wipe() @@() & @@() & NULL() @@() ! null([,,...]) The @@() function does nothing and returns nothing. It could be used for commenting, perhaps. It does not evaluate its argument. ! The null() function is similar, but does evaluate its argument(s), so side-effects can occur within a null(). Useful for eating the output of functions when you don't use that output. & ABS() *************** *** 335,340 **** --- 332,357 ---- > think after(foo bar baz,ba) r baz + & ALLOF() + allof([, ...,], ) + + Evaluates every expression argument (including side-effects) and returns + the results of those which are true, in a list separated by osep. The + output separator argument is required and must be a single character, + or can be left empty, in which case a space will be used to separate the + results by default. + + The meaning of true or false depends on configuration options as + explained in the 'BOOLEAN VALUES' help topics. + + > &s me=Bats are similar to Rats which are afraid of Cats + > say allof(grab(v(s),rats),grab(v(s),mats),grab(v(s),bats),) + You say, "Rats Bats" + + > say allof(#-1,#101,#2970,,#-3,0,#319,null(This Doesn't Count),|) + You say, "#101|#2970|#319" + + See also: firstof(), BOOLEAN VALUES & ALPHAMAX() alphamax(, , , ...) *************** *** 628,633 **** --- 645,660 ---- This function clones , and returns the dbref number of the clone. This is a side-effect function and may not be enabled on some MUSHes. + & CMDS() + cmds() + + Returns the number of commands issued by a player during this + connection as indicated by WHO. + + The caller can use the function on himself, but using on any other + player requires privileged power such as Wizard, Royalty or SEE_ALL. + + See also: Connection Functions & COMP() comp(, [, ]) *************** *** 1158,1163 **** --- 1185,1214 ---- Returns the first element of a list. See also: rest(), last() + & FIRSTOF() + firstof(, [, ... ,]) + + Returns the first evaluated expression that is true. If no arguments + are true, then the last argument, , is returned as the default + expression, whether it is true or false. + + The meaning of true or false is dependent on configuration options + as explained in the 'BOOLEAN VALUES' help topics. + + This function does evaluate each argument while testing, including + side-effects, stopping (short-circuits) when the true expression is + found. + + > say firstof(0,2) + You say, "2" + > say firstof(10,11,0) + You say, "10" + > say firstof(grab(the cat,mommy),grab(in the hat,daddy),#-1 Error) + You say, "#-1 Error" + > say firstof(get(%#/royal cheese),#-1 This Has No Meaning,0,) + You say, "" + + See also: allof(), BOOLEAN VALUES & FLAGS() flags() flags(/) *************** *** 1469,1474 **** --- 1520,1539 ---- Returns the object's 'home'. This is the home for a player or thing, the drop-to of a room, or source of an exit. + & HOST() + & HOSTNAME() + host() + hostname() + + Returns the hostname of a player as indicated by WHO. This may + be more reliable that get(/lastsite) if the player has + multple connections from different locations, and the function + is called with a descriptor argument. + + The caller can use the function on himself, but using on any other + player requires privileged power such as Wizard, Royalty or SEE_ALL. + + See also: Connection Functions, ipaddr(), ports(), lports() & IDLE() & IDLESECS() idle() *************** *** 1541,1558 **** See also: extract(), elements(), grab() & INSERT() insert(,,[,]) ! ! This inserts before the item of at . That means that then becomes the th element of . If a separator is not given, a space is assumed. Null items are counted when determining position, as in 'items()'. Examples: > say [insert(This is a string,4,test)] You say, "This is a test string" > say [insert(one|three|four,2,two,|)] You say, "one|two|three|four" ! & ISDAYLIGHT() isdaylight() --- 1606,1636 ---- See also: extract(), elements(), grab() & INSERT() insert(,,[,]) ! ! If is a positive integer, this inserts BEFORE ! the item at from the left in . ! That means that then becomes the th element of . If a separator is not given, a space is assumed. Null items are counted when determining position, as in 'items()'. + + If is a negative integer, this inserts AFTER + the item at the absolute value of from the RIGHT in . + + This is the same as reversing the list before inserting , + and then reversing it again into correct order. For example, when + is -1, will be the last in the list; when + is -2, will be the second item from the right, + and so on. Examples: > say [insert(This is a string,4,test)] You say, "This is a test string" > say [insert(one|three|four,2,two,|)] You say, "one|two|three|four" ! > say [insert(meep bleep gleep,-3,GOOP)] ! You say, "meep GOOP bleep gleep" ! & ISDAYLIGHT() isdaylight() *************** *** 1698,1703 **** --- 1776,1793 ---- > say [iter(red blue green,iter(fish shoe, [itext(1)]:[itext(0)]))] You say, "red:fish red:shoe blue:fish blue:shoe green:fish green:shoe" + & IPADDR() + ipaddr() + + Returns the IP address of the connected player or descriptor. This + may be more reliable that get(/lastip) if the player has + multple connections from different locations, and the function + is called with a descriptor argument. + + The caller can use the function on himself, but using on any other + player requires privileged power such as Wizard, Royalty or SEE_ALL. + + See also: Connection Functions, hostname(), ports(), lports() & LAST() last([,]) *************** *** 3317,3322 **** --- 3407,3427 ---- subj() Returns the subjective pronoun - he/she/it - for an object. + & RESWITCH() + & RESWITCHI() + & RESWITCHALL() + & RESWITCHALLI() + reswitch(, , , [, ], ... []) + reswitchall(, , , [, ], ... []) + reswitchi(, , , [, ], ... []) + reswitchalli(, , , [, ], ... []) + + These functions are just like switch() except they compare + against a series of regular expressions, not wildcard patterns. reswitch() + is case-sensitive, reswitchi() is case-insensitive. The reswitchall versions + evaluate every corresponding , not just the first that matches a regexp. + + See also: switch() & SWITCH() & SWITCHALL() & CASE() *************** *** 3555,3560 **** --- 3660,3680 ---- > say [timestring(301,2)] You say, "00d 00h 05m 01s" + & TR() + tr(,,) + + This function translates every character in that exists in + to the character at an identical position in . + and must be the same length. If a character exists more than + once in , only the first instance will be counted. The example + below is the common ROT-13 algorithm for lower case strings. + + Examples: + > say tr(hello,abcdefghijklmnopqrstuvwxyz,nopqrstuvwxyzabcdefghijklm) + You say, "uryyb" + > say tr(uryyb,abcdefghijklmnopqrstuvwxyz,nopqrstuvwxyzabcdefghijklm) + You say, "hello" + & TRIM() trim([,][,]) trimpenn([,][,]) *** 1_7_7.712/game/txt/hlp/penncmd.hlp Thu, 23 Oct 2003 13:05:36 -0500 dunemush (pennmush/18_penncmd.hl 1.2.1.1.1.47.1.1.1.1.1.3.1.4.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.2.1.10.1.1.1.1.1.1.1.1.1.1.1.5 600) --- 1_7_7.757(w)/game/txt/hlp/penncmd.hlp Sun, 14 Dec 2003 11:15:12 -0600 dunemush (pennmush/18_penncmd.hl 1.2.1.1.1.47.1.1.1.1.1.3.1.4.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.2.1.10.1.1.1.1.1.1.1.1.1.1.1.12 600) *************** *** 473,484 **** See also: CHOWN_OK, Zone Masters & @chownall ! @chownall [= ] Transfers ownership of all the objects that the player owns to . If the target player is not included, then all the objects are chowned to the person executing the command. ! This is a wizard-only command. See also: @chown & @chzone --- 473,485 ---- See also: CHOWN_OK, Zone Masters & @chownall ! @chownall[/preserve] [= ] Transfers ownership of all the objects that the player owns to . If the target player is not included, then all the objects are chowned to the person executing the command. ! This is a wizard-only command. The /preserve switch keeps privileged ! flags and powers instead of clearing them, and doesn't halt them. See also: @chown & @chzone *************** *** 1017,1023 **** (which is a good thing for security). & @emit & \ ! @emit[/room][/silent][/noeval] [] \ This sends to every person in the current room. However, no --- 1018,1024 ---- (which is a good thing for security). & @emit & \ ! @emit[/] [] \ This sends to every person in the current room. However, no *************** *** 1028,1033 **** --- 1029,1037 ---- The /silent switch in combination with /room suppresses the @lemit confirmation. It has no effect without /room. The /noeval switch prevents the MUSH from evaluating the message. + The /spoof switch causes nospoof notifications to show the enactor's + dbref instead of the executor's dbref, and requires control over + the enactor or the Can_nspemit power. @emit can be abbreviated "\" *************** *** 1644,1650 **** See also: leave, @lfail & @lemit ! @lemit[/silent][/noeval] Emits a message to the outermost container object. For example, if you are carrying a bird, and are inside a vehicle which is in room #10, and --- 1648,1654 ---- See also: leave, @lfail & @lemit ! @lemit[/] Emits a message to the outermost container object. For example, if you are carrying a bird, and are inside a vehicle which is in room #10, and *************** *** 1653,1658 **** --- 1657,1665 ---- The /silent switch suppresses the normal confirmation message. The /noeval switch prevents from being evaluated. + The /spoof switch causes nospoof notifications to show the enactor's + dbref instead of the executor's dbref, and requires control over + the enactor or the Can_nspemit power. & @lfail @lfail = *************** *** 1909,1915 **** Example: @lock Stage = ispuppet/1 ! &ispuppet thing = hasflag(%#, PUPPET) This locks the object "Stage" to puppets only. Whenever someone tries to pick up the object, the attribute --- 1916,1922 ---- Example: @lock Stage = ispuppet/1 ! &ispuppet Stage = hasflag(%#, PUPPET) This locks the object "Stage" to puppets only. Whenever someone tries to pick up the object, the attribute *************** *** 1952,1958 **** @lock/enter Who can enter the player/object (aka @elock) @lock/teleport Who can teleport to the room @lock/use Who can use the object (aka @ulock) ! @lock/page Who can page the player @lock/zone Who can control objects on this zone @lock/parent Who can @parent something to this object/room @lock/link Who can @link something to this object/room --- 1959,1965 ---- @lock/enter Who can enter the player/object (aka @elock) @lock/teleport Who can teleport to the room @lock/use Who can use the object (aka @ulock) ! @lock/page Who can page/@pemit the player @lock/zone Who can control objects on this zone @lock/parent Who can @parent something to this object/room @lock/link Who can @link something to this object/room *************** *** 2176,2182 **** See also: enter, @efail, @aefail, @lock & @oemit ! @oemit[/noeval] [/] [...] = This command shows to everyone in the location of EXCEPT . The object can be specified by name if in your current --- 2183,2189 ---- See also: enter, @efail, @aefail, @lock & @oemit ! @oemit[/] [/] [...] = This command shows to everyone in the location of EXCEPT . The object can be specified by name if in your current *************** *** 2192,2197 **** --- 2199,2207 ---- you don't need to know the dbref of "spy". The /noeval switch prevents the MUSH from evaluating the message. + The /spoof switch causes nospoof notifications to show the enactor's + dbref instead of the executor's dbref, and requires control over + the enactor or the Can_nspemit power. See also: @emit, @pemit, NOSPOOF and SPOOFING. & @oenter *************** *** 2481,2486 **** --- 2491,2499 ---- /silent -- does not tell the @pemit'ing object a confirmation message. /noisy -- tells the @pemit'ing object a confirmation message. /noeval -- the message will not be evaluated for substitutions + /spoof -- the enactor's dbref will be used for nospoof notifications + instead of the executor's dbref. Requires control + over enactor or Can_nspemit power. Note that page-lock and the HAVEN flag will block @pemits as well, except from Wizards or those with the pemit_all power. *************** *** 2590,2595 **** --- 2603,2611 ---- The /list switch will send the message to the contents of multiple objects at the same time. The argument is treated as a space-separated list of targets. + The /spoof switch causes nospoof notifications to show the enactor's + dbref instead of the executor's dbref, and requires control over + the enactor or the Can_nspemit power. See also: @emit, @pemit, @oemit, SPOOFING, NOSPOOF and CONTROL. & @restart *************** *** 2701,2707 **** is a function, is replaced by each dbref sequentially. Classes EPLAYER, EROOM, EEXIT, and EOBJECT work like EVAL but are restricted to a single type. & @select ! @select[/notify] =,[,,]...[,] This is similar to @switch, except it only executes the action associated with the first expression which matches - the targets are mutually exclusive. If no target is matched, the default --- 2717,2723 ---- is a function, is replaced by each dbref sequentially. Classes EPLAYER, EROOM, EEXIT, and EOBJECT work like EVAL but are restricted to a single type. & @select ! @select =,[,,]...[,] This is similar to @switch, except it only executes the action associated with the first expression which matches - the targets are mutually exclusive. If no target is matched, the default *************** *** 2720,2725 **** --- 2736,2744 ---- If the /notify switch is given, a "@notify me" is queued after the selected . This is useful for synchronization with semaphores. + If the /regexp switch is given, the expressions are case-insensitive regular + expressions. + See also: @switch, switch() & @set @set =[!] *************** *** 2763,2768 **** --- 2782,2792 ---- This flag can only be set by royalty and wizards. veiled (V) Attribute value will not be shown on default examine, but is still otherwise accessible (for spammy attribs). + debug (b) Show debug output when this attribute is evaluated. + nearby (n) Even if this attribute is visual, it can only be + retrieved if you're co-located with the object. + public (p) This attribute can be evaluated by any object, even + if safer_ufun is in use. DANGEROUS! AVOID! prefixmatch When a user attempts to set an attribute using @, this attribute will be matched down to its unique prefixes. This flag is primarily used internally. *************** *** 2950,2955 **** --- 2974,2981 ---- /all in many cases. @switch/notify will cause a "@notify me" to be queued after the selected . + @switch/regexp will cause the expressions to be matched as case-insensitive + regular expressions. (continued in help @switch2) & @switch2 *** 1_7_7.712/game/txt/hlp/pennchat.hlp Mon, 15 Sep 2003 23:32:34 -0500 dunemush (pennmush/19_pennchat.h 1.2.1.4.1.6 600) --- 1_7_7.757(w)/game/txt/hlp/pennchat.hlp Fri, 14 Nov 2003 17:00:06 -0600 dunemush (pennmush/19_pennchat.h 1.2.1.4.1.7 600) *************** *** 139,145 **** See "help @channel5" for more. See also "help @clock". & @channel5 @channel/priv = - @channel/quiet = @channel/wipe @channel/buffer = @channel/decompile[/brief] --- 139,144 ---- *************** *** 147,153 **** The "priv" switch changes the channel's access privileges. Use ! to reset a privilege. - The "quiet" switch turns the quiet status of a channel on and off. The "wipe" switch clears a channel of players without deleting it. The "buffer" switch sets the maximum number of full-length lines that the channel will buffer for @chan/recall. Many more shorter lines may --- 146,151 ---- *** 1_7_7.712/game/mushcnf.dst Wed, 01 Oct 2003 21:42:14 -0500 dunemush (pennmush/41_mushcnf.ds 1.1.1.19.1.1.1.2.1.1.1.8.1.1.1.1.1.19 600) --- 1_7_7.757(w)/game/mushcnf.dst Thu, 13 Nov 2003 07:40:22 -0600 dunemush (pennmush/41_mushcnf.ds 1.1.1.19.1.1.1.2.1.1.1.8.1.1.1.1.1.20 600) *************** *** 612,617 **** --- 612,623 ---- # @restart command, which will work even if this is "no". startups yes + # Can @desc attributes be accessed remotely by everyone? + # Historically, this was allowed, but it makes it difficult to + # have hidden objects with secrets in their @desc if players + # can remotely get the @desc. If set to "no", you must be + # able to look at something to retrieve its @desc. + read_remote_desc no ### ### Cosmetic stuff *** 1_7_7.712/config_h.SH Tue, 30 Sep 2003 18:01:23 -0500 dunemush (pennmush/b/17_config_h.S 1.17.1.2.1.1.1.9 660) --- 1_7_7.757(w)/config_h.SH Mon, 24 Nov 2003 12:40:09 -0600 dunemush (pennmush/b/17_config_h.S 1.17.1.2.1.1.1.10 660) *************** *** 356,361 **** --- 356,370 ---- #define Malloc_t $malloctype /**/ #define Free_t $freetype /**/ + /* MYHOSTNAME: + * This symbol contains name of the host the program is going to run on. + * The domain is not kept with hostname, but must be gotten from MYDOMAIN. + * The dot comes with MYDOMAIN, and need not be supplied by the program. + * If gethostname() or uname() exist, MYHOSTNAME may be ignored. If MYDOMAIN + * is not used, MYHOSTNAME will hold the name derived from PHOSTNAME. + */ + #define MYHOSTNAME "$myhostname" /**/ + /* Pid_t: * This symbol holds the type used to declare process ids in the kernel. * It can be int, uint, pid_t, etc... It may be necessary to include *** 1_7_7.712/src/SWITCHES Sun, 19 Oct 2003 09:57:03 -0500 dunemush (pennmush/b/22_SWITCHES 1.12.1.3.1.9 600) --- 1_7_7.757(w)/src/SWITCHES Mon, 15 Dec 2003 14:03:06 -0600 dunemush (pennmush/b/22_SWITCHES 1.12.1.3.1.11 600) *************** *** 98,103 **** --- 98,104 ---- RECALL REMOVE RENAME + REGEXP REGIONS REGISTER RESTORE *************** *** 113,118 **** --- 114,120 ---- SILENT SKIPDEFAULTS SPEAK + SPOOF STATS SUMMARY TABLES *** 1_7_7.712/src/wiz.c Wed, 29 Oct 2003 14:21:02 -0600 dunemush (pennmush/b/23_wiz.c 1.44.1.1.1.1.1.2.1.7.1.1.1.1.1.1.1.1.1.1.1.8.1.2.2.2.1.2.1.1.1.1.1.1.1.2.1.1.1.2.2.17.1.7 660) --- 1_7_7.757(w)/src/wiz.c Mon, 15 Dec 2003 14:03:03 -0600 dunemush (pennmush/b/23_wiz.c 1.44.1.1.1.1.1.2.1.7.1.1.1.1.1.1.1.1.1.1.1.8.1.2.2.2.1.2.1.1.1.1.1.1.1.2.1.1.1.2.2.17.1.9 660) *************** *** 1717,1739 **** } #endif ! /** Modify access rules for a site or a player name. * \verbatim * This implements @sitelock. * \endverbatim * \param player the enactor. ! * \param site name of site (or player name to forbid) * \param opts access rules to apply. * \param who string containing dbref of player to whom rule applies. ! * \param type command switches: 0=/register, 1=/ban, 2=/name, 3=/remove, 4=/check. */ void do_sitelock(dbref player, const char *site, const char *opts, const char *who, ! int type) { - FILE *fp, *fptmp; - char buffer[80]; - char *p; if (!Wizard(player)) { notify(player, T("Your delusions of grandeur have been noted.")); return; --- 1717,1736 ---- } #endif ! /** Modify access rules for a site. * \verbatim * This implements @sitelock. * \endverbatim * \param player the enactor. ! * \param site name of site. * \param opts access rules to apply. * \param who string containing dbref of player to whom rule applies. ! * \param type sitelock operation to do. */ void do_sitelock(dbref player, const char *site, const char *opts, const char *who, ! enum sitelock_type type) { if (!Wizard(player)) { notify(player, T("Your delusions of grandeur have been noted.")); return; *************** *** 1778,1800 **** * or @sitelock/name */ switch (type) { ! case 0: ! case 1: ! if (!site || !*site) { ! /* List bad sites */ ! do_list_access(player); ! return; ! } ! /* Add a site */ ! if (type == 0) ! add_access_sitelock(player, site, AMBIGUOUS, 0, ACS_CREATE); ! else ! add_access_sitelock(player, site, AMBIGUOUS, 0, ACS_DEFAULT); write_access_file(); notify_format(player, T("Site %s locked"), site); do_log(LT_WIZ, player, NOTHING, "*** SITELOCK *** %s", site); break; ! case 4:{ struct access *ap; char tbuf[BUFFER_LEN], *bp; int rulenum; --- 1775,1797 ---- * or @sitelock/name */ switch (type) { ! case SITELOCK_LIST: ! /* List bad sites */ ! do_list_access(player); ! return; ! case SITELOCK_ADD: ! add_access_sitelock(player, site, AMBIGUOUS, 0, ACS_CREATE); write_access_file(); notify_format(player, T("Site %s locked"), site); do_log(LT_WIZ, player, NOTHING, "*** SITELOCK *** %s", site); break; ! case SITELOCK_BAN: ! add_access_sitelock(player, site, AMBIGUOUS, 0, ACS_DEFAULT); ! write_access_file(); ! notify_format(player, T("Site %s banned"), site); ! do_log(LT_WIZ, player, NOTHING, "*** SITELOCK *** %s", site); ! break; ! case SITELOCK_CHECK:{ struct access *ap; char tbuf[BUFFER_LEN], *bp; int rulenum; *************** *** 1809,1900 **** notify(player, tbuf); break; } ! case 3:{ int n; n = remove_access_sitelock(site); ! write_access_file(); notify_format(player, T("%d sitelocks removed."), n); break; } ! case 2: ! if (!site || !*site) { ! /* List bad names */ ! release_fd(); ! #ifdef macintosh ! if ((fp = fopen(NAMES_FILE, "rb")) == NULL) { ! #else ! if ((fp = fopen(NAMES_FILE, "r")) == NULL) { #endif ! notify(player, T("Unable to open names file.")); } else { ! while (fgets(buffer, 79, fp)) { ! if ((p = strrchr(buffer, '\n'))) /* extra parens for gcc */ ! *p = '\0'; ! notify(player, buffer); ! } ! fclose(fp); } - reserve_fd(); - return; } ! if (site[0] == '!') { /* Delete a name */ ! release_fd(); ! #ifdef macintosh ! if ((fp = fopen(NAMES_FILE, "rb")) != NULL) { ! if ((fptmp = fopen("tmp.tmp", "wb")) == NULL) { ! #else ! if ((fp = fopen(NAMES_FILE, "r")) != NULL) { ! if ((fptmp = fopen("tmp.tmp", "w")) == NULL) { ! #endif ! notify(player, T("Unable to open names file.")); ! fclose(fp); ! } else { ! while (fgets(buffer, 79, fp)) { ! if ((p = strrchr(buffer, '\n'))) ! *p = '\0'; ! if (strcasecmp(buffer, site + 1) != 0) ! fprintf(fptmp, "%s\n", buffer); ! } ! fclose(fp); ! fclose(fptmp); ! if (unlink(NAMES_FILE) == 0) { ! if (rename("tmp.tmp", NAMES_FILE) == 0) { ! notify(player, T("Name removed.")); ! do_log(LT_WIZ, player, NOTHING, "*** UNLOCKED NAME *** %s", ! site + 1); ! } else { ! notify(player, T("Unable to delete name.")); ! } ! } else { ! notify(player, T("Unable to delete name.")); ! } ! } } else - notify(player, T("Unable to delete name.")); - reserve_fd(); - } - /* Add a name */ - release_fd(); - #ifdef macintosh - if ((fp = fopen(NAMES_FILE, "ab")) != NULL) { - #else - if ((fp = fopen(NAMES_FILE, "a")) != NULL) { #endif ! /* Put a newline at the end of the site */ ! fprintf(fp, "%s\n", site); ! fclose(fp); ! notify_format(player, T("Name %s locked"), site); ! do_log(LT_WIZ, player, NOTHING, "*** NAMELOCK *** %s", site); ! } else { ! notify(player, T("Error writing to file.")); } - reserve_fd(); - break; } } } - /*----------------------------------------------------------------- * Functions which give memory information on objects or players. * Source code originally by Kalkin, modified by Javelin --- 1806,1933 ---- notify(player, tbuf); break; } ! case SITELOCK_REMOVE:{ int n; n = remove_access_sitelock(site); ! if (n > 0) ! write_access_file(); notify_format(player, T("%d sitelocks removed."), n); break; } ! } ! } ! } ! ! /** Edit the list of restricted player names ! * \verbatim ! * This implements @sitelock/name ! * \endverbatim ! * \param player the player doing the command. ! * \param name the name (Actually, wildcard pattern) to restrict. ! */ ! void ! do_sitelock_name(dbref player, const char *name) ! { ! FILE *fp, *fptmp; ! char buffer[BUFFER_LEN]; ! char *p; ! ! if (!Wizard(player)) { ! notify(player, T("Your delusions of grandeur have been noted.")); ! return; ! } ! ! release_fd(); ! ! if (!name || !*name) { ! /* List bad names */ ! if ((fp = fopen(NAMES_FILE, FOPEN_READ)) == NULL) { ! notify(player, T("Unable to open names file.")); ! } else { ! notify(player, T("Any name matching these wildcard patterns is banned:")); ! while (fgets(buffer, sizeof buffer, fp)) { ! if ((p = strchr(buffer, '\n')) != NULL) ! *p = '\0'; ! notify(player, buffer); ! } ! fclose(fp); ! } ! } else if (name[0] == '!') { /* Delete a name */ ! if ((fp = fopen(NAMES_FILE, FOPEN_READ)) != NULL) { ! if ((fptmp = fopen("tmp.tmp", FOPEN_WRITE)) == NULL) { ! notify(player, T("Unable to delete name.")); ! fclose(fp); ! } else { ! while (fgets(buffer, sizeof buffer, fp)) { ! if ((p = strchr(buffer, '\n')) != NULL) ! *p = '\0'; ! if (strcasecmp(buffer, name + 1) == 0) ! /* Replace the name with #NAME, to allow things like ! keeping track of unlocked feature names. */ ! fprintf(fptmp, "#%s\n", buffer); ! else ! fprintf(fptmp, "%s\n", buffer); ! } ! fclose(fp); ! fclose(fptmp); ! #ifdef WIN32 ! /* Windows can't rename to an existing file. */ ! if (unlink(NAMES_FILE) != 0) { ! notify(player, T("Unable to delete name.")); ! } else #endif ! if (rename("tmp.tmp", NAMES_FILE) == 0) { ! notify(player, T("Name removed.")); ! do_log(LT_WIZ, player, NOTHING, "*** UNLOCKED NAME *** %s", name + 1); } else { ! notify(player, T("Unable to delete name.")); } } ! } else ! notify(player, T("Unable to delete name.")); ! } else { /* Add a name */ ! if ((fp = fopen(NAMES_FILE, FOPEN_READ)) != NULL) { ! if ((fptmp = fopen("tmp.tmp", FOPEN_WRITE)) == NULL) { ! notify(player, T("Unable to lock name.")); ! } else { ! /* Read the names file, looking for #NAME and writing it ! without the commenting #. Otherwise, add the new name ! to the end of the file */ ! char commented[BUFFER_LEN + 1]; ! int found = 0; ! commented[0] = '#'; ! strcpy(commented + 1, name); ! while (fgets(buffer, sizeof buffer, fp) != NULL) { ! if ((p = strchr(buffer, '\n')) != NULL) ! *p = '\0'; ! if (strcasecmp(commented, buffer) == 0) { ! fprintf(fptmp, "%s\n", name); ! found = 1; ! } else ! fprintf(fptmp, "%s\n", buffer); ! } ! if (!found) ! fprintf(fptmp, "%s\n", name); ! fclose(fp); ! fclose(fptmp); ! ! #ifdef WIN32 ! /* Windows can't rename to an existing file. */ ! if (unlink(NAMES_FILE) != 0) { ! notify(player, T("Unable to lock name.")); } else #endif ! if (rename("tmp.tmp", NAMES_FILE) == 0) { ! notify_format(player, T("Name %s locked."), name); ! do_log(LT_WIZ, player, NOTHING, "*** NAMELOCK *** %s", name); ! } else ! notify(player, T("Unable to lock name.")); } } } + reserve_fd(); } /*----------------------------------------------------------------- * Functions which give memory information on objects or players. * Source code originally by Kalkin, modified by Javelin *** 1_7_7.712/src/help.c Wed, 29 Oct 2003 14:21:02 -0600 dunemush (pennmush/f/32_help.c 1.4.1.2.1.1.1.3.2.2.1.1.2.1.1.2.1.2.1.2.1.3.1.18 660) --- 1_7_7.757(w)/src/help.c Mon, 15 Dec 2003 14:03:02 -0600 dunemush (pennmush/f/32_help.c 1.4.1.2.1.1.1.3.2.2.1.1.2.1.1.2.1.2.1.2.1.3.1.19 660) *************** *** 207,213 **** return; } ! if ((fp = fopen(help_dat->file, "rb")) == NULL) { notify(player, T("Sorry, that function is temporarily unavailable.")); do_log(LT_ERR, 0, 0, T("Can't open text file %s for reading"), help_dat->file); --- 207,213 ---- return; } ! if ((fp = fopen(help_dat->file, FOPEN_READ)) == NULL) { notify(player, T("Sorry, that function is temporarily unavailable.")); do_log(LT_ERR, 0, 0, T("Can't open text file %s for reading"), help_dat->file); *************** *** 355,361 **** /* Quietly ignore null values for the file */ if (!h || !h->file) return; ! if ((rfp = fopen(h->file, "rb")) == NULL) { do_rawlog(LT_ERR, T("Can't open %s for reading"), h->file); return; } --- 355,361 ---- /* Quietly ignore null values for the file */ if (!h || !h->file) return; ! if ((rfp = fopen(h->file, FOPEN_READ)) == NULL) { do_rawlog(LT_ERR, T("Can't open %s for reading"), h->file); return; } *************** *** 503,509 **** return T("#-1 NO ENTRY"); } ! if ((fp = fopen(help_dat->file, "rb")) == NULL) { return T("#-1 UNAVAILABLE"); } if (fseek(fp, entry->pos, 0) < 0L) { --- 503,509 ---- return T("#-1 NO ENTRY"); } ! if ((fp = fopen(help_dat->file, FOPEN_READ)) == NULL) { return T("#-1 UNAVAILABLE"); } if (fseek(fp, entry->pos, 0) < 0L) { *** 1_7_7.712/src/switchinc.c Sun, 19 Oct 2003 09:57:03 -0500 dunemush (pennmush/b/32_switchinc. 1.3.1.2.1.6.1.18.1.2.1.2.2.5.1.4.2.4.1.1.1.2.1.5.1.2.1.5.2.1.1.31.3.4.1.5.1.4.1.1.1.1.1.1.1.7.1.1.1.2 660) --- 1_7_7.757(w)/src/switchinc.c Mon, 15 Dec 2003 14:03:03 -0600 dunemush (pennmush/b/32_switchinc. 1.3.1.2.1.6.1.18.1.2.1.2.2.5.1.4.2.4.1.1.1.2.1.5.1.2.1.5.2.1.1.31.3.4.1.5.1.4.1.1.1.1.1.1.1.7.1.1.1.4 660) *************** *** 98,103 **** --- 98,104 ---- {"READ", SWITCH_READ}, {"REBOOT", SWITCH_REBOOT}, {"RECALL", SWITCH_RECALL}, + {"REGEXP", SWITCH_REGEXP}, {"REGIONS", SWITCH_REGIONS}, {"REGISTER", SWITCH_REGISTER}, {"REMOVE", SWITCH_REMOVE}, *************** *** 115,120 **** --- 116,122 ---- {"SILENT", SWITCH_SILENT}, {"SKIPDEFAULTS", SWITCH_SKIPDEFAULTS}, {"SPEAK", SWITCH_SPEAK}, + {"SPOOF", SWITCH_SPOOF}, {"STATS", SWITCH_STATS}, {"SUMMARY", SWITCH_SUMMARY}, {"TABLES", SWITCH_TABLES}, *** 1_7_7.712/src/speech.c Wed, 29 Oct 2003 14:21:02 -0600 dunemush (pennmush/b/35_speech.c 1.21.1.2.1.3.1.5.1.1.1.7.1.3.1.1.1.8.1.1.1.1.1.1.1.10.1.2.1.13.2.4.1.1.3.1.1.5.1.1.1.1 660) --- 1_7_7.757(w)/src/speech.c Mon, 15 Dec 2003 14:03:03 -0600 dunemush (pennmush/b/35_speech.c 1.21.1.2.1.3.1.5.1.1.1.7.1.3.1.1.1.8.1.1.1.1.1.1.1.10.1.2.1.13.2.4.1.1.3.1.1.5.1.1.1.6 660) *************** *** 28,35 **** #include "memcheck.h" #include "confmagic.h" - static void oemit_notify_except(dbref loc, dbref exc1, dbref exc2, - const char *msg); int okay_pemit(dbref player, dbref target); static dbref speech_loc(dbref thing); void propagate_sound(dbref thing, const char *msg); --- 28,33 ---- *************** *** 169,227 **** NA_INTER_HEAR); } ! /** The oemit command. * \verbatim ! * This implements @oemit. ! * \endverbatim ! * \param player the enactor. ! * \param arg1 the player or room/player to omit from the emit. ! * \param arg2 the message to emit. ! */ ! void ! do_oemit(dbref player, const char *arg1, const char *arg2) ! { ! dbref who; ! dbref loc; ! char *temp; ! ! if ((temp = strchr(arg1, '/')) == NULL) { ! who = match_result(player, arg1, NOTYPE, MAT_OBJECTS); ! if (!GoodObject(who)) { ! notify(player, T("I can't find that object.")); ! return; ! } ! loc = Location(who); ! if (!GoodObject(loc)) { ! notify(player, T("You can only @oemit to neighboring objects.")); ! return; ! } ! } else { ! *temp++ = '\0'; ! ! /* first find the room */ ! loc = noisy_match_result(player, arg1, NOTYPE, MAT_EVERYTHING); ! if (!GoodObject(loc)) { ! notify(player, T("I can't find that room.")); ! return; ! } ! /* then find the person to omit within that room */ ! who = match_result(loc, temp, NOTYPE, MAT_POSSESSION | MAT_ABSOLUTE); ! } ! ! if (!Hasprivs(player) && !eval_lock(player, loc, Speech_Lock)) { ! notify(player, T("You may not speak there!")); ! return; ! } ! ! if (!GoodObject(who)) ! oemit_notify_except(loc, NOTHING, loc, arg2); ! else ! oemit_notify_except(loc, who, loc, arg2); ! } ! ! /** The oemit/list command. ! * \verbatim ! * This implements @oemit/list. * \endverbatim * \param player the enactor. * \param list the list of dbrefs to oemit from the emit. --- 167,175 ---- NA_INTER_HEAR); } ! /** The oemit(/list) command. * \verbatim ! * This implements @oemit and @oemit/list. * \endverbatim * \param player the enactor. * \param list the list of dbrefs to oemit from the emit. *************** *** 240,245 **** --- 188,194 ---- if (!message || !*message || !list || !*list) return; + orator = player; pass[0] = 0; /* Find out what room to do this in. If they supplied a db# before * the '/', then oemit to anyone in the room who's not on list. *************** *** 301,334 **** } } ! if (oneloc) { ! /* Only one room to oemit to. */ ! notify_anything(orator, na_exceptN, pass, ns_esnotify, NA_INTER_HEAR, ! message); ! do_audible_stuff(pass[1], &pass[2], pass[0], message); ! return; ! } else if (pass[0] == 0) { ! return; /* none of the dbrefs they gave were valid */ ! } else { ! /* Multiple rooms to oemit to. Sort 'em so we don't oemit to the ! * same room twice ! */ ! qsort((void *) locs, pass[0], sizeof(locs[0]), i_comp); ! pass[1] = locs[0]; ! notify_anything(orator, na_exceptN, pass, ns_esnotify, NA_INTER_HEAR, ! message); do_audible_stuff(pass[1], &pass[2], pass[0], message); - for (i = 1; i < pass[0]; i++) { - if (locs[i] != locs[i - 1]) { - pass[1] = locs[i]; - notify_anything(orator, na_exceptN, pass, ns_esnotify, NA_INTER_HEAR, - message); - do_audible_stuff(pass[1], &pass[2], pass[0], message); - } - } } } /** The whisper command. * \param player the enactor. * \param arg1 name of the object to whisper to. --- 250,270 ---- } } ! /* Sort the list of rooms to oemit to so we don't oemit to the same ! * room twice */ ! qsort((void *) locs, pass[0], sizeof(locs[0]), i_comp); ! ! for (i = 0; i < pass[0]; i++) { ! if (i != 0 && locs[i] == locs[i - 1]) ! continue; ! pass[1] = locs[i]; ! notify_anything_loc(orator, na_exceptN, pass, ns_esnotify, NA_INTER_HEAR, ! message, locs[i]); do_audible_stuff(pass[1], &pass[2], pass[0], message); } } + /** The whisper command. * \param player the enactor. * \param arg1 name of the object to whisper to. *************** *** 1042,1051 **** break; if (*p == '\0') /* Empty filter */ continue; ! if (AL_FLAGS(a) & AF_REGEXP) ! matched = quick_regexp_match(p, msg, AL_FLAGS(a) & AF_CASE); else ! matched = local_wild_match_case(p, msg, AL_FLAGS(a) & AF_CASE); } free((Malloc_t) temp); --- 978,987 ---- break; if (*p == '\0') /* Empty filter */ continue; ! if (AF_Regexp(a)) ! matched = quick_regexp_match(p, msg, AF_Case(a)); else ! matched = local_wild_match_case(p, msg, AF_Case(a)); } free((Malloc_t) temp); *************** *** 1222,1249 **** do_audible_stuff(loc, &pass[1], 2, msg); } - static void - oemit_notify_except(dbref loc, dbref exc1, dbref exc2, const char *msg) - { - dbref pass[3]; - - if (!GoodObject(loc)) - return; - - if (exc1 == NOTHING) - exc1 = AMBIGUOUS; - if (exc2 == NOTHING) - exc2 = AMBIGUOUS; - - pass[0] = loc; - pass[1] = exc1; - pass[2] = exc2; - - notify_anything(orator, na_except2, pass, ns_esnotify, NA_INTER_HEAR, msg); - - do_audible_stuff(loc, &pass[1], 2, msg); - } - /** The think command. * \param player the enactor. * \param message the message to think. --- 1158,1163 ---- *************** *** 1310,1316 **** rmno = unparse_object(player, room); notify_format(player, T("You remit, \"%s\" in %s"), msg, rmno); } ! notify_anything(player, na_loc, &room, ns_esnotify, NA_INTER_HEAR, msg); do_audible_stuff(room, NULL, 0, msg); } } --- 1224,1231 ---- rmno = unparse_object(player, room); notify_format(player, T("You remit, \"%s\" in %s"), msg, rmno); } ! notify_anything_loc(player, na_loc, &room, ns_esnotify, NA_INTER_HEAR, ! msg, room); do_audible_stuff(room, NULL, 0, msg); } } *** 1_7_7.712/src/set.c Tue, 30 Sep 2003 18:35:19 -0500 dunemush (pennmush/b/38_set.c 1.26.1.5.1.1.2.1.1.1.1.1.1.11.1.1.1.1.1.1.1.1.1.1.1.1.1.15 660) --- 1_7_7.757(w)/src/set.c Mon, 15 Dec 2003 14:03:03 -0600 dunemush (pennmush/b/38_set.c 1.26.1.5.1.1.2.1.1.1.1.1.1.11.1.1.1.1.1.1.1.1.1.1.1.1.1.18 660) *************** *** 309,323 **** do_halt(thing, "", thing); } else { if ((newowner != player) && Wizard(thing) && !God(player)) { ! notify(player, ! T ! ("Warning: WIZ flag reset because @CHOWN/PRESERVE is to a third party.")); clear_flag_internal(thing, "WIZARD"); } if (Powers(thing) || Wizard(thing) || Royalty(thing) || Inherit(thing)) ! notify(player, ! T ! ("Warning: @CHOWN/PRESERVE on a target with WIZ, ROY, INHERIT, or @power privileges.")); } } --- 309,325 ---- do_halt(thing, "", thing); } else { if ((newowner != player) && Wizard(thing) && !God(player)) { ! notify_format(player, ! T ! ("Warning: WIZ flag reset on #%d because @CHOWN/PRESERVE is to a third party."), ! thing); clear_flag_internal(thing, "WIZARD"); } if (Powers(thing) || Wizard(thing) || Royalty(thing) || Inherit(thing)) ! notify_format(player, ! T ! ("Warning: @CHOWN/PRESERVE on a object (#%d) with WIZ, ROY, INHERIT, or @power privileges."), ! thing); } } *************** *** 474,480 **** * There is one special case - the resetting of the SAFE flag. */ if (!(Can_Write_Attr(player, thing, AL_ATTR(atr)) || ! (af->clear && (af->f == AF_SAFE) && Can_Write_Attr_Ignore_Safe(player, thing, AL_ATTR(atr))))) { notify_format(player, T("You cannot change that flag on %s/%s"), Name(thing), AL_NAME(atr)); --- 476,482 ---- * There is one special case - the resetting of the SAFE flag. */ if (!(Can_Write_Attr(player, thing, AL_ATTR(atr)) || ! (af->clear && (af->f & AF_SAFE) && Can_Write_Attr_Ignore_Safe(player, thing, AL_ATTR(atr))))) { notify_format(player, T("You cannot change that flag on %s/%s"), Name(thing), AL_NAME(atr)); *************** *** 1027,1033 **** * attributes using this command and wildcards. Wiping a specific * attr still works, though. */ ! if (wildcard(pattern) && (AL_FLAGS(atr) & AF_WIZARD) && !God(player)) return 0; return do_set_atr(thing, AL_NAME(atr), NULL, player, 0) == 1; } --- 1029,1035 ---- * attributes using this command and wildcards. Wiping a specific * attr still works, though. */ ! if (wildcard(pattern) && AF_Wizard(atr) && !God(player)) return 0; return do_set_atr(thing, AL_NAME(atr), NULL, player, 0) == 1; } *** 1_7_7.712/src/predicat.c Tue, 30 Sep 2003 16:39:26 -0500 dunemush (pennmush/b/44_predicat.c 1.1.1.34.1.1.1.3.1.4.2.29 660) --- 1_7_7.757(w)/src/predicat.c Mon, 15 Dec 2003 14:03:03 -0600 dunemush (pennmush/b/44_predicat.c 1.1.1.34.1.1.1.3.1.4.2.34 660) *************** *** 39,45 **** int forbidden_name(const char *name); void do_switch(dbref player, char *expression, char **argv, ! dbref cause, int first, int notifyme); void do_verb(dbref player, dbref cause, char *arg1, char **argv); static int grep_util_helper(dbref player, dbref thing, char const *pattern, ATTR *atr, void *args); --- 39,45 ---- int forbidden_name(const char *name); void do_switch(dbref player, char *expression, char **argv, ! dbref cause, int first, int notifyme, int regexp); void do_verb(dbref player, dbref cause, char *arg1, char **argv); static int grep_util_helper(dbref player, dbref thing, char const *pattern, ATTR *atr, void *args); *************** *** 623,636 **** char *upname; upname = strupper(name); ! #ifdef macintosh ! fp = fopen(NAMES_FILE, "rb"); ! #else ! fp = fopen(NAMES_FILE, "r"); ! #endif if (!fp) return 0; ! while (fgets(buf, BUFFER_LEN - 1, fp)) { upcasestr(buf); /* step on the newline */ if ((newlin = strchr(buf, '\n')) != NULL) --- 623,632 ---- char *upname; upname = strupper(name); ! fp = fopen(NAMES_FILE, FOPEN_READ); if (!fp) return 0; ! while (fgets(buf, sizeof buf, fp)) { upcasestr(buf); /* step on the newline */ if ((newlin = strchr(buf, '\n')) != NULL) *************** *** 777,782 **** --- 773,815 ---- return 1; } + /** Does params contain only acceptable HTML tag attributes? + * Right now, this means: filter out SEND and XCH_CMD if + * the player isn't a Wizard. Params may contain a space-separated + * list of tag=value pairs. + * \param player player using the attribute, or NOTHING for internal. + * \param params the attributes to use. + * \retval 1 params is acceptable. + * \retval 0 params is not accpetable. + */ + int + ok_tag_attribute(dbref player, const char *params) + { + const char *p, *q; + if (!GoodObject(player) || Wizard(player)) + return 1; + p = params; + while (*p) { + while (*p && isspace(*p)) + p++; + q = p; + while (*q && !(isspace(*q) || (*q == '='))) + q++; + if (*q) { + *q++ = '\0'; + if (strcasecmp(p, "SEND") || strcasecmp(p, "XCH_CMD")) + return 0; + while (*q && isspace(*q)) + q++; + while (*q && !isspace(*q)) + q++; + p = q; + } + } + return 1; + } + + /** The switch command. * \verbatim * For lack of better place the @switch code is here. *************** *** 788,797 **** * \param cause the object that caused this code to run. * \param first if 1, run only first matching case; if 0, run all matching cases. * \param notifyme if 1, perform a notify after executing matched cases. */ void do_switch(dbref player, char *expression, char **argv, dbref cause, ! int first, int notifyme) { int any = 0, a; char buff[BUFFER_LEN], *bp; --- 821,831 ---- * \param cause the object that caused this code to run. * \param first if 1, run only first matching case; if 0, run all matching cases. * \param notifyme if 1, perform a notify after executing matched cases. + * \param regexp if 1, do regular expression matching; if 0, wildcard globbing. */ void do_switch(dbref player, char *expression, char **argv, dbref cause, ! int first, int notifyme, int regexp) { int any = 0, a; char buff[BUFFER_LEN], *bp; *************** *** 819,825 **** *bp = '\0'; /* check for a match */ ! if (local_wild_match(buff, expression)) { any = 1; tbuf1 = replace_string("#$", expression, argv[a + 1]); parse_que(player, tbuf1, cause); --- 853,860 ---- *bp = '\0'; /* check for a match */ ! if (regexp ? quick_regexp_match(buff, expression, 0) ! : local_wild_match(buff, expression)) { any = 1; tbuf1 = replace_string("#$", expression, argv[a + 1]); parse_que(player, tbuf1, cause); *************** *** 953,958 **** --- 988,995 ---- if (!GoodObject(obj1) || !GoodObject(obj2)) return 0; + if (IsRoom(obj1) && IsRoom(obj2)) + return 0; loc1 = where_is(obj1); if (loc1 == obj2) return 1; *** 1_7_7.712/src/player.c Mon, 06 Oct 2003 23:33:49 -0500 dunemush (pennmush/b/47_player.c 1.15.1.1.1.1.1.4.1.6.1.1.1.6 660) --- 1_7_7.757(w)/src/player.c Mon, 15 Dec 2003 14:03:03 -0600 dunemush (pennmush/b/47_player.c 1.15.1.1.1.1.1.4.1.6.1.1.1.7 660) *************** *** 341,347 **** fprintf(fp, "\n"); fprintf(fp, T("To access this character, connect to %s and type:\n"), MUDNAME); ! fprintf(fp, "\tconnect %s %s\n", name, passwd); fprintf(fp, "\n"); pclose(fp); reserve_fd(); --- 341,347 ---- fprintf(fp, "\n"); fprintf(fp, T("To access this character, connect to %s and type:\n"), MUDNAME); ! fprintf(fp, "\tconnect \"%s\" %s\n", name, passwd); fprintf(fp, "\n"); pclose(fp); reserve_fd(); *** 1_7_7.712/src/parse.c Tue, 02 Sep 2003 00:09:16 -0500 dunemush (pennmush/b/48_parse.c 1.23.1.10.1.2.1.1.1.1.1.2.1.2.1.22 660) --- 1_7_7.757(w)/src/parse.c Mon, 15 Dec 2003 14:03:02 -0600 dunemush (pennmush/b/48_parse.c 1.23.1.10.1.2.1.1.1.1.1.2.1.2.1.23 660) *************** *** 465,472 **** if (eflags != PE_NOTHING) { ! debugging = Debug(executor) && (Connected(Owner(executor)) ! || atr_get(executor, "DEBUGFORWARDLIST")); if (debugging) { int j; char *debugp; --- 465,472 ---- if (eflags != PE_NOTHING) { ! debugging = (Debug(executor) || (eflags & PE_DEBUG)) ! && (Connected(Owner(executor)) || atr_get(executor, "DEBUGFORWARDLIST")); if (debugging) { int j; char *debugp; *** 1_7_7.712/src/look.c Wed, 29 Oct 2003 14:21:02 -0600 dunemush (pennmush/c/4_look.c 1.21.1.2.1.9.1.1.1.1.1.19 660) --- 1_7_7.757(w)/src/look.c Mon, 15 Dec 2003 14:03:02 -0600 dunemush (pennmush/c/4_look.c 1.21.1.2.1.9.1.1.1.1.1.22 660) *************** *** 166,172 **** if ((p = strchr(pbuff, ';'))) *p = '\0'; p = nbuf; ! safe_tag_wrap("A", tprintf("XCH_CMD=\"go #%d\"", thing), pbuff, nbuf, &p); *p = '\0'; if (Transparented(loc) && !(Opaque(thing))) { if (SUPPORT_PUEBLO && !texits) { --- 166,173 ---- if ((p = strchr(pbuff, ';'))) *p = '\0'; p = nbuf; ! safe_tag_wrap("A", tprintf("XCH_CMD=\"go #%d\"", thing), pbuff, nbuf, &p, ! NOTHING); *p = '\0'; if (Transparented(loc) && !(Opaque(thing))) { if (SUPPORT_PUEBLO && !texits) { *************** *** 316,322 **** strcpy(fbuf, privs_to_letters(attr_privs, AL_FLAGS(atr))); if (atr_sub_branch(atr)) strcat(fbuf, "`"); ! if (AL_FLAGS(atr) & AF_VEILED) { if (ShowAnsi(player)) notify_format(player, "%s%s [#%d%s]%s is veiled", ANSI_HILITE, AL_NAME(atr), --- 317,323 ---- strcpy(fbuf, privs_to_letters(attr_privs, AL_FLAGS(atr))); if (atr_sub_branch(atr)) strcat(fbuf, "`"); ! if (AF_Veiled(atr)) { if (ShowAnsi(player)) notify_format(player, "%s%s [#%d%s]%s is veiled", ANSI_HILITE, AL_NAME(atr), *************** *** 461,466 **** --- 462,469 ---- look_description(player, loc, NULL, "IDESCRIBE", "IDESCFORMAT"); did_it(player, loc, NULL, NULL, "OIDESCRIBE", NULL, "AIDESCRIBE", NOTHING); + } else if (atr_get(loc, "IDESCFORMAT")) { + look_description(player, loc, NULL, "DESCRIBE", "IDESCFORMAT"); } else look_description(player, loc, NULL, "DESCRIBE", "DESCFORMAT"); } *************** *** 1276,1282 **** char msg[BUFFER_LEN]; char *bp; ! if (AL_FLAGS(atr) & AF_NODUMP) return 0; ptr = atr_match(AL_NAME(atr)); --- 1279,1285 ---- char msg[BUFFER_LEN]; char *bp; ! if (AF_Nodump(atr)) return 0; ptr = atr_match(AL_NAME(atr)); *** 1_7_7.712/src/game.c Wed, 29 Oct 2003 14:21:02 -0600 dunemush (pennmush/c/10_game.c 1.50.1.8.1.1.1.1.2.1.1.1.2.1.1.4.1.1.1.1.1.1.1.1.1.1.2.1.1.2.1.1.1.1.1.1.1.2.1.1.1.2.1.1.1.1.1.1.1.1.1.5.1.3.1.2.1.2.1.1.1.1.1.1.1.1.1.12.1.3.1.4 660) --- 1_7_7.757(w)/src/game.c Mon, 15 Dec 2003 14:03:02 -0600 dunemush (pennmush/c/10_game.c 1.50.1.8.1.1.1.1.2.1.1.1.2.1.1.4.1.1.1.1.1.1.1.1.1.1.2.1.1.2.1.1.1.1.1.1.1.2.1.1.1.2.1.1.1.1.1.1.1.1.1.5.1.3.1.2.1.2.1.1.1.1.1.1.1.1.1.12.1.3.1.6 660) *************** *** 487,497 **** do_rawlog(LT_ERR, T("CANNOT DUMP PANIC DB. OOPS.")); _exit(134); } else { ! #ifdef macintosh ! if ((f = fopen(panicfile, "wb")) == NULL) { ! #else ! if ((f = fopen(panicfile, "w")) == NULL) { ! #endif do_rawlog(LT_ERR, T("CANNOT OPEN PANIC FILE, YOU LOSE")); _exit(135); } else { --- 487,493 ---- do_rawlog(LT_ERR, T("CANNOT DUMP PANIC DB. OOPS.")); _exit(134); } else { ! if ((f = fopen(panicfile, FOPEN_WRITE)) == NULL) { do_rawlog(LT_ERR, T("CANNOT OPEN PANIC FILE, YOU LOSE")); _exit(135); } else { *************** *** 755,760 **** --- 751,757 ---- command_init_preconfig(); command_init_postconfig(); function_init_postconfig(); + attr_init_postconfig(); /* Load further restrictions from config file */ config_file_startup(conf, 1); /* Call Local Startup */ *************** *** 1326,1332 **** ALIST *ptr; for (ptr = List(thing); ptr; ptr = AL_NEXT(ptr)) { ! if (AL_FLAGS(ptr) & AF_COMMAND && !(AL_FLAGS(ptr) & AF_NOPROG)) return (1); } return (0); --- 1323,1329 ---- ALIST *ptr; for (ptr = List(thing); ptr; ptr = AL_NEXT(ptr)) { ! if (AF_Command(ptr) && !AF_Noprog(ptr)) return (1); } return (0); *************** *** 2091,2101 **** #endif /* WIN32 */ #endif /* macintosh */ { ! #ifdef macintosh ! f = fopen(filename, "rb"); ! #else ! f = fopen(filename, "r"); ! #endif } return f; } --- 2088,2094 ---- #endif /* WIN32 */ #endif /* macintosh */ { ! f = fopen(filename, FOPEN_READ); } return f; } *************** *** 2122,2132 **** #endif /* WIN32 */ #endif /* macintosh */ { ! #ifdef macintosh ! f = fopen(filename, "wb"); ! #else ! f = fopen(filename, "w"); ! #endif } if (!f) longjmp(db_err, 1); --- 2115,2121 ---- #endif /* WIN32 */ #endif /* macintosh */ { ! f = fopen(filename, FOPEN_WRITE); } if (!f) longjmp(db_err, 1); *** 1_7_7.712/src/funufun.c Mon, 28 Apr 2003 22:37:00 -0500 dunemush (pennmush/c/11_funufun.c 1.17 660) --- 1_7_7.757(w)/src/funufun.c Mon, 15 Dec 2003 14:03:02 -0600 dunemush (pennmush/c/11_funufun.c 1.19 660) *************** *** 109,114 **** --- 109,115 ---- char *tptr[10]; char *tbuf; char const *tp; + int pe_flags = PE_DEFAULT; /* save our stack */ for (j = 0; j < 10; j++) *************** *** 123,129 **** wenv[j] = NULL; tp = tbuf = safe_atr_value(attrib); ! process_expression(buff, bp, &tp, obj, executor, enactor, PE_DEFAULT, PT_DEFAULT, pe_info); free(tbuf); --- 124,132 ---- wenv[j] = NULL; tp = tbuf = safe_atr_value(attrib); ! if (attrib->flags & AF_DEBUG) ! pe_flags |= PE_DEBUG; ! process_expression(buff, bp, &tp, obj, executor, enactor, pe_flags, PT_DEFAULT, pe_info); free(tbuf); *************** *** 145,151 **** return; } if (attrib && Can_Read_Attr(executor, obj, attrib)) { ! if (!CanEval(executor, obj)) { safe_str(T(e_perm), buff, bp); return; } --- 148,154 ---- return; } if (attrib && Can_Read_Attr(executor, obj, attrib)) { ! if (!CanEvalAttr(executor, obj, attrib)) { safe_str(T(e_perm), buff, bp); return; } *************** *** 176,182 **** return; } if (attrib && Can_Read_Attr(executor, obj, attrib)) { ! if (!CanEval(executor, obj)) { safe_str(T(e_perm), buff, bp); return; } --- 179,185 ---- return; } if (attrib && Can_Read_Attr(executor, obj, attrib)) { ! if (!CanEvalAttr(executor, obj, attrib)) { safe_str(T(e_perm), buff, bp); return; } *************** *** 215,221 **** PE_DEFAULT, PT_DEFAULT, pe_info); *dp = '\0'; parse_attrib(executor, mstr, &thing, &attrib); ! if (GoodObject(thing) && attrib && CanEval(executor, thing) && Can_Read_Attr(executor, thing, attrib)) { /* Ok, we've got it */ /* We must now evaluate all the arguments from args[2] on and --- 218,224 ---- PE_DEFAULT, PT_DEFAULT, pe_info); *dp = '\0'; parse_attrib(executor, mstr, &thing, &attrib); ! if (GoodObject(thing) && attrib && CanEvalAttr(executor, thing, attrib) && Can_Read_Attr(executor, thing, attrib)) { /* Ok, we've got it */ /* We must now evaluate all the arguments from args[2] on and *************** *** 276,282 **** /* find the user function attribute */ attrib = atr_get(zone, upcasestr(args[0])); if (attrib && Can_Read_Attr(executor, zone, attrib)) { ! if (!CanEval(executor, zone)) { safe_str(T(e_perm), buff, bp); return; } --- 279,285 ---- /* find the user function attribute */ attrib = atr_get(zone, upcasestr(args[0])); if (attrib && Can_Read_Attr(executor, zone, attrib)) { ! if (!CanEvalAttr(executor, zone, attrib)) { safe_str(T(e_perm), buff, bp); return; } *** 1_7_7.712/src/funstr.c Sat, 30 Aug 2003 14:58:13 -0500 dunemush (pennmush/c/13_funstr.c 1.28.1.1.1.2.1.4.1.6.1.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.2.1.3.1.5.1.3.1.2.1.1.1.1.1.1.1.1.1.11 660) --- 1_7_7.757(w)/src/funstr.c Mon, 15 Dec 2003 14:03:02 -0600 dunemush (pennmush/c/13_funstr.c 1.28.1.1.1.2.1.4.1.6.1.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.2.1.3.1.5.1.3.1.2.1.1.1.1.1.1.1.1.1.13 660) *************** *** 642,647 **** --- 642,679 ---- } /* ARGSUSED */ + FUNCTION(fun_tr) + { + /* given str, s1, s2, for each character in str, if the char + * is in s1, replace it with the char at the same index in s2. + */ + + char *str, *find, *rep; + char charmap[256]; + int i; + + /* do length checks first */ + if (arglens[1] != arglens[2]) { + safe_str(T("#-1 STRING LENGTHS MUST BE EQUAL"), buff, bp); + return; + } + + for (i = 0; i < 256; i++) { + charmap[i] = (char) i; + } + + for (find = args[1], rep = args[2]; *find; find++, rep++) { + charmap[(unsigned char) *find] = *rep; + } + + /* walk the string, translating characters */ + for (str = args[0]; *str; str++) { + *str = charmap[(unsigned char) *str]; + } + safe_str(args[0], buff, bp); + } + + /* ARGSUSED */ FUNCTION(fun_lcstr) { char *p, *y; *************** *** 1250,1257 **** safe_chr(TAG_START, buff, bp); safe_strl(args[0], arglens[0], buff, bp); for (i = 1; i < nargs; i++) { ! safe_chr(' ', buff, bp); ! safe_strl(args[i], arglens[i], buff, bp); } safe_chr(TAG_END, buff, bp); } --- 1282,1291 ---- safe_chr(TAG_START, buff, bp); safe_strl(args[0], arglens[0], buff, bp); for (i = 1; i < nargs; i++) { ! if (ok_tag_attribute(executor, args[i])) { ! safe_chr(' ', buff, bp); ! safe_strl(args[i], arglens[i], buff, bp); ! } } safe_chr(TAG_END, buff, bp); } *************** *** 1273,1281 **** safe_str("#-1", buff, bp); else { if (nargs == 2) ! safe_tag_wrap(args[0], NULL, args[1], buff, bp); else ! safe_tag_wrap(args[0], args[1], args[2], buff, bp); } } --- 1307,1315 ---- safe_str("#-1", buff, bp); else { if (nargs == 2) ! safe_tag_wrap(args[0], NULL, args[1], buff, bp, executor); else ! safe_tag_wrap(args[0], args[1], args[2], buff, bp, executor); } } *** 1_7_7.712/src/funmisc.c Sat, 13 Sep 2003 11:29:45 -0500 dunemush (pennmush/c/14_funmisc.c 1.30.1.1.1.25 660) --- 1_7_7.757(w)/src/funmisc.c Mon, 15 Dec 2003 14:03:01 -0600 dunemush (pennmush/c/14_funmisc.c 1.30.1.1.1.27 660) *************** *** 315,320 **** --- 315,380 ---- } } + FUNCTION(fun_reswitch) + { + /* this works a bit like the @switch/regexp command */ + + int j, per; + char mstr[BUFFER_LEN], pstr[BUFFER_LEN], *dp; + char const *sp; + char *tbuf1; + int first = 1, found = 0, cs = 1; + + if (strstr(called_as, "ALL")) + first = 0; + + if (strcmp(called_as, "RESWITCHI") == 0 + || strcmp(called_as, "RESWITCHALLI") == 0) + cs = 0; + + dp = mstr; + sp = args[0]; + process_expression(mstr, &dp, &sp, executor, caller, enactor, + PE_DEFAULT, PT_DEFAULT, pe_info); + *dp = '\0'; + + /* try matching, return match immediately when found */ + + for (j = 1; j < (nargs - 1); j += 2) { + dp = pstr; + sp = args[j]; + process_expression(pstr, &dp, &sp, executor, caller, enactor, + PE_DEFAULT, PT_DEFAULT, pe_info); + *dp = '\0'; + + if (quick_regexp_match(pstr, mstr, cs)) { + /* If there's a #$ in a switch's action-part, replace it with + * the value of the conditional (mstr) before evaluating it. + */ + tbuf1 = replace_string("#$", mstr, args[j + 1]); + + sp = tbuf1; + + per = process_expression(buff, bp, &sp, + executor, caller, enactor, + PE_DEFAULT, PT_DEFAULT, pe_info); + mush_free((Malloc_t) tbuf1, "replace_string.buff"); + found = 1; + if (per || first) + return; + } + } + + if (!(nargs & 1) && !found) { + /* Default case */ + tbuf1 = replace_string("#$", mstr, args[nargs - 1]); + sp = tbuf1; + process_expression(buff, bp, &sp, executor, caller, enactor, + PE_DEFAULT, PT_DEFAULT, pe_info); + mush_free((Malloc_t) tbuf1, "replace_string.buff"); + } + } + /* ARGSUSED */ FUNCTION(fun_if) { *************** *** 531,533 **** --- 591,649 ---- safe_str(scan_list(thing, args[1]), buff, bp); strcpy(ccom, save_ccom); } + + + static void + do_whichof(char *args[], int nargs, int flag, char *buff, char **bp, + dbref executor, dbref caller, dbref enactor, PE_Info * pe_info) + { + int j; + char tbuf[BUFFER_LEN], *tp; + char const *sp; + char sep; + + tbuf[0] = '\0'; + + if (!flag) { + if (strlen(args[nargs]) > 1) { + safe_str(T("#-1 SEPARATOR MUST BE ONE CHARACTER"), buff, bp); + return; + } else if (*args[nargs]) + sep = *args[nargs]; + else + sep = ' '; + } + + for (j = 0; j < nargs; j++) { + tp = tbuf; + sp = args[j]; + process_expression(tbuf, &tp, &sp, executor, caller, enactor, + PE_DEFAULT, PT_DEFAULT, pe_info); + *tp = '\0'; + if (parse_boolean(tbuf)) { + if (*bp != buff) + safe_chr(sep, buff, bp); + + safe_str(tbuf, buff, bp); + + if (flag) + return; + } + } + + if (flag) + safe_str(tbuf, buff, bp); + } + + /* ARGSUSED */ + FUNCTION(fun_firstof) + { + do_whichof(args, nargs, 1, buff, bp, executor, caller, enactor, pe_info); + } + + + /* ARGSUSED */ + FUNCTION(fun_allof) + { + do_whichof(args, nargs - 1, 0, buff, bp, executor, caller, enactor, pe_info); + } *** 1_7_7.712/src/funlist.c Wed, 29 Oct 2003 14:21:02 -0600 dunemush (pennmush/c/16_funlist.c 1.3.1.1.1.5.1.2.1.1.1.1.1.4.1.2.1.2.1.19.1.2.1.1.1.2.1.5.1.1.1.1.1.1.1.1.1.1.2.1.1.3.1.2.1.1.1.1.1.1.1.1.1.1.1.12.1.14.1.3 660) --- 1_7_7.757(w)/src/funlist.c Mon, 15 Dec 2003 14:03:01 -0600 dunemush (pennmush/c/16_funlist.c 1.3.1.1.1.5.1.2.1.1.1.1.1.4.1.2.1.2.1.19.1.2.1.1.1.2.1.5.1.1.1.1.1.1.1.1.1.1.2.1.1.3.1.2.1.1.1.1.1.1.1.1.1.1.1.12.1.14.1.6 660) *************** *** 158,164 **** parse_attrib(executor, args[0], &thing, &attrib); if (!GoodObject(thing) || !attrib || !Can_Read_Attr(executor, thing, attrib)) return; ! if (!CanEval(executor, thing)) return; /* Copy the first list, since we need to pass it to two destructive --- 158,164 ---- parse_attrib(executor, args[0], &thing, &attrib); if (!GoodObject(thing) || !attrib || !Can_Read_Attr(executor, thing, attrib)) return; ! if (!CanEvalAttr(executor, thing, attrib)) return; /* Copy the first list, since we need to pass it to two destructive *************** *** 365,370 **** --- 365,371 ---- char *tptr[2]; char sep; int funccount, per; + int pe_flags = PE_DEFAULT; if (!delim_check(buff, bp, nargs, args, 4, &sep)) return; *************** *** 374,383 **** if (!GoodObject(thing) || !attrib || !Can_Read_Attr(executor, thing, attrib)) return; ! if (!CanEval(executor, thing)) return; /* Now we can go to work */ result = (char *) mush_malloc(BUFFER_LEN, "string"); rsave = (char *) mush_malloc(BUFFER_LEN, "string"); if (!result || !rsave) --- 375,386 ---- if (!GoodObject(thing) || !attrib || !Can_Read_Attr(executor, thing, attrib)) return; ! if (!CanEvalAttr(executor, thing, attrib)) return; /* Now we can go to work */ + if (AF_Debug(attrib)) + pe_flags |= PE_DEBUG; result = (char *) mush_malloc(BUFFER_LEN, "string"); rsave = (char *) mush_malloc(BUFFER_LEN, "string"); if (!result || !rsave) *************** *** 402,408 **** rp = result; ap = abuf; process_expression(result, &rp, &ap, thing, executor, enactor, ! PE_DEFAULT, PT_DEFAULT, pe_info); *rp = '\0'; strcpy(rsave, result); funccount = pe_info->fun_invocations; --- 405,411 ---- rp = result; ap = abuf; process_expression(result, &rp, &ap, thing, executor, enactor, ! pe_flags, PT_DEFAULT, pe_info); *rp = '\0'; strcpy(rsave, result); funccount = pe_info->fun_invocations; *************** *** 414,420 **** rp = result; ap = abuf; per = process_expression(result, &rp, &ap, thing, executor, enactor, ! PE_DEFAULT, PT_DEFAULT, pe_info); *rp = '\0'; if (per || (pe_info->fun_invocations >= FUNCTION_LIMIT && pe_info->fun_invocations == funccount && --- 417,423 ---- rp = result; ap = abuf; per = process_expression(result, &rp, &ap, thing, executor, enactor, ! pe_flags, PT_DEFAULT, pe_info); *rp = '\0'; if (per || (pe_info->fun_invocations >= FUNCTION_LIMIT && pe_info->fun_invocations == funccount && *************** *** 504,509 **** --- 507,513 ---- int check_bool = 0; int funccount; char *osep, osepd[2] = { '\0', '\0' }; + int pe_flags = PE_DEFAULT; if (!delim_check(buff, bp, nargs, args, 3, &sep)) return; *************** *** 523,531 **** if (!GoodObject(thing) || !attrib || !Can_Read_Attr(executor, thing, attrib)) return; ! if (!CanEval(executor, thing)) return; abuf = safe_atr_value(attrib); tptr = wenv[0]; --- 527,538 ---- if (!GoodObject(thing) || !attrib || !Can_Read_Attr(executor, thing, attrib)) return; ! if (!CanEvalAttr(executor, thing, attrib)) return; + if (AF_Debug(attrib)) + pe_flags |= PE_DEBUG; + abuf = safe_atr_value(attrib); tptr = wenv[0]; *************** *** 538,544 **** ap = abuf; rp = result; if (process_expression(result, &rp, &ap, thing, executor, enactor, ! PE_DEFAULT, PT_DEFAULT, pe_info)) break; *rp = '\0'; if ((check_bool == 0) --- 545,551 ---- ap = abuf; rp = result; if (process_expression(result, &rp, &ap, thing, executor, enactor, ! pe_flags, PT_DEFAULT, pe_info)) break; *rp = '\0'; if ((check_bool == 0) *************** *** 1046,1052 **** parse_attrib(executor, args[0], &thing, &attrib); if (!GoodObject(thing) || !attrib || !Can_Read_Attr(executor, thing, attrib)) return; ! if (!CanEval(executor, thing)) return; up = ucomp_buff; safe_str(atr_value(attrib), ucomp_buff, &up); --- 1053,1059 ---- parse_attrib(executor, args[0], &thing, &attrib); if (!GoodObject(thing) || !attrib || !Can_Read_Attr(executor, thing, attrib)) return; ! if (!CanEvalAttr(executor, thing, attrib)) return; up = ucomp_buff; safe_str(atr_value(attrib), ucomp_buff, &up); *************** *** 1846,1852 **** char *sep, int flag) { char c; ! int el, count; char *sptr, *eptr; if (!is_integer(num)) { --- 1853,1859 ---- char *sep, int flag) { char c; ! int el, count, len; char *sptr, *eptr; if (!is_integer(num)) { *************** *** 1862,1892 **** c = ' '; /* we can't remove anything before the first position */ ! if (el < 1) { safe_str(str, buff, bp); return; } ! sptr = str; ! eptr = strchr(sptr, c); count = 1; /* go to the correct item in the string */ ! /* Loop invariant: if sptr and eptr are not NULL, eptr points to ! * the count'th instance of c in str, and sptr is the beginning of ! * the count'th item. */ ! while (eptr && (count < el)) { ! sptr = eptr + 1; ! eptr = strchr(sptr, c); ! count++; } ! if (!eptr && (count < el)) { /* we've run off the end of the string without finding anything */ safe_str(str, buff, bp); return; } /* now find the end of that element */ ! if (sptr != str) sptr[-1] = '\0'; switch (flag) { --- 1869,1921 ---- c = ' '; /* we can't remove anything before the first position */ ! if ((el < 1 && flag != 2) || el == 0) { safe_str(str, buff, bp); return; } ! if (el < 0) { ! sptr = str + strlen(str); ! eptr = sptr; ! } else { ! sptr = str; ! eptr = strchr(sptr, c); ! } count = 1; /* go to the correct item in the string */ ! if (el < 0) { /* if using insert() with a negative insertion param */ ! /* count keeps track of the number of words from the right ! * of the string. When count equals the correct position, then ! * sptr will point to the count'th word from the right, or ! * a null string if the word being added will be at the end of ! * the string. ! * eptr is just a helper. */ ! for (len = strlen(str); len >= 0 && count < abs(el); len--, eptr--) { ! if (*eptr == c) ! count++; ! if (count == abs(el)) { ! sptr = eptr + 1; ! break; ! } ! } ! } else { ! /* Loop invariant: if sptr and eptr are not NULL, eptr points to ! * the count'th instance of c in str, and sptr is the beginning of ! * the count'th item. */ ! while (eptr && (count < el)) { ! sptr = eptr + 1; ! eptr = strchr(sptr, c); ! count++; ! } } ! if ((!eptr || len < 0) && (count < abs(el))) { /* we've run off the end of the string without finding anything */ safe_str(str, buff, bp); return; } /* now find the end of that element */ ! if ((el < 0 && *eptr) || (el > 0 && sptr != str)) sptr[-1] = '\0'; switch (flag) { *************** *** 2264,2269 **** --- 2293,2299 ---- int funccount; char *oldbp; char *osep, osepd[2] = { '\0', '\0' }; + int pe_flags = PE_DEFAULT; if (!is_integer(args[2])) { safe_str(T(e_int), buff, bp); *************** *** 2295,2302 **** parse_attrib(executor, args[0], &thing, &attrib); if (!GoodObject(thing) || !attrib || !Can_Read_Attr(executor, thing, attrib)) return; ! if (!CanEval(executor, thing)) return; asave = safe_atr_value(attrib); --- 2325,2334 ---- parse_attrib(executor, args[0], &thing, &attrib); if (!GoodObject(thing) || !attrib || !Can_Read_Attr(executor, thing, attrib)) return; ! if (!CanEvalAttr(executor, thing, attrib)) return; + if (AF_Debug(attrib)) + pe_flags |= PE_DEBUG; asave = safe_atr_value(attrib); *************** *** 2315,2321 **** ap = asave; process_expression(buff, bp, &ap, thing, executor, enactor, ! PE_DEFAULT, PT_DEFAULT, pe_info); oldbp = *bp; funccount = pe_info->fun_invocations; while (lp) { --- 2347,2353 ---- ap = asave; process_expression(buff, bp, &ap, thing, executor, enactor, ! pe_flags, PT_DEFAULT, pe_info); oldbp = *bp; funccount = pe_info->fun_invocations; while (lp) { *************** *** 2331,2337 **** wenv[n] = NULL; ap = asave; if (process_expression(buff, bp, &ap, thing, executor, enactor, ! PE_DEFAULT, PT_DEFAULT, pe_info)) break; if (*bp == (buff + BUFFER_LEN - 1) && pe_info->fun_invocations == funccount) break; --- 2363,2369 ---- wenv[n] = NULL; ap = asave; if (process_expression(buff, bp, &ap, thing, executor, enactor, ! pe_flags, PT_DEFAULT, pe_info)) break; if (*bp == (buff + BUFFER_LEN - 1) && pe_info->fun_invocations == funccount) break; *************** *** 2362,2367 **** --- 2394,2400 ---- int funccount; char *oldbp; char *osep, osepd[2] = { '\0', '\0' }; + int pe_flags = PE_DEFAULT; if (!delim_check(buff, bp, nargs, args, 3, &sep)) return; *************** *** 2381,2388 **** parse_attrib(executor, args[0], &thing, &attrib); if (!GoodObject(thing) || !attrib || !Can_Read_Attr(executor, thing, attrib)) return; ! if (!CanEval(executor, thing)) return; strcpy(place, "1"); asave = safe_atr_value(attrib); --- 2414,2423 ---- parse_attrib(executor, args[0], &thing, &attrib); if (!GoodObject(thing) || !attrib || !Can_Read_Attr(executor, thing, attrib)) return; ! if (!CanEvalAttr(executor, thing, attrib)) return; + if (AF_Debug(attrib)) + pe_flags |= PE_DEBUG; strcpy(place, "1"); asave = safe_atr_value(attrib); *************** *** 2395,2401 **** wenv[0] = split_token(&lp, sep); ap = asave; process_expression(buff, bp, &ap, thing, executor, enactor, ! PE_DEFAULT, PT_DEFAULT, pe_info); oldbp = *bp; funccount = pe_info->fun_invocations; while (lp) { --- 2430,2436 ---- wenv[0] = split_token(&lp, sep); ap = asave; process_expression(buff, bp, &ap, thing, executor, enactor, ! pe_flags, PT_DEFAULT, pe_info); oldbp = *bp; funccount = pe_info->fun_invocations; while (lp) { *************** *** 2404,2410 **** wenv[0] = split_token(&lp, sep); ap = asave; if (process_expression(buff, bp, &ap, thing, executor, enactor, ! PE_DEFAULT, PT_DEFAULT, pe_info)) break; if (*bp == (buff + BUFFER_LEN - 1) && pe_info->fun_invocations == funccount) break; --- 2439,2445 ---- wenv[0] = split_token(&lp, sep); ap = asave; if (process_expression(buff, bp, &ap, thing, executor, enactor, ! pe_flags, PT_DEFAULT, pe_info)) break; if (*bp == (buff + BUFFER_LEN - 1) && pe_info->fun_invocations == funccount) break; *************** *** 2436,2441 **** --- 2471,2477 ---- int n; int lists, words; char *oldbp; + int pe_flags = PE_DEFAULT; if (nargs > 3) { /* Last arg must be the delimiter */ n = nargs; *************** *** 2455,2462 **** parse_attrib(executor, args[0], &thing, &attrib); if (!GoodObject(thing) || !attrib || !Can_Read_Attr(executor, thing, attrib)) return; ! if (!CanEval(executor, thing)) return; asave = safe_atr_value(attrib); --- 2491,2500 ---- parse_attrib(executor, args[0], &thing, &attrib); if (!GoodObject(thing) || !attrib || !Can_Read_Attr(executor, thing, attrib)) return; ! if (!CanEvalAttr(executor, thing, attrib)) return; + if (AF_Debug(attrib)) + pe_flags |= PE_DEBUG; asave = safe_atr_value(attrib); *************** *** 2479,2485 **** } ap = asave; process_expression(buff, bp, &ap, thing, executor, enactor, ! PE_DEFAULT, PT_DEFAULT, pe_info); oldbp = *bp; funccount = pe_info->fun_invocations; while (1) { --- 2517,2523 ---- } ap = asave; process_expression(buff, bp, &ap, thing, executor, enactor, ! pe_flags, PT_DEFAULT, pe_info); oldbp = *bp; funccount = pe_info->fun_invocations; while (1) { *************** *** 2497,2503 **** safe_chr(sep, buff, bp); ap = asave; if (process_expression(buff, bp, &ap, thing, executor, enactor, ! PE_DEFAULT, PT_DEFAULT, pe_info)) break; if (*bp == (buff + BUFFER_LEN - 1) && pe_info->fun_invocations == funccount) break; --- 2535,2541 ---- safe_chr(sep, buff, bp); ap = asave; if (process_expression(buff, bp, &ap, thing, executor, enactor, ! pe_flags, PT_DEFAULT, pe_info)) break; if (*bp == (buff + BUFFER_LEN - 1) && pe_info->fun_invocations == funccount) break; *** 1_7_7.712/src/fundb.c Sun, 19 Oct 2003 09:57:03 -0500 dunemush (pennmush/c/17_fundb.c 1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.7.1.3.1.3.1.3.1.2.1.2.1.3.2.1.2.1.2.1.1.1.1.4.1.1.1.1.1.1.1.1.1.1.1.3.1.1.2.2.2.1.1.1.1.1.1.23 660) --- 1_7_7.757(w)/src/fundb.c Mon, 15 Dec 2003 14:03:01 -0600 dunemush (pennmush/c/17_fundb.c 1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.7.1.3.1.3.1.3.1.2.1.2.1.3.2.1.2.1.2.1.1.1.1.4.1.1.1.1.1.1.1.1.1.1.1.3.1.1.2.2.2.1.1.1.1.1.1.24 660) *************** *** 257,263 **** } a = atr_get(thing, upcasestr(args[1])); if (a && Can_Read_Attr(executor, thing, a)) { ! if (!CanEval(executor, thing)) { safe_str(T(e_perm), buff, bp); return; } --- 257,263 ---- } a = atr_get(thing, upcasestr(args[1])); if (a && Can_Read_Attr(executor, thing, a)) { ! if (!CanEvalAttr(executor, thing, a)) { safe_str(T(e_perm), buff, bp); return; } *************** *** 299,305 **** } a = atr_get(thing, upcasestr(s)); if (a && Can_Read_Attr(executor, thing, a)) { ! if (!CanEval(executor, thing)) { safe_str(T(e_perm), buff, bp); return; } --- 299,305 ---- } a = atr_get(thing, upcasestr(s)); if (a && Can_Read_Attr(executor, thing, a)) { ! if (!CanEvalAttr(executor, thing, a)) { safe_str(T(e_perm), buff, bp); return; } *************** *** 337,343 **** *dp = '\0'; parse_attrib(executor, mstr, &thing, &attrib); if (GoodObject(thing) && attrib && Can_Read_Attr(executor, thing, attrib)) { ! if (!CanEval(executor, thing)) { safe_str(T(e_perm), buff, bp); return; } --- 337,343 ---- *dp = '\0'; parse_attrib(executor, mstr, &thing, &attrib); if (GoodObject(thing) && attrib && Can_Read_Attr(executor, thing, attrib)) { ! if (!CanEvalAttr(executor, thing, attrib)) { safe_str(T(e_perm), buff, bp); return; } *************** *** 1886,1892 **** ptr = atr_get_noparent(thing, strupper(p)); if (ptr && Can_Read_Attr(executor, thing, ptr)) ! safe_boolean(AL_FLAGS(ptr) & AF_LOCKED, buff, bp); else safe_str("#-1", buff, bp); } --- 1886,1892 ---- ptr = atr_get_noparent(thing, strupper(p)); if (ptr && Can_Read_Attr(executor, thing, ptr)) ! safe_boolean(AF_Locked(ptr), buff, bp); else safe_str("#-1", buff, bp); } *** 1_7_7.712/src/function.c Sun, 19 Oct 2003 09:57:03 -0500 dunemush (pennmush/c/18_function.c 1.29.1.14.1.3.1.6.1.1.1.1.1.14.1.2.1.1.1.7.1.22.1.5 660) --- 1_7_7.757(w)/src/function.c Mon, 15 Dec 2003 14:03:01 -0600 dunemush (pennmush/c/18_function.c 1.29.1.14.1.3.1.6.1.1.1.1.1.14.1.2.1.1.1.7.1.22.1.11 660) *************** *** 181,186 **** --- 181,187 ---- {"ACCNAME", fun_accname, 1, 1, FN_REG}, {"ADD", fun_add, 2, INT_MAX, FN_REG}, {"AFTER", fun_after, 2, 2, FN_REG}, + {"ALLOF", fun_allof, 2, INT_MAX, FN_NOPARSE}, {"ALPHAMAX", fun_alphamax, 1, INT_MAX, FN_REG}, {"ALPHAMIN", fun_alphamin, 1, INT_MAX, FN_REG}, {"AND", fun_and, 2, INT_MAX, FN_REG}, *************** *** 219,224 **** --- 220,226 ---- {"CHR", fun_chr, 1, 1, FN_REG}, {"CHECKPASS", fun_checkpass, 2, 2, FN_REG | FN_WIZARD}, {"CLONE", fun_clone, 1, 1, FN_REG}, + {"CMDS", fun_cmds, 1, 1, FN_REG}, {"COMP", fun_comp, 2, 3, FN_REG}, {"CON", fun_con, 1, 1, FN_REG}, {"CONFIG", fun_config, 1, 1, FN_REG}, *************** *** 260,265 **** --- 262,268 ---- {"FILTERBOOL", fun_filter, 2, 4, FN_REG}, {"FINDABLE", fun_findable, 2, 2, FN_REG}, {"FIRST", fun_first, 1, 2, FN_REG}, + {"FIRSTOF", fun_firstof, 0, INT_MAX, FN_NOPARSE}, {"FLAGS", fun_flags, 0, 1, FN_REG}, {"FLIP", fun_flip, 1, 1, FN_REG}, {"FLOORDIV", fun_floordiv, 2, 2, FN_REG}, *************** *** 291,296 **** --- 294,301 ---- {"HEIGHT", fun_height, 1, 1, FN_REG}, {"HIDDEN", fun_hidden, 1, 1, FN_REG}, {"HOME", fun_home, 1, 1, FN_REG}, + {"HOST", fun_hostname, 1, 1, FN_REG}, + {"HOSTNAME", fun_hostname, 1, 1, FN_REG}, {"IDLE", fun_idlesecs, 1, 1, FN_REG}, {"IDLESECS", fun_idlesecs, 1, 1, FN_REG}, {"IF", fun_if, 2, 3, FN_NOPARSE}, *************** *** 301,306 **** --- 306,312 ---- {"INDEX", fun_index, 4, 4, FN_REG}, {"INSERT", fun_insert, 3, 4, FN_REG}, {"INUM", fun_inum, 1, 1, FN_REG}, + {"IPADDR", fun_ipaddr, 1, 1, FN_REG}, {"ISDAYLIGHT", fun_isdaylight, 0, 0, FN_REG}, {"ISDBREF", fun_isdbref, 1, 1, FN_REG}, {"ISINT", fun_isint, 1, 1, FN_REG}, *************** *** 380,386 **** {"NOT", fun_not, 1, 1, FN_REG}, {"NSPEMIT", fun_nspemit, 2, 2, FN_REG}, {"NUM", fun_num, 1, 1, FN_REG}, ! {"NULL", fun_null, 1, 1, FN_REG}, {"OBJ", fun_obj, 1, 1, FN_REG}, {"OBJEVAL", fun_objeval, 2, -2, FN_NOPARSE}, {"OBJMEM", fun_objmem, 1, 1, FN_REG}, --- 386,392 ---- {"NOT", fun_not, 1, 1, FN_REG}, {"NSPEMIT", fun_nspemit, 2, 2, FN_REG}, {"NUM", fun_num, 1, 1, FN_REG}, ! {"NULL", fun_null, 1, INT_MAX, FN_REG}, {"OBJ", fun_obj, 1, 1, FN_REG}, {"OBJEVAL", fun_objeval, 2, -2, FN_NOPARSE}, {"OBJMEM", fun_objmem, 1, 1, FN_REG}, *************** *** 420,425 **** --- 426,435 ---- {"REGRABI", fun_regrab, 2, 3, FN_REG}, {"REGREP", fun_regrep, 3, 3, FN_REG}, {"REGREPI", fun_regrep, 3, 3, FN_REG}, + {"RESWITCH", fun_reswitch, 3, INT_MAX, FN_NOPARSE}, + {"RESWITCHALL", fun_reswitch, 3, INT_MAX, FN_NOPARSE}, + {"RESWITCHALLI", fun_reswitch, 3, INT_MAX, FN_NOPARSE}, + {"RESWITCHI", fun_reswitch, 3, INT_MAX, FN_NOPARSE}, {"REMAINDER", fun_remainder, 2, 2, FN_REG}, {"REMIT", fun_remit, 2, -2, FN_REG}, {"REMOVE", fun_remove, 2, 3, FN_REG}, *************** *** 482,487 **** --- 492,498 ---- {"TIME", fun_time, 0, 1, FN_REG}, {"TIMEFMT", fun_timefmt, 1, 2, FN_REG}, {"TIMESTRING", fun_timestring, 1, 2, FN_REG}, + {"TR", fun_tr, 3, 3, FN_REG}, {"TRIM", fun_trim, 1, 3, FN_REG}, {"TRIMPENN", fun_trim, 1, 3, FN_REG}, {"TRIMTINY", fun_trim, 1, 3, FN_REG}, *** 1_7_7.712/src/flags.c Wed, 29 Oct 2003 14:21:02 -0600 dunemush (pennmush/c/20_flags.c 1.1.1.1.1.1.1.1.1.1.1.1.1.6.1.2.1.1.1.1.1.2.2.2.2.1.2.1.1.3.1.2.1.1.1.1.1.1.1.1.1.3.1.9.1.2.2.1.1.2.1.56.1.7 660) --- 1_7_7.757(w)/src/flags.c Mon, 15 Dec 2003 14:03:01 -0600 dunemush (pennmush/c/20_flags.c 1.1.1.1.1.1.1.1.1.1.1.1.1.6.1.2.1.1.1.1.1.2.2.2.2.1.2.1.1.3.1.2.1.1.1.1.1.1.1.1.1.3.1.9.1.2.2.1.1.2.1.56.1.11 660) *************** *** 680,685 **** --- 680,691 ---- f->type = NOTYPE; f->letter = '\0'; } + f = add_flag("CHAN_USEFIRSTMATCH", '\0', NOTYPE, F_INHERIT, F_INHERIT); + if (!match_flag("CHAN_FIRSTMATCH")) + flag_add(hashfind("FLAG", &htab_flagspaces), "CHAN_FIRSTMATCH", f); + if (!match_flag("CHAN_MATCHFIRST")) + flag_add(hashfind("FLAG", &htab_flagspaces), "CHAN_MATCHFIRST", f); + local_flags(); } *************** *** 1625,1639 **** * \param perms mask of permissions to see/set the flag. * \param negate_perms mask of permissions to clear the flag. */ ! void add_flag(const char *name, const char letter, int type, int perms, int negate_perms) { FLAG *f; FLAGSPACE *n; /* Don't double-add */ ! if (match_flag(name)) ! return; n = hashfind("FLAG", &htab_flagspaces); f = new_flag(); f->name = mush_strdup(strupper(name), "flag name"); --- 1631,1645 ---- * \param perms mask of permissions to see/set the flag. * \param negate_perms mask of permissions to clear the flag. */ ! FLAG * add_flag(const char *name, const char letter, int type, int perms, int negate_perms) { FLAG *f; FLAGSPACE *n; /* Don't double-add */ ! if ((f = match_flag(name))) ! return f; n = hashfind("FLAG", &htab_flagspaces); f = new_flag(); f->name = mush_strdup(strupper(name), "flag name"); *************** *** 1643,1648 **** --- 1649,1655 ---- f->negate_perms = negate_perms; f->bitpos = -1; flag_add(n, f->name, f); + return f; } *************** *** 1789,1795 **** notify(player, T("You don't have enough magic for that.")); return; } ! if (!name && !*name) { notify(player, T("You must provide a name for the flag.")); return; } --- 1796,1802 ---- notify(player, T("You don't have enough magic for that.")); return; } ! if (!name || !*name) { notify(player, T("You must provide a name for the flag.")); return; } *************** *** 1876,1882 **** notify(player, T("You don't look like God.")); return; } ! if (!alias && !*alias) { notify(player, T("You must provide a name for the alias.")); return; } --- 1883,1889 ---- notify(player, T("You don't look like God.")); return; } ! if (!alias || !*alias) { notify(player, T("You must provide a name for the alias.")); return; } *** 1_7_7.712/src/extchat.c Wed, 29 Oct 2003 14:21:02 -0600 dunemush (pennmush/c/23_extchat.c 1.1.1.1.1.1.1.1.1.2.1.1.1.3.1.1.1.5.1.1.1.1.1.5.1.2.1.3.1.3.1.1.1.4.1.2.1.6.1.2.1.1.2.4.2.9.1.2.1.2.1.3.1.2.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.2.1.1.2.1.1.2.1.1.1.1.1.1.1.1.1.8 660) --- 1_7_7.757(w)/src/extchat.c Mon, 15 Dec 2003 14:03:01 -0600 dunemush (pennmush/c/23_extchat.c 1.1.1.1.1.1.1.1.1.2.1.1.1.3.1.1.1.5.1.1.1.1.1.5.1.2.1.3.1.3.1.1.1.4.1.2.1.6.1.2.1.1.2.4.2.9.1.2.1.2.1.3.1.2.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.2.1.1.2.1.1.2.1.1.1.1.1.1.1.1.1.13 660) *************** *** 83,88 **** --- 83,90 ---- static void format_channel_broadcast(CHAN *chan, CHANUSER *u, dbref victim, int flags, const char *msg, const char *extra); + static void list_partial_matches(dbref player, const char *name, + enum chan_match_type type); const char *chan_speak_lock = "ChanSpeakLock"; /**< Name of speak lock */ const char *chan_join_lock = "ChanJoinLock"; /**< Name of join lock */ *************** *** 151,156 **** --- 153,159 ---- return; \ case CMATCH_AMBIG: \ notify(player, T("CHAT: I don't know which channel you mean.")); \ + list_partial_matches(player, name, PMATCH_ALL); \ return; \ } \ } while (0) *************** *** 754,759 **** --- 757,795 ---- return CMATCH_AMBIG; } + static void + list_partial_matches(dbref player, const char *name, enum chan_match_type type) + { + CHAN *p; + char cleanname[BUFFER_LEN]; + char cleanp[CHAN_NAME_LEN]; + char buff[BUFFER_LEN], *bp; + bp = buff; + + if (!name || !*name) + return; + + safe_str(T("CHAT: Partial matches are:"), buff, &bp); + strcpy(cleanname, remove_markup(name, NULL)); + for (p = channels; p; p = p->next) { + if ((type == PMATCH_ALL) || ((type == PMATCH_ON) + ? (int) (void *) onchannel(player, p) + : !onchannel(player, p))) { + strcpy(cleanp, remove_markup(ChanName(p), NULL)); + if (string_prefix(cleanp, cleanname)) { + safe_chr(' ', buff, &bp); + safe_str(ChanName(p), buff, &bp); + } + } + } + + safe_chr('\0', buff, &bp); + notify(player, buff); + + } + + + /** Attempt to match a channel name for a player. * Given name and a chan pointer, set chan pointer to point to *************** *** 1047,1052 **** --- 1083,1089 ---- return; case CMATCH_AMBIG: notify(player, T("CHAT: I don't know which channel you mean.")); + list_partial_matches(player, name, PMATCH_OFF); return; } if (!Chan_Can_See(chan, player)) { *************** *** 1108,1113 **** --- 1145,1151 ---- return; case CMATCH_AMBIG: notify(player, T("CHAT: I don't know which channel you mean.")); + list_partial_matches(player, name, PMATCH_ON); return; } u = onchannel(player, chan); *************** *** 1188,1202 **** /* First try to find a channel that the player's on. If that fails, * look for one that the player's not on. */ ! if (find_channel_partial_on(name, &c, player) == CMATCH_NONE) { if (find_channel(name, &c, player) == CMATCH_NONE) { if (source) ! notify(player, T("No such channel.")); return 0; } } ! do_chat(player, c, msg); ! return 1; } /** Send a message to a channel. --- 1226,1250 ---- /* First try to find a channel that the player's on. If that fails, * look for one that the player's not on. */ ! switch (find_channel_partial_on(name, &c, player)) { ! case CMATCH_AMBIG: ! if (!ChanUseFirstMatch(player)) { ! notify(player, T("CHAT: I don't know which channel you mean.")); ! list_partial_matches(player, name, PMATCH_ON); ! return 1; ! } ! case CMATCH_EXACT: ! case CMATCH_PARTIAL: ! do_chat(player, c, msg); ! return 1; ! case CMATCH_NONE: if (find_channel(name, &c, player) == CMATCH_NONE) { if (source) ! notify(player, T("CHAT: No such channel.")); return 0; } } ! return 0; } /** Send a message to a channel. *************** *** 1322,1327 **** --- 1370,1376 ---- return; case CMATCH_AMBIG: notify(player, T("I don't know which channel you mean.")); + list_partial_matches(player, name, PMATCH_ALL); return; } if (!Chan_Can_See(chan, player)) { *************** *** 2223,2229 **** if (Chan_Can_See(c, player) && string_prefix(cleanp, cleanname)) { notify(player, ChanName(c)); notify_format(player, T("Description: %s"), ChanTitle(c)); ! notify_format(player, T("Creator: %s"), Name(ChanCreator(c))); notify_format(player, T("Flags: %s"), privs_to_string(priv_table, ChanType(c))); if (ChanBuffer(c)) --- 2272,2278 ---- if (Chan_Can_See(c, player) && string_prefix(cleanp, cleanname)) { notify(player, ChanName(c)); notify_format(player, T("Description: %s"), ChanTitle(c)); ! notify_format(player, T("Owner: %s"), Name(ChanCreator(c))); notify_format(player, T("Flags: %s"), privs_to_string(priv_table, ChanType(c))); if (ChanBuffer(c)) *************** *** 2686,2695 **** do_chan_admin(player, arg_left, arg_right, 3); else if (SW_ISSET(sw, SWITCH_RECALL)) do_chan_recall(player, arg_left, arg_right, SW_ISSET(sw, SWITCH_QUIET)); - else if (SW_ISSET(sw, SWITCH_QUIET)) - do_chan_admin(player, arg_left, "quiet", 3); - else if (SW_ISSET(sw, SWITCH_NOISY)) - do_chan_admin(player, arg_left, "!quiet", 3); else if (SW_ISSET(sw, SWITCH_DECOMPILE)) do_chan_decompile(player, arg_left, SW_ISSET(sw, SWITCH_BRIEF)); else if (SW_ISSET(sw, SWITCH_DESCRIBE)) --- 2735,2740 ---- *************** *** 3112,3115 **** --- 3157,3204 ---- } + /* Evaluate a channel lock with %0 set to the channel name. + * \param c the channel to test. + * \param p the object trying to pass the lock. + * \param type the type of channel lock to test. + * \return true or false + */ + int + eval_chan_lock(CHAN *c, dbref p, enum clock_type type) + { + char *oldenv[10]; + boolexp b = TRUE_BOOLEXP; + int retval, n; + + if (!c || !GoodObject(p)) + return 0; + + switch (type) { + case CLOCK_SEE: + b = ChanSeeLock(c); + break; + case CLOCK_JOIN: + b = ChanJoinLock(c); + break; + case CLOCK_SPEAK: + b = ChanSpeakLock(c); + break; + case CLOCK_HIDE: + b = ChanHideLock(c); + break; + case CLOCK_MOD: + b = ChanModLock(c); + } + + save_global_env("eval_chan_lock", oldenv); + wenv[0] = ChanName(c); + for (n = 1; n < 10; n++) + wenv[n] = NULL; + retval = eval_boolexp(p, b, p); + restore_global_env("eval_chan_lock", oldenv); + + return retval; + + } + #endif /* CHAT_SYSTEM */ *** 1_7_7.712/src/destroy.c Wed, 24 Sep 2003 12:03:30 -0500 dunemush (pennmush/c/24_destroy.c 1.24.2.2.1.3.1.1.1.1.1.1.1.4.1.1.1.1.1.3 660) --- 1_7_7.757(w)/src/destroy.c Mon, 15 Dec 2003 14:03:01 -0600 dunemush (pennmush/c/24_destroy.c 1.24.2.2.1.3.1.1.1.1.1.1.1.4.1.1.1.1.1.5 660) *************** *** 294,309 **** T("That object is set WIZARD. You must use @nuke to destroy it.")); return NOTHING; } - if (thing == Home(player) && !IsExit(player)) { - notify(player, T("No home-wrecking allowed! Relink first.")); - return NOTHING; - } break; case TYPE_ROOM: - if (thing == Home(player) && !IsExit(player)) { - notify(player, T("No home-wrecking allowed! Relink first.")); - return NOTHING; - } break; case TYPE_EXIT: break; --- 294,301 ---- *************** *** 1162,1168 **** loc); set_name(loc, "XXXX"); } ! if (!Going(loc) && !Floating(loc) && (!EXITS_CONNECT_ROOMS || (Exits(loc) == NOTHING))) { notify_format(Owner(loc), T("You own a disconnected room, %s"), object_header(Owner(loc), loc)); --- 1154,1160 ---- loc); set_name(loc, "XXXX"); } ! if (!Going(loc) && !Floating(loc) && !NoWarnable(loc) && (!EXITS_CONNECT_ROOMS || (Exits(loc) == NOTHING))) { notify_format(Owner(loc), T("You own a disconnected room, %s"), object_header(Owner(loc), loc)); *** 1_7_7.712/src/db.c Sun, 19 Oct 2003 09:34:44 -0500 dunemush (pennmush/c/25_db.c 1.26.1.1.1.1.1.6.1.1.1.7 660) --- 1_7_7.757(w)/src/db.c Mon, 15 Dec 2003 14:03:01 -0600 dunemush (pennmush/c/25_db.c 1.26.1.1.1.1.1.6.1.1.1.9 660) *************** *** 41,48 **** --- 41,50 ---- #include "confmagic.h" #ifdef WIN32 + #ifdef __MINGW32__ void shutdown_checkpoint(void); #endif + #endif extern jmp_buf db_err; *************** *** 485,491 **** /* write the attribute list */ for (list = o->list; list; list = AL_NEXT(list)) { ! if (AL_FLAGS(list) & AF_NODUMP) continue; OUTPUT(fprintf(f, "]%s^%d^%d^%d\n", AL_NAME(list), Owner(AL_CREATOR(list)), AL_FLAGS(list), AL_DEREFS(list))); --- 487,493 ---- /* write the attribute list */ for (list = o->list; list; list = AL_NEXT(list)) { ! if (AF_Nodump(list)) continue; OUTPUT(fprintf(f, "]%s^%d^%d^%d\n", AL_NAME(list), Owner(AL_CREATOR(list)), AL_FLAGS(list), AL_DEREFS(list))); *************** *** 544,553 **** --- 546,557 ---- OUTPUT(fprintf(f, "~%d\n", db_top)); for (i = 0; i < db_top; i++) { #ifdef WIN32 + #ifndef __MINGW32__ /* Keep the service manager happy */ if (shutdown_flag && (i & 0xFF) == 0) shutdown_checkpoint(); #endif + #endif if (IsGarbage(i)) continue; OUTPUT(fprintf(f, "!%d\n", i)); *************** *** 595,601 **** /* write the attribute list, scanning */ for (list = o->list; list; list = next) { next = AL_NEXT(list); ! if (AL_FLAGS(list) & AF_NODUMP) continue; fixmemdb = err = 0; /* smash unprintable characters in the name, replace with ! */ --- 599,605 ---- /* write the attribute list, scanning */ for (list = o->list; list; list = next) { next = AL_NEXT(list); ! if (AF_Nodump(list)) continue; fixmemdb = err = 0; /* smash unprintable characters in the name, replace with ! */ *************** *** 722,731 **** --- 726,737 ---- /* write out each object */ for (i = 0; i < db_top; i++) { #ifdef WIN32 + #ifndef __MINGW32__ /* Keep the service manager happy */ if (shutdown_flag && (i & 0xFF) == 0) shutdown_checkpoint(); #endif + #endif if (IsGarbage(i)) continue; OUTPUT(fprintf(f, "!%d\n", i)); *** 1_7_7.712/src/conf.c Mon, 06 Oct 2003 23:33:49 -0500 dunemush (pennmush/c/31_conf.c 1.41.2.3.1.3.1.2.1.15.1.1.1.1.1.1.1.8 660) --- 1_7_7.757(w)/src/conf.c Mon, 15 Dec 2003 14:03:01 -0600 dunemush (pennmush/c/31_conf.c 1.41.2.3.1.3.1.2.1.15.1.1.1.1.1.1.1.10 660) *************** *** 428,433 **** --- 428,435 ---- , {"startups", cf_bool, &options.startups, 2, 0, "attribs"} , + {"read_remote_desc", cf_bool, &options.read_remote_desc, 2, 0, "attribs"} + , {"room_connects", cf_bool, &options.room_connects, 2, 0, "attribs"} , {"reverse_shs", cf_bool, &options.reverse_shs, 2, 0, "attribs"} *************** *** 1090,1095 **** --- 1092,1098 ---- strcpy(options.chunk_swap_file, "data/chunkswap"); options.chunk_cache_memory = 1000000; options.chunk_migrate_amount = 500; + options.read_remote_desc = 0; #ifdef HAS_OPENSSL strcpy(options.ssl_private_key_file, ""); strcpy(options.ssl_ca_file, ""); *************** *** 1127,1137 **** if (conf_recursion == 0) { if (conf && *conf) strcpy(cfile, conf); ! #ifdef macintosh ! fp = fopen(cfile, "rb"); ! #else ! fp = fopen(cfile, "r"); ! #endif if (fp == NULL) { do_rawlog(LT_ERR, T("ERROR: Cannot open configuration file %s."), cfile); return 0; --- 1130,1136 ---- if (conf_recursion == 0) { if (conf && *conf) strcpy(cfile, conf); ! fp = fopen(cfile, FOPEN_READ); if (fp == NULL) { do_rawlog(LT_ERR, T("ERROR: Cannot open configuration file %s."), cfile); return 0; *************** *** 1139,1149 **** do_rawlog(LT_ERR, "Reading %s", cfile); } else { if (conf && *conf) ! #ifdef macintosh ! fp = fopen(conf, "rb"); ! #else ! fp = fopen(conf, "r"); ! #endif if (fp == NULL) { do_rawlog(LT_ERR, T("ERROR: Cannot open configuration file %s."), (conf && *conf) ? conf : "Unknown"); --- 1138,1144 ---- do_rawlog(LT_ERR, "Reading %s", cfile); } else { if (conf && *conf) ! fp = fopen(conf, FOPEN_READ); if (fp == NULL) { do_rawlog(LT_ERR, T("ERROR: Cannot open configuration file %s."), (conf && *conf) ? conf : "Unknown"); *** 1_7_7.712/src/command.c Wed, 29 Oct 2003 14:21:02 -0600 dunemush (pennmush/c/36_command.c 1.56.1.1.1.1.1.1.1.2.1.1.1.1.1.5.1.2.1.1.1.1.1.2.1.3.1.10.1.1.3.24 660) --- 1_7_7.757(w)/src/command.c Mon, 15 Dec 2003 14:03:00 -0600 dunemush (pennmush/c/36_command.c 1.56.1.1.1.1.1.1.1.2.1.1.1.1.1.5.1.2.1.1.1.1.1.2.1.3.1.10.1.1.3.26 660) *************** *** 129,135 **** CMD_T_NOGAGGED, 0, 0}, {"@ELOCK", NULL, cmd_elock, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, 0, 0}, ! {"@EMIT", "ROOM NOEVAL SILENT", cmd_emit, CMD_T_ANY | CMD_T_NOGAGGED, 0, 0}, {"@ENABLE", NULL, cmd_enable, CMD_T_ANY | CMD_T_NOGAGGED, "WIZARD", 0}, {"@ENTRANCES", "EXITS THINGS PLAYERS ROOMS", cmd_entrances, --- 129,136 ---- CMD_T_NOGAGGED, 0, 0}, {"@ELOCK", NULL, cmd_elock, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, 0, 0}, ! {"@EMIT", "ROOM NOEVAL SILENT SPOOF", cmd_emit, CMD_T_ANY | CMD_T_NOGAGGED, 0, ! 0}, {"@ENABLE", NULL, cmd_enable, CMD_T_ANY | CMD_T_NOGAGGED, "WIZARD", 0}, {"@ENTRANCES", "EXITS THINGS PLAYERS ROOMS", cmd_entrances, *************** *** 155,161 **** "WIZARD", 0}, {"@KICK", NULL, cmd_kick, CMD_T_ANY, "WIZARD", 0}, ! {"@LEMIT", "NOEVAL SILENT", cmd_lemit, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, 0, 0}, {"@LINK", "PRESERVE", cmd_link, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, 0, 0}, --- 156,162 ---- "WIZARD", 0}, {"@KICK", NULL, cmd_kick, CMD_T_ANY, "WIZARD", 0}, ! {"@LEMIT", "NOEVAL SILENT SPOOF", cmd_lemit, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, 0, 0}, {"@LINK", "PRESERVE", cmd_link, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, 0, 0}, *************** *** 198,204 **** CMD_T_ANY | CMD_T_EQSPLIT, "WIZARD", CAN_NSPEMIT}, {"@NUKE", NULL, cmd_nuke, CMD_T_ANY | CMD_T_NOGAGGED, 0, 0}, ! {"@OEMIT", "NOEVAL", cmd_oemit, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, 0, 0}, {"@OPEN", NULL, cmd_open, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_RS_ARGS | CMD_T_NOGAGGED, 0, 0}, --- 199,206 ---- CMD_T_ANY | CMD_T_EQSPLIT, "WIZARD", CAN_NSPEMIT}, {"@NUKE", NULL, cmd_nuke, CMD_T_ANY | CMD_T_NOGAGGED, 0, 0}, ! {"@OEMIT", "NOEVAL SPOOF", cmd_oemit, ! CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, 0, 0}, {"@OPEN", NULL, cmd_open, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_RS_ARGS | CMD_T_NOGAGGED, 0, 0}, *************** *** 207,213 **** | CMD_T_NOGUEST, 0, 0}, {"@PCREATE", NULL, cmd_pcreate, CMD_T_ANY | CMD_T_EQSPLIT, 0, 0}, ! {"@PEMIT", "LIST CONTENTS SILENT NOISY NOEVAL", cmd_pemit, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, 0, 0}, {"@POLL", NULL, cmd_poll, CMD_T_ANY, 0, 0}, {"@POOR", NULL, cmd_poor, CMD_T_ANY, 0, 0}, --- 209,215 ---- | CMD_T_NOGUEST, 0, 0}, {"@PCREATE", NULL, cmd_pcreate, CMD_T_ANY | CMD_T_EQSPLIT, 0, 0}, ! {"@PEMIT", "LIST CONTENTS SILENT NOISY NOEVAL SPOOF", cmd_pemit, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, 0, 0}, {"@POLL", NULL, cmd_poll, CMD_T_ANY, 0, 0}, {"@POOR", NULL, cmd_poor, CMD_T_ANY, 0, 0}, *************** *** 220,226 **** {"@READCACHE", NULL, cmd_readcache, CMD_T_ANY, "WIZARD", 0}, {"@RECYCLE", "OVERRIDE", cmd_destroy, CMD_T_ANY | CMD_T_NOGAGGED, 0, 0}, ! {"@REMIT", "LIST NOEVAL NOISY SILENT", cmd_remit, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, 0, 0}, {"@REJECTMOTD", NULL, cmd_rejectmotd, CMD_T_ANY, "WIZARD", 0}, {"@RESTART", "ALL", cmd_restart, CMD_T_ANY | CMD_T_NOGAGGED, 0, 0}, --- 222,228 ---- {"@READCACHE", NULL, cmd_readcache, CMD_T_ANY, "WIZARD", 0}, {"@RECYCLE", "OVERRIDE", cmd_destroy, CMD_T_ANY | CMD_T_NOGAGGED, 0, 0}, ! {"@REMIT", "LIST NOEVAL NOISY SILENT SPOOF", cmd_remit, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, 0, 0}, {"@REJECTMOTD", NULL, cmd_rejectmotd, CMD_T_ANY, "WIZARD", 0}, {"@RESTART", "ALL", cmd_restart, CMD_T_ANY | CMD_T_NOGAGGED, 0, 0}, *************** *** 229,235 **** CMD_T_ANY | CMD_T_NOGAGGED, 0, 0}, {"@SEARCH", NULL, cmd_search, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_RS_ARGS | CMD_T_RS_NOPARSE, 0, 0}, ! {"@SELECT", "NOTIFY", cmd_select, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_RS_ARGS | CMD_T_RS_NOPARSE, 0, 0}, {"@SET", NULL, cmd_set, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, 0, 0}, {"@SHUTDOWN", "PANIC REBOOT PARANOID", cmd_shutdown, CMD_T_ANY, "WIZARD", 0}, --- 231,237 ---- CMD_T_ANY | CMD_T_NOGAGGED, 0, 0}, {"@SEARCH", NULL, cmd_search, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_RS_ARGS | CMD_T_RS_NOPARSE, 0, 0}, ! {"@SELECT", "NOTIFY REGEXP", cmd_select, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_RS_ARGS | CMD_T_RS_NOPARSE, 0, 0}, {"@SET", NULL, cmd_set, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, 0, 0}, {"@SHUTDOWN", "PANIC REBOOT PARANOID", cmd_shutdown, CMD_T_ANY, "WIZARD", 0}, *************** *** 239,245 **** CMD_T_ANY, 0, 0}, {"@SWEEP", "CONNECTED HERE INVENTORY EXITS", cmd_sweep, CMD_T_ANY, 0, 0}, ! {"@SWITCH", "NOTIFY FIRST ALL", cmd_switch, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_RS_ARGS | CMD_T_RS_NOPARSE | CMD_T_NOGAGGED, 0, 0}, #ifdef QUOTA --- 241,247 ---- CMD_T_ANY, 0, 0}, {"@SWEEP", "CONNECTED HERE INVENTORY EXITS", cmd_sweep, CMD_T_ANY, 0, 0}, ! {"@SWITCH", "NOTIFY FIRST ALL REGEXP", cmd_switch, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_RS_ARGS | CMD_T_RS_NOPARSE | CMD_T_NOGAGGED, 0, 0}, #ifdef QUOTA *** 1_7_7.712/src/cmds.c Mon, 20 Oct 2003 21:29:07 -0500 dunemush (pennmush/c/37_cmds.c 1.33.1.1.1.2.1.2.2.3.1.1.1.2.1.1.1.3.1.8.1.1.2.2.2.20.1.3.1.4 660) --- 1_7_7.757(w)/src/cmds.c Mon, 15 Dec 2003 14:03:00 -0600 dunemush (pennmush/c/37_cmds.c 1.33.1.1.1.2.1.2.2.3.1.1.1.2.1.1.1.3.1.8.1.1.2.2.2.20.1.3.1.7 660) *************** *** 237,242 **** --- 237,244 ---- } COMMAND (cmd_emit) { + SPOOF(player, cause, sw); + if (SW_ISSET(sw, SWITCH_ROOM)) do_lemit(player, arg_left, SW_ISSET(sw, SWITCH_SILENT)); else *************** *** 386,391 **** --- 388,394 ---- } COMMAND (cmd_lemit) { + SPOOF(player, cause, sw); do_lemit(player, arg_left, SW_ISSET(sw, SWITCH_SILENT)); } *************** *** 605,610 **** --- 608,614 ---- } COMMAND (cmd_oemit) { + SPOOF(player, cause, sw); do_oemit_list(player, arg_left, arg_right); } *************** *** 627,632 **** --- 631,637 ---- COMMAND (cmd_pemit) { int silent; + SPOOF(player, cause, sw); if (SW_ISSET(sw, SWITCH_SILENT)) silent = PEMIT_SILENT; else if (SW_ISSET(sw, SWITCH_NOISY)) *************** *** 686,691 **** --- 691,697 ---- COMMAND (cmd_remit) { int flags; + SPOOF(player, cause, sw); if (SW_ISSET(sw, SWITCH_SILENT)) flags = PEMIT_SILENT; else if (SW_ISSET(sw, SWITCH_NOISY)) *************** *** 733,739 **** COMMAND (cmd_select) { do_switch(player, arg_left, args_right, cause, 1, ! (SW_ISSET(sw, SWITCH_NOTIFY))); } COMMAND (cmd_set) { --- 739,745 ---- COMMAND (cmd_select) { do_switch(player, arg_left, args_right, cause, 1, ! SW_ISSET(sw, SWITCH_NOTIFY), SW_ISSET(sw, SWITCH_REGEXP)); } COMMAND (cmd_set) { *************** *** 757,773 **** COMMAND (cmd_sitelock) { if (SW_ISSET(sw, SWITCH_BAN)) ! do_sitelock(player, arg_left, NULL, NULL, 1); else if (SW_ISSET(sw, SWITCH_REGISTER)) ! do_sitelock(player, arg_left, NULL, NULL, 0); else if (SW_ISSET(sw, SWITCH_NAME)) ! do_sitelock(player, arg_left, NULL, NULL, 2); else if (SW_ISSET(sw, SWITCH_REMOVE)) ! do_sitelock(player, arg_left, NULL, NULL, 3); else if (SW_ISSET(sw, SWITCH_CHECK)) ! do_sitelock(player, arg_left, NULL, NULL, 4); else ! do_sitelock(player, arg_left, args_right[1], args_right[2], 0); } COMMAND (cmd_stats) { --- 763,781 ---- COMMAND (cmd_sitelock) { if (SW_ISSET(sw, SWITCH_BAN)) ! do_sitelock(player, arg_left, NULL, NULL, SITELOCK_BAN); else if (SW_ISSET(sw, SWITCH_REGISTER)) ! do_sitelock(player, arg_left, NULL, NULL, SITELOCK_ADD); else if (SW_ISSET(sw, SWITCH_NAME)) ! do_sitelock_name(player, arg_left); else if (SW_ISSET(sw, SWITCH_REMOVE)) ! do_sitelock(player, arg_left, NULL, NULL, SITELOCK_REMOVE); else if (SW_ISSET(sw, SWITCH_CHECK)) ! do_sitelock(player, arg_left, NULL, NULL, SITELOCK_CHECK); ! else if (!arg_left || !*arg_left) ! do_sitelock(player, NULL, NULL, NULL, SITELOCK_LIST); else ! do_sitelock(player, arg_left, args_right[1], args_right[2], SITELOCK_ADD); } COMMAND (cmd_stats) { *************** *** 802,809 **** } COMMAND (cmd_switch) { ! do_switch(player, arg_left, args_right, cause, (SW_ISSET(sw, SWITCH_FIRST)), ! (SW_ISSET(sw, SWITCH_NOTIFY))); } #ifdef QUOTA --- 810,817 ---- } COMMAND (cmd_switch) { ! do_switch(player, arg_left, args_right, cause, SW_ISSET(sw, SWITCH_FIRST), ! SW_ISSET(sw, SWITCH_NOTIFY), SW_ISSET(sw, SWITCH_REGEXP)); } #ifdef QUOTA *** 1_7_7.712/src/bsd.c Wed, 29 Oct 2003 14:21:02 -0600 dunemush (pennmush/c/38_bsd.c 1.58.1.11.1.2.1.5.1.7.1.14.1.13.1.9.1.4.1.2.1.12.1.1.1.1.1.2.1.1.1.13.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.8.2.1.1.1.1.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.5 660) --- 1_7_7.757(w)/src/bsd.c Mon, 15 Dec 2003 14:03:00 -0600 dunemush (pennmush/c/38_bsd.c 1.58.1.11.1.2.1.5.1.7.1.14.1.13.1.9.1.4.1.2.1.12.1.1.1.1.1.2.1.1.1.13.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.8.2.1.1.1.1.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.8 660) *************** *** 28,34 **** --- 28,36 ---- #define EWOULDBLOCK WSAEWOULDBLOCK #define MAXHOSTNAMELEN 32 #define LC_MESSAGES 6 + #ifndef __MINGW32__ void shutdown_checkpoint(void); + #endif #else /* !WIN32 */ #ifdef I_SYS_FILE #include *************** *** 504,510 **** #endif #ifndef BOOLEXP_DEBUGGING ! #ifdef WIN32 /* Under WIN32, MUSH is a "service", so we just start a thread here. * The real "main" is in win32/services.c */ --- 506,512 ---- #endif #ifndef BOOLEXP_DEBUGGING ! #if defined(WIN32) && !defined(__MINGW32__) /* Under WIN32, MUSH is a "service", so we just start a thread here. * The real "main" is in win32/services.c */ *************** *** 754,762 **** --- 756,766 ---- /* someone has told us to shut down */ #ifdef WIN32 + #ifndef __MINGW32__ /* Keep service manager happy */ shutdown_checkpoint(); #endif + #endif close_sockets(); *************** *** 765,773 **** --- 769,779 ---- #endif #ifdef WIN32 + #ifndef __MINGW32__ /* Keep service manager happy */ shutdown_checkpoint(); #endif + #endif dump_database(); *************** *** 786,794 **** --- 792,802 ---- #endif #ifdef WIN32 + #ifndef __MINGW32__ /* Keep service manager happy */ shutdown_checkpoint(); #endif + #endif #ifdef HAS_GETRUSAGE rusage_stats(); *************** *** 805,811 **** --- 813,821 ---- closesocket(sock); #ifdef WIN32 + #ifndef __MINGW32__ shutdown_checkpoint(); + #endif WSACleanup(); /* clean up */ #else #ifdef __APPLE__ *************** *** 4099,4104 **** --- 4109,4147 ---- safe_str("#-1", buff, bp); } + /* ARGSUSED */ + FUNCTION(fun_hostname) + { + /* Gets a player's hostname */ + DESC *d = lookup_desc(executor, args[0]); + if (d && (d->player == executor || See_All(executor))) + safe_str(d->addr, buff, bp); + else + safe_str("#-1", buff, bp); + } + + /* ARGSUSED */ + FUNCTION(fun_ipaddr) + { + /* Gets a player's IP address */ + DESC *d = lookup_desc(executor, args[0]); + if (d && (d->player == executor || See_All(executor))) + safe_str(d->ip, buff, bp); + else + safe_str("#-1", buff, bp); + } + + /* ARGSUSED */ + FUNCTION(fun_cmds) + { + /* Gets a player's IP address */ + DESC *d = lookup_desc(executor, args[0]); + if (d && (d->player == executor || See_All(executor))) + safe_integer(d->cmds, buff, bp); + else + safe_integer(-1, buff, bp); + } + FUNCTION(fun_poll) { /* Gets the current poll */ *** 1_7_7.712/src/attrib.c Thu, 30 Oct 2003 10:00:54 -0600 dunemush (pennmush/c/40_attrib.c 1.15.1.2.1.5.1.1.1.3.1.3.1.2.1.2.1.2.2.1.1.2.1.2.1.2.1.1.1.3.1.1.1.1.1.1.3.42 660) --- 1_7_7.757(w)/src/attrib.c Mon, 15 Dec 2003 14:03:00 -0600 dunemush (pennmush/c/40_attrib.c 1.15.1.2.1.5.1.1.1.3.1.3.1.2.1.2.1.2.2.1.1.2.1.2.1.2.1.1.1.3.1.1.1.1.1.1.3.43 660) *************** *** 304,310 **** ptr = NULL; /* check for permission to modify existing atr */ ! if (ptr && (AL_FLAGS(ptr) & AF_SAFE)) return AE_SAFE; if (ptr && !Can_Write_Attr(player, thing, ptr)) return AE_ERROR; --- 304,310 ---- ptr = NULL; /* check for permission to modify existing atr */ ! if (ptr && AF_Safe(ptr)) return AE_SAFE; if (ptr && !Can_Write_Attr(player, thing, ptr)) return AE_ERROR; *************** *** 357,363 **** } /* update modification time here, because from now on, * we modify even if we fail */ ! if (!IsPlayer(thing) && !(AL_FLAGS(ptr) & AF_NODUMP)) ModTime(thing) = mudtime; /* change owner */ --- 357,363 ---- } /* update modification time here, because from now on, * we modify even if we fail */ ! if (!IsPlayer(thing) && !AF_Nodump(ptr)) ModTime(thing) = mudtime; /* change owner */ *************** *** 416,422 **** if (!ptr) return 0; ! if (ptr && (AL_FLAGS(ptr) & AF_SAFE)) return AE_SAFE; if (!Can_Write_Attr(player, thing, ptr)) return AE_ERROR; --- 416,422 ---- if (!ptr) return 0; ! if (ptr && AF_Safe(ptr)) return AE_SAFE; if (!Can_Write_Attr(player, thing, ptr)) return AE_ERROR; *************** *** 426,432 **** if (!we_are_wiping && sub) return AE_ERROR; ! if (!IsPlayer(thing) && !(AL_FLAGS(ptr) & AF_NODUMP)) ModTime(thing) = mudtime; *prev = AL_NEXT(ptr); --- 426,432 ---- if (!we_are_wiping && sub) return AE_ERROR; ! if (!IsPlayer(thing) && !AF_Nodump(ptr)) ModTime(thing) = mudtime; *prev = AL_NEXT(ptr); *************** *** 516,522 **** break; atr = AL_NEXT(atr); } ! if (!atr || (AL_FLAGS(atr) & AF_PRIVATE)) { *p = '`'; goto continue_target; } --- 516,522 ---- break; atr = AL_NEXT(atr); } ! if (!atr || AF_Private(atr)) { *p = '`'; goto continue_target; } *************** *** 530,536 **** if (comp < 0) break; if (comp == 0) { ! if (target == obj || !(AL_FLAGS(atr) & AF_PRIVATE)) return atr; else break; --- 530,536 ---- if (comp < 0) break; if (comp == 0) { ! if (target == obj || !AF_Private(atr)) return atr; else break; *************** *** 695,701 **** List(dest) = NULL; for (ptr = List(source); ptr; ptr = AL_NEXT(ptr)) ! if (!(AL_FLAGS(ptr) & AF_NOCOPY) && (AttrCount(dest) < MAX_ATTRCOUNT)) { atr_new_add(dest, AL_NAME(ptr), atr_value(ptr), AL_CREATOR(ptr), AL_FLAGS(ptr), AL_DEREFS(ptr)); --- 695,701 ---- List(dest) = NULL; for (ptr = List(source); ptr; ptr = AL_NEXT(ptr)) ! if (!AF_Nocopy(ptr) && (AttrCount(dest) < MAX_ATTRCOUNT)) { atr_new_add(dest, AL_NAME(ptr), atr_value(ptr), AL_CREATOR(ptr), AL_FLAGS(ptr), AL_DEREFS(ptr)); *************** *** 840,847 **** continue; } if (parent_depth) ! prev = use_attr(prev, AL_NAME(ptr), AL_FLAGS(ptr) & AF_NOPROG); ! if (AL_FLAGS(ptr) & AF_NOPROG) { skip[skipcount] = atr_sub_branch(ptr); if (skip[skipcount]) skipcount++; --- 840,847 ---- continue; } if (parent_depth) ! prev = use_attr(prev, AL_NAME(ptr), AF_Noprog(ptr)); ! if (AF_Noprog(ptr)) { skip[skipcount] = atr_sub_branch(ptr); if (skip[skipcount]) skipcount++; *************** *** 858,864 **** continue; *s++ = '\0'; ! if (AL_FLAGS(ptr) & AF_REGEXP) { /* Turn \: into : */ char *from, *to; for (from = tbuf1, to = tbuf2; *from; from++, to++) { --- 858,864 ---- continue; *s++ = '\0'; ! if (AF_Regexp(ptr)) { /* Turn \: into : */ char *from, *to; for (from = tbuf1, to = tbuf2; *from; from++, to++) { *************** *** 871,886 **** strcpy(tbuf2, tbuf1); match_found = 0; ! if (AL_FLAGS(ptr) & AF_REGEXP) { ! if (regexp_match_case(tbuf2 + 1, str, AL_FLAGS(ptr) & AF_