This is patch35 to PennMUSH 1.7.7. After applying this patch, you will have version 1.7.7p35 To apply this patch, save it to a file in your top-level MUSH directory, and do the following: patch -p1 < 1.7.7-patch35 make clean 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: Attributes: * NO_NAME and NO_SPACE attribute flags, when applied to @o-message attributes, omit either the enactor's name or the space after it when sending the message to others. Patch by Walker@M*U*S*H. [3] Commands: * @break = now runs instead of simply stopping execution when is true. New command @assert breaks and runs new command when is false. Suggested by Philip Mak and Zebranky@M*U*S*H. Patch by Walker@M*U*S*H. * The new command 'huh_command' is responsible for handling unmatched command input. By default, it produces the usual Huh? message, but it can be overridden with @hook. Logging of huhs is now controlled in restrict.cnf and the log_huhs mush.cnf directive is removed. Suggested by T'orA and Walker@M*U*S*H. * New @decompile/prefix switch generalizes @decompile/tf. Prefixes are now applied even when decompiling multiple attributes, and a bug in doing so is corrected. Patch by Walker@M*U*S*H. * New @edit/first switch only replaces first occurrence of string. Suggested by Kevin@M*U*S*H. Functions: * malias() function for examining mail aliases. Inspired by Kevin@M*U*S*H. * llocks()/locks() lists locks on an object. Patch by Walker@M*U*S*H. * lset() function works like @lset. Patch by Walker@M*U*S*H. * lockflags() and llockflags() show short and long flags set on a lock. Patch by Walker@M*U*S*H. * lattrp() is lattr() including parent attribs. Patch by Walker@M*U*S*H. * nattr(obj/wildcardpattern) is now supported. Patch by Walker@M*U*S*H. * nattrp() is nattr() including parent attribs. Patch by Walker@M*U*S*H. * xattr(obj/wildcardpattern,start,count) extracts the corresponding elements from lattr(). xattrp() is xattr() including parent attribs. Patch by Walker@M*U*S*H. Minor changes (user-visible): * @lset and lock() recognize locks beginning with user:. Patch by Walker@M*U*S*H. * When a player causes an ambiguous channel match, the error message mentions CHAN_USEFIRSTMATCH, which now has a help entry. Suggested by Luke@M*U*S*H. * New sort options: sorting by dbref name, idle time, connection seconds, creation time, owner dbref, and attribute values. sort() and any functions that use list2arr() are now ansi-aware. Patch by Walker@M*U*S*H. * You can @name yourself to your @alias; this swaps name and alias. Suggested by Oriens@Alexandria. Patch by Walker@M*U*S*H. Minor changes (internals): * Several global variables are now encapsulated in a single structure to reduce potential namespace clashes. * Reorganization of some filecopy.c code. [SW] Fixes: * @mail manipulation specifying folder 0 explicitly when the current folder is non-zero didn't work right. Report by Jess Hawthorne. * Buffer overflow in string handling fixed. Report by Ashen-Shugar. * @sitelock/name of an already locked name no longer creates extra entries. Report by Nymeria@M*U*S*H. * make depend no longer produces an unterminated Makefile.SH. Reported by Bytor and Cheetah@M*U*S*H. * Help fixes by [SW]. * Fix to replace_string2 to prevent overflow situations. Report by Atuarre. [SW]. * Removed non-static shutdownsock prototype in hdrs/mysocket.h. Report by Kholnuu@M*U*S*H. * SQL code should be much more memory-efficient. [SW] * Code cleanup and fixes to some memory leaks with strcoll. [SW] Prereq: 1.7.7p34 *** 1_7_7.1099/Patchlevel Tue, 22 Jun 2004 09:19:34 -0500 dunemush (pennmush/5_Patchlevel 1.17.1.11.1.36 600) --- 1_7_7.1145(w)/Patchlevel Wed, 21 Jul 2004 16:39:14 -0500 dunemush (pennmush/5_Patchlevel 1.17.1.11.1.37 600) *************** *** 1,2 **** Do not edit this file. It is maintained by the official PennMUSH patches. ! This is PennMUSH 1.7.7p34 --- 1,2 ---- Do not edit this file. It is maintained by the official PennMUSH patches. ! This is PennMUSH 1.7.7p35 *** 1_7_7.1099/CHANGES.177 Mon, 28 Jun 2004 09:20:49 -0500 dunemush (pennmush/g/23_CHANGES 1.48.1.258.1.14.1.134 600) --- 1_7_7.1145(w)/CHANGES.177 Wed, 21 Jul 2004 16:39:03 -0500 dunemush (pennmush/g/23_CHANGES 1.48.1.258.1.14.1.157 600) *************** *** 18,23 **** --- 18,91 ---- ========================================================================== + Version 1.7.7 patchlevel 35 July 21, 2004 + + Attributes: + * NO_NAME and NO_SPACE attribute flags, when applied to @o-message + attributes, omit either the enactor's name or the space after it + when sending the message to others. Patch by Walker@M*U*S*H. [3] + Commands: + * @break = now runs + instead of simply stopping execution when is true. + New command @assert breaks and runs new command when + is false. Suggested by Philip Mak and Zebranky@M*U*S*H. Patch by + Walker@M*U*S*H. + * The new command 'huh_command' is responsible for handling unmatched + command input. By default, it produces the usual Huh? message, but + it can be overridden with @hook. Logging of huhs is now controlled + in restrict.cnf and the log_huhs mush.cnf directive is removed. + Suggested by T'orA and Walker@M*U*S*H. + * New @decompile/prefix switch generalizes @decompile/tf. + Prefixes are now applied even when decompiling multiple attributes, + and a bug in doing so is corrected. Patch by Walker@M*U*S*H. + * New @edit/first switch only replaces first occurrence of string. + Suggested by Kevin@M*U*S*H. + Functions: + * malias() function for examining mail aliases. Inspired by + Kevin@M*U*S*H. + * llocks()/locks() lists locks on an object. Patch by Walker@M*U*S*H. + * lset() function works like @lset. Patch by Walker@M*U*S*H. + * lockflags() and llockflags() show short and long flags set on a lock. + Patch by Walker@M*U*S*H. + * lattrp() is lattr() including parent attribs. Patch by Walker@M*U*S*H. + * nattr(obj/wildcardpattern) is now supported. Patch by Walker@M*U*S*H. + * nattrp() is nattr() including parent attribs. Patch by Walker@M*U*S*H. + * xattr(obj/wildcardpattern,start,count) extracts the corresponding + elements from lattr(). xattrp() is xattr() including parent attribs. + Patch by Walker@M*U*S*H. + Minor changes (user-visible): + * @lset and lock() recognize locks beginning with user:. Patch by + Walker@M*U*S*H. + * When a player causes an ambiguous channel match, the error message + mentions CHAN_USEFIRSTMATCH, which now has a help entry. + Suggested by Luke@M*U*S*H. + * New sort options: sorting by dbref name, idle time, connection seconds, + creation time, owner dbref, and attribute values. sort() and any + functions that use list2arr() are now ansi-aware. Patch by Walker@M*U*S*H. + * You can @name yourself to your @alias; this swaps name and alias. + Suggested by Oriens@Alexandria. Patch by Walker@M*U*S*H. + Minor changes (internals): + * Several global variables are now encapsulated in a single structure + to reduce potential namespace clashes. + * Reorganization of some filecopy.c code. [SW] + Fixes: + * @mail manipulation specifying folder 0 explicitly when the + current folder is non-zero didn't work right. Report by + Jess Hawthorne. + * Buffer overflow in string handling fixed. Report by Ashen-Shugar. + * @sitelock/name of an already locked name no longer creates extra + entries. Report by Nymeria@M*U*S*H. + * make depend no longer produces an unterminated Makefile.SH. + Reported by Bytor and Cheetah@M*U*S*H. + * Help fixes by [SW]. + * Fix to replace_string2 to prevent overflow situations. Report by + Atuarre. [SW]. + * Removed non-static shutdownsock prototype in hdrs/mysocket.h. + Report by Kholnuu@M*U*S*H. + * SQL code should be much more memory-efficient. [SW] + * Code cleanup and fixes to some memory leaks with strcoll. [SW] + + Version 1.7.7 patchlevel 34 June 22, 2004 Flags and Powers: *** 1_7_7.1099/game/txt/hlp/pennfunc.hlp Mon, 21 Jun 2004 16:11:57 -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.1.1.11 600) --- 1_7_7.1145(w)/game/txt/hlp/pennfunc.hlp Sat, 17 Jul 2004 20:45:53 -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.1.1.17 600) *************** *** 144,149 **** --- 144,150 ---- folderstats() mail() maildstats() mailfrom() mailfstats() mailsend() mailstats() mailstatus() mailsubject() mailtime() + malias() & List functions List functions take at least one list of elements and return transformed *************** *** 1165,1171 **** preventing function evaluation in the next pass of the parser. It returns after adding the escape character ('\') at the beginning of the string, and before the following characters: ! % ; [ ] { } \ ( ) , This function prevents strings entered by players from causing side effects, such as performing an unintended GET() of an attribute. It --- 1166,1172 ---- preventing function evaluation in the next pass of the parser. It returns after adding the escape character ('\') at the beginning of the string, and before the following characters: ! % ; [ ] { } \ ( ) , ^ $ This function prevents strings entered by players from causing side effects, such as performing an unintended GET() of an attribute. It *************** *** 1313,1319 **** attached to the object or the attribute on the object. Given no arguments, this function returns a space-separated list ! of all flag names know to the server. See also: flags() & FLIP() --- 1314,1320 ---- attached to the object or the attribute on the object. Given no arguments, this function returns a space-separated list ! of all flag names known to the server. See also: flags() & FLIP() *************** *** 1879,1885 **** --- 1880,1888 ---- See also: first(), rest() & LATTR() + & LATTRP() lattr([/]) + lattrp([/]) Returns a space-separated list of the attribute names on the object. You must either be a Wizard or Royalty, own the object, have the *************** *** 1890,1900 **** matching that pattern will be returned. lattr() uses the same wildcards as examine (?, *, **). See also: nattr(), examine & NATTR() & ATTRCNT() ! nattr() ! attrcnt() This function (known by two names) returns the number of attributes on the object. You must have permission to examine the object --- 1893,1909 ---- matching that pattern will be returned. lattr() uses the same wildcards as examine (?, *, **). + lattrp() also includes attributes inherited from parents. + See also: nattr(), examine & NATTR() + & NATTRP() & ATTRCNT() ! & ATTRPCNT() ! nattr([/]) ! nattrp([/]) ! attrcnt([/]) ! attrpcnt([/]) This function (known by two names) returns the number of attributes on the object. You must have permission to examine the object *************** *** 1903,1908 **** --- 1912,1919 ---- than words(lattr()) and doesn't suffer from buffer length constraints. It's designed primarily for statistical purposes. + nattrp() and attrpcnt() also count matching attributes on the parent. + See also: lattr() & LCON() lcon() *************** *** 2124,2130 **** This is a side-effect function and may not be enabled on some MUSHes. ! See also: @lock, locktypes & LOG() log([, ]) --- 2135,2185 ---- This is a side-effect function and may not be enabled on some MUSHes. ! See also: @lock, locktypes, lockflags(), llockflags(), lset(), llocks() ! & LLOCKS() ! & LOCKS() ! llocks() ! locks() ! ! llocks(), aliased locks(), list locks set on , including ! user-defined locks (prefixed with USER:) ! ! > @lock me==me ! > @lock/use me==me ! > @lock/user:itsme me==me ! > th llocks(me) ! Basic USER:ITSME Use ! ! See also: lock(), lset(), lockflags(), llockflags() ! & LOCKFLAGS() ! lockflags([/]) ! lockflags() ! ! lockflags() returns a string consisting of the flags attached to ! the specified lock on the object. The string is a single word ! made up of all the appropriate flag letters. ! ! Given no arguments, this function returns a string consisting of ! all the flag letters the server knows. ! ! See also: llockflags(), lset(), lock(), llocks() ! & LLOCKFLAGS() ! llockflags([/]) ! llockflags() ! ! llockflags returns a space-separated list consisting of the names ! of flags attached to the specified lock on the object. ! ! Given no arguments, this function returns a space-separated list ! of all flag names known to the server. ! ! See also: llockflags(), lset(), lock(), llocks() ! & LSET() ! lset(/,[!]) ! ! This functions sets or clears flags on locks. ! ! See 'help @lset' for more information on what flags are available. & LOG() log([, ]) *************** *** 2318,2323 **** --- 2373,2393 ---- This function sends a message to a player, just like @mail/send. It returns nothing if successful, or an error message. + & MALIAS() + malias([]) + malias() + malias([,]) + + With no arguments, malias() returns the list of all malias names + which are visible to the player. With two arguments, returns the list + of dbrefs that are members of the given malias, delimited by + . + + With one argument, the behavior is ambiguous. If the argument + matches a malias, returns the list of dbrefs that are memebrs of + the malias, space-delimited. If not, it's treated as a no-argument + case with a delimiter. + & MAP() map([/],[,][, ]) *************** *** 3188,3195 **** This function returns the difference of two sets -- i.e., the elements in that aren't in . The list that is returned is sorted. Normally, alphabetic sorting is done. You can ! change this with the fourth argument, which takes the same form as ! sort()'s second. If used with exactly four arguments where the fourth is not a sort type, it's treated instead as the output separator. Example: --- 3258,3265 ---- This function returns the difference of two sets -- i.e., the elements in that aren't in . The list that is returned is sorted. Normally, alphabetic sorting is done. You can ! change this with the fourth argument, which is a sort type as defined ! in help sorting. If used with exactly four arguments where the fourth is not a sort type, it's treated instead as the output separator. Example: *************** *** 3202,3209 **** This function returns the intersection of two sets -- i.e., the elements that are in both and . The list that is returned is sorted. Normally, alphabetic sorting is done. You can ! change this with the fourth argument, which takes the same form as ! sort()'s second. If used with exactly four arguments where the fourth is not a sort type, it's treated instead as the output separator. Example: --- 3272,3279 ---- This function returns the intersection of two sets -- i.e., the elements that are in both and . The list that is returned is sorted. Normally, alphabetic sorting is done. You can ! change this with the fourth argument, which is a sort type as defined ! in help sorting. If used with exactly four arguments where the fourth is not a sort type, it's treated instead as the output separator. Example: *************** *** 3273,3280 **** elements of both and , minus any duplicate elements. Think of it as CAT() without words duplicated. The list returned is sorted. Normally, alphabetic sorting is done. You can ! change this with the fourth argument, which takes the same form as ! sort()'s second. If used with exactly four arguments where the fourth is not a sort type, it's treated instead as the output separator. Example: --- 3343,3350 ---- elements of both and , minus any duplicate elements. Think of it as CAT() without words duplicated. The list returned is sorted. Normally, alphabetic sorting is done. You can ! change this with the fourth argument, which is a sort type as defined ! in help sorting. If used with exactly four arguments where the fourth is not a sort type, it's treated instead as the output separator. Example: *************** *** 3327,3344 **** numbers, it will sort them in order of smallest to largest. If all the words are dbrefs, it will sort them in order of smallest to largest. Otherwise, it will perform a lexicographic sort. - - The following letters as a second argument specify a certain sort: - - a: Sort lexicographically (Maybe case-sensitive). - i: Sort lexicographically (Always case-insensitive). - d: Sort dbrefs. - n: Sort integer numbers. - f: Sort decimal numbers. ! Whether or not the a sort type is case-sensitive or not depends ! on the particular mush and its environment. ! The optional third argument gives the list's delimiter character. If not present, defaults to a space. The optional fourth argument gives a string that will delimit --- 3397,3405 ---- numbers, it will sort them in order of smallest to largest. If all the words are dbrefs, it will sort them in order of smallest to largest. Otherwise, it will perform a lexicographic sort. ! The second argument is a sort type. See help sorting. ! The optional third argument gives the list's delimiter character. If not present, defaults to a space. The optional fourth argument gives a string that will delimit *************** *** 3367,3372 **** --- 3428,3460 ---- function sizes should be kept reasonable. See also: anonymous attributes + & SORTING + In functions where you can specify a sorting method, you can provide + one of these sort types: + + Type Sorts: + a Sorts lexicographically (Maybe case-sensitive). + i Sorts lexicographically (Always case-insensitive). + d Sorts dbrefs. + n Sorts integer numbers. + f Sorts decimal numbers. + name Sorts dbrefs by their names. (Maybe case-sensitive) + namei Sorts dbrefs by their names. (Always case-insensitive) + conn Sorts dbrefs by their connection time. + idle Sorts dbrefs by their idle time. + owner Sorts dbrefs by their owner dbrefs. + loc Sorts dbrefs by their location dbref. + ctime Sorts dbrefs by their creation time. + + The special sort key attr: or attri: will sort dbrefs + according to their attributes. For example: Separating by + &factions or &species attrs. attr is probably case-sensitive, and + attri is case-insensitive. + + Whether or not the 'a' sort type is case-sensitive or not depends + on the particular mush and its environment. + + See also: sort(), sortby(), setunion(), setinter(), setdiff() & SOUNDEX() soundex() *************** *** 4287,4293 **** --- 4375,4396 ---- @desc here=[wrap([space(4)]Indented paragraph,72)] @desc here=[iter(wrap(Hanging indent,72,76,|), [switch(#@,>1,space(4))]##,|,%r)] + & XATTR() + & XATTRP() + xattr([/],start,count) + xattrp([/],start,count) + + xattr() fetches or fewer attribute names from + starting at position . It is useful when the number of attributes + on an object causes lattr() to exceed the buffer limit. + + It is equivalent to extract(lattr([/]),,) + + xattrp() will include attributes from parents. Do note that parent + attributes are listed _after_ child attributes, not sorted + alphabetically. + See also: nattr(), lattr() & XGET() xget(, ) *** 1_7_7.1099/game/txt/hlp/penncmd.hlp Thu, 10 Jun 2004 14:35:55 -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.36 600) --- 1_7_7.1145(w)/game/txt/hlp/penncmd.hlp Wed, 21 Jul 2004 15:19:35 -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.40 600) *************** *** 418,429 **** Only admin and those with the "boot" power can @boot other players. & @BREAK ! @break @break stops the execution of further commands in the current action ! list if its argument is a true value. It doesn't affect new queue ! entries made by previous commands in the action list. Very useful to ! people who don't like @switch. Examples: > @va obj=$testme *:@pemit %#=Before break;@break %0;@pemit %#=After break --- 418,434 ---- Only admin and those with the "boot" power can @boot other players. & @BREAK ! & @ASSERT ! @break [=] ! @assert [=] @break stops the execution of further commands in the current action ! list if is a true value. It doesn't affect new queue entries ! made by previous commands in the action list. Very useful to people who ! don't like @switch. If is given, it is executed instead of ! the rest of the commands in the current queue. ! ! @assert does the inverse: stopping execution if evaluse to false. Examples: > @va obj=$testme *:@pemit %#=Before break;@break %0;@pemit %#=After break *************** *** 804,816 **** See also: kill, BEING KILLED, @odeath, @adeath & @decompile @decompile[] [/] ! @decompile/tf / This command produces a list of the commands that you would have to enter in order to recreate . Useful for either copying objects from one MUSH to another, or for making logs of important objects to protect against an accidental @nuke or a crash. You can either @decompile an entire object, or just certain parts of it. To @decompile just a few attributes, for example, you could type: --- 809,825 ---- See also: kill, BEING KILLED, @odeath, @adeath & @decompile @decompile[] [/] ! @decompile/prefix [/]= This command produces a list of the commands that you would have to enter in order to recreate . Useful for either copying objects from one MUSH to another, or for making logs of important objects to protect against an accidental @nuke or a crash. + When the /prefix switch is specified, and a prefix given, all output + lines will be prefixed with . Good for creating client-side + scripts to edit code with. + You can either @decompile an entire object, or just certain parts of it. To @decompile just a few attributes, for example, you could type: *************** *** 838,861 **** (continued in help @decompile3) & @decompile3 ! @decompile/tf / ! The /tf switch is useful only for users of the popular "TinyFugue" ! client program (available from ftp.tcp.com in the directory ! /pub/muds/Clients/tinyfugue). If you do have this program, this ! switch is invaluable for editing code online, because it will grab the ! code to set that attribute and put it into your buffer. ! To use @dec/tf, first type this command into TinyFugue: ! /def -ag -mglob -p100 -t"FugueEdit > *" fe = /grab %-2 ! (you can also put this into your .tfrc so it will automatically ! be entered every time you start TinyFugue (tf).) This command works ! just like the 'FugueEdit' object originally created by van@TinyTIM. - You can use a string other than "FugueEdit > " by setting your - TFPREFIX attribute. This is probably a good idea. See also: CLIENTS, ATTRIBUTES, WILDCARDS, MUSHCODE & @describe @describe [=] --- 847,870 ---- (continued in help @decompile3) & @decompile3 ! @decompile/tf [/] ! Supplying the /tf switch makes @decompile act exactly as if you typed: ! @decompile/prefix [/]=FugueEdit >%b ! You can use a string other than "FugueEdit > " by setting your ! TFPREFIX attribute. This is probably a good idea. ! The /tf switch is handy for grabbing code and placing it right ! into your input window. To do this: ! In TinyFugue: ! /def -ag -mglob -p100 -t"FugueEdit > *" fe = /grab %-2 ! ! In SimpleMU: ! Set your Options -> Grab Password ! @set me=tfprefix:FugueEdit >%b See also: CLIENTS, ATTRIBUTES, WILDCARDS, MUSHCODE & @describe @describe [=] *************** *** 2161,2166 **** --- 2170,2178 ---- names, the name should be enclosed in quotes: @name me = "James Bond" + When changing a player's name to their alias, their current name and + their alias are swapped. + Changing the name of will cause object to execute its ONAME and ANAME. The old name will be passed at %0 to these; the new name will be passed as %1. *************** *** 2253,2259 **** If the = part is omitted, the message will be reset. ! See also: drop, @drop, @adrop & @oefail @oefail [= ] --- 2265,2271 ---- If the = part is omitted, the message will be reset. ! See also: drop, @drop, @adrop, NONAME, NOSPACE & @oefail @oefail [= ] *************** *** 2308,2314 **** If the = part is omitted, the message will be reset. ! See also: FAILURE, @lock, @failure, @afailure & @ofollow @ofollow [= ] --- 2320,2326 ---- If the = part is omitted, the message will be reset. ! See also: FAILURE, @lock, @failure, @afailure, NONAME, NOSPACE & @ofollow @ofollow [= ] *************** *** 2435,2441 **** If the = part is omitted, the message will be reset. ! See also: take, @success, @asuccess, @lock, FAILURE & @otport @otport [=] --- 2447,2453 ---- If the = part is omitted, the message will be reset. ! See also: take, @success, @asuccess, @lock, FAILURE, NONAME, NOSPACE & @otport @otport [=] *************** *** 2917,2922 **** --- 2929,2939 ---- safe (S) Attribute may not be modified, without unsetting this flag. mortal_dark (m) Attribute cannot be seen by mortals. This flag can only be set by royalty and wizards. "hidden" is a synonym. + + Continued in 'help attribute flags2' + & attribute flags2 + noname (N) Attribute won't show name in @o-* messages. + nospace (s) Attribute won't append a space in @o-* messages. wizard (w) Attribute can only be set by wizards. This flag can only be set by royalty and wizards. veiled (V) Attribute value will not be shown on default examine, *** 1_7_7.1099/game/txt/hlp/pennchat.hlp Fri, 14 Nov 2003 17:03:40 -0600 dunemush (pennmush/19_pennchat.h 1.2.1.4.1.7 600) --- 1_7_7.1145(w)/game/txt/hlp/pennchat.hlp Wed, 30 Jun 2004 21:02:03 -0500 dunemush (pennmush/19_pennchat.h 1.2.1.4.1.8 600) *************** *** 33,39 **** as normal, preventing user-defined commands like "+last" from being clobbered by the chat system. ! See also: chat & @cemit @cemit[/noisy][/noeval] = --- 33,47 ---- as normal, preventing user-defined commands like "+last" from being clobbered by the chat system. ! See also: chat, CHAN_USEFIRSTMATCH ! & CHAN_USEFIRSTMATCH ! CHAN_USEFIRSTMATCH (any type) ! ! When this flag is set on an object that uses the chat system, ! channel name matching will default to the first matching channel ! in cases of ambiguity. Without this flag, attempting to use an ! ambiguous partial channel name will produce an error. ! & @cemit @cemit[/noisy][/noeval] = *** 1_7_7.1099/game/mushcnf.dst Mon, 24 May 2004 14:18:07 -0500 dunemush (pennmush/41_mushcnf.ds 1.1.1.19.1.1.1.2.1.1.1.8.1.1.1.1.1.31 600) --- 1_7_7.1145(w)/game/mushcnf.dst Thu, 15 Jul 2004 14:16:15 -0500 dunemush (pennmush/41_mushcnf.ds 1.1.1.19.1.1.1.2.1.1.1.8.1.1.1.1.1.32 600) *************** *** 496,504 **** # debugging, generally. log_commands no - # log commands which produce "Huh?" - log_huhs no - # log forces done by wizards log_forces yes --- 496,501 ---- *** 1_7_7.1099/src/local.dst Thu, 27 May 2004 14:05:53 -0500 dunemush (pennmush/b/19_local.dst 1.20 660) --- 1_7_7.1145(w)/src/local.dst Wed, 04 Aug 2004 14:45:29 -0500 dunemush (pennmush/b/19_local.dst 1.21 660) *************** *** 34,40 **** * them in mush.cnf. */ void ! local_configs() { #ifdef EXAMPLE /* For each config parameter you add, you should initialize it as a --- 34,40 ---- * them in mush.cnf. */ void ! local_configs(void) { #ifdef EXAMPLE /* For each config parameter you add, you should initialize it as a *** 1_7_7.1099/src/funlocal.dst Thu, 27 May 2004 14:05:53 -0500 dunemush (pennmush/b/20_funlocal.d 1.6 660) --- 1_7_7.1145(w)/src/funlocal.dst Wed, 04 Aug 2004 14:45:29 -0500 dunemush (pennmush/b/20_funlocal.d 1.7 660) *************** *** 36,42 **** #endif void ! local_functions() { #ifdef EXAMPLE function_add("SILLY", local_fun_silly, 1, 1, FN_REG); --- 36,42 ---- #endif void ! local_functions(void) { #ifdef EXAMPLE function_add("SILLY", local_fun_silly, 1, 1, FN_REG); *** 1_7_7.1099/src/cmdlocal.dst Thu, 27 May 2004 14:05:53 -0500 dunemush (pennmush/b/21_cmdlocal.d 1.15 660) --- 1_7_7.1145(w)/src/cmdlocal.dst Wed, 04 Aug 2004 14:45:29 -0500 dunemush (pennmush/b/21_cmdlocal.d 1.16 660) *************** *** 28,34 **** * or globals) */ void ! reserve_aliases() { #ifdef EXAMPLE /* Example: Don't alias any commands to cardinal directions. --- 28,34 ---- * or globals) */ void ! reserve_aliases(void) { #ifdef EXAMPLE /* Example: Don't alias any commands to cardinal directions. *************** *** 71,77 **** * Hardcoded function the command should call (cmd_local_silly) */ void ! local_commands() { #ifdef EXAMPLE command_add("@SILLY", CMD_T_ANY, "WIZARD ROYALTY", SEE_ALL, "NOISY NOEVAL", --- 71,77 ---- * Hardcoded function the command should call (cmd_local_silly) */ void ! local_commands(void) { #ifdef EXAMPLE command_add("@SILLY", CMD_T_ANY, "WIZARD ROYALTY", SEE_ALL, "NOISY NOEVAL", *** 1_7_7.1099/src/SWITCHES Tue, 08 Jun 2004 14:18:47 -0500 dunemush (pennmush/b/22_SWITCHES 1.12.1.3.1.15 600) --- 1_7_7.1145(w)/src/SWITCHES Wed, 04 Aug 2004 14:45:31 -0500 dunemush (pennmush/b/22_SWITCHES 1.12.1.3.1.16 600) *************** *** 91,96 **** --- 91,97 ---- PLAYERS PORT POWERS + PREFIX PRESERVE PRINT PRIVS *** 1_7_7.1099/src/wiz.c Wed, 09 Jun 2004 20:58:57 -0500 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.1.25 660) --- 1_7_7.1145(w)/src/wiz.c Wed, 04 Aug 2004 14:45:30 -0500 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.1.30.1.1 660) *************** *** 51,58 **** extern dbref find_entrance(dbref door); struct db_stat_info *get_stats(dbref owner); extern dbref find_player_by_desc(int port); - extern int paranoid_dump; - extern int paranoid_checkpt; #ifndef WIN32 --- 51,56 ---- *************** *** 448,454 **** * if home is valid before sending them there. */ if (!GoodObject(Home(victim))) Home(victim) = PLAYER_START; ! do_move(victim, "home", 0); return; } else { /* valid location, perform other checks */ --- 446,452 ---- * if home is valid before sending them there. */ if (!GoodObject(Home(victim))) Home(victim) = PLAYER_START; ! do_move(victim, "home", MOVE_NORMAL); return; } else { /* valid location, perform other checks */ *************** *** 458,464 **** notify(player, T("What are you doing inside of yourself?")); if (Home(victim) == absroom) Home(victim) = PLAYER_START; ! do_move(victim, "home", 0); return; } /* find the "absolute" room */ --- 456,462 ---- notify(player, T("What are you doing inside of yourself?")); if (Home(victim) == absroom) Home(victim) = PLAYER_START; ! do_move(victim, "home", MOVE_NORMAL); return; } /* find the "absolute" room */ *************** *** 468,474 **** notify(victim, T("You're in the void - sending you home.")); if (Home(victim) == Location(victim)) Home(victim) = PLAYER_START; ! do_move(victim, "home", 0); return; } /* if there are a lot of containers, send him home */ --- 466,472 ---- notify(victim, T("You're in the void - sending you home.")); if (Home(victim) == Location(victim)) Home(victim) = PLAYER_START; ! do_move(victim, "home", MOVE_NORMAL); return; } /* if there are a lot of containers, send him home */ *************** *** 476,482 **** notify(victim, T("You're in too many containers.")); if (Home(victim) == Location(victim)) Home(victim) = PLAYER_START; ! do_move(victim, "home", 0); return; } /* note that we check the NO_TEL status of the victim rather --- 474,480 ---- notify(victim, T("You're in too many containers.")); if (Home(victim) == Location(victim)) Home(victim) = PLAYER_START; ! do_move(victim, "home", MOVE_NORMAL); return; } /* note that we check the NO_TEL status of the victim rather *************** *** 534,540 **** /* attempted teleport to an exit */ if (Tel_Anything(player) || controls(player, victim) || controls(player, Location(victim))) ! do_move(victim, to, 0); else notify_format(victim, T("%s tries to impose his will on you and fails."), --- 532,538 ---- /* attempted teleport to an exit */ if (Tel_Anything(player) || controls(player, victim) || controls(player, Location(victim))) ! do_move(victim, to, MOVE_NORMAL); else notify_format(victim, T("%s tries to impose his will on you and fails."), *************** *** 579,587 **** } /* force victim to do command */ for (j = 0; j < 10; j++) ! wnxt[j] = wenv[j]; for (j = 0; j < NUMQ; j++) ! rnxt[j] = renv[j]; parse_que(victim, command, player); } --- 577,585 ---- } /* force victim to do command */ for (j = 0; j < 10; j++) ! global_eval_context.wnxt[j] = global_eval_context.wenv[j]; for (j = 0; j < NUMQ; j++) ! global_eval_context.rnxt[j] = global_eval_context.renv[j]; parse_que(victim, command, player); } *************** *** 805,811 **** break; } ! if (victim == player && (!d || d->descriptor == process_command_port)) { notify(player, T("If you want to quit, use QUIT.")); return; } --- 803,810 ---- break; } ! if (victim == player ! && (!d || d->descriptor == global_eval_context.process_command_port)) { notify(player, T("If you want to quit, use QUIT.")); return; } *************** *** 1839,1851 **** } 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 { --- 1838,1844 ---- } fclose(fp); fclose(fptmp); ! if (rename_file("tmp.tmp", NAMES_FILE) == 0) { notify(player, T("Name removed.")); do_log(LT_WIZ, player, NOTHING, "*** UNLOCKED NAME *** %s", name + 1); } else { *************** *** 1861,1867 **** } 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] = '#'; --- 1854,1860 ---- } 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 unless it's already present */ char commented[BUFFER_LEN + 1]; int found = 0; commented[0] = '#'; *************** *** 1872,1894 **** else 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 --- 1865,1884 ---- else if ((p = strchr(buffer, '\n')) != NULL) *p = '\0'; if (strcasecmp(commented, buffer) == 0) { ! fprintf(fptmp, "%s\n", buffer + 1); found = 1; ! } else { fprintf(fptmp, "%s\n", buffer); + if (strcasecmp(name, buffer) == 0) + found = 1; + } } if (!found) fprintf(fptmp, "%s\n", name); fclose(fp); fclose(fptmp); ! if (rename_file("tmp.tmp", NAMES_FILE) == 0) { notify_format(player, T("Name %s locked."), name); do_log(LT_WIZ, player, NOTHING, "*** NAMELOCK *** %s", name); } else *************** *** 2009,2018 **** Name(Owner(player))); } if (flag) { ! paranoid_dump = 1; ! paranoid_checkpt = db_top / 5; ! if (paranoid_checkpt < 1) ! paranoid_checkpt = 1; } #ifdef HAS_OPENSSL close_ssl_connections(); --- 1999,2008 ---- Name(Owner(player))); } if (flag) { ! globals.paranoid_dump = 1; ! globals.paranoid_checkpt = db_top / 5; ! if (globals.paranoid_checkpt < 1) ! globals.paranoid_checkpt = 1; } #ifdef HAS_OPENSSL close_ssl_connections(); *** 1_7_7.1099/src/wild.c Sat, 01 May 2004 13:51:07 -0500 dunemush (pennmush/b/24_wild.c 1.11.1.1.1.8.1.1.1.4.1.2.1.7 660) --- 1_7_7.1145(w)/src/wild.c Wed, 04 Aug 2004 14:45:30 -0500 dunemush (pennmush/b/24_wild.c 1.11.1.1.1.8.1.1.1.4.1.2.1.8 660) *************** *** 282,288 **** if (!*dstr) return 0; ! wnxt[arg++] = wbuf; *wbuf++ = *dstr; *wbuf++ = '\0'; --- 282,288 ---- if (!*dstr) return 0; ! global_eval_context.wnxt[arg++] = wbuf; *wbuf++ = *dstr; *wbuf++ = '\0'; *************** *** 312,318 **** /* If at end of pattern, slurp the rest, and leave. */ if (!tstr[1]) { ! wnxt[arg] = wbuf; strcpy(wbuf, dstr); return 1; } --- 312,318 ---- /* If at end of pattern, slurp the rest, and leave. */ if (!tstr[1]) { ! global_eval_context.wnxt[arg] = wbuf; strcpy(wbuf, dstr); return 1; } *************** *** 326,332 **** /* Fill in arguments if someone put another '*' * before a fixed string. */ ! wnxt[argpos++] = wbuf; *wbuf++ = '\0'; /* Jump to the fast routine if we can. */ --- 326,332 ---- /* Fill in arguments if someone put another '*' * before a fixed string. */ ! global_eval_context.wnxt[argpos++] = wbuf; *wbuf++ = '\0'; /* Jump to the fast routine if we can. */ *************** *** 335,341 **** /* Fill in any intervening '?'s */ while (argpos < arg) { ! wnxt[argpos++] = wbuf; *wbuf++ = *datapos++; *wbuf++ = '\0'; --- 335,341 ---- /* Fill in any intervening '?'s */ while (argpos < arg) { ! global_eval_context.wnxt[argpos++] = wbuf; *wbuf++ = *datapos++; *wbuf++ = '\0'; *************** *** 388,394 **** /* Found a match! Fill in all remaining arguments. * First do the '*'... */ ! wnxt[argpos++] = wbuf; strncpy(wbuf, datapos, (dstr - datapos) - numextra); wbuf += (dstr - datapos) - numextra; *wbuf++ = '\0'; --- 388,394 ---- /* Found a match! Fill in all remaining arguments. * First do the '*'... */ ! global_eval_context.wnxt[argpos++] = wbuf; strncpy(wbuf, datapos, (dstr - datapos) - numextra); wbuf += (dstr - datapos) - numextra; *wbuf++ = '\0'; *************** *** 398,404 **** while (numextra) { if (argpos >= NUMARGS) return 1; ! wnxt[argpos++] = wbuf; *wbuf++ = *datapos++; *wbuf++ = '\0'; numextra--; --- 398,404 ---- while (numextra) { if (argpos >= NUMARGS) return 1; ! global_eval_context.wnxt[argpos++] = wbuf; *wbuf++ = *datapos++; *wbuf++ = '\0'; numextra--; *************** *** 456,464 **** int j; /* Clear %0-%9 and r(0) - r(9) */ for (j = 0; j < NUMARGS; j++) ! wnxt[j] = (char *) NULL; for (j = 0; j < NUMQ; j++) ! rnxt[j] = (char *) NULL; return wild(s, d, 0, cs); } --- 456,464 ---- int j; /* Clear %0-%9 and r(0) - r(9) */ for (j = 0; j < NUMARGS; j++) ! global_eval_context.wnxt[j] = (char *) NULL; for (j = 0; j < NUMQ; j++) ! global_eval_context.rnxt[j] = (char *) NULL; return wild(s, d, 0, cs); } *************** *** 519,532 **** /* Clear %0-%9 and r(0) - r(9) */ for (j = 0; j < NUMARGS; j++) { wtmp[j][0] = '\0'; ! wnxt[j] = (char *) NULL; } for (j = 0; j < NUMQ; j++) ! rnxt[j] = (char *) NULL; for (i = 0; (i < 10) && (i < NUMARGS); i++) { pcre_copy_substring(d, offsets, subpatterns, i, wtmp[i], BUFFER_LEN); ! wnxt[i] = wtmp[i]; } mush_free(re, "pcre"); --- 519,532 ---- /* Clear %0-%9 and r(0) - r(9) */ for (j = 0; j < NUMARGS; j++) { wtmp[j][0] = '\0'; ! global_eval_context.wnxt[j] = (char *) NULL; } for (j = 0; j < NUMQ; j++) ! global_eval_context.rnxt[j] = (char *) NULL; for (i = 0; (i < 10) && (i < NUMARGS); i++) { pcre_copy_substring(d, offsets, subpatterns, i, wtmp[i], BUFFER_LEN); ! global_eval_context.wnxt[i] = wtmp[i]; } mush_free(re, "pcre"); *** 1_7_7.1099/src/version.c Thu, 03 Jun 2004 17:00:50 -0500 dunemush (pennmush/b/26_version.c 1.10 660) --- 1_7_7.1145(w)/src/version.c Wed, 04 Aug 2004 14:45:30 -0500 dunemush (pennmush/b/26_version.c 1.11 660) *************** *** 24,30 **** #endif #include "confmagic.h" - extern time_t start_time; /* from bsd.c */ void do_version(dbref player); /** The version command. --- 24,29 ---- *************** *** 37,43 **** notify_format(player, T("You are connected to %s"), MUDNAME); ! strcpy(buff, ctime(&start_time)); buff[strlen(buff) - 1] = '\0'; /* eat the newline */ notify_format(player, T("Last restarted: %s"), buff); --- 36,42 ---- notify_format(player, T("You are connected to %s"), MUDNAME); ! strcpy(buff, ctime(&globals.start_time)); buff[strlen(buff) - 1] = '\0'; /* eat the newline */ notify_format(player, T("Last restarted: %s"), buff); *** 1_7_7.1099/src/utils.c Tue, 08 Jun 2004 12:37:13 -0500 dunemush (pennmush/b/27_utils.c 1.30.1.1.1.21 660) --- 1_7_7.1145(w)/src/utils.c Wed, 04 Aug 2004 14:45:30 -0500 dunemush (pennmush/b/27_utils.c 1.30.1.1.1.22 660) *************** *** 51,58 **** static long genrand_int31(void); static void init_genrand(unsigned long); static void init_by_array(unsigned long *, int); - extern int local_can_interact_first(dbref from, dbref to, int type); - extern int local_can_interact_last(dbref from, dbref to, int type); /** A malloc wrapper that tracks type of allocation. * This should be used in preference to malloc() when possible, --- 51,56 ---- *** 1_7_7.1099/src/unparse.c Thu, 27 May 2004 14:05:53 -0500 dunemush (pennmush/b/28_unparse.c 1.16.1.7.1.11 660) --- 1_7_7.1145(w)/src/unparse.c Wed, 04 Aug 2004 14:45:30 -0500 dunemush (pennmush/b/28_unparse.c 1.16.1.7.1.12 660) *************** *** 202,214 **** mush_panic("Unable to allocate memory in nameformat"); save_global_regs("nameformat", rsave); for (j = 0; j < 10; j++) { ! wsave[j] = wenv[j]; ! wenv[j] = NULL; } for (j = 0; j < NUMQ; j++) ! renv[j][0] = '\0'; strcpy(arg, unparse_dbref(loc)); ! wenv[0] = arg; sp = save = safe_atr_value(a); bp = tbuf1; process_expression(tbuf1, &bp, &sp, loc, player, player, --- 202,214 ---- mush_panic("Unable to allocate memory in nameformat"); save_global_regs("nameformat", rsave); for (j = 0; j < 10; j++) { ! wsave[j] = global_eval_context.wenv[j]; ! global_eval_context.wenv[j] = NULL; } for (j = 0; j < NUMQ; j++) ! global_eval_context.renv[j][0] = '\0'; strcpy(arg, unparse_dbref(loc)); ! global_eval_context.wenv[0] = arg; sp = save = safe_atr_value(a); bp = tbuf1; process_expression(tbuf1, &bp, &sp, loc, player, player, *************** *** 216,222 **** *bp = '\0'; free((Malloc_t) save); for (j = 0; j < 10; j++) { ! wenv[j] = wsave[j]; } restore_global_regs("nameformat", rsave); mush_free((Malloc_t) arg, "string"); --- 216,222 ---- *bp = '\0'; free((Malloc_t) save); for (j = 0; j < 10; j++) { ! global_eval_context.wenv[j] = wsave[j]; } restore_global_regs("nameformat", rsave); mush_free((Malloc_t) arg, "string"); *** 1_7_7.1099/src/timer.c Thu, 27 May 2004 14:05:53 -0500 dunemush (pennmush/b/29_timer.c 1.29.1.7.1.19 660) --- 1_7_7.1145(w)/src/timer.c Wed, 04 Aug 2004 14:45:30 -0500 dunemush (pennmush/b/29_timer.c 1.29.1.7.1.22 660) *************** *** 41,51 **** #include "confmagic.h" - int on_second = 0; /**< Have we been called at the end of a second? */ static sig_atomic_t hup_triggered = 0; static sig_atomic_t usr1_triggered = 0; - extern char ccom[BUFFER_LEN]; - extern dbref cplr; extern void inactivity_check(void); extern void reopen_logs(void); --- 41,48 ---- *************** *** 58,67 **** #endif void dispatch(void); - #ifdef HAS_ITIMER - void signal_cpu_limit(int signo); - #endif - #ifndef WIN32 /** Handler for HUP signal. --- 55,60 ---- *************** *** 213,221 **** do_reboot(NOTHING, 0); /* We don't return from this */ usr1_triggered = 0; /* But just in case */ } ! if (!on_second) return; ! on_second = 0; mudtime = time(NULL); --- 206,214 ---- do_reboot(NOTHING, 0); /* We don't return from this */ usr1_triggered = 0; /* But just in case */ } ! if (!globals.on_second) return; ! globals.on_second = 0; mudtime = time(NULL); *************** *** 226,241 **** if (options.purge_counter <= mudtime) { /* Free list reconstruction */ options.purge_counter = options.purge_interval + mudtime; ! cplr = NOTHING; ! strcpy(ccom, "purge"); purge(); } if (options.dbck_counter <= mudtime) { /* Database consistency check */ options.dbck_counter = options.dbck_interval + mudtime; ! cplr = NOTHING; ! strcpy(ccom, "dbck"); dbck(); } --- 219,234 ---- if (options.purge_counter <= mudtime) { /* Free list reconstruction */ options.purge_counter = options.purge_interval + mudtime; ! global_eval_context.cplr = NOTHING; ! strcpy(global_eval_context.ccom, "purge"); purge(); } if (options.dbck_counter <= mudtime) { /* Database consistency check */ options.dbck_counter = options.dbck_interval + mudtime; ! global_eval_context.cplr = NOTHING; ! strcpy(global_eval_context.ccom, "dbck"); dbck(); } *************** *** 249,255 **** if (options.dump_counter <= mudtime) { log_mem_check(); options.dump_counter = options.dump_interval + mudtime; ! strcpy(ccom, "dump"); fork_and_dump(1); flag_broadcast(0, "ON-VACATION", "%s", T --- 242,248 ---- if (options.dump_counter <= mudtime) { log_mem_check(); options.dump_counter = options.dump_interval + mudtime; ! strcpy(global_eval_context.ccom, "dump"); fork_and_dump(1); flag_broadcast(0, "ON-VACATION", "%s", T *************** *** 265,271 **** } if (options.warn_interval && (options.warn_counter <= mudtime)) { options.warn_counter = options.warn_interval + mudtime; ! strcpy(ccom, "warnings"); run_topology(); } --- 258,264 ---- } if (options.warn_interval && (options.warn_counter <= mudtime)) { options.warn_counter = options.warn_interval + mudtime; ! strcpy(global_eval_context.ccom, "warnings"); run_topology(); } *** 1_7_7.1099/src/switchinc.c Tue, 08 Jun 2004 14:18:47 -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.8 660) --- 1_7_7.1145(w)/src/switchinc.c Wed, 04 Aug 2004 14:45:30 -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.9 660) *************** *** 93,98 **** --- 93,99 ---- {"PLAYERS", SWITCH_PLAYERS}, {"PORT", SWITCH_PORT}, {"POWERS", SWITCH_POWERS}, + {"PREFIX", SWITCH_PREFIX}, {"PRESERVE", SWITCH_PRESERVE}, {"PRINT", SWITCH_PRINT}, {"PRIVS", SWITCH_PRIVS}, *** 1_7_7.1099/src/strutil.c Tue, 11 May 2004 10:08:19 -0500 dunemush (pennmush/b/33_strutil.c 1.28.1.3.1.3.1.7.2.1.1.2.1.1.1.1.1.1.1.21.1.2.1.2.1.18 660) --- 1_7_7.1145(w)/src/strutil.c Wed, 04 Aug 2004 14:45:30 -0500 dunemush (pennmush/b/33_strutil.c 1.28.1.3.1.3.1.7.2.1.1.2.1.1.1.1.1.1.1.21.1.2.1.2.1.21 660) *************** *** 808,814 **** if (n > BUFFER_LEN - 1) n = BUFFER_LEN - 1; ! blen = BUFFER_LEN - (*bp - buff); if (blen < n) { n = blen; --- 808,814 ---- if (n > BUFFER_LEN - 1) n = BUFFER_LEN - 1; ! blen = BUFFER_LEN - (*bp - buff) - 1; if (blen < n) { n = blen; *************** *** 954,968 **** safe_strl(string, skip, result, &rp); string += skip; } ! if (strncmp(string, old[0], oldlens[0]) == 0) { /* Copy the first */ ! safe_strl(newbits[0], newlens[0], result, &rp); ! string += oldlens[0]; ! } else if (strncmp(string, old[1], oldlens[1]) == 0) { /* The second */ ! safe_strl(newbits[1], newlens[1], result, &rp); ! string += oldlens[1]; ! } else { ! safe_chr(*string, result, &rp); ! string++; } } --- 954,970 ---- safe_strl(string, skip, result, &rp); string += skip; } ! if (*string) { ! if (strncmp(string, old[0], oldlens[0]) == 0) { /* Copy the first */ ! safe_strl(newbits[0], newlens[0], result, &rp); ! string += oldlens[0]; ! } else if (strncmp(string, old[1], oldlens[1]) == 0) { /* The second */ ! safe_strl(newbits[1], newlens[1], result, &rp); ! string += oldlens[1]; ! } else { ! safe_chr(*string, result, &rp); ! string++; ! } } } *************** *** 1388,1393 **** --- 1390,1397 ---- (void) strxfrm(d1, ns1, s1_len); (void) strxfrm(d2, ns2, s2_len); result = strcmp(d1, d2); + mush_free(ns1, "string"); + mush_free(ns2, "string"); mush_free(d1, "string"); mush_free(d2, "string"); return result; *************** *** 1449,1454 **** --- 1453,1460 ---- (void) strxfrm(d1, strupper(ns1), s1_len); (void) strxfrm(d2, strupper(ns2), s2_len); result = strcmp(d1, d2); + mush_free(ns1, "string"); + mush_free(ns2, "string"); mush_free(d1, "string"); mush_free(d2, "string"); return result; *** 1_7_7.1099/src/speech.c Thu, 10 Jun 2004 13:12:03 -0500 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.1.1.1.6 660) --- 1_7_7.1145(w)/src/speech.c Wed, 04 Aug 2004 14:45:30 -0500 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.1.1.1.7.1.1 660) *************** *** 801,807 **** notify(player, T("You are set HAVEN and cannot receive pages.")); /* Figure out what kind of message */ ! wenv[0] = (char *) message; gap = " "; switch (*message) { case SEMI_POSE_TOKEN: --- 801,807 ---- notify(player, T("You are set HAVEN and cannot receive pages.")); /* Figure out what kind of message */ ! global_eval_context.wenv[0] = (char *) message; gap = " "; switch (*message) { case SEMI_POSE_TOKEN: *************** *** 974,983 **** safe_str(", ", tbuf1, &bp); } else { for (j = 0; j < 10; j++) { ! wsave[j] = wenv[j]; ! wenv[j] = NULL; } ! wenv[0] = (char *) msg; save_global_regs("prefix_save", preserve); asave = safe_atr_value(a); ap = asave; --- 974,983 ---- safe_str(", ", tbuf1, &bp); } else { for (j = 0; j < 10; j++) { ! wsave[j] = global_eval_context.wenv[j]; ! global_eval_context.wenv[j] = NULL; } ! global_eval_context.wenv[0] = (char *) msg; save_global_regs("prefix_save", preserve); asave = safe_atr_value(a); ap = asave; *************** *** 986,992 **** free((Malloc_t) asave); restore_global_regs("prefix_save", preserve); for (j = 0; j < 10; j++) ! wenv[j] = wsave[j]; if (bp != tbuf1) safe_chr(' ', tbuf1, &bp); } --- 986,992 ---- free((Malloc_t) asave); restore_global_regs("prefix_save", preserve); for (j = 0; j < 10; j++) ! global_eval_context.wenv[j] = wsave[j]; if (bp != tbuf1) safe_chr(' ', tbuf1, &bp); } *************** *** 1115,1121 **** pass[1] = exc1; pass[2] = exc2; ! notify_anything(orator, na_except2, pass, NULL, flags, msg); do_audible_stuff(loc, &pass[1], 2, msg); } --- 1115,1121 ---- pass[1] = exc1; pass[2] = exc2; ! notify_anything(orator, na_except2, pass, ns_esnotify, flags, msg); do_audible_stuff(loc, &pass[1], 2, msg); } *** 1_7_7.1099/src/set.c Thu, 27 May 2004 14:05:53 -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.32 660) --- 1_7_7.1145(w)/src/set.c Wed, 04 Aug 2004 14:45:30 -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.38 660) *************** *** 33,38 **** --- 33,39 ---- #include "dbdefs.h" #include "lock.h" #include "log.h" + #include "game.h" #include "confmagic.h" void do_name(dbref player, const char *name, char *newname); *************** *** 44,60 **** int do_set(dbref player, const char *name, char *flag); void do_cpattr (dbref player, char *oldpair, char **newpair, int move, int noflagcopy); ! void do_gedit(dbref player, char *it, char **argv); void do_trigger(dbref player, char *object, char **argv); void do_use(dbref player, const char *what); void do_parent(dbref player, char *name, char *parent_name); void do_wipe(dbref player, char *name); ! static int af_helper(dbref player, dbref thing, char const *pattern, ! ATTR *atr, void *args); ! static int gedit_helper(dbref player, dbref thing, char const *pattern, ! ATTR *atr, void *args); ! static int wipe_helper(dbref player, dbref thing, char const *pattern, ! ATTR *atr, void *args); static void copy_attrib_flags(dbref player, dbref target, ATTR *atr, int flags); --- 45,61 ---- int do_set(dbref player, const char *name, char *flag); void do_cpattr (dbref player, char *oldpair, char **newpair, int move, int noflagcopy); ! void do_gedit(dbref player, char *it, char **argv, enum edit_type target); void do_trigger(dbref player, char *object, char **argv); void do_use(dbref player, const char *what); void do_parent(dbref player, char *name, char *parent_name); void do_wipe(dbref player, char *name); ! static int af_helper(dbref player, dbref thing, dbref parent, ! char const *pattern, ATTR *atr, void *args); ! static int gedit_helper(dbref player, dbref thing, dbref parent, ! char const *pattern, ATTR *atr, void *args); ! static int wipe_helper(dbref player, dbref thing, dbref parent, ! char const *pattern, ATTR *atr, void *args); static void copy_attrib_flags(dbref player, dbref target, ATTR *atr, int flags); *************** *** 70,75 **** --- 71,78 ---- do_name(dbref player, const char *name, char *newname) { dbref thing; + ATTR *a = NULL; + char alias[BUFFER_LEN]; char *password; char *myenv[10]; int i; *************** *** 124,135 **** password++; } } if (strcasecmp(newname, Name(thing)) ! && !ok_player_name(newname, thing)) { /* strcasecmp allows changing foo to Foo, etc. */ notify(player, T("You can't give a player that name.")); return; } /* everything ok, notify */ do_log(LT_CONN, 0, 0, T("Name change by %s(#%d) to %s"), Name(thing), thing, newname); --- 127,145 ---- password++; } } + a = atr_get_noparent(thing, "ALIAS"); + if (a) + strcpy(alias, atr_value(a)); if (strcasecmp(newname, Name(thing)) ! && !(a && !strcasecmp(newname, alias)) /* Swap alias, name */ ! &&!ok_player_name(newname, thing)) { /* strcasecmp allows changing foo to Foo, etc. */ notify(player, T("You can't give a player that name.")); return; } + if (a && strcasecmp(alias, newname)) { + a = NULL; + } /* everything ok, notify */ do_log(LT_CONN, 0, 0, T("Name change by %s(#%d) to %s"), Name(thing), thing, newname); *************** *** 154,163 **** for (i = 2; i < 10; i++) myenv[i] = NULL; ! if (IsPlayer(thing)) delete_player(thing, NULL); set_name(thing, newname); ! if (IsPlayer(thing)) add_player(thing, NULL); if (!AreQuiet(player, thing)) --- 164,177 ---- for (i = 2; i < 10; i++) myenv[i] = NULL; ! if (IsPlayer(thing) && !a) delete_player(thing, NULL); + else if (a) + atr_add(thing, "ALIAS", Name(thing), player, 0); + set_name(thing, newname); ! ! if (IsPlayer(thing) && !a) add_player(thing, NULL); if (!AreQuiet(player, thing)) *************** *** 463,468 **** --- 477,483 ---- static int af_helper(dbref player, dbref thing, + dbref parent __attribute__ ((__unused__)), char const *pattern __attribute__ ((__unused__)), ATTR *atr, void *args) { *************** *** 706,711 **** --- 721,727 ---- static int gedit_helper(dbref player, dbref thing, + dbref parent __attribute__ ((__unused__)), char const *pattern __attribute__ ((__unused__)), ATTR *a, void *args) { *************** *** 716,726 **** --- 732,744 ---- char *tbufp, *tbufap; char **argv = (char **) args; size_t rlen, vlen; + enum edit_type target; val = argv[1]; vlen = strlen(val); r = argv[2] ? argv[2] : ""; rlen = strlen(r); + target = (enum edit_type) argv[3]; /* Nasty kludge, getting enum passed as address */ tbufp = tbuf1; tbufap = tbuf_ansi; *************** *** 761,785 **** /* Add one at the start */ if (!safe_strl(r, rlen, tbuf1, &tbufp)) { ! for (last = 0; last < haystack->len; last++) { ! /* Add the next character */ ! if (safe_ansi_string(haystack, last, 1, tbuf1, &tbufp)) { ! too_long = 1; ! break; ! } ! if (!ansi_long_flag) { ! if (safe_ansi_string(haystack, last, 1, tbuf_ansi, &tbufap)) ! ansi_long_flag = 1; ! } ! /* Copy in r */ ! if (safe_strl(r, rlen, tbuf1, &tbufp)) { ! too_long = 1; ! break; ! } ! if (!ansi_long_flag) { ! if (safe_format(tbuf_ansi, &tbufap, "%s%s%s", ANSI_HILITE, r, ! ANSI_NORMAL)) ! ansi_long_flag = 1; } } } --- 779,805 ---- /* Add one at the start */ if (!safe_strl(r, rlen, tbuf1, &tbufp)) { ! if (target != EDIT_FIRST) { ! for (last = 0; last < haystack->len; last++) { ! /* Add the next character */ ! if (safe_ansi_string(haystack, last, 1, tbuf1, &tbufp)) { ! too_long = 1; ! break; ! } ! if (!ansi_long_flag) { ! if (safe_ansi_string(haystack, last, 1, tbuf_ansi, &tbufap)) ! ansi_long_flag = 1; ! } ! /* Copy in r */ ! if (safe_strl(r, rlen, tbuf1, &tbufp)) { ! too_long = 1; ! break; ! } ! if (!ansi_long_flag) { ! if (safe_format(tbuf_ansi, &tbufap, "%s%s%s", ANSI_HILITE, r, ! ANSI_NORMAL)) ! ansi_long_flag = 1; ! } } } } *************** *** 817,822 **** --- 837,844 ---- ansi_long_flag = 1; } last = p - haystack->text + vlen; + if (target == EDIT_FIRST) + break; } if (last < haystack->len && !too_long) { safe_ansi_string(haystack, last, haystack->len, tbuf1, &tbufp); *************** *** 851,857 **** * \param argv array containing the search and replace strings. */ void ! do_gedit(dbref player, char *it, char **argv) { dbref thing; char tbuf1[BUFFER_LEN]; --- 873,879 ---- * \param argv array containing the search and replace strings. */ void ! do_gedit(dbref player, char *it, char **argv, enum edit_type target) { dbref thing; char tbuf1[BUFFER_LEN]; *************** *** 879,884 **** --- 901,907 ---- notify(player, T("Nothing to do.")); return; } + argv[3] = (char *) target; /* Nasty kludge, passing an enum as an address */ if (!atr_iter_get(player, thing, q, 0, gedit_helper, argv)) notify(player, T("No matching attributes.")); } *************** *** 922,928 **** } /* trigger modifies the stack */ for (a = 0; a < 10; a++) ! wnxt[a] = argv[a + 1]; if (charge_action(player, thing, upcasestr(s))) { if (!AreQuiet(player, thing)) --- 945,951 ---- } /* trigger modifies the stack */ for (a = 0; a < 10; a++) ! global_eval_context.wnxt[a] = argv[a + 1]; if (charge_action(player, thing, upcasestr(s))) { if (!AreQuiet(player, thing)) *************** *** 1024,1030 **** } static int ! wipe_helper(dbref player, dbref thing, char const *pattern, ATTR *atr, void *args __attribute__ ((__unused__))) { /* for added security, only God can modify wiz-only-modifiable --- 1047,1055 ---- } static int ! wipe_helper(dbref player, dbref thing, ! dbref parent __attribute__ ((__unused__)), ! char const *pattern, ATTR *atr, void *args __attribute__ ((__unused__))) { /* for added security, only God can modify wiz-only-modifiable *** 1_7_7.1099/src/rob.c Tue, 08 Jun 2004 14:18:47 -0500 dunemush (pennmush/b/42_rob.c 1.18.1.2.1.3.1.3.1.31 660) --- 1_7_7.1145(w)/src/rob.c Wed, 04 Aug 2004 14:45:30 -0500 dunemush (pennmush/b/42_rob.c 1.18.1.2.1.3.1.3.1.32 660) *************** *** 292,298 **** fbp = fbuff; safe_integer_sbuf(amount, paid, &pb); *pb = '\0'; ! wenv[0] = paid; process_expression(fbuff, &fbp, &ap, who, player, player, PE_DEFAULT, PT_DEFAULT, NULL); *fbp = '\0'; --- 292,298 ---- fbp = fbuff; safe_integer_sbuf(amount, paid, &pb); *pb = '\0'; ! global_eval_context.wenv[0] = paid; process_expression(fbuff, &fbp, &ap, who, player, player, PE_DEFAULT, PT_DEFAULT, NULL); *fbp = '\0'; *** 1_7_7.1099/src/predicat.c Thu, 03 Jun 2004 16:22:17 -0500 dunemush (pennmush/b/44_predicat.c 1.1.1.34.1.1.1.3.1.4.2.38.1.12 660) --- 1_7_7.1145(w)/src/predicat.c Wed, 04 Aug 2004 14:45:30 -0500 dunemush (pennmush/b/44_predicat.c 1.1.1.34.1.1.1.3.1.4.2.38.1.13.1.2 660) *************** *** 41,49 **** 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); ! static int grep_helper(dbref player, dbref thing, char const *pattern, ATTR *atr, void *args); void do_grep(dbref player, char *obj, char *lookfor, int flag, int insensitive); static int pay_quota(dbref, int); --- 41,49 ---- 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, dbref parent, char const *pattern, ATTR *atr, void *args); ! static int grep_helper(dbref player, dbref thing, dbref parent, char const *pattern, ATTR *atr, void *args); void do_grep(dbref player, char *obj, char *lookfor, int flag, int insensitive); static int pay_quota(dbref, int); *************** *** 254,264 **** int j; char *preserves[10]; char *preserveq[NUMQ]; int need_pres = 0; int attribs_used = 0; loc = (loc == NOTHING) ? Location(player) : loc; ! /* only give messages if the location is good */ if (GoodObject(loc)) { --- 254,265 ---- int j; char *preserves[10]; char *preserveq[NUMQ]; + dbref preserve_orator = orator; int need_pres = 0; int attribs_used = 0; loc = (loc == NOTHING) ? Location(player) : loc; ! orator = player; /* only give messages if the location is good */ if (GoodObject(loc)) { *************** *** 299,306 **** asave = safe_atr_value(d); ap = asave; bp = buff; ! safe_str(Name(player), buff, &bp); ! safe_chr(' ', buff, &bp); sp = bp; process_expression(buff, &bp, &ap, thing, player, player, PE_DEFAULT, PT_DEFAULT, NULL); --- 300,310 ---- asave = safe_atr_value(d); ap = asave; bp = buff; ! if (!((d)->flags & AF_NONAME)) { ! safe_str(Name(player), buff, &bp); ! if (!((d)->flags & AF_NOSPACE)) ! safe_chr(' ', buff, &bp); ! } sp = bp; process_expression(buff, &bp, &ap, thing, player, player, PE_DEFAULT, PT_DEFAULT, NULL); *************** *** 322,331 **** restore_global_env("did_it_save", preserves); } for (j = 0; j < 10; j++) ! wnxt[j] = myenv[j]; for (j = 0; j < NUMQ; j++) ! rnxt[j] = NULL; attribs_used = charge_action(player, thing, awhat) || attribs_used; return attribs_used; } --- 326,336 ---- restore_global_env("did_it_save", preserves); } for (j = 0; j < 10; j++) ! global_eval_context.wnxt[j] = myenv[j]; for (j = 0; j < NUMQ; j++) ! global_eval_context.rnxt[j] = NULL; attribs_used = charge_action(player, thing, awhat) || attribs_used; + orator = preserve_orator; return attribs_used; } *************** *** 853,861 **** /* set up environment for any spawned commands */ for (a = 0; a < 10; a++) ! wnxt[a] = wenv[a]; for (a = 0; a < NUMQ; a++) ! rnxt[a] = renv[a]; /* now try a wild card match of buff with stuff in coms */ for (a = 1; --- 858,866 ---- /* set up environment for any spawned commands */ for (a = 0; a < 10; a++) ! global_eval_context.wnxt[a] = global_eval_context.wenv[a]; for (a = 0; a < NUMQ; a++) ! global_eval_context.rnxt[a] = global_eval_context.renv[a]; /* now try a wild card match of buff with stuff in coms */ for (a = 1; *************** *** 1074,1094 **** /* We're okay. Send out messages. */ for (i = 0; i < 10; i++) { ! wsave[i] = wenv[i]; ! wenv[i] = argv[i + 7]; } real_did_it(actor, victim, upcasestr(argv[2]), argv[3], upcasestr(argv[4]), argv[5], ! NULL, Location(actor), wenv, NA_INTER_HEAR); for (i = 0; i < 10; i++) ! wenv[i] = wsave[i]; /* Now we copy our args into the stack, and do the command. */ for (i = 0; i < 10; i++) ! wnxt[i] = argv[i + 7]; charge_action(actor, victim, upcasestr(argv[6])); } --- 1079,1099 ---- /* We're okay. Send out messages. */ for (i = 0; i < 10; i++) { ! wsave[i] = global_eval_context.wenv[i]; ! global_eval_context.wenv[i] = argv[i + 7]; } real_did_it(actor, victim, upcasestr(argv[2]), argv[3], upcasestr(argv[4]), argv[5], ! NULL, Location(actor), global_eval_context.wenv, NA_INTER_HEAR); for (i = 0; i < 10; i++) ! global_eval_context.wenv[i] = wsave[i]; /* Now we copy our args into the stack, and do the command. */ for (i = 0; i < 10; i++) ! global_eval_context.wnxt[i] = argv[i + 7]; charge_action(actor, victim, upcasestr(argv[6])); } *************** *** 1106,1111 **** --- 1111,1117 ---- static int grep_util_helper(dbref player __attribute__ ((__unused__)), dbref thing __attribute__ ((__unused__)), + dbref parent __attribute__ ((__unused__)), char const *pattern __attribute__ ((__unused__)), ATTR *atr, void *args) { *************** *** 1166,1171 **** --- 1172,1178 ---- static int grep_helper(dbref player, dbref thing __attribute__ ((__unused__)), + dbref parent __attribute__ ((__unused__)), char const *pattern __attribute__ ((__unused__)), ATTR *atr, void *args) { *** 1_7_7.1099/src/parse.c Thu, 27 May 2004 14:05:53 -0500 dunemush (pennmush/b/48_parse.c 1.23.1.10.1.2.1.1.1.1.1.2.1.2.1.38 660) --- 1_7_7.1145(w)/src/parse.c Wed, 04 Aug 2004 14:45:30 -0500 dunemush (pennmush/b/48_parse.c 1.23.1.10.1.2.1.1.1.1.1.2.1.2.1.39 660) *************** *** 33,39 **** #include "mymalloc.h" #include "confmagic.h" - extern char ccom[]; /* bsd.c */ extern char *absp[], *obj[], *poss[], *subj[]; /* fundb.c */ extern int inum, inum_limit; int global_fun_invocations; --- 33,38 ---- *************** *** 738,745 **** case '7': case '8': case '9': /* positional argument */ ! if (wenv[savec - '0']) ! safe_str(wenv[savec - '0'], buff, bp); break; case 'A': case 'a': /* enactor absolute possessive pronoun */ --- 737,744 ---- case '7': case '8': case '9': /* positional argument */ ! if (global_eval_context.wenv[savec - '0']) ! safe_str(global_eval_context.wenv[savec - '0'], buff, bp); break; case 'A': case 'a': /* enactor absolute possessive pronoun */ *************** *** 753,759 **** break; case 'C': case 'c': /* command line */ ! safe_str(ccom, buff, bp); break; case 'L': case 'l': /* enactor location dbref */ --- 752,758 ---- break; case 'C': case 'c': /* command line */ ! safe_str(global_eval_context.ccom, buff, bp); break; case 'L': case 'l': /* enactor location dbref */ *************** *** 785,792 **** (*str)++; if ((qindex = qreg_indexes[(unsigned char) nextc]) == -1) break; ! if (renv[qindex]) ! safe_str(renv[qindex], buff, bp); break; case 'R': case 'r': /* newline */ --- 784,791 ---- (*str)++; if ((qindex = qreg_indexes[(unsigned char) nextc]) == -1) break; ! if (global_eval_context.renv[qindex]) ! safe_str(global_eval_context.renv[qindex], buff, bp); break; case 'R': case 'r': /* newline */ *** 1_7_7.1099/src/move.c Thu, 03 Jun 2004 16:22:17 -0500 dunemush (pennmush/b/51_move.c 1.1.1.18.1.5.1.13.1.3.1.9.1.1.1.1.1.2.1.1.1.1.1.30 660) --- 1_7_7.1145(w)/src/move.c Wed, 04 Aug 2004 14:45:30 -0500 dunemush (pennmush/b/51_move.c 1.1.1.18.1.5.1.13.1.3.1.9.1.1.1.1.1.2.1.1.1.1.1.32 660) *************** *** 27,34 **** #include "game.h" #include "confmagic.h" - extern char ccom[BUFFER_LEN]; - void moveit(dbref what, dbref where, int nomovemsgs); static void send_contents(dbref loc, dbref dest); static void maybe_dropto(dbref loc, dbref dropto); --- 27,32 ---- *************** *** 244,250 **** /* autolook */ ! look_room(player, loc, 2); deep--; } --- 242,248 ---- /* autolook */ ! look_room(player, loc, LOOK_AUTO); deep--; } *************** *** 923,936 **** return; } if (can_move(player, command)) ! do_move(player, command, 0); else if ((Zone(Location(player)) != NOTHING) && remote_exit(player, command)) ! do_move(player, command, 2); else if ((Location(player) != MASTER_ROOM) && global_exit(player, command)) ! do_move(player, command, 1); else ! do_move(player, command, 0); } /* Routines for dealing with the follow commands */ --- 921,934 ---- return; } if (can_move(player, command)) ! do_move(player, command, MOVE_NORMAL); else if ((Zone(Location(player)) != NOTHING) && remote_exit(player, command)) ! do_move(player, command, MOVE_ZONE); else if ((Location(player) != MASTER_ROOM) && global_exit(player, command)) ! do_move(player, command, MOVE_GLOBAL); else ! do_move(player, command, MOVE_NORMAL); } /* Routines for dealing with the follow commands */ *** 1_7_7.1099/src/malias.c Tue, 08 Jun 2004 12:15:45 -0500 dunemush (pennmush/c/3_malias.c 1.36.1.13 660) --- 1_7_7.1145(w)/src/malias.c Wed, 04 Aug 2004 14:45:30 -0500 dunemush (pennmush/c/3_malias.c 1.36.1.14 660) *************** *** 329,334 **** --- 329,390 ---- notify(player, buff); } + FUNCTION(fun_malias) + { + /* With no arguments, list all alias names + * With one argument, it's either a delimiter or list all member dbrefs + * With two arguments, it's a malias name and a delimiter, and we + * list dbrefs, delimited + */ + int i; + int count = 0; + char sep = ' '; + struct mail_alias *m; + + if (nargs >= 1) { + m = get_malias(executor, args[0]); + if (m) { + if (!delim_check(buff, bp, nargs, args, 2, &sep)) + return; + if ((m->owner == executor) || (m->mflags == 0) || + (Hasprivs(executor)) || + ((m->mflags & ALIAS_MEMBERS) && ismember(m, executor))) { + for (i = 0; i < m->size; i++) { + if (count++) + safe_chr(sep, buff, bp); + safe_dbref(m->members[i], buff, bp); + } + } else { + safe_str(T(e_perm), buff, bp); + } + return; + } else { + /* Perhaps it's a delimiter? */ + if (arglens[0] > 1) { + /* Oops, not if it's longer than one character */ + safe_str(T(e_match), buff, bp); + return; + } + if (!delim_check(buff, bp, nargs, args, 1, &sep)) + return; + + } + + } + /* List maliases, possibly with a delimiter */ + for (i = 0; i < ma_top; i++) { + m = &malias[i]; + if ((m->owner == executor) || (m->nflags == 0) || + ((m->nflags & ALIAS_ADMIN) && Hasprivs(executor)) || + ((m->nflags & ALIAS_MEMBERS) && ismember(m, executor))) { + if (count++) + safe_chr(sep, buff, bp); + safe_chr(MALIAS_TOKEN, buff, bp); + safe_str(m->name, buff, bp); + } + } + } + /** Describe a malias. * \verbatim *** 1_7_7.1099/src/look.c Mon, 28 Jun 2004 09:20:49 -0500 dunemush (pennmush/c/4_look.c 1.21.1.2.1.9.1.1.1.1.1.33 660) --- 1_7_7.1145(w)/src/look.c Wed, 04 Aug 2004 14:45:30 -0500 dunemush (pennmush/c/4_look.c 1.21.1.2.1.9.1.1.1.1.1.38 660) *************** *** 38,52 **** static void look_simple(dbref player, dbref thing); static void look_description(dbref player, dbref thing, const char *def, const char *descname, const char *descformatname); ! static int decompile_helper ! (dbref player, dbref thing, char const *pattern, ATTR *atr, void *args); ! static int look_helper ! (dbref player, dbref thing, char const *pattern, ATTR *atr, void *args); ! static int look_helper_veiled ! (dbref player, dbref thing, char const *pattern, ATTR *atr, void *args); void decompile_atrs(dbref player, dbref thing, const char *name, const char *pattern, const char *prefix, int skipdef); ! void decompile_locks(dbref player, dbref thing, const char *name, int skipdef); static char *parent_chain(dbref player, dbref thing); extern PRIV attr_privs[]; --- 38,53 ---- static void look_simple(dbref player, dbref thing); static void look_description(dbref player, dbref thing, const char *def, const char *descname, const char *descformatname); ! static int decompile_helper(dbref player, dbref thing, dbref parent, ! char const *pattern, ATTR *atr, void *args); ! static int look_helper(dbref player, dbref thing, dbref parent, ! char const *pattern, ATTR *atr, void *args); ! static int look_helper_veiled(dbref player, dbref thing, dbref parent, ! char const *pattern, ATTR *atr, void *args); void decompile_atrs(dbref player, dbref thing, const char *name, const char *pattern, const char *prefix, int skipdef); ! void decompile_locks(dbref player, dbref thing, const char *name, ! int skipdef, const char *prefix); static char *parent_chain(dbref player, dbref thing); extern PRIV attr_privs[]; *************** *** 90,100 **** mush_panic("Unable to allocate memory in look_exits"); save_global_regs("look_exits", rsave); for (j = 0; j < 10; j++) { ! wsave[j] = wenv[j]; ! wenv[j] = NULL; } for (j = 0; j < NUMQ; j++) ! renv[j][0] = '\0'; bp = arg; DOLIST(thing, Exits(loc)) { if ((!(DarkLegal(thing) || (Dark(loc) && !Light(thing)))) --- 91,101 ---- mush_panic("Unable to allocate memory in look_exits"); save_global_regs("look_exits", rsave); for (j = 0; j < 10; j++) { ! wsave[j] = global_eval_context.wenv[j]; ! global_eval_context.wenv[j] = NULL; } for (j = 0; j < NUMQ; j++) ! global_eval_context.renv[j][0] = '\0'; bp = arg; DOLIST(thing, Exits(loc)) { if ((!(DarkLegal(thing) || (Dark(loc) && !Light(thing)))) *************** *** 105,111 **** } } *bp = '\0'; ! wenv[0] = arg; sp = save = safe_atr_value(a); bp = buff; process_expression(buff, &bp, &sp, loc, player, player, --- 106,112 ---- } } *bp = '\0'; ! global_eval_context.wenv[0] = arg; sp = save = safe_atr_value(a); bp = buff; process_expression(buff, &bp, &sp, loc, player, player, *************** *** 114,120 **** free((Malloc_t) save); notify_by(loc, player, buff); for (j = 0; j < 10; j++) { ! wenv[j] = wsave[j]; } restore_global_regs("look_exits", rsave); mush_free((Malloc_t) tbuf1, "string"); --- 115,121 ---- free((Malloc_t) save); notify_by(loc, player, buff); for (j = 0; j < 10; j++) { ! global_eval_context.wenv[j] = wsave[j]; } restore_global_regs("look_exits", rsave); mush_free((Malloc_t) tbuf1, "string"); *************** *** 242,252 **** mush_panic("Unable to allocate memory in look_contents"); save_global_regs("look_contents", rsave); for (j = 0; j < 10; j++) { ! wsave[j] = wenv[j]; ! wenv[j] = NULL; } for (j = 0; j < NUMQ; j++) ! renv[j][0] = '\0'; bp = arg; DOLIST(thing, Contents(loc)) { if (can_see(player, thing, can_see_loc)) { --- 243,253 ---- mush_panic("Unable to allocate memory in look_contents"); save_global_regs("look_contents", rsave); for (j = 0; j < 10; j++) { ! wsave[j] = global_eval_context.wenv[j]; ! global_eval_context.wenv[j] = NULL; } for (j = 0; j < NUMQ; j++) ! global_eval_context.renv[j][0] = '\0'; bp = arg; DOLIST(thing, Contents(loc)) { if (can_see(player, thing, can_see_loc)) { *************** *** 256,262 **** } } *bp = '\0'; ! wenv[0] = arg; sp = save = safe_atr_value(a); bp = buff; process_expression(buff, &bp, &sp, loc, player, player, --- 257,263 ---- } } *bp = '\0'; ! global_eval_context.wenv[0] = arg; sp = save = safe_atr_value(a); bp = buff; process_expression(buff, &bp, &sp, loc, player, player, *************** *** 265,271 **** free((Malloc_t) save); notify_by(loc, player, buff); for (j = 0; j < 10; j++) { ! wenv[j] = wsave[j]; } restore_global_regs("look_contents", rsave); mush_free((Malloc_t) arg, "string"); --- 266,272 ---- free((Malloc_t) save); notify_by(loc, player, buff); for (j = 0; j < 10; j++) { ! global_eval_context.wenv[j] = wsave[j]; } restore_global_regs("look_contents", rsave); mush_free((Malloc_t) arg, "string"); *************** *** 302,319 **** static int look_helper_veiled(dbref player, dbref thing __attribute__ ((__unused__)), char const *pattern, ATTR *atr, void *args __attribute__ ((__unused__))) { char fbuf[BUFFER_LEN]; char const *r; - dbref parent = NOTHING; if (EX_PUBLIC_ATTRIBS && !strcmp(AL_NAME(atr), "DESCRIBE") && !strcmp(pattern, "*")) return 0; - if (args) - parent = *(dbref *) args; if (parent == thing || !GoodObject(parent)) parent = NOTHING; strcpy(fbuf, privs_to_letters(attr_privs, AL_FLAGS(atr))); --- 303,318 ---- static int look_helper_veiled(dbref player, dbref thing __attribute__ ((__unused__)), + dbref parent __attribute__ ((__unused__)), char const *pattern, ATTR *atr, void *args __attribute__ ((__unused__))) { char fbuf[BUFFER_LEN]; char const *r; if (EX_PUBLIC_ATTRIBS && !strcmp(AL_NAME(atr), "DESCRIBE") && !strcmp(pattern, "*")) return 0; if (parent == thing || !GoodObject(parent)) parent = NOTHING; strcpy(fbuf, privs_to_letters(attr_privs, AL_FLAGS(atr))); *************** *** 366,383 **** static int look_helper(dbref player, dbref thing __attribute__ ((__unused__)), char const *pattern, ATTR *atr, void *args __attribute__ ((__unused__))) { char fbuf[BUFFER_LEN]; char const *r; - dbref parent = NOTHING; if (EX_PUBLIC_ATTRIBS && !strcmp(AL_NAME(atr), "DESCRIBE") && !strcmp(pattern, "*")) return 0; - if (args) - parent = *(dbref *) args; if (parent == thing || !GoodObject(parent)) parent = NOTHING; strcpy(fbuf, privs_to_letters(attr_privs, AL_FLAGS(atr))); --- 365,380 ---- static int look_helper(dbref player, dbref thing __attribute__ ((__unused__)), + dbref parent __attribute__ ((__unused__)), char const *pattern, ATTR *atr, void *args __attribute__ ((__unused__))) { char fbuf[BUFFER_LEN]; char const *r; if (EX_PUBLIC_ATTRIBS && !strcmp(AL_NAME(atr), "DESCRIBE") && !strcmp(pattern, "*")) return 0; if (parent == thing || !GoodObject(parent)) parent = NOTHING; strcpy(fbuf, privs_to_letters(attr_privs, AL_FLAGS(atr))); *************** *** 411,417 **** { if (all || (mstr && *mstr && !wildcard(mstr))) { if (parent) { ! if (!atr_iter_get_parent(player, thing, mstr, mortal, look_helper) && mstr) notify(player, T("No matching attributes.")); } else { --- 408,414 ---- { if (all || (mstr && *mstr && !wildcard(mstr))) { if (parent) { ! if (!atr_iter_get_parent(player, thing, mstr, mortal, look_helper, NULL) && mstr) notify(player, T("No matching attributes.")); } else { *************** *** 421,427 **** } else { if (parent) { if (!atr_iter_get_parent ! (player, thing, mstr, mortal, look_helper_veiled) && mstr) notify(player, T("No matching attributes.")); } else { if (!atr_iter_get(player, thing, mstr, mortal, look_helper_veiled, NULL) --- 418,424 ---- } else { if (parent) { if (!atr_iter_get_parent ! (player, thing, mstr, mortal, look_helper_veiled, NULL) && mstr) notify(player, T("No matching attributes.")); } else { if (!atr_iter_get(player, thing, mstr, mortal, look_helper_veiled, NULL) *************** *** 441,447 **** static void look_simple(dbref player, dbref thing) { ! int flag = 0; PUEBLOBUFF; PUSE; --- 438,444 ---- static void look_simple(dbref player, dbref thing) { ! enum look_type flag = LOOK_NORMAL; PUEBLOBUFF; PUSE; *************** *** 453,463 **** did_it(player, thing, NULL, NULL, "ODESCRIBE", NULL, "ADESCRIBE", NOTHING); if (IsExit(thing) && Transparented(thing)) { if (Cloudy(thing)) ! flag = 3; else ! flag = 1; } else if (Cloudy(thing)) ! flag = 4; if (flag) { if (Location(thing) == HOME) look_room(player, Home(player), flag); --- 450,460 ---- did_it(player, thing, NULL, NULL, "ODESCRIBE", NULL, "ADESCRIBE", NOTHING); if (IsExit(thing) && Transparented(thing)) { if (Cloudy(thing)) ! flag = LOOK_CLOUDYTRANS; else ! flag = LOOK_TRANS; } else if (Cloudy(thing)) ! flag = LOOK_CLOUDY; if (flag) { if (Location(thing) == HOME) look_room(player, Home(player), flag); *************** *** 580,586 **** if (f) { /* We have a DESCFORMAT, evaluate it into fbuff and use it */ /* If we have a DESCRIBE, pass the evaluated version as %0 */ ! wenv[0] = a ? buff : NULL; asave = safe_atr_value(f); ap = asave; fbp = fbuff; --- 577,583 ---- if (f) { /* We have a DESCFORMAT, evaluate it into fbuff and use it */ /* If we have a DESCRIBE, pass the evaluated version as %0 */ ! global_eval_context.wenv[0] = a ? buff : NULL; asave = safe_atr_value(f); ap = asave; fbp = fbuff; *************** *** 1318,1325 **** }; static int ! decompile_helper(dbref player, dbref thing ! __attribute__ ((__unused__)), const char *pattern __attribute__ ((__unused__)), ATTR *atr, void *args) { struct dh_args *dh = args; --- 1315,1323 ---- }; static int ! decompile_helper(dbref player, dbref thing __attribute__ ((__unused__)), ! dbref parent __attribute__ ((__unused__)), ! const char *pattern __attribute__ ((__unused__)), ATTR *atr, void *args) { struct dh_args *dh = args; *************** *** 1391,1405 **** * \param thing object with attributes to decompile. * \param name name to refer to object by in decompile. * \param skipdef if true, skip showing default lock flags. */ void ! decompile_locks(dbref player, dbref thing, const char *name, int skipdef) { lock_list *ll; for (ll = Locks(thing); ll; ll = ll->next) { const lock_list *p = get_lockproto(L_TYPE(ll)); if (p) { ! notify_format(player, "@lock/%s %s=%s", L_TYPE(ll), name, unparse_boolexp(player, L_KEY(ll), UB_MEREF)); if (skipdef) { --- 1389,1405 ---- * \param thing object with attributes to decompile. * \param name name to refer to object by in decompile. * \param skipdef if true, skip showing default lock flags. + * \param prefix The prefix to show before the locks. */ void ! decompile_locks(dbref player, dbref thing, const char *name, ! int skipdef, const char *prefix) { lock_list *ll; for (ll = Locks(thing); ll; ll = ll->next) { const lock_list *p = get_lockproto(L_TYPE(ll)); if (p) { ! notify_format(player, "%s@lock/%s %s=%s", prefix, L_TYPE(ll), name, unparse_boolexp(player, L_KEY(ll), UB_MEREF)); if (skipdef) { *************** *** 1407,1422 **** continue; } if (L_FLAGS(ll)) ! notify_format(player, ! "@lset %s/%s=%s", name, L_TYPE(ll), lock_flags_long(ll)); if ((L_FLAGS(p) & LF_PRIVATE) && !(L_FLAGS(ll) & LF_PRIVATE)) ! notify_format(player, "@lset %s/%s=!no_inherit", name, L_TYPE(ll)); } else { ! notify_format(player, "@lock/user:%s %s=%s", ll->type, name, unparse_boolexp(player, ll->key, UB_MEREF)); if (L_FLAGS(ll)) ! notify_format(player, ! "@lset %s/%s=%s", name, L_TYPE(ll), lock_flags_long(ll)); } } } --- 1407,1423 ---- continue; } if (L_FLAGS(ll)) ! notify_format(player, "%s@lset %s/%s=%s", prefix, name, ! L_TYPE(ll), lock_flags_long(ll)); if ((L_FLAGS(p) & LF_PRIVATE) && !(L_FLAGS(ll) & LF_PRIVATE)) ! notify_format(player, "%s@lset %s/%s=!no_inherit", prefix, ! name, L_TYPE(ll)); } else { ! notify_format(player, "%s@lock/user:%s %s=%s", prefix, ll->type, name, unparse_boolexp(player, ll->key, UB_MEREF)); if (L_FLAGS(ll)) ! notify_format(player, "%s@lset %s/%s=%s", prefix, name, ! L_TYPE(ll), lock_flags_long(ll)); } } } *************** *** 1431,1442 **** * \param skipdef if true, skip showing default flags on attributes/locks. */ void ! do_decompile(dbref player, const char *name, enum dec_type dbflag, int skipdef) { dbref thing; const char *object = NULL; char *attrib; - ATTR *a; char dbnum[40]; /* @decompile must always have an argument */ --- 1432,1443 ---- * \param skipdef if true, skip showing default flags on attributes/locks. */ void ! do_decompile(dbref player, const char *name, const char *prefix, ! enum dec_type dbflag, int skipdef) { dbref thing; const char *object = NULL; char *attrib; char dbnum[40]; /* @decompile must always have an argument */ *************** *** 1463,1482 **** if (attrib && *attrib) { switch (dbflag) { case DEC_DB: ! decompile_atrs(player, thing, dbnum, attrib, "", skipdef); ! break; ! case DEC_TF: ! if (((a = atr_get_noparent(player, "TFPREFIX")) != NULL) && ! AL_STR(a) && *AL_STR(a)) { ! decompile_atrs(player, thing, dbnum, attrib, atr_value(a), skipdef); ! } else ! decompile_atrs(player, thing, dbnum, attrib, "FugueEdit > ", skipdef); break; default: if (IsRoom(thing)) ! decompile_atrs(player, thing, "here", attrib, "", skipdef); else ! decompile_atrs(player, thing, Name(thing), attrib, "", skipdef); break; } return; --- 1464,1476 ---- if (attrib && *attrib) { switch (dbflag) { case DEC_DB: ! decompile_atrs(player, thing, dbnum, attrib, prefix, skipdef); break; default: if (IsRoom(thing)) ! decompile_atrs(player, thing, "here", attrib, prefix, skipdef); else ! decompile_atrs(player, thing, Name(thing), attrib, prefix, skipdef); break; } return; *************** *** 1503,1509 **** } else object = Name(thing); if (dbflag != DEC_ATTR) ! notify_format(player, "@create %s", object); break; case TYPE_ROOM: if (dbflag == DEC_DB) { --- 1497,1503 ---- } else object = Name(thing); if (dbflag != DEC_ATTR) ! notify_format(player, "%s@create %s", prefix, object); break; case TYPE_ROOM: if (dbflag == DEC_DB) { *************** *** 1512,1518 **** } else object = "here"; if (dbflag != DEC_ATTR) ! notify_format(player, "@dig/teleport %s", Name(thing)); break; case TYPE_EXIT: if (dbflag == DEC_DB) { --- 1506,1512 ---- } else object = "here"; if (dbflag != DEC_ATTR) ! notify_format(player, "%s@dig/teleport %s", prefix, Name(thing)); break; case TYPE_EXIT: if (dbflag == DEC_DB) { *************** *** 1520,1526 **** } else { object = shortname(thing); if (dbflag != DEC_ATTR) ! notify_format(player, "@open %s", Name(thing)); } break; } --- 1514,1520 ---- } else { object = shortname(thing); if (dbflag != DEC_ATTR) ! notify_format(player, "%s@open %s", prefix, Name(thing)); } break; } *************** *** 1528,1556 **** if (dbflag != DEC_ATTR) { if (Mobile(thing)) { if (GoodObject(Home(thing))) ! notify_format(player, "@link %s = #%d", object, Home(thing)); else if (Home(thing) == HOME) ! notify_format(player, "@link %s = HOME", object); } else { if (GoodObject(Destination(thing))) ! notify_format(player, "@link %s = #%d", object, Destination(thing)); else if (Destination(thing) == AMBIGUOUS) ! notify_format(player, "@link %s = VARIABLE", object); else if (Destination(thing) == HOME) ! notify_format(player, "@link %s = HOME", object); } if (GoodObject(Zone(thing))) ! notify_format(player, "@chzone %s = #%d", object, Zone(thing)); if (GoodObject(Parent(thing))) ! notify_format(player, "@parent %s=#%d", object, Parent(thing)); ! decompile_locks(player, thing, object, skipdef); ! decompile_flags(player, thing, object); ! decompile_powers(player, thing, object); } if (dbflag != DEC_FLAG) { ! decompile_atrs(player, thing, object, "**", "", skipdef); } } --- 1522,1551 ---- if (dbflag != DEC_ATTR) { if (Mobile(thing)) { if (GoodObject(Home(thing))) ! notify_format(player, "%s@link %s = #%d", prefix, object, Home(thing)); else if (Home(thing) == HOME) ! notify_format(player, "%s@link %s = HOME", prefix, object); } else { if (GoodObject(Destination(thing))) ! notify_format(player, "%s@link %s = #%d", prefix, object, ! Destination(thing)); else if (Destination(thing) == AMBIGUOUS) ! notify_format(player, "%s@link %s = VARIABLE", prefix, object); else if (Destination(thing) == HOME) ! notify_format(player, "%s@link %s = HOME", prefix, object); } if (GoodObject(Zone(thing))) ! notify_format(player, "%s@chzone %s = #%d", prefix, object, Zone(thing)); if (GoodObject(Parent(thing))) ! notify_format(player, "%s@parent %s=#%d", prefix, object, Parent(thing)); ! decompile_locks(player, thing, object, skipdef, prefix); ! decompile_flags(player, thing, object, prefix); ! decompile_powers(player, thing, object, prefix); } if (dbflag != DEC_FLAG) { ! decompile_atrs(player, thing, object, "**", prefix, skipdef); } } *** 1_7_7.1099/src/lock.c Thu, 10 Jun 2004 13:12:03 -0500 dunemush (pennmush/c/6_lock.c 1.17.1.13.1.1.1.1.1.21 660) --- 1_7_7.1145(w)/src/lock.c Wed, 04 Aug 2004 14:45:30 -0500 dunemush (pennmush/c/6_lock.c 1.17.1.13.1.1.1.1.1.22 660) *************** *** 138,144 **** static lock_type check_lock_type(dbref player, dbref thing, lock_type name); static int delete_lock(dbref player, dbref thing, lock_type type); static int can_write_lock(dbref player, dbref thing, lock_list *lock); - static lock_list *getlockstruct(dbref thing, lock_type type); static lock_list *getlockstruct_noparent(dbref thing, lock_type type); /** Number of locks to store in a page, assuming 4096 byte pages */ --- 138,143 ---- *************** *** 159,164 **** --- 158,196 ---- return privs_to_letters(lock_privs, L_FLAGS(ll)); } + /** List all lock flag characters on a buffer + * \param buff The buffer + * \param bp Pointer to a position in the buffer. + */ + + void + list_lock_flags(char *buff, char **bp) + { + int i; + for (i = 0; lock_privs[i].name; i++) { + if (lock_privs[i].letter) + safe_chr(lock_privs[i].letter, buff, bp); + } + } + + /** List all lock flag names on a buffer + * \param buff The buffer + * \param bp Pointer to a position in the buffer. + */ + + void + list_lock_flags_long(char *buff, char **bp) + { + int i; + int first = 1; + for (i = 0; lock_privs[i].name; i++) { + if (!first) + safe_chr(' ', buff, bp); + first = 0; + safe_str(lock_privs[i].name, buff, bp); + } + } + /** Return a list of lock flag names. * \param ll pointer to a lock. * \return string of lock flag names, space-separated. *************** *** 288,294 **** return L_KEY(ll); } ! static lock_list * getlockstruct(dbref thing, lock_type type) { lock_list *ll; --- 320,326 ---- return L_KEY(ll); } ! lock_list * getlockstruct(dbref thing, lock_type type) { lock_list *ll; *** 1_7_7.1099/src/game.c Tue, 08 Jun 2004 12:45:57 -0500 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.7.1.2.2.1.1.23 660) --- 1_7_7.1145(w)/src/game.c Wed, 04 Aug 2004 14:45:30 -0500 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.7.1.2.2.1.1.32 660) *************** *** 86,113 **** #endif /* declarations */ ! int database_loaded = 0; /**< True after the database has been read. */ ! char dumpfile[200]; /**< File name to dump database to */ ! time_t start_time; /**< MUSH start time (since process exec'd) */ ! time_t first_start_time = 0; /**< MUSH start time (since last shutdown) */ ! time_t last_dump_time = 0; /**< Time of last successful db save */ ! int reboot_count = 0; /**< Number of reboots so far */ static int epoch = 0; static int reserved; /**< Reserved file descriptor */ - int depth = 0; /**< excessive recursion prevention */ static dbref *errdblist = NULL; /**< List of dbrefs to return errors from */ static dbref *errdbtail; /**< Pointer to end of errdblist */ static int errdbsize = 4; /**< Current size of errdblist array */ static void errdb_grow(void); - extern dbref cplr; - extern char ccom[]; extern void initialize_mt(void); - int paranoid_dump = 0; /**< if paranoid, scan before dumping */ - int paranoid_checkpt = 0; /**< write out an okay message every x objs */ - extern long indb_flags; extern void conf_default_set(void); static int dump_database_internal(void); static FILE *db_open(const char *filename); --- 86,102 ---- #endif /* declarations */ ! GLOBALTAB globals = { 0, "", 0, 0, 0, 0, 0, 0, 0, 0 }; static int epoch = 0; static int reserved; /**< Reserved file descriptor */ static dbref *errdblist = NULL; /**< List of dbrefs to return errors from */ static dbref *errdbtail; /**< Pointer to end of errdblist */ static int errdbsize = 4; /**< Current size of errdblist array */ static void errdb_grow(void); extern void initialize_mt(void); extern void conf_default_set(void); static int dump_database_internal(void); static FILE *db_open(const char *filename); *************** *** 189,233 **** if (flag != DUMP_NORMAL) { #endif /* want to do a scan before dumping each object */ ! paranoid_dump = 1; if (num && *num) { /* checkpoint interval given */ ! paranoid_checkpt = atoi(num); ! if ((paranoid_checkpt < 1) || (paranoid_checkpt >= db_top)) { notify(player, T("Permission denied. Invalid checkpoint interval.")); ! paranoid_dump = 0; return; } } else { /* use a default interval */ ! paranoid_checkpt = db_top / 5; ! if (paranoid_checkpt < 1) ! paranoid_checkpt = 1; } if (flag == DUMP_PARANOID) { notify_format(player, T("Paranoid dumping, checkpoint interval %d."), ! paranoid_checkpt); do_rawlog(LT_CHECK, "*** PARANOID DUMP *** done by %s(#%d),\n", Name(player), player); } else { notify_format(player, T("Debug dumping, checkpoint interval %d."), ! paranoid_checkpt); do_rawlog(LT_CHECK, "*** DEBUG DUMP *** done by %s(#%d),\n", Name(player), player); } do_rawlog(LT_CHECK, T("\tcheckpoint interval %d, at %s"), ! paranoid_checkpt, show_time(mudtime, 0)); } else { /* normal dump */ ! paranoid_dump = 0; /* just to be safe */ notify(player, "Dumping..."); do_rawlog(LT_CHECK, "** DUMP ** done by %s(#%d) at %s", Name(player), player, show_time(mudtime, 0)); } fork_and_dump(1); ! paranoid_dump = 0; } else { notify(player, T("Sorry, you are in a no dumping zone.")); } --- 178,223 ---- if (flag != DUMP_NORMAL) { #endif /* want to do a scan before dumping each object */ ! globals.paranoid_dump = 1; if (num && *num) { /* checkpoint interval given */ ! globals.paranoid_checkpt = atoi(num); ! if ((globals.paranoid_checkpt < 1) ! || (globals.paranoid_checkpt >= db_top)) { notify(player, T("Permission denied. Invalid checkpoint interval.")); ! globals.paranoid_dump = 0; return; } } else { /* use a default interval */ ! globals.paranoid_checkpt = db_top / 5; ! if (globals.paranoid_checkpt < 1) ! globals.paranoid_checkpt = 1; } if (flag == DUMP_PARANOID) { notify_format(player, T("Paranoid dumping, checkpoint interval %d."), ! globals.paranoid_checkpt); do_rawlog(LT_CHECK, "*** PARANOID DUMP *** done by %s(#%d),\n", Name(player), player); } else { notify_format(player, T("Debug dumping, checkpoint interval %d."), ! globals.paranoid_checkpt); do_rawlog(LT_CHECK, "*** DEBUG DUMP *** done by %s(#%d),\n", Name(player), player); } do_rawlog(LT_CHECK, T("\tcheckpoint interval %d, at %s"), ! globals.paranoid_checkpt, show_time(mudtime, 0)); } else { /* normal dump */ ! globals.paranoid_dump = 0; /* just to be safe */ notify(player, "Dumping..."); do_rawlog(LT_CHECK, "** DUMP ** done by %s(#%d) at %s", Name(player), player, show_time(mudtime, 0)); } fork_and_dump(1); ! globals.paranoid_dump = 0; } else { notify(player, T("Sorry, you are in a no dumping zone.")); } *************** *** 240,250 **** void report(void) { ! if (GoodObject(cplr)) ! do_rawlog(LT_TRACE, T("TRACE: Cmd:%s\tdepth:%d\tby #%d at #%d"), ccom, ! depth, cplr, Location(cplr)); else ! do_rawlog(LT_TRACE, "TRACE: Cmd:%s\tdepth:%d\tby #%d", ccom, depth, cplr); notify_activity(NOTHING, 0, 1); } --- 230,242 ---- void report(void) { ! if (GoodObject(global_eval_context.cplr)) ! do_rawlog(LT_TRACE, T("TRACE: Cmd:%s\tby #%d at #%d"), ! global_eval_context.ccom, global_eval_context.cplr, ! Location(global_eval_context.cplr)); else ! do_rawlog(LT_TRACE, "TRACE: Cmd:%s\tby #%d", global_eval_context.ccom, ! global_eval_context.cplr); notify_activity(NOTHING, 0, 1); } *************** *** 311,320 **** mush_panic("@shutdown/panic"); } else { if (flag == SHUT_PARANOID) { ! paranoid_checkpt = db_top / 5; ! if (paranoid_checkpt < 1) ! paranoid_checkpt = 1; ! paranoid_dump = 1; } shutdown_flag = 1; } --- 303,312 ---- mush_panic("@shutdown/panic"); } else { if (flag == SHUT_PARANOID) { ! globals.paranoid_checkpt = db_top / 5; ! if (globals.paranoid_checkpt < 1) ! globals.paranoid_checkpt = 1; ! globals.paranoid_dump = 1; } shutdown_flag = 1; } *************** *** 355,371 **** local_dump_database(); #ifdef ALWAYS_PARANOID ! paranoid_checkpt = db_top / 5; ! if (paranoid_checkpt < 1) ! paranoid_checkpt = 1; #endif ! sprintf(realdumpfile, "%s%s", dumpfile, options.compresssuff); ! strcpy(tmpfl, make_new_epoch_file(dumpfile, epoch)); sprintf(realtmpfl, "%s%s", tmpfl, options.compresssuff); if ((f = db_open_write(tmpfl)) != NULL) { ! switch (paranoid_dump) { case 0: #ifdef ALWAYS_PARANOID db_paranoid_write(f, 0); --- 347,363 ---- local_dump_database(); #ifdef ALWAYS_PARANOID ! globals.paranoid_checkpt = db_top / 5; ! if (globals.paranoid_checkpt < 1) ! globals.paranoid_checkpt = 1; #endif ! sprintf(realdumpfile, "%s%s", globals.dumpfile, options.compresssuff); ! strcpy(tmpfl, make_new_epoch_file(globals.dumpfile, epoch)); sprintf(realtmpfl, "%s%s", tmpfl, options.compresssuff); if ((f = db_open_write(tmpfl)) != NULL) { ! switch (globals.paranoid_dump) { case 0: #ifdef ALWAYS_PARANOID db_paranoid_write(f, 0); *************** *** 381,391 **** break; } db_close(f); ! #ifdef WIN32 ! /* Win32 systems can't rename over an existing file, so unlink first */ ! unlink(realdumpfile); ! #endif ! if (rename(realtmpfl, realdumpfile) < 0) { perror(realtmpfl); longjmp(db_err, 1); } --- 373,379 ---- break; } db_close(f); ! if (rename_file(realtmpfl, realdumpfile) < 0) { perror(realtmpfl); longjmp(db_err, 1); } *************** *** 400,409 **** if ((f = db_open_write(tmpfl)) != NULL) { dump_mail(f); db_close(f); ! #ifdef WIN32 ! unlink(realdumpfile); ! #endif ! if (rename(realtmpfl, realdumpfile) < 0) { perror(realtmpfl); longjmp(db_err, 1); } --- 388,394 ---- if ((f = db_open_write(tmpfl)) != NULL) { dump_mail(f); db_close(f); ! if (rename_file(realtmpfl, realdumpfile) < 0) { perror(realtmpfl); longjmp(db_err, 1); } *************** *** 418,427 **** if ((f = db_open_write(tmpfl)) != NULL) { save_chatdb(f); db_close(f); ! #ifdef WIN32 ! unlink(realdumpfile); ! #endif ! if (rename(realtmpfl, realdumpfile) < 0) { perror(realtmpfl); longjmp(db_err, 1); } --- 403,409 ---- if ((f = db_open_write(tmpfl)) != NULL) { save_chatdb(f); db_close(f); ! if (rename_file(realtmpfl, realdumpfile) < 0) { perror(realtmpfl); longjmp(db_err, 1); } *************** *** 429,435 **** perror(realtmpfl); longjmp(db_err, 1); } ! time(&last_dump_time); } #endif --- 411,417 ---- perror(realtmpfl); longjmp(db_err, 1); } ! time(&globals.last_dump_time); } #endif *************** *** 476,482 **** emergency_shutdown(); /* dump panic file if we have a database read. */ ! if (database_loaded) { if (setjmp(db_err)) { /* Dump failed. We're in deep doo-doo */ do_rawlog(LT_ERR, T("CANNOT DUMP PANIC DB. OOPS.")); --- 458,464 ---- emergency_shutdown(); /* dump panic file if we have a database read. */ ! if (globals.database_loaded) { if (setjmp(db_err)) { /* Dump failed. We're in deep doo-doo */ do_rawlog(LT_ERR, T("CANNOT DUMP PANIC DB. OOPS.")); *************** *** 537,545 **** { epoch++; ! do_rawlog(LT_ERR, "DUMPING: %s.#%d#", dumpfile, epoch); dump_database_internal(); ! do_rawlog(LT_ERR, "DUMPING: %s.#%d# (done)", dumpfile, epoch); } /** Dump a database, possibly by forking the process. --- 519,527 ---- { epoch++; ! do_rawlog(LT_ERR, "DUMPING: %s.#%d#", globals.dumpfile, epoch); dump_database_internal(); ! do_rawlog(LT_ERR, "DUMPING: %s.#%d# (done)", globals.dumpfile, epoch); } /** Dump a database, possibly by forking the process. *************** *** 561,571 **** chunk_stats(NOTHING, 0); chunk_stats(NOTHING, 1); #endif ! do_rawlog(LT_CHECK, "CHECKPOINTING: %s.#%d#\n", dumpfile, epoch); if (NO_FORK) nofork = 1; else ! nofork = !forking || (paranoid_dump == 2); /* Don't fork for dump/debug */ #ifdef WIN32 nofork = 1; #endif --- 543,553 ---- chunk_stats(NOTHING, 0); chunk_stats(NOTHING, 1); #endif ! do_rawlog(LT_CHECK, "CHECKPOINTING: %s.#%d#\n", globals.dumpfile, epoch); if (NO_FORK) nofork = 1; else ! nofork = !forking || (globals.paranoid_dump == 2); /* Don't fork for dump/debug */ #ifdef WIN32 nofork = 1; #endif *************** *** 674,682 **** * rid of null names. */ for (j = 0; j < 10; j++) ! wnxt[j] = NULL; for (j = 0; j < NUMQ; j++) ! rnxt[j] = NULL; for (thing = 0; thing < db_top; thing++) { if (Name(thing) == NULL) { --- 656,664 ---- * rid of null names. */ for (j = 0; j < 10; j++) ! global_eval_context.wnxt[j] = NULL; for (j = 0; j < NUMQ; j++) ! global_eval_context.rnxt[j] = NULL; for (thing = 0; thing < db_top; thing++) { if (Name(thing) == NULL) { *************** *** 709,730 **** { int a; ! process_command_port = 0; ! depth = 0; for (a = 0; a < 10; a++) { ! wenv[a] = NULL; ! wnxt[a] = NULL; } for (a = 0; a < NUMQ; a++) { ! renv[a][0] = '\0'; ! rnxt[a] = NULL; } /* set MUSH start time */ ! start_time = time((time_t *) 0); ! if (!first_start_time) ! first_start_time = start_time; /* initialize all the hash and prefix tables */ init_flagspaces(); --- 691,714 ---- { int a; ! global_eval_context.process_command_port = 0; ! global_eval_context.break_called = 0; ! global_eval_context.cplr = NOTHING; ! strcpy(global_eval_context.ccom, ""); for (a = 0; a < 10; a++) { ! global_eval_context.wenv[a] = NULL; ! global_eval_context.wnxt[a] = NULL; } for (a = 0; a < NUMQ; a++) { ! global_eval_context.renv[a][0] = '\0'; ! global_eval_context.rnxt[a] = NULL; } /* set MUSH start time */ ! globals.start_time = time((time_t *) 0); ! if (!globals.first_start_time) ! globals.first_start_time = globals.start_time; /* initialize all the hash and prefix tables */ init_flagspaces(); *************** *** 753,759 **** do_rawlog(LT_ERR, "%s", VERSION); do_rawlog(LT_ERR, T("MUSH restarted, PID %d, at %s"), ! (int) getpid(), show_time(start_time, 0)); } /** Post-db-load configuration. --- 737,743 ---- do_rawlog(LT_ERR, "%s", VERSION); do_rawlog(LT_ERR, T("MUSH restarted, PID %d, at %s"), ! (int) getpid(), show_time(globals.start_time, 0)); } /** Post-db-load configuration. *************** *** 814,820 **** infile = restarting ? options.output_db : options.input_db; outfile = options.output_db; mailfile = options.mail_db; ! strcpy(dumpfile, outfile); /* read small text files into cache */ fcache_init(); --- 798,804 ---- infile = restarting ? options.output_db : options.input_db; outfile = options.output_db; mailfile = options.mail_db; ! strcpy(globals.dumpfile, outfile); /* read small text files into cache */ fcache_init(); *************** *** 865,871 **** * format db, with everything shoved together. In that case, * don't close the file */ ! panicdb = ((indb_flags & DBF_PANIC) && !feof(f)); /* everything ok */ if (!panicdb) --- 849,855 ---- * format db, with everything shoved together. In that case, * don't close the file */ ! panicdb = ((globals.indb_flags & DBF_PANIC) && !feof(f)); /* everything ok */ if (!panicdb) *************** *** 1009,1015 **** errdblist = mush_malloc(errdbsize * sizeof(dbref), "errdblist"); errdbtail = errdblist; errdb = NOTHING; - depth = 0; if (!command) { do_log(LT_ERR, NOTHING, NOTHING, T("ERROR: No command!!!")); return; --- 993,998 ---- *************** *** 1078,1084 **** if (Fixed(player)) notify(player, T("You can't do that IC!")); else ! do_move(player, command, 0); return; } strcpy(unp, command); --- 1061,1067 ---- if (Fixed(player)) notify(player, T("You can't do that IC!")); else ! do_move(player, command, MOVE_NORMAL); return; } strcpy(unp, command); *************** *** 1131,1137 **** if (!Mobile(player)) goto done; else { ! do_move(player, cptr, 2); goto done; } } else --- 1114,1120 ---- if (!Mobile(player)) goto done; else { ! do_move(player, cptr, MOVE_ZONE); goto done; } } else *************** *** 1163,1169 **** if (!Mobile(player)) goto done; else { ! do_move(player, cptr, 1); goto done; } } else --- 1146,1152 ---- if (!Mobile(player)) goto done; else { ! do_move(player, cptr, MOVE_GLOBAL); goto done; } } else *************** *** 1178,1189 **** /* Do we have any error dbs queued up, and if so, do any * have associated failure messages? */ ! if ((errdblist == errdbtail) || (!fail_commands(player))) { ! /* Nope. This is totally unmatched */ ! notify(player, T("Huh? (Type \"help\" for help.)")); ! if (options.log_huhs) ! do_log(LT_HUH, player, 0, "%s", unp); ! } } } --- 1161,1169 ---- /* Do we have any error dbs queued up, and if so, do any * have associated failure messages? */ ! if ((errdblist == errdbtail) || (!fail_commands(player))) ! /* Nope. This is totally unmatched, run generic failure */ ! generic_command_failure(player, cause, unp); } } *************** *** 1620,1627 **** notify(player, T("What command do you want to scan for?")); return; } ! strcpy(save_ccom, ccom); ! memmove(ccom, (char *) ccom + 5, BUFFER_LEN - 5); if (flag & CHECK_NEIGHBORS) { notify(player, T("Matches on contents of this room:")); DOLIST(thing, Contents(Location(player))) { --- 1600,1608 ---- notify(player, T("What command do you want to scan for?")); return; } ! strcpy(save_ccom, global_eval_context.ccom); ! memmove(global_eval_context.ccom, (char *) global_eval_context.ccom + 5, ! BUFFER_LEN - 5); if (flag & CHECK_NEIGHBORS) { notify(player, T("Matches on contents of this room:")); DOLIST(thing, Contents(Location(player))) { *************** *** 1729,1735 **** } } } ! strcpy(ccom, save_ccom); } #define DOL_MAP 1 /**< The map command */ --- 1710,1716 ---- } } } ! strcpy(global_eval_context.ccom, save_ccom); } #define DOL_MAP 1 /**< The map command */ *************** *** 1776,1784 **** /* set up environment for any spawned commands */ for (j = 0; j < 10; j++) ! wnxt[j] = wenv[j]; for (j = 0; j < NUMQ; j++) ! rnxt[j] = renv[j]; bp = outbuf; if (flags & DOL_DELIM) list += 2; --- 1757,1765 ---- /* set up environment for any spawned commands */ for (j = 0; j < 10; j++) ! global_eval_context.wnxt[j] = global_eval_context.wenv[j]; for (j = 0; j < NUMQ; j++) ! global_eval_context.rnxt[j] = global_eval_context.renv[j]; bp = outbuf; if (flags & DOL_DELIM) list += 2; *************** *** 2051,2072 **** char tbuf1[BUFFER_LEN]; struct tm *when; ! when = localtime(&first_start_time); strftime(tbuf1, sizeof tbuf1, T(" Up since %a %b %d %X %Z %Y"), when); notify(player, tbuf1); ! when = localtime(&start_time); strftime(tbuf1, sizeof tbuf1, T(" Last reboot: %a %b %d %X %Z %Y"), when); notify(player, tbuf1); ! notify_format(player, T("Total reboots: %d"), reboot_count); when = localtime(&mudtime); strftime(tbuf1, sizeof tbuf1, T(" Time now: %a %b %d %X %Z %Y"), when); notify(player, tbuf1); ! if (last_dump_time > 0) { ! when = localtime(&last_dump_time); strftime(tbuf1, sizeof tbuf1, T(" Time of last database save: %a %b %d %X %Z %Y"), when); notify(player, tbuf1); --- 2032,2053 ---- char tbuf1[BUFFER_LEN]; struct tm *when; ! when = localtime(&globals.first_start_time); strftime(tbuf1, sizeof tbuf1, T(" Up since %a %b %d %X %Z %Y"), when); notify(player, tbuf1); ! when = localtime(&globals.start_time); strftime(tbuf1, sizeof tbuf1, T(" Last reboot: %a %b %d %X %Z %Y"), when); notify(player, tbuf1); ! notify_format(player, T("Total reboots: %d"), globals.reboot_count); when = localtime(&mudtime); strftime(tbuf1, sizeof tbuf1, T(" Time now: %a %b %d %X %Z %Y"), when); notify(player, tbuf1); ! if (globals.last_dump_time > 0) { ! when = localtime(&globals.last_dump_time); strftime(tbuf1, sizeof tbuf1, T(" Time of last database save: %a %b %d %X %Z %Y"), when); notify(player, tbuf1); *************** *** 2236,2242 **** else if (string_prefix("functions", arg)) do_list_functions(player, lc); else if (string_prefix("motd", arg)) ! do_motd(player, 3, ""); else if (string_prefix("attribs", arg)) do_list_attribs(player, lc); else --- 2217,2223 ---- else if (string_prefix("functions", arg)) do_list_functions(player, lc); else if (string_prefix("motd", arg)) ! do_motd(player, MOTD_LIST, ""); else if (string_prefix("attribs", arg)) do_list_attribs(player, lc); else *** 1_7_7.1099/src/funufun.c Sun, 02 May 2004 16:46:16 -0500 dunemush (pennmush/c/11_funufun.c 1.21 660) --- 1_7_7.1145(w)/src/funufun.c Wed, 04 Aug 2004 14:45:30 -0500 dunemush (pennmush/c/11_funufun.c 1.22 660) *************** *** 113,127 **** /* save our stack */ for (j = 0; j < 10; j++) ! tptr[j] = wenv[j]; /* copy the appropriate args into the stack */ if (nargs > 10) nargs = 10; /* maximum ten args */ for (j = 0; j < nargs; j++) ! wenv[j] = args[j]; for (; j < 10; j++) ! wenv[j] = NULL; tp = tbuf = safe_atr_value(attrib); if (attrib->flags & AF_DEBUG) --- 113,127 ---- /* save our stack */ for (j = 0; j < 10; j++) ! tptr[j] = global_eval_context.wenv[j]; /* copy the appropriate args into the stack */ if (nargs > 10) nargs = 10; /* maximum ten args */ for (j = 0; j < nargs; j++) ! global_eval_context.wenv[j] = args[j]; for (; j < 10; j++) ! global_eval_context.wenv[j] = NULL; tp = tbuf = safe_atr_value(attrib); if (attrib->flags & AF_DEBUG) *************** *** 132,138 **** /* restore the stack */ for (j = 0; j < 10; j++) ! wenv[j] = tptr[j]; } /* ARGSUSED */ --- 132,138 ---- /* restore the stack */ for (j = 0; j < 10; j++) ! global_eval_context.wenv[j] = tptr[j]; } /* ARGSUSED */ *** 1_7_7.1099/src/funtime.c Fri, 14 May 2004 16:43:06 -0500 dunemush (pennmush/c/12_funtime.c 1.11.1.14.1.1.1.8 660) --- 1_7_7.1145(w)/src/funtime.c Wed, 04 Aug 2004 14:45:30 -0500 dunemush (pennmush/c/12_funtime.c 1.11.1.14.1.1.1.9 660) *************** *** 10,16 **** #include "config.h" #include #include ! #if defined(__GNUC__) || defined(__LCC__) /* Required to get the getdate() prototype on glibc. */ #define __USE_XOPEN_EXTENDED #endif --- 10,16 ---- #include "config.h" #include #include ! #if (defined(__GNUC__) || defined(__LCC__)) && !defined(__USE_XOPEN_EXTENDED) /* Required to get the getdate() prototype on glibc. */ #define __USE_XOPEN_EXTENDED #endif *** 1_7_7.1099/src/funstr.c Sun, 06 Jun 2004 20:04:25 -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.14.1.17 660) --- 1_7_7.1145(w)/src/funstr.c Wed, 04 Aug 2004 14:45:30 -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.14.1.19 660) *************** *** 481,487 **** memcpy(left, l, llen); r = remove_markup(args[1], &rlen); memcpy(right, r, rlen); ! safe_integer(gencomp(left, right, ALPHANUM_LIST), buff, bp); return; } case 'I': /* Case-insensitive lexicographic */ --- 481,487 ---- memcpy(left, l, llen); r = remove_markup(args[1], &rlen); memcpy(right, r, rlen); ! safe_integer(gencomp(executor, left, right, ALPHANUM_LIST), buff, bp); return; } case 'I': /* Case-insensitive lexicographic */ *************** *** 492,498 **** memcpy(left, l, llen); r = remove_markup(args[1], &rlen); memcpy(right, r, rlen); ! safe_integer(gencomp(left, right, INSENS_ALPHANUM_LIST), buff, bp); return; } case 'N': /* Integers */ --- 492,499 ---- memcpy(left, l, llen); r = remove_markup(args[1], &rlen); memcpy(right, r, rlen); ! safe_integer(gencomp(executor, left, right, INSENS_ALPHANUM_LIST), buff, ! bp); return; } case 'N': /* Integers */ *************** *** 500,513 **** safe_str(T(e_ints), buff, bp); return; } ! safe_integer(gencomp(args[0], args[1], NUMERIC_LIST), buff, bp); return; case 'F': if (!is_strict_number(args[0]) || !is_strict_number(args[1])) { safe_str(T(e_nums), buff, bp); return; } ! safe_integer(gencomp(args[0], args[1], FLOAT_LIST), buff, bp); return; case 'D': { --- 501,514 ---- safe_str(T(e_ints), buff, bp); return; } ! safe_integer(gencomp(executor, args[0], args[1], NUMERIC_LIST), buff, bp); return; case 'F': if (!is_strict_number(args[0]) || !is_strict_number(args[1])) { safe_str(T(e_nums), buff, bp); return; } ! safe_integer(gencomp(executor, args[0], args[1], FLOAT_LIST), buff, bp); return; case 'D': { *************** *** 518,524 **** safe_str(T("#-1 INVALID DBREF"), buff, bp); return; } ! safe_integer(gencomp(args[0], args[1], DBREF_LIST), buff, bp); return; } default: --- 519,525 ---- safe_str(T("#-1 INVALID DBREF"), buff, bp); return; } ! safe_integer(gencomp(executor, args[0], args[1], DBREF_LIST), buff, bp); return; } default: *************** *** 991,999 **** asave = safe_atr_value(attrib); /* save our stack */ ! tptr[0] = wenv[0]; ! tptr[1] = wenv[1]; ! wenv[1] = place; ap = remove_markup(args[1], &len); memcpy(letters, ap, len); --- 992,1000 ---- asave = safe_atr_value(attrib); /* save our stack */ ! tptr[0] = global_eval_context.wenv[0]; ! tptr[1] = global_eval_context.wenv[1]; ! global_eval_context.wenv[1] = place; ap = remove_markup(args[1], &len); memcpy(letters, ap, len); *************** *** 1006,1012 **** safe_str(lp, buff, bp); free((Malloc_t) asave); free_anon_attrib(attrib); ! wenv[1] = tptr[1]; return; } oldbp = place; --- 1007,1013 ---- safe_str(lp, buff, bp); free((Malloc_t) asave); free_anon_attrib(attrib); ! global_eval_context.wenv[1] = tptr[1]; return; } oldbp = place; *************** *** 1020,1026 **** } cbuf[1] = '\0'; ! wenv[0] = cbuf; oldbp = *bp; funccount = pe_info->fun_invocations; while (*lp && *lp != end) { --- 1021,1027 ---- } cbuf[1] = '\0'; ! global_eval_context.wenv[0] = cbuf; oldbp = *bp; funccount = pe_info->fun_invocations; while (*lp && *lp != end) { *************** *** 1041,1048 **** safe_str(lp + 1, buff, bp); free((Malloc_t) asave); free_anon_attrib(attrib); ! wenv[0] = tptr[0]; ! wenv[1] = tptr[1]; } extern char escaped_chars[UCHAR_MAX + 1]; --- 1042,1049 ---- safe_str(lp + 1, buff, bp); free((Malloc_t) asave); free_anon_attrib(attrib); ! global_eval_context.wenv[0] = tptr[0]; ! global_eval_context.wenv[1] = tptr[1]; } extern char escaped_chars[UCHAR_MAX + 1]; *** 1_7_7.1099/src/funmisc.c Mon, 07 Jun 2004 15:14:35 -0500 dunemush (pennmush/c/14_funmisc.c 1.30.1.1.1.38 660) --- 1_7_7.1145(w)/src/funmisc.c Wed, 04 Aug 2004 14:45:30 -0500 dunemush (pennmush/c/14_funmisc.c 1.30.1.1.1.41 660) *************** *** 31,40 **** #pragma warning( disable : 4761) /* NJG: disable warning re conversion */ #endif - extern time_t start_time, first_start_time; - extern int reboot_count; extern FUN flist[]; - extern char ccom[BUFFER_LEN]; static char *soundex(char *str); extern char cf_motd_msg[BUFFER_LEN], cf_wizmotd_msg[BUFFER_LEN], cf_downmotd_msg[BUFFER_LEN], cf_fullmotd_msg[BUFFER_LEN]; --- 31,37 ---- *************** *** 162,169 **** if (*args[0] && (*(args[0] + 1) == '\0') && ((qindex = qreg_indexes[(unsigned char) args[0][0]]) != -1) ! && renv[qindex]) { ! strcpy(renv[qindex], args[1]); if (!strcmp(called_as, "SETR")) safe_strl(args[1], arglens[1], buff, bp); } else --- 159,166 ---- if (*args[0] && (*(args[0] + 1) == '\0') && ((qindex = qreg_indexes[(unsigned char) args[0][0]]) != -1) ! && global_eval_context.renv[qindex]) { ! strcpy(global_eval_context.renv[qindex], args[1]); if (!strcmp(called_as, "SETR")) safe_strl(args[1], arglens[1], buff, bp); } else *************** *** 178,185 **** if (*args[0] && (*(args[0] + 1) == '\0') && ((qindex = qreg_indexes[(unsigned char) args[0][0]]) != -1) ! && renv[qindex]) ! safe_str(renv[qindex], buff, bp); else safe_str(T("#-1 REGISTER OUT OF RANGE"), buff, bp); } --- 175,182 ---- if (*args[0] && (*(args[0] + 1) == '\0') && ((qindex = qreg_indexes[(unsigned char) args[0][0]]) != -1) ! && global_eval_context.renv[qindex]) ! safe_str(global_eval_context.renv[qindex], buff, bp); else safe_str(T("#-1 REGISTER OUT OF RANGE"), buff, bp); } *************** *** 428,446 **** /* ARGSUSED */ FUNCTION(fun_starttime) { ! safe_str(show_time(first_start_time, 0), buff, bp); } /* ARGSUSED */ FUNCTION(fun_restarttime) { ! safe_str(show_time(start_time, 0), buff, bp); } /* ARGSUSED */ FUNCTION(fun_restarts) { ! safe_integer(reboot_count, buff, bp); } /* Data for soundex functions */ --- 425,443 ---- /* ARGSUSED */ FUNCTION(fun_starttime) { ! safe_str(show_time(globals.first_start_time, 0), buff, bp); } /* ARGSUSED */ FUNCTION(fun_restarttime) { ! safe_str(show_time(globals.start_time, 0), buff, bp); } /* ARGSUSED */ FUNCTION(fun_restarts) { ! safe_integer(globals.reboot_count, buff, bp); } /* Data for soundex functions */ *************** *** 452,459 **** /* The actual soundex routine */ static char * ! soundex(str) ! char *str; { static char tbuf1[BUFFER_LEN]; char *p, *q; --- 449,455 ---- /* The actual soundex routine */ static char * ! soundex(char *str) { static char tbuf1[BUFFER_LEN]; char *p, *q; *************** *** 609,619 **** } cmdptr = args[1]; } ! strcpy(save_ccom, ccom); ! strncpy(ccom, cmdptr, BUFFER_LEN); ! ccom[BUFFER_LEN - 1] = '\0'; safe_str(scan_list(thing, cmdptr), buff, bp); ! strcpy(ccom, save_ccom); } --- 605,615 ---- } cmdptr = args[1]; } ! strcpy(save_ccom, global_eval_context.ccom); ! strncpy(global_eval_context.ccom, cmdptr, BUFFER_LEN); ! global_eval_context.ccom[BUFFER_LEN - 1] = '\0'; safe_str(scan_list(thing, cmdptr), buff, bp); ! strcpy(global_eval_context.ccom, save_ccom); } *** 1_7_7.1099/src/funlist.c Sat, 08 May 2004 17:45:24 -0500 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.7.1.5 660) --- 1_7_7.1145(w)/src/funlist.c Wed, 04 Aug 2004 14:45:30 -0500 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.7.1.17 660) *************** *** 28,43 **** #define MAX_SORTSIZE (BUFFER_LEN / 2) /**< Maximum number of elements to sort */ static char *next_token(char *str, char sep); ! static list_type autodetect_list(char **ptrs, int nptrs); ! static list_type get_list_type(char **args, int nargs, ! int type_pos, char **ptrs, int nptrs); ! static list_type get_list_type_noauto(char **args, int nargs, int type_pos); ! static int a_comp(const void *s1, const void *s2); ! static int ai_comp(const void *s1, const void *s2); int i_comp(const void *s1, const void *s2); static int f_comp(const void *s1, const void *s2); static int u_comp(const void *s1, const void *s2); ! static int regrep_helper(dbref who, dbref what, char const *name, ATTR *atr, void *args); /** Type definition for a qsort comparison function */ typedef int (*comp_func) (const void *, const void *); --- 28,41 ---- #define MAX_SORTSIZE (BUFFER_LEN / 2) /**< Maximum number of elements to sort */ static char *next_token(char *str, char sep); ! static char *autodetect_list(char **ptrs, int nptrs); ! static char *get_list_type(char **args, int nargs, ! int type_pos, char **ptrs, int nptrs); ! static char *get_list_type_noauto(char **args, int nargs, int type_pos); int i_comp(const void *s1, const void *s2); static int f_comp(const void *s1, const void *s2); static int u_comp(const void *s1, const void *s2); ! static int regrep_helper(dbref who, dbref what, dbref parent, char const *name, ATTR *atr, void *args); /** Type definition for a qsort comparison function */ typedef int (*comp_func) (const void *, const void *); *************** *** 81,93 **** int list2arr(char *r[], int max, char *list, char sep) { ! char *p; int i; ! list = trim_space_sep(list, sep); ! p = split_token(&list, sep); ! for (i = 0; p