This is patch02 to PennMUSH 1.8.1. After applying this patch, you will have version 1.8.1p2 To apply this patch, save it to a file in your top-level MUSH directory, and do the following: patch -p1 < 1.8.1-patch02 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: Commands: * @edit/check shows the results of an @edit without actually doing it, to avoid inadvertent overediting. Patch by Walker@M*U*S*H. Functions: * sortkey() sorts a list by mapping each list element through a function and applying a standard sort type. Patch by Walker@M*U*S*H. Minor changes: * "% " (percent-space) is now parsed to a literal percent-space, making it easier to type things like "I'm 50% happy". And % at end of line is parsed to a literal %. Patch by Sketch@M*U*S*H. * @nameformat now receives the default-formatted name as %1 so you can edit from that if you prefer. Suggested by Talvo@M*U*S*H. * Added netbsd hints. Suggested by Tyr@M*U*S*H. * hastype() can take a list of types to check for, not just one. [SW] * Add @function/preserve, which does the same thing as the localize restriction. [MUX] [SW] * Leaving out the argument to align() defaults it to a space. Suggested by Tyr@M*U*S*H, patch by Walker@M*U*S*H. * Improved error message for setq() with odd arguments. Report by Malix@8bit. * When variable exits fail due to invalid/not permitted destination, the enactor is told what the attempted destination was. Suggested by Nathan Baum. * Rooms may now @search/search() their owners. Suggested by Kali@M*U*S*H. Fixes: * @function/restrict mentioned in help. [SW] * Clearer help on parallel setq. Suggested by Trinsec@M*U*S*H. [TAP] * lsearch() didn't refund pennies when it failed because of lack of permissions or invalid search criteria. Reported by Nathan Baum. [SW] * lsearch() could return garbage objects. Report by Nathan Baum. [SW] * %+ now only records argument count from last ufun, not from other (builtin) functions. Report by Cheetah@M*U*S*H. * Some linting of float comparisons. Report by Cheetah@M*U*S*H. * page = now pages the player with a blank line instead of repaging the last paged player with "". Report by Cheetah@M*U*S*H. Prereq: 1.8.1p1 *** 1_8_1.113/Patchlevel Mon, 27 Jun 2005 14:30:26 -0500 dunemush (pennmush/5_Patchlevel 1.17.1.11.1.45 600) --- 1_8_1.148(w)/Patchlevel Mon, 05 Sep 2005 08:47:33 -0500 dunemush (pennmush/5_Patchlevel 1.17.1.11.1.46 600) *************** *** 1,2 **** Do not edit this file. It is maintained by the official PennMUSH patches. ! This is PennMUSH 1.8.1p1 --- 1,2 ---- Do not edit this file. It is maintained by the official PennMUSH patches. ! This is PennMUSH 1.8.1p2 *** 1_8_1.113/game/txt/hlp/penntop.hlp Wed, 01 Jun 2005 16:30:19 -0500 dunemush (pennmush/13_penntop.hl 1.2.1.27.1.3.1.2.1.2.1.1.1.1.1.1.1.1.1.12.1.1.1.1.1.8.1.11.1.1.1.3.2.2 600) --- 1_8_1.148(w)/game/txt/hlp/penntop.hlp Sat, 27 Aug 2005 12:06:35 -0500 dunemush (pennmush/13_penntop.hl 1.2.1.27.1.3.1.2.1.2.1.1.1.1.1.1.1.1.1.12.1.1.1.1.1.8.1.11.1.1.1.3.2.1.1.1.1.1.1.3 600) *************** *** 1185,1191 **** string from left to right. Most characters stand for themselves in a pattern, and match the corresponding characters in the subject. ! There are two different sets of meta-characters: those that are recognized anywhere in the pattern except within square brackets, and those that are recognized in square brackets. Outside square brackets, the meta-characters are as follows: --- 1185,1191 ---- string from left to right. Most characters stand for themselves in a pattern, and match the corresponding characters in the subject. ! There are two different sets of meta-characters: those that are recognized anywhere in the pattern except within square brackets, and those that are recognized in square brackets. Outside square brackets, the meta-characters are as follows: *************** *** 1230,1236 **** (Cont'd in help regexp syntax4) & regexp syntax4 ! A backlash can also two useful assertions -- conditions that must be met at a particular point in a match: \b word boundary --- 1230,1236 ---- (Cont'd in help regexp syntax4) & regexp syntax4 ! A backlash can also be used for two useful assertions -- conditions that must be met at a particular point in a match: \b word boundary *************** *** 1516,1534 **** Standard attributes are set using @ = Nonstandard attributes are set using & = Attributes may also be set using @set =: Attributes are cleared using @ or & ! or with @wipe. ! Note that there is a difference between clearing an attribute ! and setting an attribute to a null value: @va me <--- wipes out my VA attribute @va me= <--- sets my VA attribute to be empty Empty attributes retain their flags and atrlock status. Wiped attributes are gone forever. ! See also ATTRIBUTES, NON-STANDARD ATTRIBUTES, @set, @wipe & SPOOFING Spoofing is the act of making other characters think that a person said or did something that they did not. This is very easy to --- 1516,1537 ---- Standard attributes are set using @ = Nonstandard attributes are set using & = Attributes may also be set using @set =: + or the attrib_set() or set() functions. Attributes are cleared using @ or & ! or with @wipe or wipe(). ! Note that if the empty_attrs configuration option is set ! (@config empty_attrs to check), there is a difference between ! clearing an attribute and setting an attribute to a null value: @va me <--- wipes out my VA attribute @va me= <--- sets my VA attribute to be empty Empty attributes retain their flags and atrlock status. Wiped attributes are gone forever. ! See also ATTRIBUTES, NON-STANDARD ATTRIBUTES, @set, @wipe, attrib_set(), ! set(), wipe() & SPOOFING Spoofing is the act of making other characters think that a person said or did something that they did not. This is very easy to *************** *** 1600,1606 **** %L = the dbref of the ENACTOR's location. %c = text of the last command, _before_ evaluation. %? = The current function invocation and depth counts. ! %+ = The number of arguments passed to the current function. %qN = the equivalent of r(N), a register set by a setq() function. (continued in help substitutions4) --- 1603,1609 ---- %L = the dbref of the ENACTOR's location. %c = text of the last command, _before_ evaluation. %? = The current function invocation and depth counts. ! %+ = The number of arguments passed to the current ufun. %qN = the equivalent of r(N), a register set by a setq() function. (continued in help substitutions4) *** 1_8_1.113/game/txt/hlp/pennfunc.hlp Thu, 02 Jun 2005 17:07:40 -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.26.1.1.1.2 600) --- 1_8_1.148(w)/game/txt/hlp/pennfunc.hlp Sat, 27 Aug 2005 13:34:39 -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.26.1.1.1.1.1.1.1.5 600) *************** *** 146,153 **** iter() last() ldelete() map() match() matchall() member() mix() munge() remove() replace() rest() revwords() setdiff() setinter() ! setunion() shuffle() sort() sortby() splice() ! step() table() wordpos() words() See also: LISTS & Math functions --- 146,153 ---- iter() last() ldelete() map() match() matchall() member() mix() munge() remove() replace() rest() revwords() setdiff() setinter() ! setunion() shuffle() sort() sortby() sortkey() ! splice() step() table() wordpos() words() See also: LISTS & Math functions *************** *** 1549,1558 **** You may or may not have to be able to examine the object to use this. & HASTYPE() ! hastype(, ) Returns 1 if the object is of the named type, otherwise 0. ! Valid types are: ROOM, EXIT, PLAYER, THING, GARBAGE. If an invalid type is given, #-1 NO SUCH TYPE is returned. & HIDDEN() hidden() --- 1549,1560 ---- You may or may not have to be able to examine the object to use this. & HASTYPE() ! hastype(, ) Returns 1 if the object is of the named type, otherwise 0. ! Valid types are: ROOM, EXIT, PLAYER, THING, GARBAGE. You can ! test to see if the object is one of a number of types by using a space- ! separated list of types. If an invalid type is given, #-1 NO SUCH TYPE is returned. & HIDDEN() hidden() *************** *** 2279,2287 **** & LVTHINGS() lvthings() ! This function returns the dbrefs of all connected and non-dark things ! inside an object. You must be in the object or control it to use this ! function. & LWHO() lwho() lwho() --- 2281,2288 ---- & LVTHINGS() lvthings() ! This function returns the dbrefs of all non-dark things inside an ! object. You must be in the object or control it to use this function. & LWHO() lwho() lwho() *************** *** 2842,2851 **** & PMATCH() pmatch() ! Given the partial name of a player, it returns that player's dbref number. This partial name completion works similarly to the partial name completion of the "page" command - i.e. it first attempts to match ! the normal names of all players (connected or not), and if that fails, it tries to match the partial names of connected players visible to the enactor. If no player is matched, it returns "#-1". If more than one match is possible for a partial name, it returns "#-2". --- 2843,2852 ---- & PMATCH() pmatch() ! Given the partial name of a connected player, returns that player's dbref number. This partial name completion works similarly to the partial name completion of the "page" command - i.e. it first attempts to match ! the full names of all players (connected or not), and if that fails, it tries to match the partial names of connected players visible to the enactor. If no player is matched, it returns "#-1". If more than one match is possible for a partial name, it returns "#-2". *************** *** 3240,3246 **** function. setr() returns the value stored. Multiple registers can be assigned with a single setq() or setr(), with additional pairs of registers and values in the function's arguments. In this case, ! setr() returns the value stored in the first register listed. There are thirty-six local registers, numbered 0 through 9 and A through Z. They are cleared at the start of each new queue cycle --- 3241,3250 ---- function. setr() returns the value stored. Multiple registers can be assigned with a single setq() or setr(), with additional pairs of registers and values in the function's arguments. In this case, ! setr() returns the value stored in the first register listed. All ! arguments are evaluated before any registers are set; if you want ! to use the result of setting one register in setting another, use ! multiple setq()s. There are thirty-six local registers, numbered 0 through 9 and A through Z. They are cleared at the start of each new queue cycle *************** *** 3258,3275 **** The setq() function is probably best used at the start of the string being manipulated, such as in the following example: ! &TEST object=[strlen(%0)] &CMD object=$test ! *:"[setq(0,u(TEST,%0))]Test. %0 has length [r(0)]. test Foo > ! Object says, "Test. Foo has length 3." In this case, it is a waste to use setq(), since we only use the function result once, but if TEST was a complex function being used multiple times within the same command, it would be much more efficient to use the local register, since TEST would then only be evaluated once. - setq() can thus be used to improve the readability of MUSH code, as well as to cut down the amount of time needed to do complex evaluations. See "help SETQ3" for scoping rules of setq(). & SETQ3 --- 3262,3286 ---- The setq() function is probably best used at the start of the string being manipulated, such as in the following example: ! &TEST object=[strlen(%0)] ! &CMD object=$test *:"[setq(0,u(TEST,%0))]Test. %0 has length %q0. ! test Foo ! > Object says, "Test. Foo has length 3." In this case, it is a waste to use setq(), since we only use the function result once, but if TEST was a complex function being used multiple times within the same command, it would be much more efficient to use the local register, since TEST would then only be evaluated once. setq() can thus be used to improve the readability of MUSH code, as well as to cut down the amount of time needed to do complex evaluations. + Swapping the contents of registers can be done without writing to + temporary registers by setting both registers at once, so the code: + + think setq(0,foo,1,bar)%q0%q1 - [setq(0,%q1,1,%q0)]%q0%q1 + + yields "foobar - barfoo". + See "help SETQ3" for scoping rules of setq(). & SETQ3 *************** *** 3284,3290 **** produces the following when executed by an object: ! Object says "foo" Object says "bar" Object says "foo" & SETUNION() setunion(, [, ][, ][, ]) --- 3295,3303 ---- produces the following when executed by an object: ! Object says "foo" ! Object says "bar" ! Object says "foo" & SETUNION() setunion(, [, ][, ][, ]) *************** *** 3377,3383 **** this limit is exceeded, the function will fail _silently_. List and 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: --- 3390,3417 ---- this limit is exceeded, the function will fail _silently_. List and function sizes should be kept reasonable. ! See also: anonymous attributes, sorting ! & SORTKEY() ! sortkey([/],[,[,[,]]]) ! ! This function creates a list of keys by passing every element of ! into the u-function given in . The list is then sorted according ! to the sorting method in , or is automatically guessed. ! (As per 'help sorting') ! ! This is equivalent to: ! > &munge_sort me=sort(%0,) ! > munge(munge_sort,map(,),) ! ! Only there is no risk with delimiters ocurring within the list. ! ! A simple example, which sorts players by their names: ! > @@ #1 is "God", #2 is "Amby", "#3" is "Bob" ! > &KEY_NAME me=name(%0) ! > say sortkey(key_name,#1 #2 #3) ! You say, "#2 #3 #1" ! ! See also: anonymous attributes, sorting & SORTING In functions where you can specify a sorting method, you can provide one of these sort types: *************** *** 3404,3410 **** 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() --- 3438,3444 ---- Whether or not the 'a' sort type is case-sensitive or not depends on the particular mush and its environment. ! See also: sort(), sortby(), sortkey(), setunion(), setinter(), setdiff() & SOUNDEX() soundex() *************** *** 3495,3501 **** be careful to escape them with sqlescape(), like this: &SEL_GETID obj = SELECT id FROM mytable WHERE name = '[sqlescape(%0)]' ! &DOIT obj = $do *: ... [setq(0,u(SEL_GETID,%0))] ... See also: sqlescape(), @sql --- 3529,3535 ---- be careful to escape them with sqlescape(), like this: &SEL_GETID obj = SELECT id FROM mytable WHERE name = '[sqlescape(%0)]' ! &DOIT obj = $do *: ... [setq(0,sql(u(SEL_GETID,%0),~,|))] ... See also: sqlescape(), @sql *** 1_8_1.113/game/txt/hlp/penncmd.hlp Sun, 20 Mar 2005 14:08:15 -0600 dunemush (pennmush/18_penncmd.hl 1.2.1.1.1.47.1.1.1.1.1.3.1.4.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.2.1.10.1.1.1.1.1.1.1.1.1.1.1.47.1.4 600) --- 1_8_1.148(w)/game/txt/hlp/penncmd.hlp Sat, 27 Aug 2005 13:35:32 -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.47.1.1.1.2 600) *************** *** 622,627 **** --- 622,630 ---- are parsed by default, but you can call foo/noeval. Note: the $-command needs to make allowances for the /noeval switch in it's matching. + Commands added with @command/add, like other standard commands, + are never case-sensitive (regardless of CASE flag on the attribute). + (examples in help @command3) & @command3 Examples: *************** *** 739,750 **** Customizes the usual display of the object's name to people who are inside it and 'look'. It is evaluated as if it were a description ! or similar message on the room. The room's dbref is passed as %0. @nameformat is not used when people outside the object look at it. Example: Show the room's zone after its name. ! @nameformat here = [name(%0)] [if(isdbref(zone(%0)),<[name(zone(%0))]>)] See also: @exitformat, @conformat, @descformat & @cost --- 742,754 ---- Customizes the usual display of the object's name to people who are inside it and 'look'. It is evaluated as if it were a description ! or similar message on the room. The room's dbref is passed as %0, ! and the default-formatted name as %1. @nameformat is not used when people outside the object look at it. Example: Show the room's zone after its name. ! @nameformat here = %1 [if(isdbref(zone(%0)),<[name(zone(%0))]>)] See also: @exitformat, @conformat, @descformat & @cost *************** *** 1079,1087 **** i.e. sit down;sit;sit on chair & @edit & @gedit ! @edit[/first] / = , ! @edit / = $, ! @edit / = ^, This is useful when you don't want to have to retype those obnoxiously long descriptions just to make one little change. Instead, search and --- 1083,1091 ---- i.e. sit down;sit;sit on chair & @edit & @gedit ! @edit[/first][/check] / = , ! @edit[/check] / = $, ! @edit[/check] / = ^, This is useful when you don't want to have to retype those obnoxiously long descriptions just to make one little change. Instead, search and *************** *** 1097,1102 **** --- 1101,1110 ---- If the /first switch is used, only the first occurrence of is replaced. + + If the /check switch is used, the editing is not actually done, but the + results are shown to you (with changes hilighted) as if a normal @edit + was performed. See also ATTRIBUTES, edit() & @efail *************** *** 1472,1480 **** & @function @function [] ! @function =,[,, [,]] or @function =/ @function/ When used without any arguments, this command lists all global user-defined functions. For wizards and others with the Functions --- 1480,1490 ---- & @function @function [] ! @function[/preserve] =,[,, ! [,]] or @function =/ @function/ + @function/restrict = When used without any arguments, this command lists all global user-defined functions. For wizards and others with the Functions *************** *** 1489,1510 **** /disable, to disable a built in function. /enable, to re-enable it. /delete, to remove a user-defined function. Otherwise, this command defines a global function with the name , which evaluates to on . - can be anything that the player using the @function command - controls. must be 30 characters or less. - (continued in help @function2) & @function2 A function defined using @function works just like any of the normal MUSH functions, from the user's perspective. The functions are executed by the object, with its powers. Functions defined via @function should follow the format used by UFUN() - %0 is the first argument passed, %1 is the second argument ! passed, and so forth. Option third and fourth arguments to @function can be used to set a parser-enforced number of arguments for the function. Example: --- 1499,1526 ---- /disable, to disable a built in function. /enable, to re-enable it. /delete, to remove a user-defined function. + /restrict, to change the restriction flags on an existing function. Otherwise, this command defines a global function with the name , which evaluates to on . (continued in help @function2) & @function2 + can be anything that the player using the @function command + controls. must be 30 characters or less. + A function defined using @function works just like any of the normal MUSH functions, from the user's perspective. The functions are executed by the object, with its powers. Functions defined via @function should follow the format used by UFUN() - %0 is the first argument passed, %1 is the second argument ! passed, and so forth. Optional third and fourth arguments to @function can be used to set a parser-enforced number of arguments for the function. + An optional fifth argument will set restriction flags. + + The /preserve switch, for MUX compability, does the same thing as the + 'localize' restriction - treats the attribute that's evaluated as if it + were called with ulocal() instead of u(). Example: *************** *** 1540,1545 **** --- 1556,1564 ---- @function/restore will delete the @function and turn the built in version back on. + Using @function on an already-added @function will delete the old one and + install a new function with none of the settings of the old one kept. + For example: @function/delete ansi &ansi_fun #1234=%0 *** 1_8_1.113/game/restart Tue, 18 Jan 2005 13:28:25 -0600 dunemush (pennmush/39_restart 1.1.1.1.1.1.1.2.1.1.1.1.1.2.1.2.2.1.2.2.1.1.1.1.1.4.2.1 700) --- 1_8_1.148(w)/game/restart Wed, 10 Aug 2005 22:43:25 -0500 dunemush (pennmush/39_restart 1.1.1.1.1.1.1.2.1.1.1.1.1.2.1.2.2.1.2.2.1.1.1.1.1.4.3.2 700) *************** *** 36,47 **** ####################################################################### ! if [ -z $GAMEDIR ]; then echo "You must set GAMEDIR in the restart script." exit 1 fi ! if [ ! -d $GAMEDIR ]; then echo "GAMEDIR doesn't appear to be a directory. It's: $GAMEDIR" exit 1 fi --- 36,47 ---- ####################################################################### ! if [ -z "$GAMEDIR" ]; then echo "You must set GAMEDIR in the restart script." exit 1 fi ! if [ ! -d "$GAMEDIR" ]; then echo "GAMEDIR doesn't appear to be a directory. It's: $GAMEDIR" exit 1 fi *************** *** 49,55 **** cd $GAMEDIR echo Running from `pwd` ! if [ ! -f $CONF_FILE ]; then echo "CONF_FILE doesn't exist. It's: $CONF_FILE" echo "Create $CONF_FILE from $GAMEDIR/mushcnf.dst" exit 1 --- 49,55 ---- cd $GAMEDIR echo Running from `pwd` ! if [ ! -f "$CONF_FILE" ]; then echo "CONF_FILE doesn't exist. It's: $CONF_FILE" echo "Create $CONF_FILE from $GAMEDIR/mushcnf.dst" exit 1 *************** *** 75,81 **** # Find out what the compression program is, if any egrep -s "^compress_program[ ]*[A-Za-z0-9]" $CONF_FILE nocompress=$? ! if [ $nocompress -eq 0 ]; then COMPRESSOR=`egrep "^compress_program" $CONF_FILE | sed "s/[^ ]*[ ]*\(.*\)/\1/" | sed 's/\r$//'` SUFFIX=`egrep "^compress_suffix" $CONF_FILE | sed "s/[^ ]*[ ]*\(.*\)/\1/" | sed 's/\r$//'` fi --- 75,81 ---- # Find out what the compression program is, if any egrep -s "^compress_program[ ]*[A-Za-z0-9]" $CONF_FILE nocompress=$? ! if [ "$nocompress" -eq 0 ]; then COMPRESSOR=`egrep "^compress_program" $CONF_FILE | sed "s/[^ ]*[ ]*\(.*\)/\1/" | sed 's/\r$//'` SUFFIX=`egrep "^compress_suffix" $CONF_FILE | sed "s/[^ ]*[ ]*\(.*\)/\1/" | sed 's/\r$//'` fi *************** *** 88,94 **** mush=`ps uwwx | grep " $GAMEDIR/$CONF_FILE" | grep -v grep | wc -l` ! if [ $mush -gt 0 ]; then echo Mush already active or some other process is using $GAMEDIR/$CONF_FILE. exit 0 fi --- 88,94 ---- mush=`ps uwwx | grep " $GAMEDIR/$CONF_FILE" | grep -v grep | wc -l` ! if [ "$mush" -gt 0 ]; then echo Mush already active or some other process is using $GAMEDIR/$CONF_FILE. exit 0 fi *************** *** 98,104 **** echo Restarting Mush. ! if [ -r $PANICDIR/$PANICDB ]; then end="`tail -1 $PANICDIR/$PANICDB`" if [ "$end" = "***END OF DUMP***" ]; then echo "Recovering PANIC dump." --- 98,104 ---- echo Restarting Mush. ! if [ -r "$PANICDIR/$PANICDB" ]; then end="`tail -1 $PANICDIR/$PANICDB`" if [ "$end" = "***END OF DUMP***" ]; then echo "Recovering PANIC dump." *************** *** 113,129 **** rm -f log/*.log ! if [ -r data/$OUTDB$SUFFIX ]; then rm -f save/$INDB$SUFFIX.old mv -f data/$INDB$SUFFIX save/$INDB$SUFFIX.old mv data/$OUTDB$SUFFIX data/$INDB$SUFFIX else echo "No $OUTDB$SUFFIX found." ! if [ -r data/$INDB$SUFFIX ]; then echo "Using $INDB$SUFFIX." else echo "No $INDB$SUFFIX found." ! if [ -r save/$INDB$SUFFIX.old ]; then echo "Using save/$INDB$SUFFIX.old." cp save/$INDB$SUFFIX.old data/$INDB$SUFFIX else --- 113,129 ---- rm -f log/*.log ! if [ -r "data/$OUTDB$SUFFIX" ]; then rm -f save/$INDB$SUFFIX.old mv -f data/$INDB$SUFFIX save/$INDB$SUFFIX.old mv data/$OUTDB$SUFFIX data/$INDB$SUFFIX else echo "No $OUTDB$SUFFIX found." ! if [ -r "data/$INDB$SUFFIX" ]; then echo "Using $INDB$SUFFIX." else echo "No $INDB$SUFFIX found." ! if [ -r "save/$INDB$SUFFIX.old" ]; then echo "Using save/$INDB$SUFFIX.old." cp save/$INDB$SUFFIX.old data/$INDB$SUFFIX else *** 1_8_1.113/config_h.SH Mon, 24 May 2004 14:14:15 -0500 dunemush (pennmush/b/17_config_h.S 1.17.1.2.1.1.1.11 660) --- 1_8_1.148(w)/config_h.SH Sun, 11 Sep 2005 09:01:55 -0500 dunemush (pennmush/b/17_config_h.S 1.17.1.2.1.1.1.12 660) *************** *** 398,403 **** --- 398,409 ---- */ #define Size_t $sizetype /* length paramater for string functions */ + /* CAN_KEEPALIVE: + * This symbol if defined indicates to the C program that the SO_KEEPALIVE + * option of setsockopt() will work as advertised in the manual. + */ + #$d_keepalive CAN_KEEPALIVE /**/ + /* VOIDFLAGS: * This symbol indicates how much support of the void type is given by this * compiler. What various bits mean: *************** *** 729,734 **** --- 735,745 ---- */ #$d_toupper HAS_SAFE_TOUPPER /**/ + /* HAS_UINT32_T: + * If defined, this system has the uint32_t type. + */ + #$d_uint32_t HAS_UINT32_T /**/ + /* UPTIME_PATH: * This symbol gives the full path to the uptime(1) program if * it exists on the system. If not, this symbol is undefined. *************** *** 795,812 **** */ #$i_netdb I_NETDB /**/ - /* I_NETINET_TCP: - * This symbol, if defined, indicates to the C program that it should - * include . - */ - #$i_nitcp I_NETINET_TCP /**/ - /* I_SETJMP: * This symbol, if defined, indicates to the C program that it can * include and have things work right. */ #$i_setjmp I_SETJMP /**/ /* USE_TIOCNOTTY: * This symbol, if defined indicate to the C program that the ioctl() * call with TIOCNOTTY should be used to void tty association. --- 806,823 ---- */ #$i_netdb I_NETDB /**/ /* I_SETJMP: * This symbol, if defined, indicates to the C program that it can * include and have things work right. */ #$i_setjmp I_SETJMP /**/ + /* I_STDINT: + * This symbol, if defined, indicates that the program should include + * . + */ + #$i_stdint I_STDINT /**/ + /* USE_TIOCNOTTY: * This symbol, if defined indicate to the C program that the ioctl() * call with TIOCNOTTY should be used to void tty association. *************** *** 833,859 **** */ #$i_stdarg I_STDARG /**/ - /* HAS_MYSQL: - * Defined if mysql client libraries are available. - */ - #$d_mysql HAS_MYSQL /**/ - /* HAS_OPENSSL: * Defined if openssl 0.9.6+ is available. */ #$d_openssl HAS_OPENSSL /**/ - /* CAN_KEEPALIVE: - * This symbol if defined indicates to the C program that the SO_KEEPALIVE - * option of setsockopt() will work as advertised in the manual. - */ - /* CAN_KEEPIDLE: - * This symbol if defined indicates to the C program that the TCP_KEEPIDLE - * option of setsockopt() will work as advertised in the manual. - */ - #$d_keepalive CAN_KEEPALIVE /**/ - - #$d_keepidle CAN_KEEPIDLE /**/ - #endif !GROK!THIS! --- 844,853 ---- *** 1_8_1.113/src/wiz.c Sat, 04 Jun 2005 22:07:51 -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.3.1.2.1.1.1.4.1.2 660) --- 1_8_1.148(w)/src/wiz.c Wed, 14 Sep 2005 22:51:22 -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.3.1.2.1.1.1.4.1.1.1.1.1.5 660) *************** *** 553,565 **** return; } else { /* attempted teleport to an exit */ ! if (tport_control_ok(player, victim, Location(victim))) do_move(victim, to, MOVE_NORMAL); ! else { notify(player, T("Permission denied.")); ! notify_format(victim, ! T("%s tries to impose his will on you and fails."), ! Name(player)); } } } --- 553,569 ---- return; } else { /* attempted teleport to an exit */ ! if (tport_control_ok(player, victim, Location(victim)) ! && (Tel_Anything(player) || ! (Tel_Anywhere(player) && (player == victim)) || ! (!Fixed(Owner(victim)) && !Fixed(player)))) { do_move(victim, to, MOVE_NORMAL); ! } else { notify(player, T("Permission denied.")); ! if (victim != player) ! notify_format(victim, ! T("%s tries to impose his will on you and fails."), ! Name(player)); } } } *************** *** 1324,1330 **** safe_str("#-1", buff, bp); } else if (nresults == 0) { notify(executor, T("Nothing found.")); - safe_str("#-1", buff, bp); } else { int first = 1, n; if (!rev) { --- 1328,1333 ---- *************** *** 1986,1998 **** return -1; } ! if (fill_search_spec(player, owner, nargs, args, &spec) < 0) return -1; is_wiz = Search_All(player) || See_All(player); ! if ((spec.owner != ANY_OWNER && spec.owner != player) && !(is_wiz || (spec.type == TYPE_PLAYER))) { notify(player, T("You need a search warrant to do that.")); return -1; } --- 1989,2004 ---- return -1; } ! if (fill_search_spec(player, owner, nargs, args, &spec) < 0) { ! giveto(player, FIND_COST); return -1; + } is_wiz = Search_All(player) || See_All(player); ! if ((spec.owner != ANY_OWNER && spec.owner != Owner(player)) && !(is_wiz || (spec.type == TYPE_PLAYER))) { + giveto(player, FIND_COST); notify(player, T("You need a search warrant to do that.")); return -1; } *************** *** 2004,2009 **** --- 2010,2017 ---- mush_panic(T("Couldn't allocate memory in search!")); for (n = spec.low; n <= spec.high; n++) { + if (IsGarbage(n)) + continue; if (spec.owner != ANY_OWNER && Owner(n) != spec.owner) continue; if (spec.type != NOTYPE && Typeof(n) != spec.type) *** 1_8_1.113/src/unparse.c Wed, 30 Jun 2004 15:00:16 -0500 dunemush (pennmush/b/28_unparse.c 1.16.1.7.1.12 660) --- 1_8_1.148(w)/src/unparse.c Wed, 14 Sep 2005 22:51:22 -0500 dunemush (pennmush/b/28_unparse.c 1.16.1.7.1.15 660) *************** *** 133,148 **** case HOME: return T("*HOME*"); default: ! if (use_nameformat && nameformat(player, loc, buf)) { ! strcpy(tbuf1, buf); ! got_nameformat = 1; ! } else { ! /* Not using @nameformat or couldn't get one */ ! if (use_nameaccent) ! strcpy(tbuf1, accented_name(loc)); ! else ! strcpy(tbuf1, Name(loc)); ! } if (IsExit(loc) && obey_myopic) { if ((p = strchr(tbuf1, ';'))) *p = '\0'; --- 133,142 ---- case HOME: return T("*HOME*"); default: ! if (use_nameaccent) ! strcpy(tbuf1, accented_name(loc)); ! else ! strcpy(tbuf1, Name(loc)); if (IsExit(loc) && obey_myopic) { if ((p = strchr(tbuf1, ';'))) *p = '\0'; *************** *** 162,179 **** safe_format(buf, &bp, "%s(#%d%s)", tbuf1, loc, unparse_flags(loc, player)); *bp = '\0'; - return buf; } else { /* show only the name */ if (ANSI_NAMES && ShowAnsi(player) && !got_nameformat) { bp = buf; safe_format(buf, &bp, "%s%s%s", ANSI_HILITE, tbuf1, ANSI_NORMAL); *bp = '\0'; - return buf; } else ! return tbuf1; } } } /** Build the name of loc as seen by a player inside it, but only --- 156,178 ---- safe_format(buf, &bp, "%s(#%d%s)", tbuf1, loc, unparse_flags(loc, player)); *bp = '\0'; } else { /* show only the name */ if (ANSI_NAMES && ShowAnsi(player) && !got_nameformat) { bp = buf; safe_format(buf, &bp, "%s%s%s", ANSI_HILITE, tbuf1, ANSI_NORMAL); *bp = '\0'; } else ! strcpy(buf, tbuf1); } } + /* buf now contains the default formatting of the name. If we + * have @nameaccent, though, we might change to that. + */ + if (use_nameformat && nameformat(player, loc, tbuf1, buf)) + return tbuf1; + else + return buf; } /** Build the name of loc as seen by a player inside it, but only *************** *** 183,203 **** * \param player the looker. * \param loc dbref of location being looked at. * \param tbuf1 address to store formatted name of loc. * \retval 1 a NAMEFORMAT was found, and tbuf1 contains formatted name. * \retval 0 no NAMEFORMAT on loc, tbuf1 is undefined. */ int ! nameformat(dbref player, dbref loc, char *tbuf1) { ATTR *a; char *wsave[10], *rsave[NUMQ]; ! char *arg, *bp; char const *sp, *save; int j; a = atr_get(loc, "NAMEFORMAT"); if (a) { arg = (char *) mush_malloc(BUFFER_LEN, "string"); if (!arg) mush_panic("Unable to allocate memory in nameformat"); save_global_regs("nameformat", rsave); --- 182,204 ---- * \param player the looker. * \param loc dbref of location being looked at. * \param tbuf1 address to store formatted name of loc. + * \param defname the name as it would be formatted without NAMEFORMAT. * \retval 1 a NAMEFORMAT was found, and tbuf1 contains formatted name. * \retval 0 no NAMEFORMAT on loc, tbuf1 is undefined. */ int ! nameformat(dbref player, dbref loc, char *tbuf1, char *defname) { ATTR *a; char *wsave[10], *rsave[NUMQ]; ! char *arg, *bp, *arg2; char const *sp, *save; int j; a = atr_get(loc, "NAMEFORMAT"); if (a) { arg = (char *) mush_malloc(BUFFER_LEN, "string"); + arg2 = (char *) mush_malloc(BUFFER_LEN, "string"); if (!arg) mush_panic("Unable to allocate memory in nameformat"); save_global_regs("nameformat", rsave); *************** *** 209,214 **** --- 210,217 ---- global_eval_context.renv[j][0] = '\0'; strcpy(arg, unparse_dbref(loc)); global_eval_context.wenv[0] = arg; + strcpy(arg2, defname); + global_eval_context.wenv[1] = defname; sp = save = safe_atr_value(a); bp = tbuf1; process_expression(tbuf1, &bp, &sp, loc, player, player, *************** *** 220,225 **** --- 223,229 ---- } restore_global_regs("nameformat", rsave); mush_free((Malloc_t) arg, "string"); + mush_free((Malloc_t) arg2, "string"); return 1; } else { /* No @nameformat attribute */ *** 1_8_1.113/src/htab.c Sat, 21 May 2005 22:11:12 -0500 dunemush (pennmush/b/30_htab.c 1.8.1.16 660) --- 1_8_1.148(w)/src/htab.c Wed, 14 Sep 2005 22:51:21 -0500 dunemush (pennmush/b/30_htab.c 1.8.1.17 660) *************** *** 573,577 **** "%-10s %7d %7d %6d %4d %4d %4d %4d %4d %6.3f %7u", hname, htab->hashsize, htab->entries, longest, lengths[0], lengths[1], lengths[2], lengths[3], lengths[4], ! totchains == 0.0 ? 0.0 : chainlens / totchains, bytes); } --- 573,577 ---- "%-10s %7d %7d %6d %4d %4d %4d %4d %4d %6.3f %7u", hname, htab->hashsize, htab->entries, longest, lengths[0], lengths[1], lengths[2], lengths[3], lengths[4], ! totchains > 0 ? chainlens / totchains : 0.0, bytes); } *** 1_8_1.113/src/speech.c Sat, 04 Jun 2005 14:31:05 -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.3.1.1.2 660) --- 1_8_1.148(w)/src/speech.c Wed, 14 Sep 2005 22:51:22 -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.3.1.1.4 660) *************** *** 629,638 **** * \param noeval if 1, page/noeval. * \param multipage if 1, a page/list; if 0, a page/blind. * \param override if 1, page/override. */ void do_page(dbref player, const char *arg1, const char *arg2, dbref cause, ! int noeval, int multipage, int override) { dbref target; const char *message; --- 629,639 ---- * \param noeval if 1, page/noeval. * \param multipage if 1, a page/list; if 0, a page/blind. * \param override if 1, page/override. + * \param has_eq if 1, the command had an = in it. */ void do_page(dbref player, const char *arg1, const char *arg2, dbref cause, ! int noeval, int multipage, int override, int has_eq) { dbref target; const char *message; *************** *** 658,665 **** if (!tbuf2) mush_panic("Unable to allocate memory in do_page"); ! if (arg2 && *arg2 && *arg1) { ! /* page to=msg. Always evaluate to, maybe evaluate msg */ process_expression(tbuf2, &tp2, &arg1, player, cause, cause, PE_DEFAULT, PT_DEFAULT, NULL); *tp2 = '\0'; --- 659,666 ---- if (!tbuf2) mush_panic("Unable to allocate memory in do_page"); ! if (*arg1 && has_eq) { ! /* page to=[msg]. Always evaluate to, maybe evaluate msg */ process_expression(tbuf2, &tp2, &arg1, player, cause, cause, PE_DEFAULT, PT_DEFAULT, NULL); *tp2 = '\0'; *** 1_8_1.113/src/set.c Sat, 21 May 2005 22:07:43 -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.49 660) --- 1_8_1.148(w)/src/set.c Wed, 14 Sep 2005 22:51:21 -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.42.1.2 660) *************** *** 727,732 **** --- 727,733 ---- /** Argument struct for gedit_helper */ struct gedit_args { enum edit_type target; /**< The type of edit */ + int doit; /**< Do we actually replace the attribute, or just pretend? */ char *from; /**< What is going to be replaced? */ char *to; /**< What it gets replaced with. */ }; *************** *** 865,872 **** *tbufp = '\0'; *tbufap = '\0'; ! if (do_set_atr(thing, AL_NAME(a), tbuf1, player, 0) && ! !AreQuiet(player, thing)) { if (!ansi_long_flag && ShowAnsi(player)) notify_format(player, "%s - Set: %s", AL_NAME(a), tbuf_ansi); else --- 866,881 ---- *tbufp = '\0'; *tbufap = '\0'; ! if (gargs->doit) { ! if (do_set_atr(thing, AL_NAME(a), tbuf1, player, 0) && ! !AreQuiet(player, thing)) { ! if (!ansi_long_flag && ShowAnsi(player)) ! notify_format(player, "%s - Set: %s", AL_NAME(a), tbuf_ansi); ! else ! notify_format(player, "%s - Set: %s", AL_NAME(a), tbuf1); ! } ! } else { ! // We don't do it - we just pemit it. if (!ansi_long_flag && ShowAnsi(player)) notify_format(player, "%s - Set: %s", AL_NAME(a), tbuf_ansi); else *************** *** 885,897 **** * \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]; char *q; struct gedit_args args; if (!(it && *it)) { notify(player, T("I need to know what you want to edit.")); return; --- 894,907 ---- * \param argv array containing the search and replace strings. */ void ! do_gedit(dbref player, char *it, char **argv, enum edit_type target, int doit) { dbref thing; char tbuf1[BUFFER_LEN]; char *q; struct gedit_args args; + if (!(it && *it)) { notify(player, T("I need to know what you want to edit.")); return; *************** *** 917,922 **** --- 927,934 ---- args.from = argv[1]; args.to = argv[2]; args.target = target; + args.doit = doit; + if (!atr_iter_get(player, thing, q, 0, gedit_helper, &args)) notify(player, T("No matching attributes.")); } *************** *** 1111,1117 **** we_are_wiping = 1; if (!atr_iter_get(player, thing, pattern, 0, wipe_helper, NULL)) ! notify(player, T("No matching attributes.")); else notify(player, T("Attributes wiped.")); --- 1123,1129 ---- we_are_wiping = 1; if (!atr_iter_get(player, thing, pattern, 0, wipe_helper, NULL)) ! notify(player, T("No attributes wiped.")); else notify(player, T("Attributes wiped.")); *** 1_8_1.113/src/parse.c Wed, 08 Jun 2005 18:16:59 -0500 dunemush (pennmush/b/48_parse.c 1.23.1.10.1.2.1.1.1.1.1.2.1.2.1.41.1.2 660) --- 1_8_1.148(w)/src/parse.c Wed, 14 Sep 2005 22:51:21 -0500 dunemush (pennmush/b/48_parse.c 1.23.1.10.1.2.1.1.1.1.1.2.1.2.1.41.1.6 660) *************** *** 706,713 **** (*str)++; savec = **str; ! if (!savec) goto exit_sequence; savepos = *bp; (*str)++; --- 706,716 ---- (*str)++; savec = **str; ! if (!savec) { ! /* Line ended in %, so treat it as literal */ ! safe_chr('%', buff, bp); goto exit_sequence; + } savepos = *bp; (*str)++; *************** *** 715,720 **** --- 718,726 ---- case '%': /* %% - a real % */ safe_chr('%', buff, bp); break; + case ' ': /* "% " for more natural typing */ + safe_str("% ", buff, bp); + break; case '!': /* executor dbref */ safe_dbref(executor, buff, bp); break; *************** *** 1126,1139 **** global_fun_recursions++; pe_info->fun_depth++; if (fp->flags & FN_BUILTIN) { - int old_nfargs; global_fun_invocations++; pe_info->fun_invocations++; - old_nfargs = pe_info->arg_count; - pe_info->arg_count = nfargs; fp->where.fun(fp, buff, bp, nfargs, fargs, arglens, executor, caller, enactor, fp->name, pe_info); - pe_info->arg_count = old_nfargs; if (fp->flags & FN_LOGARGS) { char logstr[BUFFER_LEN]; char *logp; --- 1132,1141 ---- *** 1_8_1.113/src/move.c Sun, 20 Mar 2005 15:07:46 -0600 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.33.1.2 660) --- 1_8_1.148(w)/src/move.c Wed, 14 Sep 2005 22:51:21 -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.33.1.3 660) *************** *** 417,424 **** case AMBIGUOUS: var_dest = find_var_dest(player, exit_m); /* Only allowed if the owner of the exit could link to var_dest */ ! if (GoodObject(var_dest) && !can_link_to(exit_m, var_dest)) ! var_dest = NOTHING; break; default: var_dest = Location(exit_m); --- 417,429 ---- case AMBIGUOUS: var_dest = find_var_dest(player, exit_m); /* Only allowed if the owner of the exit could link to var_dest */ ! if (!GoodObject(var_dest) || !can_link_to(exit_m, var_dest)) { ! notify_format(player, ! T ! ("Variable exit destination #%d is invalid or not permitted."), ! var_dest); ! return; ! } break; default: var_dest = Location(exit_m); *** 1_8_1.113/src/lock.c Fri, 25 Feb 2005 16:14:13 -0600 dunemush (pennmush/c/6_lock.c 1.17.1.13.1.1.1.1.1.24 660) --- 1_8_1.148(w)/src/lock.c Wed, 14 Sep 2005 22:51:21 -0500 dunemush (pennmush/c/6_lock.c 1.17.1.13.1.1.1.1.1.23.1.1.1.2 660) *************** *** 736,744 **** unparse_dbref(thing), real_type); if (!IsPlayer(thing)) ModTime(thing) = mudtime; ! } else notify(player, T("Permission denied.")); ! } } } --- 736,747 ---- unparse_dbref(thing), real_type); if (!IsPlayer(thing)) ModTime(thing) = mudtime; ! } else { notify(player, T("Permission denied.")); ! free_boolexp(key); ! } ! } else ! free_boolexp(key); } } *** 1_8_1.113/src/funufun.c Tue, 22 Mar 2005 16:45:23 -0600 dunemush (pennmush/c/11_funufun.c 1.23 660) --- 1_8_1.148(w)/src/funufun.c Wed, 14 Sep 2005 22:51:21 -0500 dunemush (pennmush/c/11_funufun.c 1.24 660) *************** *** 110,116 **** char *tbuf; char const *tp; int pe_flags = PE_DEFAULT; ! int old_args; /* save our stack */ for (j = 0; j < 10; j++) --- 110,116 ---- char *tbuf; char const *tp; int pe_flags = PE_DEFAULT; ! int old_args = 0; /* save our stack */ for (j = 0; j < 10; j++) *** 1_8_1.113/src/funstr.c Sun, 20 Mar 2005 13:09:51 -0600 dunemush (pennmush/c/13_funstr.c 1.28.1.1.1.2.1.4.1.6.1.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.2.1.3.1.5.1.3.1.2.1.1.1.1.1.1.1.1.1.14.1.27 660) --- 1_8_1.148(w)/src/funstr.c Wed, 14 Sep 2005 22:51:21 -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.30 660) *************** *** 1310,1322 **** char *m; size_t len = 0; if (!args[0] || !args[0][0]) { ! safe_str(T("#-1 FUNCTION EXPECTS ONE CHARACTER"), buff, bp); return; } m = remove_markup(args[0], &len); if (len != 2) /* len includes trailing nul */ ! safe_str(T("#-1 FUNCTION EXPECTS ONE CHARACTER"), buff, bp); else if (isprint((unsigned char) *m)) safe_integer((unsigned char) *m, buff, bp); else --- 1310,1322 ---- char *m; size_t len = 0; if (!args[0] || !args[0][0]) { ! safe_str(T("#-1 FUNCTION (ORD) EXPECTS ONE CHARACTER"), buff, bp); return; } m = remove_markup(args[0], &len); if (len != 2) /* len includes trailing nul */ ! safe_str(T("#-1 FUNCTION (ORD) EXPECTS ONE CHARACTER"), buff, bp); else if (isprint((unsigned char) *m)) safe_integer((unsigned char) *m, buff, bp); else *************** *** 2040,2050 **** return; } if (nargs >= (ncols + 2)) { ! if (!args[ncols + 1] || strlen(args[ncols + 1]) != 1) { safe_str(T("#-1 FILLER MUST BE ONE CHARACTER"), buff, bp); return; } ! filler = *(args[ncols + 1]); } if (nargs >= (ncols + 3)) { fieldsep = args[ncols + 2]; --- 2040,2052 ---- return; } if (nargs >= (ncols + 2)) { ! if (!args[ncols + 1] || strlen(args[ncols + 1]) > 1) { safe_str(T("#-1 FILLER MUST BE ONE CHARACTER"), buff, bp); return; } ! if (*args[ncols + 1]) { ! filler = *(args[ncols + 1]); ! } } if (nargs >= (ncols + 3)) { fieldsep = args[ncols + 2]; *** 1_8_1.113/src/funmisc.c Tue, 22 Mar 2005 16:29:41 -0600 dunemush (pennmush/c/14_funmisc.c 1.30.1.1.1.41.1.5 660) --- 1_8_1.148(w)/src/funmisc.c Wed, 14 Sep 2005 22:51:21 -0500 dunemush (pennmush/c/14_funmisc.c 1.30.1.1.1.41.1.8 660) *************** *** 159,165 **** int n; if ((nargs % 2) != 0) { ! safe_str(T("#-1 FUNCTION EXPECTS AN EVEN NUMBER OF ARGUMENTS"), buff, bp); return; } --- 159,167 ---- int n; if ((nargs % 2) != 0) { ! safe_format(buff, bp, ! T("#-1 FUNCTION (%s) EXPECTS AN EVEN NUMBER OF ARGUMENTS"), ! called_as); return; } *** 1_8_1.113/src/funmath.c Thu, 02 Jun 2005 14:57:20 -0500 dunemush (pennmush/c/15_funmath.c 1.39.1.1.1.1.1.1.1.10.1.13 660) --- 1_8_1.148(w)/src/funmath.c Wed, 14 Sep 2005 22:51:21 -0500 dunemush (pennmush/c/15_funmath.c 1.39.1.1.1.1.1.1.1.10.1.16 660) *************** *** 28,33 **** --- 28,36 ---- #define M_PI 3.14159265358979323846264338327 #endif + #define EPSILON 0.000000001 /**< limit of precision for float equality */ + #define EQ(x,y) (fabs(x-y) < EPSILON) /**< floating point equality macro */ + static void do_spellnum(char *num, unsigned int len, char **buff, char ***bp); static int nval_sort(const void *, const void *); static NVAL find_median(NVAL *, int); *************** *** 50,56 **** static MATH *math_hash_lookup(char *); static NVAL angle_to_rad(NVAL angle, const char *from); static NVAL rad_to_angle(NVAL angle, const char *to); ! static double frac(double v, int *RESTRICT n, int *RESTRICT d, double error); void init_math_hashtab(void); extern int format_long(long n, char *buff, char **bp, int maxlen, int base); --- 53,60 ---- static MATH *math_hash_lookup(char *); static NVAL angle_to_rad(NVAL angle, const char *from); static NVAL rad_to_angle(NVAL angle, const char *to); ! static double frac(double v, double *RESTRICT n, double *RESTRICT d, ! double error); void init_math_hashtab(void); extern int format_long(long n, char *buff, char **bp, int maxlen, int base); *************** *** 164,170 **** safe_str(T(e_nums), buff, bp); return; } ! safe_boolean(parse_number(args[0]) == parse_number(args[1]), buff, bp); } /* ARGSUSED */ --- 168,174 ---- safe_str(T(e_nums), buff, bp); return; } ! safe_boolean(EQ(parse_number(args[0]), parse_number(args[1])), buff, bp); } /* ARGSUSED */ *************** *** 174,180 **** safe_str(T(e_nums), buff, bp); return; } ! safe_boolean(parse_number(args[0]) != parse_number(args[1]), buff, bp); } /* ARGSUSED */ --- 178,184 ---- safe_str(T(e_nums), buff, bp); return; } ! safe_boolean(!EQ(parse_number(args[0]), parse_number(args[1])), buff, bp); } /* ARGSUSED */ *************** *** 199,205 **** return; } x = parse_number(args[0]); ! if (x == 0) safe_chr('0', buff, bp); else if (x > 0) safe_chr('1', buff, bp); --- 203,209 ---- return; } x = parse_number(args[0]); ! if (EQ(x, 0)) safe_chr('0', buff, bp); else if (x > 0) safe_chr('1', buff, bp); *************** *** 734,740 **** } sum = sqrt(sum); ! if (!sum) { /* zero vector */ p1 = tbuf; safe_chr('0', buff, bp); --- 738,744 ---- } sum = sqrt(sum); ! if (EQ(sum, 0)) { /* zero vector */ p1 = tbuf; safe_chr('0', buff, bp); *************** *** 802,808 **** return; } y = parse_number(args[1]); ! if (y == 0) { safe_str(T("#-1 DIVISION BY ZERO"), buff, bp); return; } --- 806,812 ---- return; } y = parse_number(args[1]); ! if (EQ(y, 0)) { safe_str(T("#-1 DIVISION BY ZERO"), buff, bp); return; } *************** *** 992,998 **** } num = parse_number(args[0]); m = parse_number(args[1]); ! if (num < 0 && (m != (int) m)) { safe_str(T("#-1 FRACTIONAL POWER OF NEGATIVE"), buff, bp); return; } --- 996,1002 ---- } num = parse_number(args[0]); m = parse_number(args[1]); ! if (num < 0 && (!EQ(m, (int) m))) { safe_str(T("#-1 FRACTIONAL POWER OF NEGATIVE"), buff, bp); return; } *************** *** 1145,1151 **** * \return -1.0 if (v < MIN || v > MAX || error < 0.0) | (v - n/d) / v | otherwise. */ static double ! frac(double v, int *RESTRICT n, int *RESTRICT d, double error) { /* Based on a routine found in netlib (http://www.netlib.org) by --- 1149,1155 ---- * \return -1.0 if (v < MIN || v > MAX || error < 0.0) | (v - n/d) / v | otherwise. */ static double ! frac(double v, double *RESTRICT n, double *RESTRICT d, double error) { /* Based on a routine found in netlib (http://www.netlib.org) by *************** *** 1164,1191 **** */ ! int D, N, t; int first = 1; double epsilon, r = 0.0, m; if (v < 0 || error < 0.0) return -1.0; *d = D = 1; ! *n = (int) v; N = *n + 1; do { if (!first) { if (r <= 1.0) r = 1.0 / r; ! N += *n * (int) r; ! D += *d * (int) r; *n += N; *d += D; } else first = 0; r = 0.0; ! if (v * (*d) != *n) { r = (N - v * D) / (v * (*d) - *n); if (r <= 1.0) { t = N; --- 1168,1195 ---- */ ! double D, N, t; int first = 1; double epsilon, r = 0.0, m; if (v < 0 || error < 0.0) return -1.0; *d = D = 1; ! *n = floor(v); N = *n + 1; do { if (!first) { if (r <= 1.0) r = 1.0 / r; ! N += *n * floor(r); ! D += *d * floor(r); *n += N; *d += D; } else first = 0; r = 0.0; ! if (!EQ(v * (*d), *n)) { r = (N - v * D) / (v * (*d) - *n); if (r <= 1.0) { t = N; *************** *** 1203,1218 **** do { m *= 10.0; } while (m * epsilon < 1.0); ! epsilon = 1.0 / m * ((int) (0.5 + m * epsilon)); if (epsilon <= error) return epsilon; ! } while (r != 0.0); return epsilon; } FUNCTION(fun_fraction) { ! int num = 0, denom = 0; NVAL n; int sign = 0; --- 1207,1222 ---- do { m *= 10.0; } while (m * epsilon < 1.0); ! epsilon = 1.0 / m * (floor(0.5 + m * epsilon)); if (epsilon <= error) return epsilon; ! } while (!EQ(r, 0.0)); return epsilon; } FUNCTION(fun_fraction) { ! double num = 0, denom = 0; NVAL n; int sign = 0; *************** *** 1226,1232 **** if (n < 0) { n = fabs(n); sign = 1; ! } else if (n == 0) { safe_chr('0', buff, bp); return; } --- 1230,1236 ---- if (n < 0) { n = fabs(n); sign = 1; ! } else if (EQ(n, 0)) { safe_chr('0', buff, bp); return; } *************** *** 1236,1245 **** if (sign) safe_chr('-', buff, bp); ! if (denom == 1) ! safe_integer(num, buff, bp); else ! safe_format(buff, bp, "%d/%d", num, denom); } FUNCTION(fun_isint) --- 1240,1249 ---- if (sign) safe_chr('-', buff, bp); ! if (fabs(denom - 1) < 1.0e-10) ! safe_format(buff, bp, "%.0lf", num); else ! safe_format(buff, bp, "%.0lf/%.0lf", num, denom); } FUNCTION(fun_isint) *************** *** 1934,1940 **** } temp = parse_number(ptr[n]); ! if (temp == 0) { safe_str(T("#-1 DIVISION BY ZERO"), buff, bp); return; } --- 1938,1944 ---- } temp = parse_number(ptr[n]); ! if (EQ(temp, 0)) { safe_str(T("#-1 DIVISION BY ZERO"), buff, bp); return; } *** 1_8_1.113/src/funlist.c Thu, 23 Jun 2005 10:09:57 -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.20.1.1.1.1.1.2 660) --- 1_8_1.148(w)/src/funlist.c Wed, 14 Sep 2005 22:51:21 -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.20.1.1.1.1.1.6 660) *************** *** 710,715 **** --- 710,716 ---- * its 'key' to sort by. Sort of a hardcode munge. */ struct sort_record { + char *ptr; /**< NULL except for sortkey */ char *val; /**< The string this is */ dbref db; /**< dbref (default 0, bad is -1) */ char *str; /**< string comparisons */ *************** *** 743,749 **** #define Compare(r,x,y) \ ((x->db < 0 || y->db < 0) ? \ ((x->db < 0 && y->db < 0) ? 0 : (x->db < 0 ? 2 : -2)) \ ! : ((r != 0) ? (r < 0 ? -2 : 2) \ : (x->db == y->db ? 0 : (x->db < y->db ? -1 : 1)) \ ) \ ) --- 744,750 ---- #define Compare(r,x,y) \ ((x->db < 0 || y->db < 0) ? \ ((x->db < 0 && y->db < 0) ? 0 : (x->db < 0 ? 2 : -2)) \ ! : ((fabs(r) > 0.000000001) ? (r < 0 ? -2 : 2) \ : (x->db == y->db ? 0 : (x->db < y->db ? -1 : 1)) \ ) \ ) *************** *** 1061,1067 **** */ void ! do_gensort(dbref player, char *s[], int n, char *sort_type) { char *ptr; static char stype[BUFFER_LEN]; --- 1062,1068 ---- */ void ! do_gensort(dbref player, char *keys[], char *strs[], int n, char *sort_type) { char *ptr; static char stype[BUFFER_LEN]; *************** *** 1087,1098 **** } sp = (s_rec *) mush_malloc(n * sizeof(s_rec), "do_gensort"); for (i = 0; i < n; i++) { ! sp[i].val = s[i]; sp[i].freestr = 0; sp[i].db = 0; sp[i].str = NULL; if (ltypelist[sorti].isdbs) { ! sp[i].db = parse_objid(s[i]); if (!RealGoodObject(sp[i].db)) sp[i].db = NOTHING; } --- 1088,1104 ---- } sp = (s_rec *) mush_malloc(n * sizeof(s_rec), "do_gensort"); for (i = 0; i < n; i++) { ! sp[i].val = keys[i]; sp[i].freestr = 0; sp[i].db = 0; + if (strs) { + sp[i].ptr = strs[i]; + } else { + sp[i].ptr = NULL; + } sp[i].str = NULL; if (ltypelist[sorti].isdbs) { ! sp[i].db = parse_objid(keys[i]); if (!RealGoodObject(sp[i].db)) sp[i].db = NOTHING; } *************** *** 1101,1107 **** qsort((void *) sp, n, sizeof(s_rec), ltypelist[sorti].sorter); for (i = 0; i < n; i++) { ! s[i] = sp[i].val; if (sp[i].freestr) mush_free(sp[i].str, "genrecord"); } --- 1107,1116 ---- qsort((void *) sp, n, sizeof(s_rec), ltypelist[sorti].sorter); for (i = 0; i < n; i++) { ! keys[i] = sp[i].val; ! if (strs) { ! strs[i] = sp[i].ptr; ! } if (sp[i].freestr) mush_free(sp[i].str, "genrecord"); } *************** *** 1131,1137 **** nptrs = list2arr(ptrs, MAX_SORTSIZE, args[0], sep); sort_type = get_list_type(args, nargs, 2, ptrs, nptrs); ! do_gensort(executor, ptrs, nptrs, sort_type); arr2list(ptrs, nptrs, buff, bp, outsep); } --- 1140,1146 ---- nptrs = list2arr(ptrs, MAX_SORTSIZE, args[0], sep); sort_type = get_list_type(args, nargs, 2, ptrs, nptrs); ! do_gensort(executor, ptrs, NULL, nptrs, sort_type); arr2list(ptrs, nptrs, buff, bp, outsep); } *************** *** 1199,1204 **** --- 1208,1281 ---- } } + /* ARGSUSED */ + FUNCTION(fun_sortkey) + { + char *ptrs[MAX_SORTSIZE]; + char *keys[MAX_SORTSIZE]; + int nptrs; + char *sort_type; + char sep; + char outsep[BUFFER_LEN]; + int i; + char tbuff[BUFFER_LEN]; + char *tp; + char const *cp; + char result[BUFFER_LEN]; + char *rp; + ATTR *attrib; + dbref thing; + + /* sortkey(attr,list,sort_type,delim,osep) */ + + if (!nargs || !*args[0] || !*args[1]) + return; + + if (!delim_check(buff, bp, nargs, args, 4, &sep)) + return; + + if (nargs < 5) { + outsep[0] = sep; + outsep[1] = '\0'; + } else + strcpy(outsep, args[4]); + + /* Find object and attribute to get sortby function from. */ + parse_anon_attrib(executor, args[0], &thing, &attrib); + if (!GoodObject(thing) || !attrib || !Can_Read_Attr(executor, thing, attrib)) { + free_anon_attrib(attrib); + return; + } + if (!CanEvalAttr(executor, thing, attrib)) { + free_anon_attrib(attrib); + return; + } + tp = tbuff; + safe_str(atr_value(attrib), tbuff, &tp); + *tp = '\0'; + + + nptrs = list2arr(ptrs, MAX_SORTSIZE, args[1], sep); + + /* Now we make a list of keys */ + for (i = 0; i < nptrs; i++) { + global_eval_context.wenv[0] = (char *) ptrs[i]; + rp = result; + cp = tbuff; + process_expression(result, &rp, &cp, + thing, executor, enactor, + PE_DEFAULT, PT_DEFAULT, pe_info); + *rp = '\0'; + keys[i] = mush_strdup(result, "sortkey"); + } + + sort_type = get_list_type(args, nargs, 3, keys, nptrs); + do_gensort(executor, keys, ptrs, nptrs, sort_type); + arr2list(ptrs, nptrs, buff, bp, outsep); + for (i = 0; i < nptrs; i++) { + mush_free(keys[i], "sortkey"); + } + } /* ARGSUSED */ FUNCTION(fun_sortby) *************** *** 1303,1309 **** osep = args[4]; } ! do_gensort(executor, a1, n1, sort_type); /* Strip the duplicates and make a2 contain the list */ a = 0; --- 1380,1386 ---- osep = args[4]; } ! do_gensort(executor, a1, NULL, n1, sort_type); /* Strip the duplicates and make a2 contain the list */ a = 0; *************** *** 1370,1377 **** osepl = arglens[4]; } /* sort each array */ ! do_gensort(executor, a1, n1, sort_type); ! do_gensort(executor, a2, n2, sort_type); /* get the first value for the intersection, removing duplicates */ x1 = x2 = 0; --- 1447,1454 ---- osepl = arglens[4]; } /* sort each array */ ! do_gensort(executor, a1, NULL, n1, sort_type); ! do_gensort(executor, a2, NULL, n2, sort_type); /* get the first value for the intersection, removing duplicates */ x1 = x2 = 0; *************** *** 1486,1493 **** } /* sort each array */ ! do_gensort(executor, a1, n1, sort_type); ! do_gensort(executor, a2, n2, sort_type); /* get the first value for the difference, removing duplicates */ x1 = x2 = 0; --- 1563,1570 ---- } /* sort each array */ ! do_gensort(executor, a1, NULL, n1, sort_type); ! do_gensort(executor, a2, NULL, n2, sort_type); /* get the first value for the difference, removing duplicates */ x1 = x2 = 0; *** 1_8_1.113/src/fundb.c Mon, 27 Jun 2005 10:17:42 -0500 dunemush (pennmush/c/17_fundb.c 1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.7.1.3.1.3.1.3.1.2.1.2.1.3.2.1.2.1.2.1.1.1.1.4.1.1.1.1.1.1.1.1.1.1.1.3.1.1.2.2.2.1.1.1.1.1.1.42.1.14.1.3 660) --- 1_8_1.148(w)/src/fundb.c Wed, 14 Sep 2005 22:51:21 -0500 dunemush (pennmush/c/17_fundb.c 1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.7.1.3.1.3.1.3.1.2.1.2.1.3.2.1.2.1.2.1.1.1.1.4.1.1.1.1.1.1.1.1.1.1.1.3.1.1.2.2.2.1.1.1.1.1.1.42.1.14.1.1.1.1.1.5 660) *************** *** 1049,1084 **** /* ARGSUSED */ FUNCTION(fun_hastype) { dbref it = match_thing(executor, args[0]); if (!GoodObject(it)) { safe_str(T(e_notvis), buff, bp); return; } ! switch (*args[1]) { ! case 'r': ! case 'R': ! safe_boolean(IsRoom(it), buff, bp); ! break; ! case 'e': ! case 'E': ! safe_boolean(IsExit(it), buff, bp); ! break; ! case 'p': ! case 'P': ! safe_boolean(IsPlayer(it), buff, bp); ! break; ! case 't': ! case 'T': ! safe_boolean(IsThing(it), buff, bp); ! break; ! case 'g': ! case 'G': ! safe_boolean(IsGarbage(it), buff, bp); ! break; ! default: ! safe_str(T("#-1 NO SUCH TYPE"), buff, bp); ! break; ! }; } /* ARGSUSED */ --- 1049,1100 ---- /* ARGSUSED */ FUNCTION(fun_hastype) { + char *r, *s; + int found = 0; dbref it = match_thing(executor, args[0]); if (!GoodObject(it)) { safe_str(T(e_notvis), buff, bp); return; } ! s = trim_space_sep(args[1], ' '); ! r = split_token(&s, ' '); ! do { ! switch (*r) { ! case 'r': ! case 'R': ! if (IsRoom(it)) ! found = 1; ! break; ! case 'e': ! case 'E': ! if (IsExit(it)) ! found = 1; ! break; ! case 'p': ! case 'P': ! if (IsPlayer(it)) ! found = 1; ! break; ! case 't': ! case 'T': ! if (IsThing(it)) ! found = 1; ! break; ! case 'g': ! case 'G': ! if (IsGarbage(it)) ! found = 1; ! break; ! default: ! safe_str(T("#-1 NO SUCH TYPE"), buff, bp); ! return; ! } ! if (found) { ! safe_boolean(found, buff, bp); ! return; ! } ! } while ((r = split_token(&s, ' '))); ! safe_boolean(0, buff, bp); } /* ARGSUSED */ *************** *** 1227,1240 **** FUNCTION(fun_lock) { dbref it; ! char *p; ! lock_type ltype; ! if ((p = strchr(args[0], '/'))) ! *p++ = '\0'; it = match_thing(executor, args[0]); - ltype = get_locktype(p); if (nargs == 2) { if (!command_check_byname(executor, "@lock") || fun->flags & FN_NOSIDEFX) { --- 1243,1259 ---- FUNCTION(fun_lock) { dbref it; ! char *ltype = NULL; ! lock_type real_ltype; ! if ((ltype = strchr(args[0], '/'))) { ! *ltype++ = '\0'; ! upcasestr(ltype); ! } ! ! real_ltype = get_locktype(ltype); it = match_thing(executor, args[0]); if (nargs == 2) { if (!command_check_byname(executor, "@lock") || fun->flags & FN_NOSIDEFX) { *************** *** 1248,1256 **** return; } } ! if (GoodObject(it) && (ltype != NULL) ! && Can_Read_Lock(executor, it, ltype)) { ! safe_str(unparse_boolexp(executor, getlock(it, ltype), UB_DBREF), buff, bp); return; } safe_str("#-1", buff, bp); --- 1267,1276 ---- return; } } ! if (GoodObject(it) && (real_ltype != NULL) ! && Can_Read_Lock(executor, it, real_ltype)) { ! safe_str(unparse_boolexp(executor, getlock(it, real_ltype), UB_DBREF), ! buff, bp); return; } safe_str("#-1", buff, bp); *************** *** 1646,1652 **** safe_str(T(e_perm), buff, bp); return; } ! if (nameformat(executor, it, tbuf1)) safe_str(tbuf1, buff, bp); else if (IsExit(it)) safe_str(shortname(it), buff, bp); --- 1666,1673 ---- safe_str(T(e_perm), buff, bp); return; } ! if (nameformat(executor, it, tbuf1, ! IsExit(it) ? shortname(it) : (char *) accented_name(it))) safe_str(tbuf1, buff, bp); else if (IsExit(it)) safe_str(shortname(it), buff, bp); *** 1_8_1.113/src/function.c Thu, 23 Jun 2005 12:18:25 -0500 dunemush (pennmush/c/18_function.c 1.29.1.14.1.3.1.6.1.1.1.1.1.14.1.2.1.1.1.7.1.22.1.11.1.3.1.24.1.4.1.2.2.1.1.1.1.2 660) --- 1_8_1.148(w)/src/function.c Wed, 14 Sep 2005 22:51:21 -0500 dunemush (pennmush/c/18_function.c 1.29.1.14.1.3.1.6.1.1.1.1.1.14.1.2.1.1.1.7.1.22.1.11.1.3.1.24.1.4.1.2.2.1.1.1.1.8 660) *************** *** 146,189 **** } /** Save a copy of the wnxt and rnxt state * \param funcname name of function calling (for memory leak testing) ! * \param preservew pointer to array to store the wnxt in. ! * \param preserver pointer to array to store the rnxt in. */ void ! save_global_nxt(const char *funcname, char *preservew[], char *preserver[]) { int i; for (i = 0; i < NUMQ; i++) { preserver[i] = global_eval_context.rnxt[i]; ! if (global_eval_context.rnxt[i]) ! global_eval_context.rnxt[i] = (char *) mush_malloc(BUFFER_LEN, funcname); } for (i = 0; i < 10; i++) { preservew[i] = global_eval_context.wnxt[i]; ! if (global_eval_context.wnxt[i]) ! global_eval_context.wnxt[i] = (char *) mush_malloc(BUFFER_LEN, funcname); } } /** Restore a copy of the wnxt and rnxt state * \param funcname name of function calling (for memory leak testing) ! * \param preservew pointer to array to restore the wnxt from. ! * \param preserver pointer to array to restore the rnxt from. */ void ! restore_global_nxt(const char *funcname, char *preservew[], char *preserver[]) { int i; for (i = 0; i < NUMQ; i++) { - if (global_eval_context.rnxt[i]) - mush_free(global_eval_context.rnxt[i], funcname); global_eval_context.rnxt[i] = preserver[i]; } for (i = 0; i < 10; i++) { - if (global_eval_context.wnxt[i]) - mush_free(global_eval_context.wnxt[i], funcname); global_eval_context.wnxt[i] = preservew[i]; } } --- 146,214 ---- } /** Save a copy of the wnxt and rnxt state + * This function must deal with both the addresses and the values + * of these variables, because they get modified in all sorts of + * nasty ways that we may not account for. * \param funcname name of function calling (for memory leak testing) ! * \param preservew pointer to array to store the wnxt address in. ! * \param preserver pointer to array to store the rnxt address in. ! * \param valw pointer to array to store the wnxt value in. ! * \param valr pointer to array to store the rnxt value in. */ void ! save_global_nxt(const char *funcname, char *preservew[], char *preserver[], ! char *valw[], char *valr[]) { int i; for (i = 0; i < NUMQ; i++) { preserver[i] = global_eval_context.rnxt[i]; ! if (!global_eval_context.rnxt[i]) ! valr[i] = NULL; ! else { ! valr[i] = (char *) mush_malloc(BUFFER_LEN, funcname); ! strcpy(valr[i], global_eval_context.rnxt[i]); ! } } for (i = 0; i < 10; i++) { preservew[i] = global_eval_context.wnxt[i]; ! if (!global_eval_context.wnxt[i]) ! valw[i] = NULL; ! else { ! valw[i] = (char *) mush_malloc(BUFFER_LEN, funcname); ! strcpy(valw[i], global_eval_context.wnxt[i]); ! } } } /** Restore a copy of the wnxt and rnxt state * \param funcname name of function calling (for memory leak testing) ! * \param preservew pointer to array to restore the wnxt address from. ! * \param preserver pointer to array to restore the rnxt address from. ! * \param valw pointer to array to restore the wnxt value from. ! * \param valr pointer to array to restore the rnxt value from. */ void ! restore_global_nxt(const char *funcname, char *preservew[], char *preserver[], ! char *valw[], char *valr[]) { int i; for (i = 0; i < NUMQ; i++) { global_eval_context.rnxt[i] = preserver[i]; + if (preserver[i]) { + /* There was a former address, so we can restore to it */ + strcpy(global_eval_context.rnxt[i], valr[i]); + mush_free(valr[i], funcname); + valr[i] = NULL; + } } for (i = 0; i < 10; i++) { global_eval_context.wnxt[i] = preservew[i]; + if (preservew[i]) { + /* There was a former address, so we can restore to it */ + strcpy(global_eval_context.wnxt[i], valw[i]); + mush_free(valw[i], funcname); + valw[i] = NULL; + } } } *************** *** 561,566 **** --- 586,592 ---- {"SIGN", fun_sign, 1, 1, FN_REG}, {"SORT", fun_sort, 1, 4, FN_REG}, {"SORTBY", fun_sortby, 2, 4, FN_REG}, + {"SORTKEY", fun_sortkey, 2, 5, FN_REG}, {"SOUNDEX", fun_soundex, 1, 1, FN_REG}, {"SOUNDSLIKE", fun_soundlike, 2, 2, FN_REG}, {"SPACE", fun_space, 1, 1, FN_REG}, *************** *** 711,717 **** } /* do_gensort needs a dbref now, but only for sort types that aren't * used here anyway */ ! do_gensort((dbref) 0, (char **) ptrs, nptrs, ALPHANUM_LIST); bp = buff; safe_str(ptrs[0], buff, &bp); for (i = 1; i < nptrs; i++) { --- 737,743 ---- } /* do_gensort needs a dbref now, but only for sort types that aren't * used here anyway */ ! do_gensort((dbref) 0, (char **) ptrs, NULL, nptrs, ALPHANUM_LIST); bp = buff; safe_str(ptrs[0], buff, &bp); for (i = 1; i < nptrs; i++) { *************** *** 1022,1030 **** * \param player the enactor. * \param name name of function to add. * \param argv array of arguments. */ void ! do_function(dbref player, char *name, char *argv[]) { char tbuf1[BUFFER_LEN]; char *bp = tbuf1; --- 1048,1058 ---- * \param player the enactor. * \param name name of function to add. * \param argv array of arguments. + * \param preserve Treat the function like it was called with ulocal() instead + * of u(). */ void ! do_function(dbref player, char *name, char *argv[], int preserve) { char tbuf1[BUFFER_LEN]; char *bp = tbuf1; *************** *** 1138,1143 **** --- 1166,1173 ---- fp->flags = apply_restrictions(0, argv[5]); else fp->flags = 0; + if (preserve) + fp->flags |= FN_LOCALIZE; hashadd(name, fp, &htab_user_function); /* now add it to the user function table */ *************** *** 1191,1196 **** --- 1221,1235 ---- fp->maxargs = 10; } else fp->maxargs = 10; + + /* Set new flags */ + if (argv[5] && *argv[5]) + fp->flags = apply_restrictions(0, argv[5]); + else + fp->flags = 0; + if (preserve) + fp->flags |= FN_LOCALIZE; + notify(player, T("Function updated.")); } } *** 1_8_1.113/src/flags.c Mon, 14 Mar 2005 11:02:24 -0600 dunemush (pennmush/c/20_flags.c 1.1.1.1.1.1.1.1.1.1.1.1.1.6.1.2.1.1.1.1.1.2.2.2.2.1.2.1.1.3.1.2.1.1.1.1.1.1.1.1.1.3.1.9.1.2.2.1.1.2.1.56.1.12.1.1.1.29.1.2.1.2.1.4 660) --- 1_8_1.148(w)/src/flags.c Wed, 14 Sep 2005 22:51:21 -0500 dunemush (pennmush/c/20_flags.c 1.1.1.1.1.1.1.1.1.1.1.1.1.6.1.2.1.1.1.1.1.2.2.2.2.1.2.1.1.3.1.2.1.1.1.1.1.1.1.1.1.3.1.9.1.2.2.1.1.2.1.56.1.12.1.1.1.29.1.2.1.2.2.3 660) *************** *** 1889,1896 **** FLAGSPACE *n; Flagspace_Lookup(n, ns); /* Don't double-add */ ! if ((f = match_flag_ns(n, strupper(name)))) ! return f; f = new_flag(); f->name = mush_strdup(strupper(name), "flag name"); f->letter = letter; --- 1889,1898 ---- FLAGSPACE *n; Flagspace_Lookup(n, ns); /* Don't double-add */ ! if ((f = match_flag_ns(n, strupper(name)))) { ! if (strcasecmp(f->name, name) == 0) ! return f; ! } f = new_flag(); f->name = mush_strdup(strupper(name), "flag name"); f->letter = letter; *************** *** 2511,2517 **** ptrs[numptrs++] = (char *) f->name; } } ! do_gensort(privs, ptrs, numptrs, ALPHANUM_LIST); bp = buf; for (i = 0; i < numptrs; i++) { switch (which) { --- 2513,2519 ---- ptrs[numptrs++] = (char *) f->name; } } ! do_gensort(privs, ptrs, NULL, numptrs, ALPHANUM_LIST); bp = buf; for (i = 0; i < numptrs; i++) { switch (which) { *** 1_8_1.113/src/filecopy.c Thu, 19 Aug 2004 06:46:33 -0500 dunemush (pennmush/c/21_filecopy.c 1.86 660) --- 1_8_1.148(w)/src/filecopy.c Wed, 14 Sep 2005 22:51:21 -0500 dunemush (pennmush/c/21_filecopy.c 1.87 660) *************** *** 25,30 **** --- 25,32 ---- #include "log.h" #include "confmagic.h" + extern char confname[BUFFER_LEN]; /* From bsd.c */ + #ifdef WIN32 /* This is bad, but only for WIN32, which is bad anyway... */ *************** *** 207,213 **** --- 209,219 ---- if (!strcasecmp(rindex(FileName, '\\') + 1, "pennmush.exe")) { if (CopyFile("pennmush.exe", "pennmush_run.exe", FALSE)) { do_rawlog(LT_ERR, "Successfully copied executable, starting copy."); + #ifdef WIN32SERVICES execl("pennmush_run.exe", "pennmush_run.exe", "/run", NULL); + #else + execl("pennmush_run.exe", "pennmush_run.exe", confname, NULL); + #endif } } } *** 1_8_1.113/src/create.c Wed, 30 Jun 2004 15:00:16 -0500 dunemush (pennmush/c/27_create.c 1.27.1.3.1.1.1.1.1.1.1.2.1.1.1.1.1.27 660) --- 1_8_1.148(w)/src/create.c Wed, 14 Sep 2005 22:51:21 -0500 dunemush (pennmush/c/27_create.c 1.27.1.3.1.1.1.1.1.1.1.2.1.1.1.1.1.28 660) *************** *** 182,188 **** void do_unlink(dbref player, const char *name) { ! dbref exit_l; long match_flags = MAT_EXIT | MAT_HERE | MAT_ABSOLUTE; if (!Wizard(player)) { --- 182,188 ---- void do_unlink(dbref player, const char *name) { ! dbref exit_l, old_loc; long match_flags = MAT_EXIT | MAT_HERE | MAT_ABSOLUTE; if (!Wizard(player)) { *************** *** 201,208 **** } else { switch (Typeof(exit_l)) { case TYPE_EXIT: Location(exit_l) = NOTHING; ! notify_format(player, T("Unlinked exit #%d."), exit_l); break; case TYPE_ROOM: Location(exit_l) = NOTHING; --- 201,210 ---- } else { switch (Typeof(exit_l)) { case TYPE_EXIT: + old_loc = Location(exit_l); Location(exit_l) = NOTHING; ! notify_format(player, T("Unlinked exit #%d (Used to lead to %s)."), ! exit_l, unparse_object(player, old_loc)); break; case TYPE_ROOM: Location(exit_l) = NOTHING; *************** *** 304,310 **** Location(thing) = room; /* notify the player */ ! notify_format(player, T("Linked exit #%d to #%d"), thing, room); break; case TYPE_PLAYER: case TYPE_THING: --- 306,313 ---- Location(thing) = room; /* notify the player */ ! notify_format(player, T("Linked exit #%d to %s"), thing, ! unparse_object(player, room)); break; case TYPE_PLAYER: case TYPE_THING: *** 1_8_1.113/src/cque.c Tue, 21 Jun 2005 10:13:22 -0500 dunemush (pennmush/c/28_cque.c 1.36.1.5.1.1.1.1.1.1.1.2.1.6.1.29.1.3 660) --- 1_8_1.148(w)/src/cque.c Wed, 14 Sep 2005 22:51:21 -0500 dunemush (pennmush/c/28_cque.c 1.36.1.5.1.1.1.1.1.1.1.2.1.6.1.29.1.4 660) *************** *** 195,203 **** if (estcost != QUEUE_COST && Track_Money(Owner(player))) { char *preserve_wnxt[10]; char *preserve_rnxt[NUMQ]; char *preserves[10]; char *preserveq[NUMQ]; ! save_global_nxt("pay_queue_save", preserve_wnxt, preserve_rnxt); save_global_regs("pay_queue_save", preserveq); save_global_env("pay_queue_save", preserves); notify_format(Owner(player), --- 195,206 ---- if (estcost != QUEUE_COST && Track_Money(Owner(player))) { char *preserve_wnxt[10]; char *preserve_rnxt[NUMQ]; + char *val_wnxt[10]; + char *val_rnxt[NUMQ]; char *preserves[10]; char *preserveq[NUMQ]; ! save_global_nxt("pay_queue_save", preserve_wnxt, preserve_rnxt, val_wnxt, ! val_rnxt); save_global_regs("pay_queue_save", preserveq); save_global_env("pay_queue_save", preserves); notify_format(Owner(player), *************** *** 205,211 **** Name(player), unparse_dbref(player), MONEY); restore_global_regs("pay_queue_save", preserveq); restore_global_env("pay_queue_save", preserves); ! restore_global_nxt("pay_queue_save", preserve_wnxt, preserve_rnxt); } if (queue_limit(QUEUE_PER_OWNER ? Owner(player) : player)) { notify_format(Owner(player), --- 208,215 ---- Name(player), unparse_dbref(player), MONEY); restore_global_regs("pay_queue_save", preserveq); restore_global_env("pay_queue_save", preserves); ! restore_global_nxt("pay_queue_save", preserve_wnxt, preserve_rnxt, val_wnxt, ! val_rnxt); } if (queue_limit(QUEUE_PER_OWNER ? Owner(player) : player)) { notify_format(Owner(player), *** 1_8_1.113/src/conf.c Sun, 20 Mar 2005 13:49:18 -0600 dunemush (pennmush/c/31_conf.c 1.41.2.3.1.3.1.2.1.15.1.1.1.1.1.1.1.41.1.1.1.2 660) --- 1_8_1.148(w)/src/conf.c Wed, 14 Sep 2005 22:51:21 -0500 dunemush (pennmush/c/31_conf.c 1.41.2.3.1.3.1.2.1.15.1.1.1.1.1.1.1.41.1.1.1.1.1.2 660) *************** *** 835,841 **** /* Was this "restrict_command "? If so, do it */ if (!strcasecmp(opt, "restrict_command")) { if (!restrictions) ! return 1; for (p = val; *p && !isspace((unsigned char) *p); p++) ; if (*p) { *p++ = '\0'; --- 835,841 ---- /* Was this "restrict_command "? If so, do it */ if (!strcasecmp(opt, "restrict_command")) { if (!restrictions) ! return 0; for (p = val; *p && !isspace((unsigned char) *p); p++) ; if (*p) { *p++ = '\0'; *************** *** 858,864 **** return 1; } else if (!strcasecmp(opt, "restrict_function")) { if (!restrictions) ! return 1; for (p = val; *p && !isspace((unsigned char) *p); p++) ; if (*p) { *p++ = '\0'; --- 858,864 ---- return 1; } else if (!strcasecmp(opt, "restrict_function")) { if (!restrictions) ! return 0; for (p = val; *p && !isspace((unsigned char) *p); p++) ; if (*p) { *p++ = '\0'; *************** *** 882,893 **** return 1; } else if (!strcasecmp(opt, "reserve_alias")) { if (!restrictions) ! return 1; reserve_alias(val); return 1; } else if (!strcasecmp(opt, "command_alias")) { if (!restrictions) ! return 1; for (p = val; *p && !isspace((unsigned char) *p); p++) ; if (*p) { *p++ = '\0'; --- 882,893 ---- return 1; } else if (!strcasecmp(opt, "reserve_alias")) { if (!restrictions) ! return 0; reserve_alias(val); return 1; } else if (!strcasecmp(opt, "command_alias")) { if (!restrictions) ! return 0; for (p = val; *p && !isspace((unsigned char) *p); p++) ; if (*p) { *p++ = '\0'; *************** *** 907,913 **** return 1; } else if (!strcasecmp(opt, "attribute_alias")) { if (!restrictions) ! return 1; for (p = val; *p && !isspace((unsigned char) *p); p++) ; if (*p) { *p++ = '\0'; --- 907,913 ---- return 1; } else if (!strcasecmp(opt, "attribute_alias")) { if (!restrictions) ! return 0; for (p = val; *p && !isspace((unsigned char) *p); p++) ; if (*p) { *p++ = '\0'; *************** *** 927,933 **** return 1; } else if (!strcasecmp(opt, "function_alias")) { if (!restrictions) ! return 1; for (p = val; *p && !isspace((unsigned char) *p); p++) ; if (*p) { *p++ = '\0'; --- 927,933 ---- return 1; } else if (!strcasecmp(opt, "function_alias")) { if (!restrictions) ! return 0; for (p = val; *p && !isspace((unsigned char) *p); p++) ; if (*p) { *p++ = '\0'; *************** *** 950,956 **** char *comm, *file; int admin = !strcasecmp(opt, "ahelp_command"); if (!restrictions) ! return 1; /* Add a new help-like command */ if (source == 1) return 0; --- 950,956 ---- char *comm, *file; int admin = !strcasecmp(opt, "ahelp_command"); if (!restrictions) ! return 0; /* Add a new help-like command */ if (source == 1) return 0; *** 1_8_1.113/src/command.c Thu, 23 Jun 2005 11:55:45 -0500 dunemush (pennmush/c/36_command.c 1.56.1.1.1.1.1.1.1.2.1.1.1.1.1.5.1.2.1.1.1.1.1.2.1.3.1.10.1.1.3.74.1.6.1.3.1.1.1.1.1.2 660) --- 1_8_1.148(w)/src/command.c Wed, 14 Sep 2005 22:51:21 -0500 dunemush (pennmush/c/36_command.c 1.56.1.1.1.1.1.1.1.2.1.1.1.1.1.5.1.2.1.1.1.1.1.2.1.3.1.10.1.1.3.74.1.6.1.3.1.1.1.1.1.1.1.2 660) *************** *** 93,99 **** {"@CONFIG", "SET LOWERCASE LIST GLOBALS DEFAULTS COSTS FLAGS FUNCTIONS COMMANDS ATTRIBS", cmd_config, CMD_T_ANY | CMD_T_EQSPLIT, 0, 0}, ! {"@CPATTR", "CONVERT", cmd_cpattr, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_RS_ARGS, 0, 0}, {"@CREATE", NULL, cmd_create, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, 0, 0}, --- 93,100 ---- {"@CONFIG", "SET LOWERCASE LIST GLOBALS DEFAULTS COSTS FLAGS FUNCTIONS COMMANDS ATTRIBS", cmd_config, CMD_T_ANY | CMD_T_EQSPLIT, 0, 0}, ! {"@CPATTR", "CONVERT NOFLAGCOPY", cmd_cpattr, ! CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_RS_ARGS, 0, 0}, {"@CREATE", NULL, cmd_create, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, 0, 0}, *************** *** 119,125 **** {"@DRAIN", "ALL ANY", cmd_notify_drain, CMD_T_ANY | CMD_T_EQSPLIT, 0, 0}, {"@DUMP", "PARANOID DEBUG", cmd_dump, CMD_T_ANY, "WIZARD", 0}, ! {"@EDIT", "FIRST", cmd_edit, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_RS_ARGS | CMD_T_RS_NOPARSE | CMD_T_NOGAGGED, 0, 0}, {"@ELOCK", NULL, cmd_elock, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, --- 120,126 ---- {"@DRAIN", "ALL ANY", cmd_notify_drain, CMD_T_ANY | CMD_T_EQSPLIT, 0, 0}, {"@DUMP", "PARANOID DEBUG", cmd_dump, CMD_T_ANY, "WIZARD", 0}, ! {"@EDIT", "FIRST CHECK", cmd_edit, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_RS_ARGS | CMD_T_RS_NOPARSE | CMD_T_NOGAGGED, 0, 0}, {"@ELOCK", NULL, cmd_elock, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, *************** *** 141,147 **** {"@FORCE", "NOEVAL", cmd_force, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, 0, 0}, ! {"@FUNCTION", "DELETE ENABLE DISABLE RESTORE RESTRICT", cmd_function, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_RS_ARGS | CMD_T_NOGAGGED, 0, 0}, {"@GREP", "LIST PRINT ILIST IPRINT", cmd_grep, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_RS_NOPARSE | CMD_T_NOGAGGED, 0, 0}, --- 142,148 ---- {"@FORCE", "NOEVAL", cmd_force, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, 0, 0}, ! {"@FUNCTION", "DELETE ENABLE DISABLE PRESERVE RESTORE RESTRICT", cmd_function, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_RS_ARGS | CMD_T_NOGAGGED, 0, 0}, {"@GREP", "LIST PRINT ILIST IPRINT", cmd_grep, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_RS_NOPARSE | CMD_T_NOGAGGED, 0, 0}, *************** *** 180,186 **** 0, 0}, {"@MOTD", "CONNECT LIST WIZARD DOWN FULL", cmd_motd, CMD_T_ANY | CMD_T_NOGAGGED, 0, 0}, ! {"@MVATTR", "CONVERT", cmd_mvattr, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_RS_ARGS, 0, 0}, {"@NAME", NULL, cmd_name, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED | CMD_T_NOGUEST, 0, 0}, --- 181,188 ---- 0, 0}, {"@MOTD", "CONNECT LIST WIZARD DOWN FULL", cmd_motd, CMD_T_ANY | CMD_T_NOGAGGED, 0, 0}, ! {"@MVATTR", "CONVERT NOFLAGCOPY", cmd_mvattr, ! CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_RS_ARGS, 0, 0}, {"@NAME", NULL, cmd_name, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED | CMD_T_NOGUEST, 0, 0}, *************** *** 1625,1631 **** command = (COMMAND_INFO *) ptab_nextentry(&ptab_command); } ! do_gensort((dbref) 0, (char **) ptrs, nptrs, ALPHANUM_LIST); bp = buff; safe_str(ptrs[0], buff, &bp); for (i = 1; i < nptrs; i++) { --- 1627,1633 ---- command = (COMMAND_INFO *) ptab_nextentry(&ptab_command); } ! do_gensort((dbref) 0, (char **) ptrs, NULL, nptrs, ALPHANUM_LIST); bp = buff; safe_str(ptrs[0], buff, &bp); for (i = 1; i < nptrs; i++) { *** 1_8_1.113/src/cmds.c Sat, 04 Jun 2005 22:07:51 -0500 dunemush (pennmush/c/37_cmds.c 1.33.1.1.1.2.1.2.2.3.1.1.1.2.1.1.1.3.1.8.1.1.2.2.2.20.1.3.1.7.1.2.1.20.1.2.1.1.1.2 660) --- 1_8_1.148(w)/src/cmds.c Wed, 14 Sep 2005 22:51:21 -0500 dunemush (pennmush/c/37_cmds.c 1.33.1.1.1.2.1.2.2.3.1.1.1.2.1.1.1.3.1.8.1.1.2.2.2.20.1.3.1.7.1.2.1.20.1.2.1.1.1.5 660) *************** *** 262,271 **** } COMMAND (cmd_edit) { ! if (SW_ISSET(sw, SWITCH_FIRST)) ! do_gedit(player, arg_left, args_right, EDIT_FIRST); ! else ! do_gedit(player, arg_left, args_right, EDIT_ALL); } COMMAND (cmd_elock) { --- 262,270 ---- } COMMAND (cmd_edit) { ! do_gedit(player, arg_left, args_right, ! SW_ISSET(sw, SWITCH_FIRST) ? EDIT_FIRST : EDIT_ALL, ! SW_ISSET(sw, SWITCH_CHECK) ? 0 : 1); } COMMAND (cmd_elock) { *************** *** 365,375 **** *args_right[2]++ = '\0'; } if (args_right[1] && *args_right[1]) ! do_function(player, arg_left, args_right); else if (arg_left && *arg_left) do_function_report(player, arg_left); else ! do_function(player, NULL, NULL); if (split) { if (args_right[2]) *--args_right[2] = '/'; --- 364,374 ---- *args_right[2]++ = '\0'; } if (args_right[1] && *args_right[1]) ! do_function(player, arg_left, args_right, SW_ISSET(sw, SWITCH_PRESERVE)); else if (arg_left && *arg_left) do_function_report(player, arg_left); else ! do_function(player, NULL, NULL, 0); if (split) { if (args_right[2]) *--args_right[2] = '/'; *************** *** 1075,1092 **** COMMAND (cmd_page) { char *t; if ((arg_right) && (*arg_right)) { t = arg_right; } else { t = NULL; } if (SW_ISSET(sw, SWITCH_PORT)) do_page_port(player, arg_left, t); else do_page(player, arg_left, t, cause, SW_ISSET(sw, SWITCH_NOEVAL), !(SW_ISSET(sw, SWITCH_BLIND) || (!(SW_ISSET(sw, SWITCH_LIST)) && (BLIND_PAGE))), ! SW_ISSET(sw, SWITCH_OVERRIDE)); } COMMAND (cmd_pose) { --- 1074,1094 ---- COMMAND (cmd_page) { char *t; + int has_eq = 0; if ((arg_right) && (*arg_right)) { t = arg_right; } else { t = NULL; } + if (args_raw && *args_raw && strchr(args_raw, '=')) + has_eq = 1; if (SW_ISSET(sw, SWITCH_PORT)) do_page_port(player, arg_left, t); else do_page(player, arg_left, t, cause, SW_ISSET(sw, SWITCH_NOEVAL), !(SW_ISSET(sw, SWITCH_BLIND) || (!(SW_ISSET(sw, SWITCH_LIST)) && (BLIND_PAGE))), ! SW_ISSET(sw, SWITCH_OVERRIDE), has_eq); } COMMAND (cmd_pose) { *** 1_8_1.113/src/attrib.c Mon, 27 Jun 2005 14:30:26 -0500 dunemush (pennmush/c/40_attrib.c 1.15.1.2.1.5.1.1.1.3.1.3.1.2.1.2.1.2.2.1.1.2.1.2.1.2.1.1.1.3.1.1.1.1.1.1.3.43.1.25 660) --- 1_8_1.148(w)/src/attrib.c Wed, 14 Sep 2005 22:51:21 -0500 dunemush (pennmush/c/40_attrib.c 1.15.1.2.1.5.1.1.1.3.1.3.1.2.1.2.1.2.2.1.1.2.1.2.1.2.1.1.1.3.1.1.1.1.1.1.3.43.1.15.1.1.1.2 660) *************** *** 1589,1595 **** s ? atr_add(thing, name, s, player, (flags & 0x02) ? AF_NOPROG : NOTHING) : atr_clr(thing, name, player); if (res == AE_SAFE) { ! notify(player, T("That attribute is SAFE. Set it !SAFE to modify it.")); return 0; } else if (res == AE_BADNAME) { notify(player, T("That's not a very good name for an attribute.")); --- 1589,1596 ---- s ? atr_add(thing, name, s, player, (flags & 0x02) ? AF_NOPROG : NOTHING) : atr_clr(thing, name, player); if (res == AE_SAFE) { ! notify_format(player, T("Attribute %s is SAFE. Set it !SAFE to modify it."), ! name); return 0; } else if (res == AE_BADNAME) { notify(player, T("That's not a very good name for an attribute.")); *** 1_8_1.113/hdrs/version.h Mon, 27 Jun 2005 14:30:26 -0500 dunemush (pennmush/c/47_version.h 1.32.1.2.1.7.1.9.1.1.1.17.1.51 660) --- 1_8_1.148(w)/hdrs/version.h Wed, 14 Sep 2005 22:51:22 -0500 dunemush (pennmush/c/47_version.h 1.32.1.2.1.7.1.9.1.1.1.17.1.52 660) *************** *** 1,4 **** #define VERSION "1.8.1" ! #define PATCHLEVEL "1" ! #define PATCHDATE "[06/27/2005]" ! #define NUMVERSION 1008001001 --- 1,4 ---- #define VERSION "1.8.1" ! #define PATCHLEVEL "2" ! #define PATCHDATE "[09/05/2005]" ! #define NUMVERSION 1008001002 *** 1_8_1.113/hdrs/shs.h Tue, 11 May 2004 10:52:49 -0500 dunemush (pennmush/c/48_shs.h 1.9 660) --- 1_8_1.148(w)/hdrs/shs.h Wed, 14 Sep 2005 22:51:22 -0500 dunemush (pennmush/c/48_shs.h 1.10 660) *************** *** 2,7 **** --- 2,10 ---- #define _SHS_H #include "config.h" + #ifdef I_STDINT + #include + #endif #include "confmagic.h" /* -------------- SHS.H --------------------------- */ *************** *** 15,22 **** --- 18,29 ---- typedef long LONG; #else typedef unsigned char BYTE; + #ifdef HAS_UINT32_T + typedef uint32_t LONG; + #else typedef unsigned long LONG; #endif + #endif #define SHS_BLOCKSIZE 64 *** 1_8_1.113/hdrs/game.h Sat, 04 Jun 2005 22:07:51 -0500 dunemush (pennmush/d/12_game.h 1.28.1.2.1.1.1.1.1.1.1.7.1.22.1.3.1.2.1.2 660) --- 1_8_1.148(w)/hdrs/game.h Wed, 14 Sep 2005 22:51:22 -0500 dunemush (pennmush/d/12_game.h 1.28.1.2.1.1.1.1.1.1.1.7.1.22.1.3.1.2.1.4 660) *************** *** 112,118 **** (dbref player, char *oldpair, char **newpair, int move, int noflagcopy); enum edit_type { EDIT_FIRST, EDIT_ALL }; extern void do_gedit(dbref player, char *it, char **argv, ! enum edit_type target); extern void do_trigger(dbref player, char *object, char **argv); extern void do_use(dbref player, const char *what); extern void do_parent(dbref player, char *name, char *parent_name); --- 112,118 ---- (dbref player, char *oldpair, char **newpair, int move, int noflagcopy); enum edit_type { EDIT_FIRST, EDIT_ALL }; extern void do_gedit(dbref player, char *it, char **argv, ! enum edit_type target, int doit); extern void do_trigger(dbref player, char *object, char **argv); extern void do_use(dbref player, const char *what); extern void do_parent(dbref player, char *name, char *parent_name); *************** *** 129,135 **** extern void do_wall(dbref player, const char *message, enum wall_type target, int emit); extern void do_page(dbref player, const char *arg1, const char *arg2, ! dbref cause, int noeval, int multipage, int override); extern void do_page_port(dbref player, const char *arg1, const char *arg2); extern void do_think(dbref player, const char *message); #define PEMIT_SILENT 0x1 --- 129,136 ---- extern void do_wall(dbref player, const char *message, enum wall_type target, int emit); extern void do_page(dbref player, const char *arg1, const char *arg2, ! dbref cause, int noeval, int multipage, int override, ! int has_eq); extern void do_page_port(dbref player, const char *arg1, const char *arg2); extern void do_think(dbref player, const char *message); #define PEMIT_SILENT 0x1 *** 1_8_1.113/hdrs/function.h Sat, 21 May 2005 15:34:52 -0500 dunemush (pennmush/d/13_function.h 1.23 660) --- 1_8_1.148(w)/hdrs/function.h Wed, 14 Sep 2005 22:51:22 -0500 dunemush (pennmush/d/13_function.h 1.24 660) *************** *** 98,104 **** extern void do_function_restore(dbref player, const char *name); extern void do_list_functions(dbref player, int lc); extern char *list_functions(void); ! extern void do_function(dbref player, char *name, char **argv); extern void do_function_toggle(dbref player, char *name, int toggle); extern void do_function_report(dbref player, char *name); extern void do_function_delete(dbref player, char *name); --- 98,104 ---- extern void do_function_restore(dbref player, const char *name); extern void do_list_functions(dbref player, int lc); extern char *list_functions(void); ! extern void do_function(dbref player, char *name, char **argv, int preserve); extern void do_function_toggle(dbref player, char *name, int toggle); extern void do_function_report(dbref player, char *name); extern void do_function_delete(dbref player, char *name); *** 1_8_1.113/hdrs/externs.h Thu, 23 Jun 2005 11:55:45 -0500 dunemush (pennmush/d/16_externs.h 1.1.1.53.1.2.1.8.2.1.1.2.1.1.1.1.1.2.1.6.1.3.1.4.3.1.1.1.1.18.1.8.1.1.1.32.1.1.3.1.1.2 660) --- 1_8_1.148(w)/hdrs/externs.h Wed, 14 Sep 2005 22:51:22 -0500 dunemush (pennmush/d/16_externs.h 1.1.1.53.1.2.1.8.2.1.1.2.1.1.1.1.1.2.1.6.1.3.1.4.3.1.1.1.1.18.1.8.1.1.1.32.1.1.3.1.1.5 660) *************** *** 503,509 **** #define object_header(p,l) unparse_object(p,l) extern const char *unparse_object_myopic(dbref player, dbref loc); extern const char *unparse_room(dbref player, dbref loc); ! extern int nameformat(dbref player, dbref loc, char *tbuf1); extern const char *accented_name(dbref thing); /* From utils.c */ --- 503,509 ---- #define object_header(p,l) unparse_object(p,l) extern const char *unparse_object_myopic(dbref player, dbref loc); extern const char *unparse_room(dbref player, dbref loc); ! extern int nameformat(dbref player, dbref loc, char *tbuf1, char *defname); extern const char *accented_name(dbref thing); /* From utils.c */ *************** *** 586,594 **** extern void save_global_env(const char *funcname, char *preserve[]); extern void restore_global_env(const char *funcname, char *preserve[]); extern void save_global_nxt(const char *funcname, char *preservew[], ! char *preserver[]); extern void restore_global_nxt(const char *funcname, char *preservew[], ! char *preserver[]); extern int delim_check(char *buff, char **bp, int nfargs, char **fargs, int sep_arg, char *sep); extern int get_gender(dbref player); --- 586,595 ---- extern void save_global_env(const char *funcname, char *preserve[]); extern void restore_global_env(const char *funcname, char *preserve[]); extern void save_global_nxt(const char *funcname, char *preservew[], ! char *preserver[], char *valw[], char *valr[]); extern void restore_global_nxt(const char *funcname, char *preservew[], ! char *preserver[], char *valw[], ! char *valr[]); extern int delim_check(char *buff, char **bp, int nfargs, char **fargs, int sep_arg, char *sep); extern int get_gender(dbref player); *************** *** 633,639 **** void local_flags(FLAGSPACE * flags); /* funlist.c */ ! void do_gensort(dbref player, char *s[], int n, char *sort_type); /* sig.c */ /** Type definition for signal handlers */ --- 634,641 ---- void local_flags(FLAGSPACE * flags); /* funlist.c */ ! void do_gensort(dbref player, char *keys[], char *strs[], int n, ! char *sort_type); /* sig.c */ /** Type definition for signal handlers */ *** 1_8_1.113/Configure Mon, 28 Jun 2004 09:33:37 -0500 dunemush (pennmush/d/32_Configure 1.21.1.4.1.1.1.1.1.1.1.7.1.14 710) --- 1_8_1.148(w)/Configure Sun, 11 Sep 2005 09:01:55 -0500 dunemush (pennmush/d/32_Configure 1.21.1.4.1.1.1.1.1.1.1.7.1.16 710) *************** *** 263,269 **** warnings='' cdecl='' cf_email='' - cf_name='' cf_by='' cf_time='' contains='' --- 263,268 ---- *************** *** 355,360 **** --- 354,360 ---- d_textdomain='' d_timelocal='' d_toupper='' + d_uint32_t='' d_uptime='' d_urandom='' d_uwait3='' *************** *** 379,387 **** i_netdb='' i_niin='' i_sysin='' - i_nitcp='' i_setjmp='' i_stddef='' i_stdlib='' i_string='' strings='' --- 379,387 ---- i_netdb='' i_niin='' i_sysin='' i_setjmp='' i_stddef='' + i_stdint='' i_stdlib='' i_string='' strings='' *************** *** 416,423 **** install='' installdir='' libc='' - d_mysql='' - libmysqlclient='' glibpth='' libpth='' loclibpth='' --- 416,421 ---- *************** *** 455,461 **** sizetype='' so='' d_keepalive='' - d_keepidle='' sharpbang='' shsharp='' spitshell='' --- 453,458 ---- *************** *** 4620,4661 **** set socketpair d_sockpair eval $inlibc - : see if this is a netinet/tcp.h system - set netinet/tcp.h i_nitcp - eval $inhdr - : see if setsockopt with SO_KEEPALIVE works as advertised echo " " case "$d_oldsock" in "$undef") echo "OK, let's see if SO_KEEPALIVE works as advertised..." >&4 $cat > socket.c < #include #include - #$i_nitcp I_NETINET_TCP - #ifdef I_NETINET_TCP - #include - #endif #include main() { int s = socket(AF_INET, SOCK_STREAM, 0); - int val = 1; if (s == -1) exit(1); ! if (-1 == setsockopt(s, SOL_SOCKET, SO_KEEPALIVE, &val, sizeof(val))) exit(2); - #ifdef I_NETINET_TCP - #ifdef TCP_KEEPIDLE - val = 1; - if (-1 == setsockopt(s, IPPROTO_TCP, TCP_KEEPIDLE, &val, sizeof(val))) - exit(3); - #else - exit(3); - #endif - #endif exit(0); } EOP --- 4617,4643 ---- set socketpair d_sockpair eval $inlibc : see if setsockopt with SO_KEEPALIVE works as advertised echo " " case "$d_oldsock" in "$undef") + if $contains SO_KEEPALIVE `./findhdr sys/socket.h` \ + /dev/null >/dev/null 2>&1 + then echo "OK, let's see if SO_KEEPALIVE works as advertised..." >&4 $cat > socket.c < #include #include #include main() { int s = socket(AF_INET, SOCK_STREAM, 0); if (s == -1) exit(1); ! if (-1 == setsockopt(s, SOL_SOCKET, SO_KEEPALIVE, 0, 0)) exit(2); exit(0); } EOP *************** *** 4664,4706 **** ./socket >/dev/null 2>&1 case $? in 0) echo "Yes, it does!" ! val="$define" ! val2="$i_nitcp" ! ;; 1) $cat </dev/null 2>&1 case $? in 0) echo "Yes, it does!" ! val="$define";; 1) $cat < test_mysql.c < - #include - #include - #include - - int main(int argc, char **argv) { - printf("Your mysql is version %s\n",mysql_get_client_info()); - exit(0); - } - EOM - - if $cc $ccflags $ldflags -o test_mysql test_mysql.c $libs $libmysqlclient >/dev/null 2>&1 ; - then - echo 'You have mysql...' >&4 - version=`./test_mysql` - if $test $? -eq 0; then - echo "$version" >&4 - d_mysql="$define" - else - echo "...but my test program didn't run correctly." >&4 - libmysqlclient='' - fi - else - echo "You don't seem to have mysql." >&4 - libmysqlclient='' - fi - $rm -f test_mysql* core - - else - - echo "Skipping mysql tests." >&4 - libmysqlclient='' - - fi - : check for a new-style definitions echo " " $cat >test_newstyle.c <<'EOCP' --- 4759,4764 ---- *************** *** 5313,5377 **** fi $rm -f test_toupper* core - : uptime - echo " " - if $test -x $uptime ; then - val="$define" - else - val="$undef" - fi - set d_uptime; eval $setvar - - : see if /dev/urandom is present - echo " " - if $test -c /dev/urandom ; then - val="$define" - else - val="$undef" - fi - set d_urandom; eval $setvar - - : see if union wait is available - echo " " - set X $cppflags - shift - flags='' - also='' - for f in $*; do - case "$f" in - *NO_PROTO*) ;; - *) flags="$flags $f";; - esac - done - xxx="`./findhdr sys/wait.h`" - case "x$xxx" in - x) xxx=/dev/null - esac - $cat "$xxx" | $cppstdin $flags $cppminus >wait.out 2>/dev/null - if $contains 'union.*wait.*{' wait.out >/dev/null 2>&1 ; then - echo "Looks like your knows about 'union wait'..." >&4 - val="$define" - also='also ' - if $contains 'extern.*wait[ ]*([ ]*int' wait.out >/dev/null 2>&1 - then - echo "But wait() seems to expect an 'int' pointer (POSIX way)." >&4 - val="$undef" - also='' - elif $contains 'extern.*wait[ ]*([ ]*union' wait.out >/dev/null 2>&1 - then - echo "And indeed wait() expects an 'union wait' pointer (BSD way)." >&4 - else - echo "So we'll use that for wait()." >&4 - fi - else - echo "No trace of 'union wait' in ..." >&4 - val="$undef" - echo "Your wait() should be happy with a plain 'int' pointer." >&4 - fi - set d_uwait - eval $setvar - $rm -f wait.out - : get C preprocessor symbols handy echo " " $echo $n "Hmm... $c" --- 5238,5243 ---- *************** *** 5479,5484 **** --- 5345,5461 ---- fi $rm -f ccsym* + : see if this is a stdint system + val="$undef" + if $test "`./findhdr stdint.h`"; then + val="$define" + echo " found." >&4 + fi + echo " " + set i_stdint; eval $setvar + : see if we have uint32_t + echo "Let's try to figure out a really big double." >&4 + echo " " + $cat >d_uint32.c < + #$i_stdint I_STDINT + #ifdef I_STDINT + #include + #endif + + int main() + { + uint32_t a; + a = 2*2*2*2; + a *= a; /* 2^8 */ + a *= a; /* 2^16 */ + a *= a; /* 2^32 */ + a += 1; /* 2^32 + 1 */ + if (a == 1) + printf("ok\n"); + else + printf("not ok\n"); + } + EOCP + + if $cc $ccflags $ldflags d_uint32.c -o d_uint32 $libs >/dev/null 2>&1; then + val=`./d_uint32` + if test $val = "ok" ; then + val="$define" + set d_uint32_t; eval $setvar + echo "You have uint32_t." >&4 + else + val="$undef" + set d_uint32_t; eval $setvar + echo "You don't have uint32_t, hope you're a 32 bit machine." >&4 + fi + else + val="$undef" + set d_uint32_t; eval $setvar + echo "I can't tell if you have uint32_t, hope you're a 32 bit machine." >&4 + fi + + $rm -f d_uint32* + + : uptime + echo " " + if $test -x $uptime ; then + val="$define" + else + val="$undef" + fi + set d_uptime; eval $setvar + + : see if /dev/urandom is present + echo " " + if $test -c /dev/urandom ; then + val="$define" + else + val="$undef" + fi + set d_urandom; eval $setvar + + : see if union wait is available + echo " " + set X $cppflags + shift + flags='' + also='' + for f in $*; do + case "$f" in + *NO_PROTO*) ;; + *) flags="$flags $f";; + esac + done + xxx="`./findhdr sys/wait.h`" + case "x$xxx" in + x) xxx=/dev/null + esac + $cat "$xxx" | $cppstdin $flags $cppminus >wait.out 2>/dev/null + if $contains 'union.*wait.*{' wait.out >/dev/null 2>&1 ; then + echo "Looks like your knows about 'union wait'..." >&4 + val="$define" + also='also ' + if $contains 'extern.*wait[ ]*([ ]*int' wait.out >/dev/null 2>&1 + then + echo "But wait() seems to expect an 'int' pointer (POSIX way)." >&4 + val="$undef" + also='' + elif $contains 'extern.*wait[ ]*([ ]*union' wait.out >/dev/null 2>&1 + then + echo "And indeed wait() expects an 'union wait' pointer (BSD way)." >&4 + else + echo "So we'll use that for wait()." >&4 + fi + else + echo "No trace of 'union wait' in ..." >&4 + val="$undef" + echo "Your wait() should be happy with a plain 'int' pointer." >&4 + fi + set d_uwait + eval $setvar + $rm -f wait.out + : see if this is a termio system val="$undef" val2="$undef" *************** *** 6628,6635 **** dflt=y elif ./xenix; then dflt=y - elif $test "x$osname" = "xlinux"; then - dflt=y else dflt=n fi --- 6605,6610 ---- *************** *** 6886,6892 **** cdecl='$cdecl' cf_by='$cf_by' cf_email='$cf_email' - cf_name='$cf_name' cf_time='$cf_time' chgrp='$chgrp' chmod='$chmod' --- 6861,6866 ---- *************** *** 6940,6946 **** d_ipv6='$d_ipv6' d_itimer='$d_itimer' d_keepalive='$d_keepalive' - d_keepidle='$d_keepidle' d_keepsig='$d_keepsig' d_lrand48='$d_lrand48' d_maxdouble='$d_maxdouble' --- 6914,6919 ---- *************** *** 6949,6955 **** d_memmove='$d_memmove' d_memset='$d_memset' d_mymalloc='$d_mymalloc' - d_mysql='$d_mysql' d_newstyle='$d_newstyle' d_oldsock='$d_oldsock' d_open3='$d_open3' --- 6922,6927 ---- *************** *** 6988,6993 **** --- 6960,6966 ---- d_textdomain='$d_textdomain' d_timelocal='$d_timelocal' d_toupper='$d_toupper' + d_uint32_t='$d_uint32_t' d_uptime='$d_uptime' d_urandom='$d_urandom' d_usgnames='$d_usgnames' *************** *** 7034,7044 **** i_memory='$i_memory' i_netdb='$i_netdb' i_niin='$i_niin' - i_nitcp='$i_nitcp' i_setjmp='$i_setjmp' i_sgtty='$i_sgtty' i_stdarg='$i_stdarg' i_stddef='$i_stddef' i_stdlib='$i_stdlib' i_string='$i_string' i_syserrno='$i_syserrno' --- 7007,7017 ---- i_memory='$i_memory' i_netdb='$i_netdb' i_niin='$i_niin' i_setjmp='$i_setjmp' i_sgtty='$i_sgtty' i_stdarg='$i_stdarg' i_stddef='$i_stddef' + i_stdint='$i_stdint' i_stdlib='$i_stdlib' i_string='$i_string' i_syserrno='$i_syserrno' *************** *** 7075,7081 **** ldflags='$ldflags' less='$less' libc='$libc' - libmysqlclient='$libmysqlclient' libpth='$libpth' libs='$libs' libssl='$libssl' --- 7048,7053 ---- *** 1_8_1.113/win32/funs.h Fri, 25 Feb 2005 15:08:13 -0600 dunemush (pennmush/f/12_funs.h 1.11.1.9.2.8.2.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.8.1.3.1.7.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.10.1.1.1.4.1.5.1.1.1.1.1.3 640) --- 1_8_1.148(w)/win32/funs.h Wed, 14 Sep 2005 21:59:06 -0500 dunemush (pennmush/f/12_funs.h 1.11.1.9.2.8.2.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.8.1.3.1.7.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.10.1.1.1.4.1.5.1.1.1.1.1.4 640) *************** *** 278,283 **** --- 278,284 ---- FUNCTION_PROTO(fun_sin); FUNCTION_PROTO(fun_sort); FUNCTION_PROTO(fun_sortby); + FUNCTION_PROTO(fun_sortkey); FUNCTION_PROTO(fun_soundex); FUNCTION_PROTO(fun_soundlike); FUNCTION_PROTO(fun_space); *** 1_8_1.113/game/README Sat, 10 Jul 2004 09:53:09 -0500 dunemush (pennmush/g/13_README 1.6 660) --- 1_8_1.148(w)/game/README Wed, 10 Aug 2005 22:43:04 -0500 dunemush (pennmush/g/13_README 1.7 660) *************** *** 42,47 **** --- 42,53 ---- in mush.cnf) every time, since errors and other important messages get printed to that logfile. + After your first startup, it's a good idea to make some small + change to the database (e.g., @create an object) and then + do an @shutdown. Restart the game again and ensure that your + object is still present - this verifies that the server is + successfully dumping. + ============================================================================ Game Trouble-shooting *** 1_8_1.113/game/txt/hlp/pennvOLD.hlp Mon, 27 Jun 2005 10:18:50 -0500 dunemush (pennmush/g/30_pennvOLD.h 1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.9.1.2.1.5.1.1.1.1.1.1.1.1.1.3 660) --- 1_8_1.148(w)/game/txt/hlp/pennvOLD.hlp Wed, 14 Sep 2005 22:51:22 -0500 dunemush (pennmush/g/30_pennvOLD.h 1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.9.1.2.1.5.1.1.1.1.1.1.1.1.1.1.1.1.1.2 660) *************** *** 4417,4424 **** For information on a specific patchlevel of one of the versions listed, type 'help p'. For example, 'help 1.7.2p3' ! 1.8.1: 0, 1 ! 1.8.0: 0, 1, 2, 3, 4, 5, 6 1.7.7: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 --- 4417,4424 ---- For information on a specific patchlevel of one of the versions listed, type 'help p'. For example, 'help 1.7.2p3' ! 1.8.1: 0, 1, 2 ! 1.8.0: 0, 1, 2, 3, 4, 5, 6, 7, 8 1.7.7: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 *** 1_8_1.113/README.SQL Wed, 21 Jul 2004 11:20:20 -0500 dunemush (pennmush/h/15_README.SQL 1.2 660) --- 1_8_1.148(w)/README.SQL Wed, 10 Aug 2005 22:43:04 -0500 dunemush (pennmush/h/15_README.SQL 1.3 660) *************** *** 16,22 **** II. Mush configuration overview III. SQL setup tips ! I. Compiling withi MySQL The Configure script distributed with PennMUSH automatically detects the MySQL client library (libmysqlclient) and attempts to link --- 16,22 ---- II. Mush configuration overview III. SQL setup tips ! I. Compiling with MySQL The Configure script distributed with PennMUSH automatically detects the MySQL client library (libmysqlclient) and attempts to link *** 1_8_1.113/src/sql.c Sat, 10 Jul 2004 09:53:09 -0500 dunemush (pennmush/h/16_sql.c 1.8 660) --- 1_8_1.148(w)/src/sql.c Wed, 14 Sep 2005 22:51:22 -0500 dunemush (pennmush/h/16_sql.c 1.9 660) *************** *** 224,230 **** if (!delim_check(buff, bp, nargs, args, 2, &row_delim)) return; if (nargs < 3) ! field_delim = row_delim; else if (!delim_check(buff, bp, nargs, args, 3, &field_delim)) return; --- 224,230 ---- if (!delim_check(buff, bp, nargs, args, 2, &row_delim)) return; if (nargs < 3) ! field_delim = ' '; else if (!delim_check(buff, bp, nargs, args, 3, &field_delim)) return; *** 1_8_1.113/CHANGES.180 Sat, 25 Jun 2005 12:43:00 -0500 dunemush (pennmush/h/21_CHANGES.18 1.39 600) --- 1_8_1.148(w)/CHANGES.180 Sun, 11 Sep 2005 09:00:23 -0500 dunemush (pennmush/h/21_CHANGES.18 1.49 600) *************** *** 12,17 **** --- 12,52 ---- ========================================================================== + Version 1.8.0 patchlevel 8 August 29, 2005 + + Fixes: + * /noflagcopy switch to @cpattr/@mvattr works now. Report by + Kimiko Muffin. + * SHS encryption now works on 64-bit architectures that define + uint32_t. Report by Licenser@M*U*S*H. + + + Version 1.8.0 patchlevel 7 August 29, 2005 + + Fixes: + * lsearch() with no results no longer returns #-1. It still does so when + there's an error. Suggested by Nathan Baum. [SW] + * Improved messages for @link of exits. Report by Nathan Baum. [SW] + * Restart script more portable to older bourne-like shells. + Patch by Walker@M*U*S*H. + * Fix to MinGW reboot. Patch by Nathan Baum. + * Help fixes by Tyr@M*U*S*H, Talvo@M*U*S*H, Dizzy@Forgotten Time, + and Trinsec@M*U*S*H. + * @flag/add of a flag with a name that is a unique prefix of an existing + flag wouldn't add the new flag. Reported by Mike Griffiths. [SW] + * @config/set of an invalid option would still return a success message. + Report by Sholevi@M*U*S*H. [SW] + * sql() without a field delimiter defaulted to using the row delimiter, + instead of a space. Report by Kali@M*U*S*H. + * lock() didn't set user-defined locks properly. Report by + Dahan@M*U*S*H. [SW] + * Infinite loop in fraction() fixed. + * FIXED players may no longer teleport through exits. Report by + Anyasha@bDv2 + * Better messages when attempting to wipe SAFE attributes. + Suggested by Nathan Baum. + + Version 1.8.0 patchlevel 6 June 24, 2005 Fixes: *** 1_8_1.113/game/txt/hlp/pennv180.hlp Sat, 25 Jun 2005 12:47:43 -0500 dunemush (pennmush/h/28_pennv180.h 1.1.1.2.1.1.1.2.1.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.4.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.2 660) --- 1_8_1.148(w)/game/txt/hlp/pennv180.hlp Wed, 14 Sep 2005 22:51:22 -0500 dunemush (pennmush/h/28_pennv180.h 1.1.1.2.1.1.1.2.1.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.4.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.2.1.1.1.1.1.1.1.3 660) *************** *** 1,3 **** --- 1,40 ---- + & 1.8.0p8 + Version 1.8.0 patchlevel 8 August 29, 2005 + + Fixes: + * /noflagcopy switch to @cpattr/@mvattr works now. Report by + Kimiko Muffin. + * SHS encryption now works on 64-bit architectures that define + uint32_t. Report by Licenser@M*U*S*H. + + + & 1.8.0p7 + Version 1.8.0 patchlevel 7 August 29, 2005 + + Fixes: + * lsearch() with no results no longer returns #-1. It still does so when + there's an error. Suggested by Nathan Baum. [SW] + * Improved messages for @link of exits. Report by Nathan Baum. [SW] + * Restart script more portable to older bourne-like shells. + Patch by Walker@M*U*S*H. + * Fix to MinGW reboot. Patch by Nathan Baum. + * Help fixes by Tyr@M*U*S*H, Talvo@M*U*S*H, Dizzy@Forgotten Time, + and Trinsec@M*U*S*H. + * @flag/add of a flag with a name that is a unique prefix of an existing + flag wouldn't add the new flag. Reported by Mike Griffiths. [SW] + * @config/set of an invalid option would still return a success message. + Report by Sholevi@M*U*S*H. [SW] + * sql() without a field delimiter defaulted to using the row delimiter, + instead of a space. Report by Kali@M*U*S*H. + * lock() didn't set user-defined locks properly. Report by + Dahan@M*U*S*H. [SW] + * Infinite loop in fraction() fixed. + * FIXED players may no longer teleport through exits. Report by + Anyasha@bDv2 + * Better messages when attempting to wipe SAFE attributes. + Suggested by Nathan Baum. + + & 1.8.0p6 Version 1.8.0 patchlevel 6 June 24, 2005 *** 1_8_1.113/game/txt/hlp/pennv181.hlp Mon, 27 Jun 2005 14:30:26 -0500 dunemush (pennmush/h/29_pennv181.h 1.40 660) --- 1_8_1.148(w)/game/txt/hlp/pennv181.hlp Wed, 14 Sep 2005 22:51:22 -0500 dunemush (pennmush/h/29_pennv181.h 1.54 660) *************** *** 1,4 **** ! & 1.8.1p1 & changes This is a list of changes in this patchlevel which are probably of interest to players. More information about new commands and functions --- 1,4 ---- ! & 1.8.1p2 & changes This is a list of changes in this patchlevel which are probably of interest to players. More information about new commands and functions *************** *** 11,16 **** --- 11,56 ---- A list of the patchlevels associated with each release can be read in 'help patchlevels'. + Version 1.8.1 patchlevel 2 September 5, 2005 + + Commands: + * @edit/check shows the results of an @edit without actually doing + it, to avoid inadvertent overediting. Patch by Walker@M*U*S*H. + Functions: + * sortkey() sorts a list by mapping each list element through a + function and applying a standard sort type. Patch by Walker@M*U*S*H. + Minor changes: + * "% " (percent-space) is now parsed to a literal percent-space, + making it easier to type things like "I'm 50% happy". And + % at end of line is parsed to a literal %. Patch by Sketch@M*U*S*H. + * @nameformat now receives the default-formatted name as %1 + so you can edit from that if you prefer. Suggested by Talvo@M*U*S*H. + * Added netbsd hints. Suggested by Tyr@M*U*S*H. + * hastype() can take a list of types to check for, not just one. [SW] + * Add @function/preserve, which does the same thing as the localize + restriction. [MUX] [SW] + * Leaving out the argument to align() defaults it to a + space. Suggested by Tyr@M*U*S*H, patch by Walker@M*U*S*H. + * Improved error message for setq() with odd arguments. + Report by Malix@8bit. + * When variable exits fail due to invalid/not permitted destination, + the enactor is told what the attempted destination was. + Suggested by Nathan Baum. + * Rooms may now @search/search() their owners. Suggested by Kali@M*U*S*H. + Fixes: + * @function/restrict mentioned in help. [SW] + * Clearer help on parallel setq. Suggested by Trinsec@M*U*S*H. [TAP] + * lsearch() didn't refund pennies when it failed because of lack of + permissions or invalid search criteria. Reported by Nathan Baum. [SW] + * lsearch() could return garbage objects. Report by Nathan Baum. [SW] + * %+ now only records argument count from last ufun, not from other + (builtin) functions. Report by Cheetah@M*U*S*H. + * Some linting of float comparisons. Report by Cheetah@M*U*S*H. + * page = now pages the player with a blank line instead of + repaging the last paged player with "". Report by Cheetah@M*U*S*H. + + + & 1.8.1p1 Version 1.8.1 patchlevel 1 June 27, 2005 Fixes: *** 1_8_1.113/CHANGES.181 Mon, 27 Jun 2005 14:30:26 -0500 dunemush (pennmush/h/30_CHANGES.18 1.35 600) --- 1_8_1.148(w)/CHANGES.181 Wed, 14 Sep 2005 22:51:01 -0500 dunemush (pennmush/h/30_CHANGES.18 1.49 600) *************** *** 8,17 **** --- 8,57 ---- [SW] is Shawn Wagner, a PennMUSH developer (aka Raevnos) [EEH] is Ervin Hearn III, a PennMUSH developer (aka Noltar) [3] refers to code by (or inspired by) TinyMUSH 3.0 + [MUX] refers to code by (or inspired by) TinyMUX 2.x [Rhost] refers to code by (or inspired by) RhostMUSH ========================================================================== + Version 1.8.1 patchlevel 2 September 5, 2005 + + Commands: + * @edit/check shows the results of an @edit without actually doing + it, to avoid inadvertent overediting. Patch by Walker@M*U*S*H. + Functions: + * sortkey() sorts a list by mapping each list element through a + function and applying a standard sort type. Patch by Walker@M*U*S*H. + Minor changes: + * "% " (percent-space) is now parsed to a literal percent-space, + making it easier to type things like "I'm 50% happy". And + % at end of line is parsed to a literal %. Patch by Sketch@M*U*S*H. + * @nameformat now receives the default-formatted name as %1 + so you can edit from that if you prefer. Suggested by Talvo@M*U*S*H. + * Added netbsd hints. Suggested by Tyr@M*U*S*H. + * hastype() can take a list of types to check for, not just one. [SW] + * Add @function/preserve, which does the same thing as the localize + restriction. [MUX] [SW] + * Leaving out the argument to align() defaults it to a + space. Suggested by Tyr@M*U*S*H, patch by Walker@M*U*S*H. + * Improved error message for setq() with odd arguments. + Report by Malix@8bit. + * When variable exits fail due to invalid/not permitted destination, + the enactor is told what the attempted destination was. + Suggested by Nathan Baum. + * Rooms may now @search/search() their owners. Suggested by Kali@M*U*S*H. + Fixes: + * @function/restrict mentioned in help. [SW] + * Clearer help on parallel setq. Suggested by Trinsec@M*U*S*H. [TAP] + * lsearch() didn't refund pennies when it failed because of lack of + permissions or invalid search criteria. Reported by Nathan Baum. [SW] + * lsearch() could return garbage objects. Report by Nathan Baum. [SW] + * %+ now only records argument count from last ufun, not from other + (builtin) functions. Report by Cheetah@M*U*S*H. + * Some linting of float comparisons. Report by Cheetah@M*U*S*H. + * page = now pages the player with a blank line instead of + repaging the last paged player with "". Report by Cheetah@M*U*S*H. + + Version 1.8.1 patchlevel 1 June 27, 2005 Fixes: