This is patch13 to PennMUSH 1.7.7. After applying this patch, you will have version 1.7.7p13 To apply this patch, save it to a file in your top-level MUSH directory, and do the following: patch -p1 < 1.7.7-patch13 *** Fix your local.c. If you haven't hacked in there, just *** cp local.dst local.c *** If you have hacked, move your hacks into local.dst and *** do the cp bit. ./Configure -d 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: Major changes: * Interactions (something like "realms" in mux2). Two functions in local.c can now be used to control conditions under which objects can see, hear, or match each other. Possibly useful for implementing umbral worlds, etc. Patch by Vadiv@M*U*S*H. Functions: * children(), syntactic sugar for lsearch(all,parent,). Suggested by Kyieren@M*U*S*H. Patch by BlaZe@M*U*S*H. * powers() can now take a second argument to set an @power. Suggested by Rob@BtFMUSH. Minor changes: * @config/set can now set null strings. Suggested by Cheetah@M*U*S*H. * In restart, set LC_ALL as well as LANG from the given LANG value, in case the user's got an LC_ALL in their shell. * The channel buffer shifting code has gotten much more efficient. Suggested by [TAP]. * @function/restrict can accept arguments of the form '!' to clear a restriction. Suggested by Saturn@M3. * Most of the asterisk lines between different login message files have been removed. Suggested by Vadiv@M*U*S*H most recently. Fixes: * Fixes from 1.7.6p9. * Win32 portability fixes. [EEH] * deny_silent in access.cnf was ignored in several cases, and no longer is. Patch by Cloud@Sci-Fi Chat * Help fixes by Cheetah@M*U*S*H and LeeLaLimaLLama@M*U*S*H. Prereq: 1.7.7p12 rm -rf CHANGES*~ CHANGES*bak utils/mkvershlp.pl game/txt/hlp CHANGES* *** 1_7_7.309/Patchlevel Mon, 24 Mar 2003 12:05:49 -0600 dunemush (pennmush/5_Patchlevel 1.17.1.11.1.14 600) --- 1_7_7.365(w)/Patchlevel Wed, 09 Apr 2003 14:16:43 -0500 dunemush (pennmush/5_Patchlevel 1.17.1.11.1.14 600) *************** *** 1,2 **** Do not edit this file. It is maintained by the official PennMUSH patches. ! This is PennMUSH 1.7.7p12 --- 1,2 ---- Do not edit this file. It is maintained by the official PennMUSH patches. ! This is PennMUSH 1.7.7p13 *** 1_7_7.309/CHANGES.176 Mon, 24 Mar 2003 12:05:49 -0600 dunemush (pennmush/g/17_CHANGES 1.10.1.6.1.2.1.2.1.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.9.1.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.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.2.1.1.1.1.1.1.1.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.2 600) --- 1_7_7.365(w)/CHANGES.176 Wed, 09 Apr 2003 13:49:56 -0500 dunemush (pennmush/g/17_CHANGES 1.10.1.6.1.2.1.2.1.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.9.1.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.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.2.1.1.1.1.1.1.1.1.1.1.1.2.1.1.1.1.1.1.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 600) *************** *** 13,18 **** --- 13,31 ---- ========================================================================== + Version 1.7.6 patchlevel 9 April 9, 2003 + + Fixes: + * index-files.pl now produces a sensible warning for duplicate + help topics, rather than a perl warning. Suggested by Cheetah@M*U*S*H. + * Spellnum cosmetic bug with 'seventeen' fixed. Report by Jules@M*U*S*H. + * Another wrap() buglet tracked down and fixed. Probably the one + reported by Nymeria@M*U*S*H. + * Memory leak in flip() and scramble() fixed. + * Configure test for /dev/urandom from 1.7.5 got left out by mistake. + * Critical overflow bug in command argument parsing fixed. + + Version 1.7.6 patchlevel 8 March 21, 2003 Minor changes: *** 1_7_7.309/CHANGES.177 Tue, 25 Mar 2003 16:50:17 -0600 dunemush (pennmush/g/23_CHANGES 1.48.1.42 600) --- 1_7_7.365(w)/CHANGES.177 Wed, 09 Apr 2003 14:16:57 -0500 dunemush (pennmush/g/23_CHANGES 1.48.1.57 600) *************** *** 18,23 **** --- 18,53 ---- ========================================================================== + Version 1.7.7 patchlevel 13 April 9, 2003 + + Major changes: + * Interactions (something like "realms" in mux2). Two functions + in local.c can now be used to control conditions under which + objects can see, hear, or match each other. Possibly useful for + implementing umbral worlds, etc. Patch by Vadiv@M*U*S*H. + Functions: + * children(), syntactic sugar for lsearch(all,parent,). + Suggested by Kyieren@M*U*S*H. Patch by BlaZe@M*U*S*H. + * powers() can now take a second argument to set an @power. + Suggested by Rob@BtFMUSH. + Minor changes: + * @config/set can now set null strings. Suggested by Cheetah@M*U*S*H. + * In restart, set LC_ALL as well as LANG from the given LANG value, + in case the user's got an LC_ALL in their shell. + * The channel buffer shifting code has gotten much more efficient. + Suggested by [TAP]. + * @function/restrict can accept arguments of the form '!' + to clear a restriction. Suggested by Saturn@M3. + * Most of the asterisk lines between different login message files + have been removed. Suggested by Vadiv@M*U*S*H most recently. + Fixes: + * Fixes from 1.7.6p9. + * Win32 portability fixes. [EEH] + * deny_silent in access.cnf was ignored in several cases, and no + longer is. Patch by Cloud@Sci-Fi Chat + * Help fixes by Cheetah@M*U*S*H and LeeLaLimaLLama@M*U*S*H. + + Version 1.7.7 patchlevel 12 March 21, 2003 Commands: *** 1_7_7.309/game/txt/hlp/pennfunc.hlp Tue, 18 Mar 2003 15:58:51 -0600 dunemush (pennmush/16_pennfunc.h 1.2.1.50.1.1.1.1.1.2.1.7.1.8.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.1.1.1.1.1.1.1.1.9.1.1.1.1.1.3.1.1.1.1.1.1.1.1.1.2 600) --- 1_7_7.365(w)/game/txt/hlp/pennfunc.hlp Tue, 08 Apr 2003 17:02: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.5 600) *************** *** 108,119 **** Dbref functions return a dbref or list of dbrefs related to some value on an object. ! con() entrances() exit() followers() following() ! home() lcon() lexits() loc() locate() ! lparent() lplayers() lsearch() lvcon() lvexits() ! lvplayers() next() num() owner() parent() ! pmatch() rloc() rnum() room() where() ! zone() See also: DBREF & Information functions --- 108,119 ---- Dbref functions return a dbref or list of dbrefs related to some value on an object. ! children() con() entrances() exit() followers() ! following() home() lcon() lexits() loc() ! locate() lparent() lplayers() lsearch() lvcon() ! lvexits() lvplayers() next() num() owner() ! parent() pmatch() rloc() rnum() room() ! where() zone() See also: DBREF & Information functions *************** *** 1931,1937 **** lpos(, ) This function returns a list of the positions where occupies ! in , with te first character of the string being 0. Note that this differs from the pos() function, but is consistent with other string functions like mid() and delete(). --- 1931,1937 ---- lpos(, ) This function returns a list of the positions where occupies ! in , with the first character of the string being 0. Note that this differs from the pos() function, but is consistent with other string functions like mid() and delete(). *************** *** 1947,1954 **** --- 1947,1956 ---- & LSEARCH() & SEARCH() & LSEARCHR() + & CHILDREN() lsearch([, [, [, [, ]]]]) lsearchr([, [, [, [, ]]]]) + children() This function is similar to the @search command, except it returns just a list of dbref numbers. It is computationally expensive, and *************** *** 1961,1966 **** --- 1963,1971 ---- The possible es and s are the same as those accepted by @search. See 'help @search' for information about them. + + children() is exactly the same as lsearch(,parent,), + using "all" for See_All/Search_All players and "me" for others. See 'help lsearch2' for more details. & LSEARCH2 *************** *** 2572,2580 **** Returns to the power of . & POWERS() powers() - Returns a space-separate list of powers possessed by the object. - If the object does not exist, #-1 will be returned. & QUOTA() quota() --- 2577,2589 ---- Returns to the power of . & POWERS() powers() + powers(,) + + The first form returns a space-separate list of powers possessed by + the object. If the object does not exist, #-1 will be returned. + + The second form attempts to set on , as per @power. & QUOTA() quota() *** 1_7_7.309/game/txt/hlp/penncmd.hlp Wed, 12 Mar 2003 12:31:02 -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.4 600) --- 1_7_7.365(w)/game/txt/hlp/penncmd.hlp Sun, 30 Mar 2003 22:07:40 -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.6 600) *************** *** 2665,2686 **** true boolean value will be listed. The token '##' in , which is a function, is replaced by each dbref sequentially. Classes EPLAYER, EROOM, EEXIT, and EOBJECT work like EVAL but are restricted to a single type. - - See "help @search3" for more. - & @search3 - For the class TYPE=PLAYER, and for PLAYER=, anyone may - obtain information on any player. In all other cases, only wizards may - obtain information about other players. This is computationally - expensive, costing 100 pennies. It is generally faster than @find. - - Examples: - @search flags=Wc <-- search for connected wizards. - @search type=room <-- list all rooms owned by me. - @search zone=#50 <-- list all objects belong to zone #50. - @search Joe eval=1,100,200 <-- list objects from #100-#200 owned by Joe. - @search eval=gt(money(##),10) <-- list all objects owned by me - worth more than 10 coins. - & @select @select[/notify] =,[,,]...[,] This is similar to @switch, except it only executes the action --- 2665,2670 ---- *************** *** 3655,3667 **** square brackets, in front of the message, in a fashion similar to the way NOSPOOF flags emits. ! Page takes four switches: /list, /blind, /noeval and /port. The /list and /blind switches provide two different ways of handling pages to lists of players. With /list, each paged player sees the list of who was paged, and the paging player is notified only once. With /blind, it's as if each player was individually paged. The default list behavior is set by the blind_page @config option. The /noeval switch prevents the MUSH from evaluating the message. The /port switch is admin-only, and will page a port descriptor directly, including connections that have not yet logged into a player. --- 3639,3652 ---- square brackets, in front of the message, in a fashion similar to the way NOSPOOF flags emits. ! Page takes five switches: /list, /blind, /noeval, /override, and /port. The /list and /blind switches provide two different ways of handling pages to lists of players. With /list, each paged player sees the list of who was paged, and the paging player is notified only once. With /blind, it's as if each player was individually paged. The default list behavior is set by the blind_page @config option. The /noeval switch prevents the MUSH from evaluating the message. + The /override switch is admin-only, and overrides pagelocks and HAVEN. The /port switch is admin-only, and will page a port descriptor directly, including connections that have not yet logged into a player. *** 1_7_7.309/game/txt/hlp/index.hlp Tue, 14 Jan 2003 23:22:31 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.1.6 660) --- 1_7_7.365(w)/game/txt/hlp/index.hlp Wed, 26 Mar 2003 09:25:28 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.2.2 660) *************** *** 11,69 **** 1.6.0p4 1.6.0p5 1.6.1p0 1.6.1p1 1.6.10p0 1.6.10p1 1.6.10p2 1.6.10p3 1.6.10p4 ! 1.6.10p5 1.6.10p6 1.6.10p6 ! 1.6.2p0 1.6.2p1 1.6.3p0 ! 1.6.3p1 1.6.3p2 1.6.3p3 ! 1.6.3p4 1.6.3p5 1.6.3p6 ! 1.6.3p7 1.6.4p0 1.6.4p1 ! 1.6.4p2 1.6.5p0 1.6.5p1 For more, see Entries-2 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- & Entries-2 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- ! 1.6.5p2 1.6.5p3 1.6.5p4 ! 1.6.6p0 1.6.7p0 1.6.7p1 ! 1.6.7p2 1.6.7p3 1.6.7p4 ! 1.6.7p5 1.6.7p6 1.6.8p0 ! 1.6.8p1 1.6.9p0 1.6.9p1 ! 1.6.9p2 1.6.9p3 1.6.9p4 ! 1.6.9p5 1.6.9p6 1.6.9p7 ! 1.6.9p8 1.6.9p9 1.7.0p0 ! 1.7.0p1 1.7.0p2 1.7.0p3 ! 1.7.0p4 1.7.0p5 1.7.0p6 ! 1.7.0p7 1.7.0p8 1.7.0p9 ! 1.7.0p10 1.7.0p11 1.7.0p11 ! 1.7.1p0 1.7.1p1 1.7.1p2 ! 1.7.1p3 1.7.2p0 1.7.2p1 ! 1.7.2p2 1.7.2p3 1.7.2p4 ! 1.7.2p5 1.7.2p6 1.7.2p7 For more, see Entries-3 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- & Entries-3 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- ! 1.7.2p8 1.7.2p9 1.7.2p10 ! 1.7.2p11 1.7.2p12 1.7.2p13 ! 1.7.2p14 1.7.2p15 1.7.2p16 ! 1.7.2p17 1.7.2p18 1.7.2p19 ! 1.7.2p20 1.7.2p21 1.7.2p22 ! 1.7.2p23 1.7.2p24 1.7.2p25 ! 1.7.2p26 1.7.2p27 1.7.2p28 ! 1.7.2p29 1.7.2p30 1.7.2p31 ! 1.7.2p32 1.7.2p33 1.7.2p34 ! 1.7.2p35 1.7.3p0 1.7.3p1 ! 1.7.3p2 1.7.3p3 1.7.3p4 ! 1.7.3p5 1.7.3p6 1.7.3p7 ! 1.7.3p8 1.7.3p9 1.7.3p10 ! 1.7.3p11 1.7.3p12 1.7.3p13 ! 1.7.3p14 1.7.4p0 1.7.4p1 ! 1.7.4p2 1.7.4p3 1.7.4p4 For more, see Entries-4 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- & Entries-4 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 1.7.4p5 1.7.4p6 1.7.4p7 1.7.4p8 1.7.4p9 1.7.4p10 1.7.4p11 1.7.4p12 1.7.4p13 --- 11,70 ---- 1.6.0p4 1.6.0p5 1.6.1p0 1.6.1p1 1.6.10p0 1.6.10p1 1.6.10p2 1.6.10p3 1.6.10p4 ! 1.6.10p5 1.6.10p6 1.6.2p0 ! 1.6.2p1 1.6.3p0 1.6.3p1 ! 1.6.3p2 1.6.3p3 1.6.3p4 ! 1.6.3p5 1.6.3p6 1.6.3p7 ! 1.6.4p0 1.6.4p1 1.6.4p2 ! 1.6.5p0 1.6.5p1 1.6.5p2 For more, see Entries-2 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- & Entries-2 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- ! 1.6.5p3 1.6.5p4 1.6.6p0 ! 1.6.7p0 1.6.7p1 1.6.7p2 ! 1.6.7p3 1.6.7p4 1.6.7p5 ! 1.6.7p6 1.6.8p0 1.6.8p1 ! 1.6.9p0 1.6.9p1 1.6.9p2 ! 1.6.9p3 1.6.9p4 1.6.9p5 ! 1.6.9p6 1.6.9p7 1.6.9p8 ! 1.6.9p9 1.7.0p0 1.7.0p1 ! 1.7.0p2 1.7.0p3 1.7.0p4 ! 1.7.0p5 1.7.0p6 1.7.0p7 ! 1.7.0p8 1.7.0p9 1.7.0p10 ! 1.7.0p11 1.7.1p0 1.7.1p1 ! 1.7.1p2 1.7.1p3 1.7.2p0 ! 1.7.2p1 1.7.2p2 1.7.2p3 ! 1.7.2p4 1.7.2p5 1.7.2p6 ! 1.7.2p7 1.7.2p8 1.7.2p9 For more, see Entries-3 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- & Entries-3 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- ! 1.7.2p10 1.7.2p11 1.7.2p12 ! 1.7.2p13 1.7.2p14 1.7.2p15 ! 1.7.2p16 1.7.2p17 1.7.2p18 ! 1.7.2p19 1.7.2p20 1.7.2p21 ! 1.7.2p22 1.7.2p23 1.7.2p24 ! 1.7.2p25 1.7.2p26 1.7.2p27 ! 1.7.2p28 1.7.2p29 1.7.2p30 ! 1.7.2p31 1.7.2p32 1.7.2p33 ! 1.7.2p34 1.7.2p35 1.7.3p0 ! 1.7.3p1 1.7.3p2 1.7.3p3 ! 1.7.3p4 1.7.3p5 1.7.3p6 ! 1.7.3p7 1.7.3p8 1.7.3p9 ! 1.7.3p10 1.7.3p11 1.7.3p12 ! 1.7.3p13 1.7.3p14 1.7.4p0 ! 1.7.4p1 1.7.4p2 1.7.4p3 ! 1.7.4p4 1.7.4p5 1.7.4p6 For more, see Entries-4 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- & Entries-4 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + <<<<<<< 1_7_7.312(w)/game/txt/hlp/index.hlp Tue, 14 Jan 2003 23:22:31 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.1.6 660) 1.7.4p5 1.7.4p6 1.7.4p7 1.7.4p8 1.7.4p9 1.7.4p10 1.7.4p11 1.7.4p12 1.7.4p13 *************** *** 80,90 **** --- 81,110 ---- 1.7.7p3 1.7.7p4 1.7.7p5 1.7.7p6 : ; @-attributes @-building @-general + ======= + 1.7.4p7 1.7.4p8 1.7.4p9 + 1.7.4p10 1.7.4p11 1.7.4p12 + 1.7.4p13 1.7.4p14 1.7.4p15 + 1.7.4p16 1.7.4p17 1.7.4p18 + 1.7.4p19 1.7.4p20 1.7.5p0 + 1.7.5p1 1.7.5p2 1.7.5p3 + 1.7.5p4 1.7.5p5 1.7.5p6 + 1.7.5p7 1.7.5p8 1.7.5p9 + 1.7.5p10 1.7.5p11 1.7.5p12 + 1.7.6p0 1.7.6p1 1.7.6p2 + 1.7.6p3 1.7.6p4 1.7.6p5 + 1.7.6p6 1.7.6p7 1.7.6p8 + : ; @-attributes + @-building @-general @-wizard + @@ @@() @aahear + @aclone @aconnect @adeath + >>>>>>> 1_7_6.134/game/txt/hlp/index.hlp Wed, 26 Mar 2003 09:25:17 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.2.1 660) For more, see Entries-5 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- & Entries-5 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + <<<<<<< 1_7_7.312(w)/game/txt/hlp/index.hlp Tue, 14 Jan 2003 23:22:31 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.1.6 660) @-wizard @@ @@() @aahear @aclone @aconnect @adeath @adescribe @adestroy *************** *** 101,111 **** --- 121,150 ---- @break @cemit @channel @channel2 @channel3 @channel4 @channel5 @charges @chat + ======= + @adescribe @adestroy @adisconnect + @adrop @aefail @aenter + @afailure @afollow @agive + @ahear @aidescribe @aleave + @alfail @alias @allhalt + @allquota @amhear @amove + @apayment @areceive @asuccess + @atport @atrchown @atrlock + @attribute @aufail @aunfollow + @ause @away @azenter + @azleave @boot @break + @cemit @channel @channel2 + @channel3 @channel4 @channel5 + @charges @chat @chown + @chownall @chzone @chzone2 + @chzoneall @clock @clock2 + >>>>>>> 1_7_6.134/game/txt/hlp/index.hlp Wed, 26 Mar 2003 09:25:17 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.2.1 660) For more, see Entries-6 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- & Entries-6 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + <<<<<<< 1_7_7.312(w)/game/txt/hlp/index.hlp Tue, 14 Jan 2003 23:22:31 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.1.6 660) @chown @chownall @chzone @chzone2 @chzoneall @clock @clock2 @clone @command *************** *** 122,132 **** --- 161,190 ---- @dig @dig2 @disable @doing @dolist @drain @drop @dump @ealias + ======= + @clone @command @comment + @config @config attribs @config chat + @config cmds @config cosmetic @config cosmetic2 + @config costs @config db @config dump + @config funcs @config limits @config limits2 + @config log @config net @config parameters + @config tiny @conformat @cost + @cpattr @create @dbck + @death @decompile @decompile2 + @decompile3 @describe @destroy + @destroy2 @dig @dig2 + @disable @doing @dolist + @drain @drop @dump + @ealias @edit @efail + @elock @emit @enable + @enter @entrances @eunlock + >>>>>>> 1_7_6.134/game/txt/hlp/index.hlp Wed, 26 Mar 2003 09:25:17 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.2.1 660) For more, see Entries-7 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- & Entries-7 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + <<<<<<< 1_7_7.312(w)/game/txt/hlp/index.hlp Tue, 14 Jan 2003 23:22:31 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.1.6 660) @edit @efail @elock @emit @enable @enter @entrances @eunlock @exitformat *************** *** 143,153 **** --- 201,230 ---- @leave @lemit @lfail @link @list @listen @listen2 @listmotd @lock + ======= + @exitformat @failure @filter + @filter2 @find @firstexit + @follow @force @force2 + @forwardlist @function @function2 + @function3 @function4 @gedit + @give @grep2 @grep + @halt @haven @hide + @hook @hook2 @idescribe + @idle @infilter @inprefix + @kick @lalias @leave + @lemit @lfail @link + @list @listen @listen2 + @listmotd @lock @lock2 + @lock3 @lock4 @lock5 + @lock6 @lock7 @lock8 + @lock9 @log @logwipe + >>>>>>> 1_7_6.134/game/txt/hlp/index.hlp Wed, 26 Mar 2003 09:25:17 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.2.1 660) For more, see Entries-8 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- & Entries-8 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + <<<<<<< 1_7_7.312(w)/game/txt/hlp/index.hlp Tue, 14 Jan 2003 23:22:31 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.1.6 660) @lock2 @lock3 @lock4 @lock5 @lock6 @lock7 @lock8 @lock9 @log *************** *** 164,174 **** --- 241,270 ---- @oleave @olfail @omove @opayment @open @oreceive @osuccess @otport @oufail + ======= + @lset @map2 @mail + @malias @malias2 @malias3 + @malias4 @malias5 @map + @motd @move @mvattr + @name @nameaccent @nameformat + @newpassword @notify @nspemit + @nuke @odeath @odescribe + @odrop @oefail @oemit + @oenter @ofailure @ofollow + @ogive @oidescribe @oleave + @olfail @omove @opayment + @open @oreceive @osuccess + @otport @oufail @ounfollow + @ouse @oxenter @oxleave + @oxmove @oxtport @ozenter + @ozleave @parent @password + >>>>>>> 1_7_6.134/game/txt/hlp/index.hlp Wed, 26 Mar 2003 09:25:17 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.2.1 660) For more, see Entries-9 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- & Entries-9 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + <<<<<<< 1_7_7.312(w)/game/txt/hlp/index.hlp Tue, 14 Jan 2003 23:22:31 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.1.6 660) @ounfollow @ouse @oxenter @oxleave @oxmove @oxtport @ozenter @ozleave @parent *************** *** 185,195 **** --- 281,310 ---- @sitelock3 @squota @startup @stats @success @sweep @switch @switch2 @teleport + ======= + @payment @pcreate @pemit + @pemit2 @poll @poor + @power @prefix @ps + @purge @quota @readcache + @receive @recycle @rejectmotd + @remit @restart @runout + @rwall @rwallemit @rwallpose + @scan @search @search2 + @search3 @select @set + @sex @shutdown @sitelock + @sitelock2 @sitelock3 @squota + @startup @stats @success + @sweep @switch @switch2 + @teleport @tport @trigger + @trigger2 @ufail @ulock + @undestroy @unfollow @unlink + >>>>>>> 1_7_6.134/game/txt/hlp/index.hlp Wed, 26 Mar 2003 09:25:17 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.2.1 660) For more, see Entries-10 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- & Entries-10 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + <<<<<<< 1_7_7.312(w)/game/txt/hlp/index.hlp Tue, 14 Jan 2003 23:22:31 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.1.6 660) @tport @trigger @trigger2 @ufail @ulock @undestroy @unfollow @unlink @unlock *************** *** 198,204 **** --- 313,328 ---- @verb2 @verb3 @verb4 @version @vrml_url @wait @wait2 @wall @warnings + ======= + @unlock @unrecycle @uptime + @uptime2 @use @uunlock + @verb @verb2 @verb3 + @verb4 @version @vrml_url + @wait @wait2 @wall + @wallemit @wallpose @warnings + >>>>>>> 1_7_6.134/game/txt/hlp/index.hlp Wed, 26 Mar 2003 09:25:17 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.2.1 660) @warnings2 @warnings3 @wcheck + <<<<<<< 1_7_7.312(w)/game/txt/hlp/index.hlp Tue, 14 Jan 2003 23:22:31 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.1.6 660) @whereis @wipe @wizmotd @wizwall @zemit @zenter @zleave \ ^ *************** *** 206,216 **** --- 330,352 ---- accent2 accent3 accent4 acos() action lists action2 add() after() ahelp + ======= + @whereis @wipe @wizemit + @wizmotd @wizpose @wizwall + @zemit @zenter @zleave + \ ^ abode + abs() accent() accent2 + accent3 accent4 acos() + action lists action2 add() + after() ahelp alphamax() + alphamin() and() andflags() + >>>>>>> 1_7_6.134/game/txt/hlp/index.hlp Wed, 26 Mar 2003 09:25:17 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.2.1 660) For more, see Entries-11 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- & Entries-11 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + <<<<<<< 1_7_7.312(w)/game/txt/hlp/index.hlp Tue, 14 Jan 2003 23:22:31 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.1.6 660) alphamax() alphamin() and() andflags() andlflags() anews ansi ansi() aposs() *************** *** 227,237 **** --- 363,392 ---- brackets() brief builder bxor() cand() capstr() case() caseall() cat() + ======= + anews ansi ansi() + aposs() art() asin() + atan() atan2() atrlock() + attrcnt() attrib-ownership attribute flags + attribute functions attribute list attributes + attributes list attributes2 attributes3 + attributes4 audible audible2 + band() beep() before() + being killed bitwise functions bnand() + bnot() boolean functions boolean values + boolean2 boolean3 bor() + bound() brackets() brief + builder bxor() cand() + capstr() case() caseall() + cat() cd ceil() + cemit() center() cflags() + >>>>>>> 1_7_6.134/game/txt/hlp/index.hlp Wed, 26 Mar 2003 09:25:17 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.2.1 660) For more, see Entries-12 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- & Entries-12 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + <<<<<<< 1_7_7.312(w)/game/txt/hlp/index.hlp Tue, 14 Jan 2003 23:22:31 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.1.6 660) cd ceil() cemit() center() cflags() ch changes channel functions channel-list *************** *** 248,258 **** --- 403,432 ---- credits ctime() ctitle() ctu() cv cwho() dark dark2 database + ======= + ch changes channel functions + channel-list channels() chat + checkpass() chown_ok chr() + clients clock() clone() + cloudy code color + commands communication functions comp() + comsys con() config() + conn() connected control + controls() convsecs() convtime() + convutcsecs() copyright copyrite + cor() cos() costs + create() credits ctime() + ctitle() ctu() cv + cwho() dark dark2 + database dbref # dbref functions + dbref number dbref2 dbrefs + >>>>>>> 1_7_6.134/game/txt/hlp/index.hlp Wed, 26 Mar 2003 09:25:17 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.2.1 660) For more, see Entries-13 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- & Entries-13 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + <<<<<<< 1_7_7.312(w)/game/txt/hlp/index.hlp Tue, 14 Jan 2003 23:22:31 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.1.6 660) dbref # dbref functions dbref number dbref2 dbrefs debug debug2 dec() decrypt() *************** *** 269,279 **** --- 443,472 ---- escape() etimefmt() etimefmt2 eval() evaluation order evaluation2 events examine executor + ======= + debug debug2 dec() + decrypt() default() delete() + desert destroy_ok die() + dig() dismiss dist2d() + dist3d() div() doing + doing() drop drop-tos + dynhelp() e() edefault() + edit() element() elements() + elist() elock() emit() + enactor encrypt() endtag() + enter enter_ok entrances() + eq() escape() etimefmt() + etimefmt2 eval() evaluation order + evaluation2 events examine + executor exit() exits + exits2 exp() extract() + >>>>>>> 1_7_6.134/game/txt/hlp/index.hlp Wed, 26 Mar 2003 09:25:17 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.2.1 660) For more, see Entries-14 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- & Entries-14 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + <<<<<<< 1_7_7.312(w)/game/txt/hlp/index.hlp Tue, 14 Jan 2003 23:22:31 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.1.6 660) exit() exits exits2 exp() extract() failure fdiv() filter() filterbool() *************** *** 281,286 **** --- 474,486 ---- flag list flag permissions flags flags list flags() flags2 flip() floating floor() + ======= + failure fdiv() filter() + filterbool() findable() first() + fixed flag list flags + flags list flags() flags2 + flip() floating floor() + >>>>>>> 1_7_6.134/game/txt/hlp/index.hlp Wed, 26 Mar 2003 09:25:17 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.2.1 660) floordiv() fmod() fold() fold2 folderstats() follow followers() following() foreach() *************** *** 290,305 **** --- 490,516 ---- get() get_eval() give global commands globals go going goto grab() + <<<<<<< 1_7_7.312(w)/game/txt/hlp/index.hlp Tue, 14 Jan 2003 23:22:31 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.1.6 660) + ======= + graball() grep() grepi() + gt() gte() halt + >>>>>>> 1_7_6.134/game/txt/hlp/index.hlp Wed, 26 Mar 2003 09:25:17 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.2.1 660) For more, see Entries-15 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- & Entries-15 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + <<<<<<< 1_7_7.312(w)/game/txt/hlp/index.hlp Tue, 14 Jan 2003 23:22:31 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.1.6 660) graball() grep() grepi() gt() gte() halt hasattr() hasattrp() hasattrpval() hasattrval() hasflag() haspower() hastype() haven height() + ======= + hasattr() hasattrp() hasattrpval() + hasattrval() hasflag() haspower() + hastype() haven help + >>>>>>> 1_7_6.134/game/txt/hlp/index.hlp Wed, 26 Mar 2003 09:25:17 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.2.1 660) here hidden() home home() homes html html functions html() i18n *************** *** 311,328 **** --- 522,550 ---- interiors2 internationalization inum() inventory isdaylight() isdbref() isint() isnum() isword() + <<<<<<< 1_7_7.312(w)/game/txt/hlp/index.hlp Tue, 14 Jan 2003 23:22:31 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.1.6 660) + ======= + itemize() items() iter() + iter2 itext() judge + >>>>>>> 1_7_6.134/game/txt/hlp/index.hlp Wed, 26 Mar 2003 09:25:17 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.2.1 660) For more, see Entries-16 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- & Entries-16 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + <<<<<<< 1_7_7.312(w)/game/txt/hlp/index.hlp Tue, 14 Jan 2003 23:22:31 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.1.6 660) itemize() items() iter() iter2 itext() judge jump_ok jury_ok kill last & lastlogout last() lastip + ======= + jump_ok jury_ok kill + last & lastlogout last() lastip + >>>>>>> 1_7_6.134/game/txt/hlp/index.hlp Wed, 26 Mar 2003 09:25:17 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.2.1 660) lastsite lattr() lcon() lcstr() ldelete() leave left() lemit() lexits() + <<<<<<< 1_7_7.312(w)/game/txt/hlp/index.hlp Tue, 14 Jan 2003 23:22:31 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.1.6 660) lflags() license light link() link_ok linking list functions list() listen_parent *************** *** 332,342 **** --- 554,578 ---- loc() locale localize() locate() locate2 lock list lock types lock types2 lock() + ======= + license light link() + link_ok linking list functions + list() listen_parent listening + listening2 listening3 lists + lit() ljust() lmath() + ln() lnum() loc() + locale localize() locate() + locate2 lock list lock types + lock types2 lock() locking + locklist locks locktypes + locktypes2 log() logout + >>>>>>> 1_7_6.134/game/txt/hlp/index.hlp Wed, 26 Mar 2003 09:25:17 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.2.1 660) For more, see Entries-17 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- & Entries-17 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + <<<<<<< 1_7_7.312(w)/game/txt/hlp/index.hlp Tue, 14 Jan 2003 23:22:31 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.1.6 660) locking locklist locks locktypes locktypes2 log() logout look look2 *************** *** 353,363 **** --- 589,618 ---- mailtime() map() master room match() matchall() matching math functions max() me + ======= + look look2 looping + lparent() lplayers() lsearch() + lsearch2 lsearchr() lstats() + lt() lte() lvcon() + lvexits() lvplayers() lwho() + macros macros2 mail + mail functions mail() mail-admin + mail-folders mail-other mail-reading + mail-sending maildstats() mailfrom() + mailfstats() mailstats() mailstatus() + mailsubject() mailtime() map() + master room match() matchall() + matching math functions max() + me mean() median() + member() merge() mid() + min() mix() mix2 + >>>>>>> 1_7_6.134/game/txt/hlp/index.hlp Wed, 26 Mar 2003 09:25:17 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.2.1 660) For more, see Entries-18 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- & Entries-18 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + <<<<<<< 1_7_7.312(w)/game/txt/hlp/index.hlp Tue, 14 Jan 2003 23:22:31 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.1.6 660) mean() median() member() merge() mid() min() mix() mix2 mod() *************** *** 374,389 **** --- 629,667 ---- no_tel no_warn noaccents noleave non-standard attributes nor() nospoof not() nowarn + ======= + mod() modulo() modulus() + money money() monitor + mortal move mtime() + mudname() mul() munge() + munge2 munge3 mushcode + mushcode2 mwho() myopic + name() nand() nattr() + nearby() neq() new locks + newbie newbie2 newbie3 + news next() no_command + no_leave no_tel no_warn + noaccents noleave non-standard attributes + nor() nospoof not() + nowarn nspemit() null() + num() obj() object parents + objeval() objmem() oemit() + >>>>>>> 1_7_6.134/game/txt/hlp/index.hlp Wed, 26 Mar 2003 09:25:17 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.2.1 660) For more, see Entries-19 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- & Entries-19 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + <<<<<<< 1_7_7.312(w)/game/txt/hlp/index.hlp Tue, 14 Jan 2003 23:22:31 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.1.6 660) nspemit() null() num() obj() object parents objeval() objmem() oemit() on-vacation opaque open() or() ord() orflags() orlflags() + ======= + on-vacation opaque open() + or() ord() orflags() + >>>>>>> 1_7_6.134/game/txt/hlp/index.hlp Wed, 26 Mar 2003 09:25:17 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.2.1 660) owner() page page2 paranoid parent parent() parents parents2 parents3 *************** *** 395,410 **** --- 673,699 ---- poss() power() powers list powers list2 powers() powers2 pueblo pueblo features pueblo() + <<<<<<< 1_7_7.312(w)/game/txt/hlp/index.hlp Tue, 14 Jan 2003 23:22:31 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.1.6 660) + ======= + puppet puppets puppets2 + queue quiet quit + quota() r() r-function + >>>>>>> 1_7_6.134/game/txt/hlp/index.hlp Wed, 26 Mar 2003 09:25:17 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.2.1 660) For more, see Entries-20 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- & Entries-20 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + <<<<<<< 1_7_7.312(w)/game/txt/hlp/index.hlp Tue, 14 Jan 2003 23:22:31 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.1.6 660) puppet puppets puppets2 queue quiet quit quota() r() r-function rand() read regedit() regeditall() regeditalli() regediti() + ======= + rand() read regedit() + regeditall() regeditalli() regediti() + >>>>>>> 1_7_6.134/game/txt/hlp/index.hlp Wed, 26 Mar 2003 09:25:17 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.2.1 660) regexp regexp classes regexp classes2 regexp examples regexp syntax regexp syntax2 regexp syntax3 regexp syntax4 regexp syntax5 *************** *** 416,432 **** --- 705,733 ---- remainder() remit() remove() repeat() replace() rest() restarts() restarttime() restrict + <<<<<<< 1_7_7.312(w)/game/txt/hlp/index.hlp Tue, 14 Jan 2003 23:22:31 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.1.6 660) + ======= + restrict2 restrict3 reverse() + revwords() right() rjust() + rloc() rnum() room + >>>>>>> 1_7_6.134/game/txt/hlp/index.hlp Wed, 26 Mar 2003 09:25:17 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.2.1 660) For more, see Entries-21 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- & Entries-21 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + <<<<<<< 1_7_7.312(w)/game/txt/hlp/index.hlp Tue, 14 Jan 2003 23:22:31 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.1.6 660) restrict2 restrict3 reverse() revwords() right() rjust() rloc() rnum() room room() round() royalty rquota rules s() + ======= + room() round() royalty + rquota rules s() + >>>>>>> 1_7_6.134/game/txt/hlp/index.hlp Wed, 26 Mar 2003 09:25:17 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.2.1 660) s-function safe say + <<<<<<< 1_7_7.312(w)/game/txt/hlp/index.hlp Tue, 14 Jan 2003 23:22:31 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.1.6 660) score scramble() screenheight screenwidth search() search2 secs() secure() semaphores *************** *** 437,447 **** --- 738,764 ---- setq3 setr() setting-attributes setunion() sex sha1() shared shared players shared players2 + ======= + score scramble() search() + search2 secs() secure() + semaphores semaphores2 semaphores3 + semaphores4 semaphores5 semaphores6 + semipose session set() + setdiff() setinter() setq() + setq2 setq3 setr() + setting-attributes setunion() sex + sha1() shared shared players + shared players2 shl() shr() + shuffle() sign() sin() + slay softcode sort() + sortby() soundex() soundex2 + >>>>>>> 1_7_6.134/game/txt/hlp/index.hlp Wed, 26 Mar 2003 09:25:17 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.2.1 660) For more, see Entries-22 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- & Entries-22 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + <<<<<<< 1_7_7.312(w)/game/txt/hlp/index.hlp Tue, 14 Jan 2003 23:22:31 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.1.6 660) shl() shr() shuffle() sign() sin() slay softcode sort() sortby() *************** *** 458,468 **** --- 775,804 ---- substitutions4 success suspect switch wildcards switch() switch2 switchall() switches t() + ======= + soundlike() soundslike() space() + spellnum() splice() spoofing + sqrt() squish() stack + starttime() stats() stddev() + step2 step() sticky + strcat() string functions strings + strinsert() stripaccents() stripansi() + strlen() strmatch() sub() + subj() substitutions substitutions2 + substitutions3 substitutions4 success + suspect switch wildcards switch() + switch2 switchall() switches + t() table() tag() + tagwrap() take tan() + teach tel() tel_ok + temple terse textfile() + >>>>>>> 1_7_6.134/game/txt/hlp/index.hlp Wed, 26 Mar 2003 09:25:17 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.2.1 660) For more, see Entries-23 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- & Entries-23 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + <<<<<<< 1_7_7.312(w)/game/txt/hlp/index.hlp Tue, 14 Jan 2003 23:22:31 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.1.6 660) table() tag() tagwrap() take tan() teach tel() tel_ok temple *************** *** 479,489 **** --- 815,844 ---- unfollow uninspected unregistered use user-defined commands user-defined2 utctime() utility functions v() + ======= + think time functions time() + timefmt() timefmt2 timestring() + topics topics2 translation + transparent transparent2 trim() + trunc() trust trust2 + type() types of objects types2 + u() u2 ucstr() + udefault() ufun() ufun2 + uldefault() ulocal() ulocal2 + unfindable unfollow uninspected + unregistered use user-defined commands + user-defined2 utctime() utility functions + v() v-function vadd() + val() valid() vdim() + vdot() verbose verbs + version() visible() visual + >>>>>>> 1_7_6.134/game/txt/hlp/index.hlp Wed, 26 Mar 2003 09:25:17 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.2.1 660) For more, see Entries-24 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- & Entries-24 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + <<<<<<< 1_7_7.312(w)/game/txt/hlp/index.hlp Tue, 14 Jan 2003 23:22:31 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.1.6 660) v-function vadd() val() valid() vdim() vdot() verbose verbs version() *************** *** 506,511 **** --- 861,881 ---- & Entries-25 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- zones2 + ======= + vmag() vmax() vmin() + vmul() vrml vsub() + vunit() warnings warnings list + warnings list2 where() whisper + whisper2 who wildcards + wipe() with wizard + wordpos() words() wrap() + xget() xor() z_tel + zemit() zfun() zmo + zmp zmr zone + zone master objects zone master rooms zone masters + zone objects zone() zones + zones2 + >>>>>>> 1_7_6.134/game/txt/hlp/index.hlp Wed, 26 Mar 2003 09:25:17 -0600 dunemush (pennmush/20_index.hlp 1.1.1.1.1.1.1.1.1.2.1.1.2.2.2.2.1.1.1.4.2.1.2.1 660) & &Entries -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- *** 1_7_7.309/game/txt/index-files.pl Tue, 08 Oct 2002 10:34:26 -0500 dunemush (pennmush/28_index-file 1.7 600) --- 1_7_7.365(w)/game/txt/index-files.pl Wed, 26 Mar 2003 09:19:00 -0600 dunemush (pennmush/28_index-file 1.8 600) *************** *** 127,132 **** my($lasta, $lastb); ($firsta, $lasta) = ($1,$2) if $a =~ /(.+)p(\d+)/o; ($firstb, $lastb) = ($1,$2) if $b =~ /(.+)p(\d+)/o; ! $firsta cmp $firstb || $lasta <=> $lastb; } --- 127,138 ---- my($lasta, $lastb); ($firsta, $lasta) = ($1,$2) if $a =~ /(.+)p(\d+)/o; ($firstb, $lastb) = ($1,$2) if $b =~ /(.+)p(\d+)/o; ! my $res = $firsta cmp $firstb; ! return $res if $res; ! if (!defined($lasta)) { ! warn "Possible duplicate help topic: $a\n"; ! return $res; ! } ! return $lasta <=> $lastb; } *** 1_7_7.309/game/restart Sat, 25 Jan 2003 20:41:21 -0600 dunemush (pennmush/39_restart 1.1.1.1.1.1.1.2.1.1.1.1.1.2.1.2.2.3 700) --- 1_7_7.365(w)/game/restart Thu, 27 Mar 2003 11:44:51 -0600 dunemush (pennmush/39_restart 1.1.1.1.1.1.1.2.1.1.1.1.1.2.1.2.2.4 700) *************** *** 127,130 **** DATEMSK="${GAMEDIR}/getdate.template" export DATEMSK ! LANG=$LANG ./netmush $CONF_FILE $LOG & --- 127,130 ---- DATEMSK="${GAMEDIR}/getdate.template" export DATEMSK ! LC_ALL=$LANG LANG=$LANG ./netmush $CONF_FILE $LOG & *** 1_7_7.309/config_h.SH Sun, 02 Feb 2003 10:43:44 -0600 dunemush (pennmush/b/17_config_h.S 1.17.1.2.1.1.1.7 660) --- 1_7_7.365(w)/config_h.SH Tue, 08 Apr 2003 22:03:04 -0500 dunemush (pennmush/b/17_config_h.S 1.17.1.2.1.1.1.8 660) *************** *** 730,735 **** --- 730,740 ---- #$d_uptime HAS_UPTIME /**/ #define UPTIME_PATH "$uptime" + /* HAS_DEV_URANDOM: + * This symbol is defined if /dev/urandom is available. + */ + #$d_urandom HAS_DEV_URANDOM /**/ + /* UNION_WAIT: * This symbol if defined indicates to the C program that the argument * for the wait() system call should be declared as 'union wait status' *** 1_7_7.309/src/shs.c Sun, 01 Dec 2002 21:14:41 -0600 dunemush (pennmush/b/18_shs.c 1.7 660) --- 1_7_7.365(w)/src/shs.c Wed, 09 Apr 2003 14:19:27 -0500 dunemush (pennmush/b/18_shs.c 1.8 660) *************** *** 1,32 **** ! /* ------------------------ SHS.C ----------------------------- */ ! ! /* Secure Hash Algorithm */ ! ! /* ! ! Written 2 September 1992. Peter C. Gutmann. ! This implementation placed in the public domain. ! ! Comments to pgutl@cs.aukuni.ac.nz ! ! Keyed in from: "Applied Cryptography by Bruce Schneier" ! ! by Nick Gammon. ! ! ! Note: include files below are slightly different from the original source ! in order to confirm to the MUSH include files standards. ! */ - #include "copyrite.h" #include "config.h" - #include - #include "shs.h" - #include "confmagic.h" /* The SHS f() functions */ --- 1,25 ---- ! /** ! * \file shs.c ! * ! * \brief The secure hash algorithm. ! * ! * Written 2 September 1992. Peter C. Gutmann. ! * This implementation placed in the public domain. ! * ! * Comments to pgutl@cs.aukuni.ac.nz ! * ! * Keyed in from: "Applied Cryptography by Bruce Schneier" ! * ! * by Nick Gammon. ! * ! * Note: include files below are slightly different from the original source ! * in order to confirm to the MUSH include files standards. */ #include "copyrite.h" #include "config.h" #include #include "shs.h" #include "confmagic.h" /* The SHS f() functions */ *************** *** 112,123 **** /* Initialise the SHS values */ void ! shsInit(shsInfo) ! SHS_INFO *shsInfo; { /* Set the h-vars to their initial values */ - shsInfo->digest[0] = h0init; shsInfo->digest[1] = h1init; shsInfo->digest[2] = h2init; --- 105,117 ---- /* Initialise the SHS values */ + /** Initialize SHS values. + * \param shsInfo pointer to shs data structure. + */ void ! shsInit(SHS_INFO *shsInfo) { /* Set the h-vars to their initial values */ shsInfo->digest[0] = h0init; shsInfo->digest[1] = h1init; shsInfo->digest[2] = h2init; *************** *** 125,143 **** shsInfo->digest[4] = h4init; /* Initialise bit count */ - shsInfo->countLo = shsInfo->countHi = 0; ! } /* end of shsInit */ - /* Perform the SHS transformation. Note that this code, like MD5, seems to break */ - /* some optimizing compilers - it may be necessary to split it into sections, e.g. */ - /* based on the four subrounds */ ! static void shsTransform(SHS_INFO * shsInfo); static void ! shsTransform(SHS_INFO * shsInfo) { LONG W[80], temp; int i; --- 119,137 ---- shsInfo->digest[4] = h4init; /* Initialise bit count */ shsInfo->countLo = shsInfo->countHi = 0; ! } ! static void shsTransform(SHS_INFO *shsInfo); + /* Perform the SHS transformation. Note that this code, like MD5, seems to + * break some optimizing compilers - it may be necessary to split it into + * sections, e.g. based on the four subrounds. + */ static void ! shsTransform(SHS_INFO *shsInfo) { LONG W[80], temp; int i; *************** *** 331,342 **** } /* end of byteReverse */ ! /* Update SHS for a block of data. This code assumes that the buffer size is a multiple */ ! /* of SHS_BLOCKSIZE bytes long, which makes the code a lot more efficient since it does */ ! /* away with the need to handle partial blocks between calls to shsUpdate () */ ! void ! shsUpdate(SHS_INFO * shsInfo, const BYTE * buffer, int count) { /* Update bitcount */ --- 325,340 ---- } /* end of byteReverse */ ! /** Update SHS for a block of data. This code assumes that the buffer ! * size is a multiple of SHS_BLOCKSIZE bytes long, which makes the ! * code a lot more efficient since it does away with the need to ! * handle partial blocks between calls to shsUpdate() ! * \param shsInfo pointer to shs data. ! * \param buffer block of data to update the hash with. ! * \param count size of buffer in bytes. ! */ void ! shsUpdate(SHS_INFO *shsInfo, const BYTE * buffer, int count) { /* Update bitcount */ *************** *** 361,370 **** memcpy(shsInfo->data, buffer, count); ! } /* end of shsUpdate */ void ! shsFinal(SHS_INFO * shsInfo) { int count; LONG lowBitcount = shsInfo->countLo, highBitcount = shsInfo->countHi; --- 359,371 ---- memcpy(shsInfo->data, buffer, count); ! } + /** Finalize the SHS hash. + * \param shsInfo pointer to shs data. + */ void ! shsFinal(SHS_INFO *shsInfo) { int count; LONG lowBitcount = shsInfo->countLo, highBitcount = shsInfo->countHi; *************** *** 411,414 **** if (shsInfo->reverse_wanted) byteReverse(shsInfo->data, SHS_DIGESTSIZE); ! } /* end of shsFinal */ --- 412,415 ---- if (shsInfo->reverse_wanted) byteReverse(shsInfo->data, SHS_DIGESTSIZE); ! } *** 1_7_7.309/src/local.dst Sun, 22 Dec 2002 01:26:12 -0600 dunemush (pennmush/b/19_local.dst 1.11 660) --- 1_7_7.365(w)/src/local.dst Wed, 09 Apr 2003 14:19:24 -0500 dunemush (pennmush/b/19_local.dst 1.15 660) *************** *** 25,31 **** /* Called after all MUSH init is done. */ void ! local_startup() { } --- 25,31 ---- /* Called after all MUSH init is done. */ void ! local_startup(void) { } *************** *** 47,53 **** * back to disk */ void ! local_dump_database() { } --- 47,53 ---- * back to disk */ void ! local_dump_database(void) { } *************** *** 56,62 **** * The log files are still open though. */ void ! local_shutdown() { } --- 56,62 ---- * The log files are still open though. */ void ! local_shutdown(void) { } *************** *** 65,71 **** * consistency checking you require. */ void ! local_dbck() { } --- 65,71 ---- * consistency checking you require. */ void ! local_dbck(void) { } *************** *** 73,79 **** * After the MUSH has done all it's stuff */ void ! local_timer() { } --- 73,79 ---- * After the MUSH has done all it's stuff */ void ! local_timer(void) { } *************** *** 151,153 **** --- 151,225 ---- /* Initiation of objects after a reload or dumping to disk should * be handled in local_dump_database() and local_startup(). */ + + + /* This function is called *before* most standard interaction checks, + * and can override them. You probably want to do as little as possible + * here and do most of the work in local_can_interact_last instead. + * If this returns NOTHING, it means 'go on to more checks' + */ + int + local_can_interact_first(dbref from __attribute__ ((__unused__)), + dbref to __attribute__ ((__unused__)), int type + __attribute__ ((__unused__))) + { + + return NOTHING; + } + + /* This one is called *after* most standard interaction checks. */ + int + local_can_interact_last(dbref from __attribute__ ((__unused__)), + dbref to __attribute__ ((__unused__)), int type + __attribute__ ((__unused__))) + { + /* from is where the message is coming from, in theory. It makes sense + * for sound, but think of it as light rays for visiblity or matching. + * The rays come *from* someone standing in a room, and go *to* the person + * looking around. + */ + + #ifdef NEVER + /* Various examples follow */ + + switch (type) { + case INTERACT_SEE: + /* Someone standing in a room, or walking into a room, or doing + * @verb type stuff that's @bar, @obar, and @abar + + /* Probably a good idea */ + if (See_All(to)) + return 1; + + break; + + case INTERACT_HEAR: + /* People talking */ + + /* Telepathy example. Players who can hear telepathy get @set + * HEAR_TELEPATHY, players currently using telepathy should be + * @set USE_TELEPATHY. */ + + if (has_flag_by_name(from, "USE_TELEPATHY", NOTYPE)) + return has_flag_by_name(to, "HEAR_TELEPATHY", NOTYPE); + + break; + + case INTERACT_MATCH: + /* Matching object names so you can pick them up, go through exits, + etc. */ + + break; + } + + /* Splits the universe in half, half FOO and half not. */ + return (has_flag_by_name(to, "FOO", NOTYPE) == + has_flag_by_name(from, "FOO", NOTYPE)); + + + #endif /* NEVER */ + + /* You want to return NOTHING if you haven't made up your mind */ + return NOTHING; + + } *** 1_7_7.309/src/wiz.c Wed, 12 Mar 2003 12:31:02 -0600 dunemush (pennmush/b/23_wiz.c 1.44.1.1.1.1.1.2.1.7.1.1.1.1.1.1.1.1.1.1.1.8.1.2.2.2.1.2.1.1.1.1.1.1.1.2.1.1.1.2.2.4 660) --- 1_7_7.365(w)/src/wiz.c Wed, 09 Apr 2003 14:19:27 -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.6 660) *************** *** 1201,1208 **** return; } ! nresults = raw_search(executor, args[0], args[1], args[2], args[3], args[4], ! &results, pe_info); if (nresults < 0) { safe_str("#-1", buff, bp); --- 1201,1212 ---- return; } ! if (!strcmp(called_as, "CHILDREN")) ! nresults = raw_search(executor, NULL, "PARENT", args[0], NULL, ! NULL, &results, pe_info); ! else ! nresults = raw_search(executor, args[0], args[1], args[2], args[3], args[4], ! &results, pe_info); if (nresults < 0) { safe_str("#-1", buff, bp); *************** *** 1235,1240 **** --- 1239,1245 ---- mush_free(results, "search_results"); } + enum search_class { S_OWNER, S_TYPE, S_PARENT, S_ZONE, S_FLAG, S_POWER, S_EVAL, S_NAME, S_LFLAG }; *** 1_7_7.309/src/wild.c Mon, 06 Jan 2003 10:30:50 -0600 dunemush (pennmush/b/24_wild.c 1.11.1.1.1.8.1.1.1.4.1.2 660) --- 1_7_7.365(w)/src/wild.c Wed, 09 Apr 2003 14:19:27 -0500 dunemush (pennmush/b/24_wild.c 1.11.1.1.1.8.1.1.1.4.1.2.1.1 660) *************** *** 1,7 **** ! /* wild.c - wildcard routines * * Written by T. Alexander Popiel, 24 June 1993 ! * Last modified by T. Alexander Popiel, 28 July 2000 * * Thanks go to Andrew Molitor for debugging * Thanks also go to Rich $alz for code to benchmark against --- 1,10 ---- ! /** ! * \file wild.c ! * ! * \brief Wildcard matching routings for PennMUSH * * Written by T. Alexander Popiel, 24 June 1993 ! * Last modified by Javelin, 2002-2003 * * Thanks go to Andrew Molitor for debugging * Thanks also go to Rich $alz for code to benchmark against *************** *** 17,22 **** --- 20,26 ---- * then please feel free to contact the author at * popiel@wolfskeep.com to work out agreeable terms. */ + #include "config.h" #include #include *************** *** 50,59 **** int cs); static char *strip_backslashes(const char *str); ! /* --------------------------------------------------------------------------- ! * quick_wild: do a wildcard match, without remembering the wild data. * * This routine will cause crashes if fed NULLs instead of strings. */ int quick_wild(const char *RESTRICT tstr, const char *RESTRICT dstr) --- 54,67 ---- int cs); static char *strip_backslashes(const char *str); ! /** Do a wildcard match, without remembering the wild data. * * This routine will cause crashes if fed NULLs instead of strings. + * + * \param tstr pattern to match against. + * \param dstr string to check. + * \retval 1 dstr matches the tstr pattern. + * \retval 0 dstr does not match the tstr pattern. */ int quick_wild(const char *RESTRICT tstr, const char *RESTRICT dstr) *************** *** 66,72 **** return quick_wild_new(tstr, dstr, 0); } ! int quick_wild_new(const char *RESTRICT tstr, const char *RESTRICT dstr, int cs) { --- 74,89 ---- return quick_wild_new(tstr, dstr, 0); } ! /** Do a wildcard match, possibly case-sensitive, without memory. ! * ! * This probably crashes if fed NULLs instead of strings, too. ! * ! * \param tstr pattern to match against. ! * \param dstr string to check. ! * \param cs if 1, case-sensitive; if 0, case-insensitive. ! * \retval 1 dstr matches the tstr pattern. ! * \retval 0 dstr does not match the tstr pattern. ! */ int quick_wild_new(const char *RESTRICT tstr, const char *RESTRICT dstr, int cs) { *************** *** 316,326 **** return wild1(s, d, p, wspace, cs); } ! /* --------------------------------------------------------------------------- ! * wild_match: do a wildcard ! * match, remembering the wild data, if wildcard match is done. * * This routine will cause crashes if fed NULLs instead of strings. */ int wild_match_case(const char *RESTRICT s, const char *RESTRICT d, int cs) --- 333,347 ---- return wild1(s, d, p, wspace, cs); } ! /** Wildcard match, possibly case-sensitive, and remember the wild data. * * This routine will cause crashes if fed NULLs instead of strings. + * + * \param s pattern to match against. + * \param d string to check. + * \param cs if 1, case-sensitive; if 0, case-insensitive. + * \retval 1 d matches s. + * \retval 0 d doesn't match s. */ int wild_match_case(const char *RESTRICT s, const char *RESTRICT d, int cs) *************** *** 334,341 **** return wild(s, d, 0, cs); } ! /* --------------------------------------------------------------------------- ! * regexp_match: do a regexp match, remembering the matched subexpressions */ int regexp_match_case(const char *RESTRICT s, const char *RESTRICT d, int cs) --- 355,369 ---- return wild(s, d, 0, cs); } ! /** Regexp match, possibly case-sensitive, and remember matched subexpressions. ! * ! * This routine will cause crashes if fed NULLs instead of strings. ! * ! * \param s regexp to match against. ! * \param d string to check. ! * \param cs if 1, case-sensitive; if 0, case-insensitive. ! * \retval 1 d matches s. ! * \retval 0 d doesn't match s. */ int regexp_match_case(const char *RESTRICT s, const char *RESTRICT d, int cs) *************** *** 406,414 **** } ! /* --------------------------------------------------------------------------- ! * quick_regexp_match: do a regexp match, not caring about saving matched ! * subexpressions. */ int quick_regexp_match(const char *RESTRICT s, const char *RESTRICT d, int cs) --- 434,448 ---- } ! /** Regexp match, possibly case-sensitive, and with no memory. ! * ! * This routine will cause crashes if fed NULLs instead of strings. ! * ! * \param s regexp to match against. ! * \param d string to check. ! * \param cs if 1, case-sensitive; if 0, case-insensitive. ! * \retval 1 d matches s. ! * \retval 0 d doesn't match s. */ int quick_regexp_match(const char *RESTRICT s, const char *RESTRICT d, int cs) *************** *** 448,458 **** } ! /* --------------------------------------------------------------------------- ! * local_wild_match: do either an order comparison or a wildcard match. ! * Ignore match correspondences. * * This routine will cause crashes if fed NULLs instead of strings. */ int local_wild_match_case(const char *RESTRICT s, const char *RESTRICT d, int cs) --- 482,496 ---- } ! /** Either an order comparison or a wildcard match with no memory. * * This routine will cause crashes if fed NULLs instead of strings. + * + * \param s pattern to match against. + * \param d string to check. + * \param cs if 1, case-sensitive; if 0, case-insensitive. + * \retval 1 d matches s. + * \retval 0 d doesn't match s. */ int local_wild_match_case(const char *RESTRICT s, const char *RESTRICT d, int cs) *************** *** 475,484 **** return quick_wild_new(s, d, cs); } ! /* --------------------------------------------------------------------------- ! * wildcard - return 1 if the string has a wildcard character (* or ?) ! * in it, and 0 otherwise. Not used by the wild matching routines, but ! * suitable for outside use. */ int wildcard(const char *s) --- 513,523 ---- return quick_wild_new(s, d, cs); } ! /** Does a string contain a wildcard character (* or ?)? ! * Not used by the wild matching routines, but suitable for outside use. ! * \param s string to check. ! * \retval 1 s contains a * or ? ! * \retval 0 s does not contain a * or ? */ int wildcard(const char *s) *** 1_7_7.309/src/warnings.c Sun, 22 Dec 2002 01:19:31 -0600 dunemush (pennmush/b/25_warnings.c 1.21.1.2 660) --- 1_7_7.365(w)/src/warnings.c Wed, 09 Apr 2003 14:19:27 -0500 dunemush (pennmush/b/25_warnings.c 1.21.1.3 660) *************** *** 1,6 **** ! ! /* warnings.c - check to make sure rooms and exits are the way they ! * should be. */ #include "config.h" --- 1,10 ---- ! /** ! * \file warnings.c ! * ! * \brief Check topology and messages on PennMUSH objects and give warnings ! * ! * ! */ #include "config.h" *************** *** 47,56 **** typedef long int warn_type; typedef struct a_tcheck tcheck; struct a_tcheck { ! const char *name; ! warn_type flag; }; --- 51,61 ---- typedef long int warn_type; + /** A structure representing a topology warning check. */ typedef struct a_tcheck tcheck; struct a_tcheck { ! const char *name; /**< Name of warning. */ ! warn_type flag; /**< Bitmask of warning. */ }; *************** *** 307,312 **** --- 312,320 ---- } } + /** Set up the default warnings on an object. + * \param player object to set warnings on. + */ void set_initial_warnings(dbref player) { *************** *** 314,319 **** --- 322,335 ---- return; } + /** Set warnings on an object. + * \verbatim + * This implements @warnings obj=warning list + * \endverbatim + * \param player the enactor. + * \param name name of object to set warnings on. + * \param warns list of warnings to set, space-separated. + */ void do_warnings(dbref player, const char *name, const char *warns) { *************** *** 386,392 **** } ! /* Given an object, return a string of warnings on it */ const char * unparse_warnings(dbref thing) { --- 402,411 ---- } ! /** Given an object, return a string of warnings on it. ! * \param thing dbref of object. ! * \return pointer to statically allocated string listing warnings. ! */ const char * unparse_warnings(dbref thing) { *************** *** 463,471 **** } ! /* Loop through all objects and check their topology */ void ! run_topology() { int ndone; for (ndone = 0; ndone < db_top; ndone++) { --- 482,490 ---- } ! /** Loop through all objects and check their topology. */ void ! run_topology(void) { int ndone; for (ndone = 0; ndone < db_top; ndone++) { *************** *** 475,480 **** --- 494,505 ---- } } + /** Wizard command to check all objects. + * \verbatim + * This implements @wcheck/all. + * \endverbatim + * \param player the enactor. + */ void do_wcheck_all(dbref player) { *************** *** 487,493 **** notify(player, T("Warning checks complete.")); } ! /* wcheck on a specific player, by that player */ void do_wcheck_me(dbref player) { --- 512,520 ---- notify(player, T("Warning checks complete.")); } ! /** Check warnings on a specific player by themselves. ! * \param player player checking warnings on their objects. ! */ void do_wcheck_me(dbref player) { *************** *** 503,510 **** } ! /* Called when a player wants to do a check on something. We check for ! * ownership or hasprivs before allowing it */ void do_wcheck(dbref player, const char *name) --- 530,539 ---- } ! /** Check warnings on a specific object. ! * We check for ownership or hasprivs before allowing this. ! * \param player the enactor. ! * \param name name of object to check. */ void do_wcheck(dbref player, const char *name) *** 1_7_7.309/src/version.c Sun, 01 Dec 2002 21:14:41 -0600 dunemush (pennmush/b/26_version.c 1.8 660) --- 1_7_7.365(w)/src/version.c Wed, 09 Apr 2003 14:19:27 -0500 dunemush (pennmush/b/26_version.c 1.9 660) *************** *** 1,6 **** ! /* This file defines the @version command. It's all by itself because * we want to rebuild this file at every compilation, so that the * BUILDDATE is correct */ #include "config.h" #include "copyrite.h" --- 1,13 ---- ! /** ! * \file version.c ! * ! * \brief Version. ! * ! * \verbatim ! * This file defines the @version command. It's all by itself because * we want to rebuild this file at every compilation, so that the * BUILDDATE is correct + * \endverbatim */ #include "config.h" #include "copyrite.h" *************** *** 20,28 **** extern time_t start_time; /* from bsd.c */ void do_version(dbref player); void ! do_version(player) ! dbref player; { char buff[BUFFER_LEN]; --- 27,37 ---- extern time_t start_time; /* from bsd.c */ void do_version(dbref player); + /** The version command. + * \param player the enactor. + */ void ! do_version(dbref player) { char buff[BUFFER_LEN]; *** 1_7_7.309/src/utils.c Sun, 01 Dec 2002 21:14:41 -0600 dunemush (pennmush/b/27_utils.c 1.30.1.1.1.5 660) --- 1_7_7.365(w)/src/utils.c Wed, 09 Apr 2003 14:19:27 -0500 dunemush (pennmush/b/27_utils.c 1.30.1.1.1.9 660) *************** *** 1,4 **** ! /* utils.c */ #include "copyrite.h" #include "config.h" --- 1,10 ---- ! /** ! * \file utils.c ! * ! * \brief Utility functions for PennMUSH. ! * ! * ! */ #include "copyrite.h" #include "config.h" *************** *** 46,56 **** dbref find_entrance(dbref door); void initialize_mt(void); ! unsigned long genrand_int32(void); ! long genrand_int31(void); ! void init_genrand(unsigned long); ! void init_by_array(unsigned long *, int); ! Malloc_t mush_malloc(size_t size, const char *check) { --- 52,71 ---- dbref find_entrance(dbref door); void initialize_mt(void); ! static unsigned long genrand_int32(void); ! static long genrand_int31(void); ! static void init_genrand(unsigned long); ! static void init_by_array(unsigned long *, int); ! extern int local_can_interact_first(dbref from, dbref to, int type); ! extern int local_can_interact_last(dbref from, dbref to, int type); ! ! /** A malloc wrapper that tracks type of allocation. ! * This should be used in preference to malloc() when possible, ! * to enable memory leak tracing with MEM_CHECK. ! * \param size bytes to allocate. ! * \param check string to label allocation with. ! * \return allocated block of memory or NULL. ! */ Malloc_t mush_malloc(size_t size, const char *check) { *************** *** 65,70 **** --- 80,91 ---- return ptr; } + /** A free wrapper that tracks type of allocation. + * If mush_malloc() gets the memory, mush_free() should free it + * to enable memory leak tracing with MEM_CHECK. + * \param ptr pointer to block of member to free. + * \param check string to label allocation with. + */ void mush_free(Malloc_t RESTRICT ptr, const char *RESTRICT check __attribute__ ((__unused__))) *************** *** 77,91 **** } void parse_attrib(dbref player, char *str, dbref *thing, ATTR **attrib) { - /* takes a string which is of the format / or , - * and returns the dbref of the object, and a pointer to the attribute. - * If no object is specified, then the dbref returned is the player's. - * str is destructively modified. - */ - char *name; /* find the object */ --- 98,116 ---- } + /** Parse object/attribute strings into components. + * This function takes a string which is of the format obj/attr or attr, + * and returns the dbref of the object, and a pointer to the attribute. + * If no object is specified, then the dbref returned is the player's. + * str is destructively modified. This function is probably underused. + * \param player the default object. + * \param str the string to parse. + * \param thing pointer to dbref of object parsed out of string. + * \param attrib pointer to pointer to attribute structure retrieved. + */ void parse_attrib(dbref player, char *str, dbref *thing, ATTR **attrib) { char *name; /* find the object */ *************** *** 103,108 **** --- 128,139 ---- } + /** Given an exit, find the room that is its source through brute force. + * This is used in pathological cases where the exit's own source + * element is invalid. + * \param door dbref of exit to find source of. + * \return dbref of exit's source room, or NOTHING. + */ dbref find_entrance(dbref door) { *************** *** 120,126 **** return NOTHING; } ! /* remove the first occurence of what in list headed by first */ dbref remove_first(dbref first, dbref what) { --- 151,162 ---- return NOTHING; } ! /** Remove the first occurence of what in chain headed by first. ! * This works for contents and exit chains. ! * \param first dbref of first object in chain. ! * \param what dbref of object to remove from chain. ! * \return new head of chain. ! */ dbref remove_first(dbref first, dbref what) { *************** *** 140,145 **** --- 176,187 ---- } } + /** Is an object on a chain? + * \param thing object to look for. + * \param list head of chain to search. + * \retval 1 found thing on list. + * \retval 0 did not find thing on list. + */ int member(dbref thing, dbref list) { *************** *** 152,160 **** } ! /* Return 1 if disallow is inside of from, i.e., if loc(disallow) = from, ! * or loc(loc(disallow)) = from, etc. ! * Actually, it's not recursive any more. */ int recursive_member(dbref disallow, dbref from, int count) --- 194,209 ---- } ! /** Is an object inside another, at any level of depth? ! * That is, we check if disallow is inside of from, i.e., if ! * loc(disallow) = from, or loc(loc(disallow)) = from, etc., with a ! * depth limit of 50. ! * Despite the name of this function, it's not recursive any more. ! * \param disallow interior object to check. ! * \param from check if disallow is inside of this object. ! * \param count depths of nesting checked so far. ! * \retval 1 disallow is inside of from. ! * \retval 0 disallow is not inside of from. */ int recursive_member(dbref disallow, dbref from, int count) *************** *** 174,180 **** return 1; } ! /* Return one if the dbref, or its location, etc. is set unfindable */ int unfindable(dbref thing) { --- 223,233 ---- return 1; } ! /** Is an object or its location unfindable? ! * \param thing object to check. ! * \retval 1 object or location is unfindable. ! * \retval 0 neither object nor location is unfindable. ! */ int unfindable(dbref thing) { *************** *** 193,198 **** --- 246,255 ---- } + /** Reverse the order of a dbref chain. + * \param list dbref at the head of the chain. + * \return dbref at the head of the reversed chain. + */ dbref reverse(dbref list) { *************** *** 224,230 **** */ ! /* Initializing the array with a seed */ void initialize_mt(void) { --- 281,287 ---- */ ! /** Wrapper to choose a seed and initialize the Mersenne Twister PRNG. */ void initialize_mt(void) { *************** *** 283,290 **** static unsigned long mt[N]; /* the array for the state vector */ static int mti = N + 1; /* mti==N+1 means mt[N] is not initialized */ ! /* initializes mt[N] with a seed */ ! void init_genrand(unsigned long s) { mt[0] = s & 0xffffffffUL; --- 340,349 ---- static unsigned long mt[N]; /* the array for the state vector */ static int mti = N + 1; /* mti==N+1 means mt[N] is not initialized */ ! /** initializes mt[N] with a seed. ! * \param a seed value. ! */ ! static void init_genrand(unsigned long s) { mt[0] = s & 0xffffffffUL; *************** *** 299,308 **** } } ! /* initialize by an array with array-length */ ! /* init_key is the array for initializing keys */ ! /* key_length is its length */ ! void init_by_array(unsigned long init_key[], int key_length) { int i, j, k; --- 358,368 ---- } } ! /** initialize by an array with array-length ! * \param init_key the array for initializing keys ! * \param key_length the array's length ! */ ! static void init_by_array(unsigned long init_key[], int key_length) { int i, j, k; *************** *** 338,344 **** } /* generates a random number on [0,0xffffffff]-interval */ ! unsigned long genrand_int32(void) { unsigned long y; --- 398,404 ---- } /* generates a random number on [0,0xffffffff]-interval */ ! static unsigned long genrand_int32(void) { unsigned long y; *************** *** 377,389 **** } /* generates a random number on [0,0x7fffffff]-interval */ ! long genrand_int31(void) { return (long) (genrand_int32() >> 1); } ! /* Based on MUX's RandomINT32() */ long get_random_long(long low, long high) { --- 437,454 ---- } /* generates a random number on [0,0x7fffffff]-interval */ ! static long genrand_int31(void) { return (long) (genrand_int32() >> 1); } ! /** Get a uniform random long between low and high values, inclusive. ! * Based on MUX's RandomINT32() ! * \param low lower bound for random number. ! * \param high upper bound for random number. ! * \return random number between low and high, or 0 or -1 for error. ! */ long get_random_long(long low, long high) { *************** *** 430,435 **** --- 495,502 ---- /* Return an object's name, but for exits, return just the first * component. We expect a valid object. + * \param it dbref of object. + * \return object's short name. */ char * shortname(dbref it) *************** *** 446,454 **** return n; } ! /* Return the absolute room (outermost container) of an object ! * or NOTHING if it's in an invalid object or in an invalid ! * location or AMBIGUOUS if there are too many containers */ dbref absolute_room(dbref it) --- 513,523 ---- return n; } ! /** Return the absolute room (outermost container) of an object. ! * Return NOTHING if it's in an invalid object or in an invalid ! * location or AMBIGUOUS if there are too many containers. ! * \param it dbref of object. ! * \return absolute room of object, NOTHING, or AMBIGUOUS. */ dbref absolute_room(dbref it) *************** *** 468,470 **** --- 537,588 ---- } return room; } + + + /** Can one object interact with/perceive another in a given way? + * This funtion checks to see if 'to' can perceive something from + * 'from'. The types of interactions currently supported include: + * INTERACT_SEE (will light rays from from reach to?), INTERACT_HEAR + * (will sound from from reach to?), and INTERACT_MATCH (can 'to' + * match the name of 'from'). + * \param from object of interaction. + * \param to subject of interaction, attempting to interact with from. + * \param type type of interaction. + * \retval 1 to can interact with from in this way. + * \retval 0 to can not interact with from in this way. + */ + int + can_interact(dbref from, dbref to, int type) + { + int lci; + + /* This shouldn't even be checked for rooms and garbage, but we're + * paranoid. Trying to stop interaction with yourself will not work 99% + * of the time, so we don't allow it anyway. */ + if (IsGarbage(from) || IsGarbage(to)) + return 0; + + if ((from == to) || IsRoom(from) || IsRoom(to)) + return 1; + + /* This function can override standard checks! */ + lci = local_can_interact_first(from, to, type); + if (lci != NOTHING) + return lci; + + /* Standard checks */ + + /* You can interact with the object you are in or any objects + * you're holding. + * You can interact with objects you control, but not + * specifically the other way around + */ + if ((from == Location(to)) || (to == Location(from)) || controls(to, from)) + return 1; + + lci = local_can_interact_last(from, to, type); + if (lci != NOTHING) + return lci; + + return 1; + } *** 1_7_7.309/src/timer.c Sat, 25 Jan 2003 23:35:07 -0600 dunemush (pennmush/b/29_timer.c 1.29.1.7.1.4 660) --- 1_7_7.365(w)/src/timer.c Wed, 09 Apr 2003 14:19:27 -0500 dunemush (pennmush/b/29_timer.c 1.29.1.7.1.5 660) *************** *** 1,6 **** ! /* timer.c */ ! ! /* Subroutines for timed events */ #include "copyrite.h" #include "config.h" --- 1,10 ---- ! /** ! * \file timer.c ! * ! * \brief Timed events in PennMUSH. ! * ! * ! */ #include "copyrite.h" #include "config.h" *************** *** 59,64 **** --- 63,72 ---- #ifndef WIN32 + /** Handler for HUP signal. + * Do the minimal work here - set a global variable and reload the handler. + * \param x unused. + */ void hup_handler(int x __attribute__ ((__unused__))) { *************** *** 66,71 **** --- 74,83 ---- reload_sig_handler(SIGHUP, hup_handler); } + /** Handler for USR1 signal. + * Do the minimal work here - set a global variable and reload the handler. + * \param x unused. + */ void usr1_handler(int x __attribute__ ((__unused__))) { *************** *** 75,82 **** #endif /* WIN32 */ void ! init_timer() { #ifndef WIN32 install_sig_handler(SIGHUP, hup_handler); --- 87,96 ---- #endif /* WIN32 */ + /** Set up signal handlers. + */ void ! init_timer(void) { #ifndef WIN32 install_sig_handler(SIGHUP, hup_handler); *************** *** 88,99 **** } void ! dispatch() { static int idle_counter = 0; ! /* this routine can be used to poll from intrface.c */ if (hup_triggered) { do_rawlog(LT_ERR, T("SIGHUP received: reloading .txt and .cnf files")); config_file_startup(NULL, 0); --- 102,120 ---- } + /** Handle events that may need handling. + * This routine is polled from bsd.c. At any call, it can handle + * the HUP and USR1 signals. At calls that are 'on the second', + * it goes on to perform regular every-second processing and to + * check whether it's time to do other periodic processes like + * purge, dump, or inactivity checks. + */ void ! dispatch(void) { static int idle_counter = 0; ! /* A HUP reloads configuration and reopens logs */ if (hup_triggered) { do_rawlog(LT_ERR, T("SIGHUP received: reloading .txt and .cnf files")); config_file_startup(NULL, 0); *************** *** 104,109 **** --- 125,131 ---- reopen_logs(); hup_triggered = 0; } + /* A USR1 does a shutdown/reboot */ if (usr1_triggered) { do_reboot(NOTHING, 0); /* We don't return from this */ usr1_triggered = 0; /* But just in case */ *************** *** 173,178 **** --- 195,204 ---- int cpu_limit_warning_sent = 0; #if defined(HAS_ITIMER) + /** Handler for PROF signal. + * Do the minimal work here - set a global variable and reload the handler. + * \param signo unused. + */ void signal_cpu_limit(int signo __attribute__ ((__unused__))) { *************** *** 189,194 **** --- 215,222 ---- #endif int timer_set = 0; + /** Start the cpu timer (before running a command). + */ void start_cpu_timer(void) { *************** *** 222,227 **** --- 250,257 ---- #endif } + /** Reset the cpu timer (after running a command). + */ void reset_cpu_timer(void) { *** 1_7_7.309/src/privtab.c Sun, 01 Dec 2002 21:14:41 -0600 dunemush (pennmush/b/31_privtab.c 1.6 660) --- 1_7_7.365(w)/src/privtab.c Wed, 09 Apr 2003 14:19:27 -0500 dunemush (pennmush/b/31_privtab.c 1.7 660) *************** *** 1,5 **** ! /* privtab.c */ ! /* Functions to work with privilege tables */ #include "copyrite.h" #include "config.h" --- 1,12 ---- ! /** ! * \file privtab.c ! * ! * \brief Privilege tables for PennMUSH. ! * ! * A privilege table is a respresentation of different privilege ! * flags with associated names, characters, and bitmasks. ! * ! */ #include "copyrite.h" #include "config.h" *************** *** 12,26 **** #include "confmagic.h" ! /* Given a privs table, a string, and an original set of privileges, * return a modified set of privileges by applying the privs in the ! * string to the original set of privileges */ int ! string_to_privs(table, str, origprivs) ! PRIV *table; ! const char *str; ! long int origprivs; { PRIV *c; long int yes = 0; --- 19,35 ---- #include "confmagic.h" ! /** Convert a string to a set of privilege bits, masked by an original set. ! * Given a privs table, a string, and an original set of privileges, * return a modified set of privileges by applying the privs in the ! * string to the original set of privileges. ! * \param table pointer to a privtab. ! * \param str a space-separated string of privilege names to apply. ! * \param origprivs the original privileges. ! * \return a privilege bitmask. */ int ! string_to_privs(PRIV *table, const char *str, long int origprivs) { PRIV *c; long int yes = 0; *************** *** 59,73 **** return ((origprivs | yes) & ~no); } ! /* Given a privs table, a string of letters, and an original set of privileges, * return a modified set of privileges by applying the privs in the ! * letters to the original set of privileges */ int ! letter_to_privs(table, str, origprivs) ! PRIV *table; ! const char *str; ! long int origprivs; { PRIV *c; long int yes = 0, no = 0; --- 68,84 ---- return ((origprivs | yes) & ~no); } ! /** Convert a letter string to a set of privilege bits, masked by an original set. ! * Given a privs table, a letter string, and an original set of privileges, * return a modified set of privileges by applying the privs in the ! * string to the original set of privileges. ! * \param table pointer to a privtab. ! * \param str a string of privilege letters to apply. ! * \param origprivs the original privileges. ! * \return a privilege bitmask. */ int ! letter_to_privs(PRIV *table, const char *str, long int origprivs) { PRIV *c; long int yes = 0, no = 0; *************** *** 97,107 **** return ((origprivs | yes) & ~no); } ! /* Given a table and a bitmask, return a privs string (static allocation) */ const char * ! privs_to_string(table, privs) ! PRIV *table; ! int privs; { PRIV *c; static char buf[BUFFER_LEN]; --- 108,120 ---- return ((origprivs | yes) & ~no); } ! /** Given a table and a bitmask, return a privs string (static allocation). ! * \param table pointer to a privtab. ! * \param privs bitmask of privileges. ! * \return statically allocated space-separated string of priv names. ! */ const char * ! privs_to_string(PRIV *table, int privs) { PRIV *c; static char buf[BUFFER_LEN]; *************** *** 121,132 **** } ! /* Given a table and a bitmask, return a privs letter string ! * (static allocation) */ const char * ! privs_to_letters(table, privs) ! PRIV *table; ! int privs; { PRIV *c; static char buf[BUFFER_LEN]; --- 134,146 ---- } ! /** Given a table and a bitmask, return a privs letter string (static allocation). ! * \param table pointer to a privtab. ! * \param privs bitmask of privileges. ! * \return statically allocated string of priv letters. ! */ const char * ! privs_to_letters(PRIV *table, int privs) { PRIV *c; static char buf[BUFFER_LEN]; *** 1_7_7.309/src/strutil.c Wed, 12 Feb 2003 17:02:38 -0600 dunemush (pennmush/b/33_strutil.c 1.28.1.3.1.3.1.7.2.1.1.2.1.1.1.1.1.1.1.21.1.4 660) --- 1_7_7.365(w)/src/strutil.c Wed, 09 Apr 2003 14:19:27 -0500 dunemush (pennmush/b/33_strutil.c 1.28.1.3.1.3.1.7.2.1.1.2.1.1.1.1.1.1.1.21.1.2.1.2.1.2 660) *************** *** 1,7 **** - /* strutil.c */ - - /* String utilities */ #include "config.h" #include --- 1,11 ---- + /** + * \file strutil.c + * + * \brief String utilities for PennMUSH. + * + * + */ #include "config.h" #include *************** *** 20,37 **** #include "memcheck.h" #endif #include "mymalloc.h" - #include "confmagic.h" - #include "log.h" char *next_token(char *str, char sep); static int format_long(long val, char *buff, char **bp, int maxlen); ! char * mush_strndup(const char *src, size_t len, const char *check) __attribute_malloc__; /* Duplicate the first len characters of s */ ! char *mush_strndup(const char *src, size_t len, const char *check) { char *copy; size_t rlen = strlen(src); --- 24,40 ---- #include "memcheck.h" #endif #include "mymalloc.h" #include "log.h" + #include "confmagic.h" char *next_token(char *str, char sep); static int format_long(long val, char *buff, char **bp, int maxlen); ! static char * mush_strndup(const char *src, size_t len, const char *check) __attribute_malloc__; /* Duplicate the first len characters of s */ ! static char *mush_strndup(const char *src, size_t len, const char *check) { char *copy; size_t rlen = strlen(src); *************** *** 48,53 **** --- 51,63 ---- return copy; } + /** Our version of strdup, with memory leak checking. + * This should be used in preference to strdup, and in assocation + * with mush_free(). + * \param s string to duplicate. + * \param check label for memory checking. + * \return newly allocated copy of s. + */ char * mush_strdup(const char *s, const char *check __attribute__ ((__unused__))) { *************** *** 69,75 **** return x; } ! /* Return the string chopped at lim characters */ char * chopstr(const char *str, size_t lim) { --- 79,89 ---- return x; } ! /** Return the string chopped at lim characters. ! * \param str string to chop. ! * \param lim character at which to chop the string. ! * \return statically allocated buffer with chopped string. ! */ char * chopstr(const char *str, size_t lim) { *************** *** 84,89 **** --- 98,110 ---- #ifndef HAS_STRCASECMP #ifndef WIN32 + /** strcasecmp for systems without it. + * \param s1 one string to compare. + * \param s2 another string to compare. + * \retval -1 s1 is less than s2. + * \retval 0 s1 equals s2 + * \retval 1 s1 is greater than s2. + */ int strcasecmp(const char *s1, const char *s2) { *************** *** 93,98 **** --- 114,127 ---- return (DOWNCASE(*s1) - DOWNCASE(*s2)); } + /** strncasecmp for systems without it. + * \param s1 one string to compare. + * \param s2 another string to compare. + * \param n number of characters to compare. + * \retval -1 s1 is less than s2. + * \retval 0 s1 equals s2 + * \retval 1 s1 is greater than s2. + */ int strncasecmp(const char *s1, const char *s2, size_t n) { *************** *** 107,112 **** --- 136,148 ---- #endif /* !WIN32 */ #endif /* !HAS_STRCASECMP */ + /** Does string begin with prefix? + * This comparison is case-insensitive. + * \param string to check. + * \param prefix to check against. + * \retval 1 string begins with prefix. + * \retval 0 string does not begin with prefix. + */ int string_prefix(const char *RESTRICT string, const char *RESTRICT prefix) { *************** *** 117,123 **** return *prefix == '\0'; } ! /* accepts only nonempty matches starting at the beginning of a word */ const char * string_match(const char *src, const char *sub) { --- 153,163 ---- return *prefix == '\0'; } ! /** Match a substring at the start of a word in a string, case-insensitively. ! * \param src a string of words to match against. ! * \param sub a prefix to match against the start of a word in string. ! * \return pointer into src at the matched word, or NULL. ! */ const char * string_match(const char *src, const char *sub) { *************** *** 137,145 **** src++; } } ! return 0; } char * strupper(const char *s) { --- 177,189 ---- src++; } } ! return NULL; } + /** Return an uppercased version of a string in a static buffer. + * \param s string to uppercase. + * \return pointer to a static buffer containing the uppercased version. + */ char * strupper(const char *s) { *************** *** 156,161 **** --- 200,209 ---- return buf1; } + /** Return a lowercased version of a string in a static buffer. + * \param s string to lowercase. + * \return pointer to a static buffer containing the lowercased version. + */ char * strlower(const char *s) { *************** *** 172,187 **** return buf1; } char * upcasestr(char *s) { - /* modifies a string in-place to be upper-case */ char *p; for (p = s; p && *p; p++) *p = UPCASE(*p); return s; } int safe_accent(const char *RESTRICT base, const char *RESTRICT tmplate, size_t len, char *buff, char **bp) --- 220,247 ---- return buf1; } + /** Modify a string in-place to uppercase. + * \param s string to uppercase. + * \return s, now modified to be all uppercase. + */ char * upcasestr(char *s) { char *p; for (p = s; p && *p; p++) *p = UPCASE(*p); return s; } + /** Safely add an accented string to a buffer. + * \param base base string to which accents are applied. + * \param tmplate accent template string. + * \param len length of base (and tmplate). + * \param buff pointer to buffer to store accented string. + * \param bp pointer to pointer to insertion point in buff. + * \retval 1 failed to store entire string. + * \retval 0 success. + */ int safe_accent(const char *RESTRICT base, const char *RESTRICT tmplate, size_t len, char *buff, char **bp) *************** *** 518,523 **** --- 578,590 ---- return len - clen + /** Safely store a formatted string into a buffer. + * This is a better way to do safe_str(tprintf(fmt,...),buff,bp) + * \param buff buffer to store formatted string. + * \param bp pointer to pointer to insertion point in buff. + * \param fmt format string. + * \return number of characters left over, or 0 for success. + */ int safe_format(char *buff, char **bp, const char *RESTRICT fmt, ...) { *************** *** 542,573 **** APPEND_TO_BUF; } int safe_integer(int i, char *buff, char **bp) { - /* Adds a int to a string, being careful not to overflow buffer */ return format_long(i, buff, bp, BUFFER_LEN); } int safe_uinteger(unsigned int i, char *buff, char **bp) { - /* Adds an unsigned int to a string */ return safe_str(unparse_uinteger(i), buff, bp); } int safe_integer_sbuf(int i, char *buff, char **bp) { - /* Adds a int to a string, being careful not to overflow buffer */ return format_long(i, buff, bp, SBUF_LEN); } int safe_dbref(dbref d, char *buff, char **bp) { - /* Adds a dbref to a string, being careful not to overflow buffer and - avoiding writing partial dbrefs */ char *saved = *bp; if (safe_chr('#', buff, bp)) { *bp = saved; --- 609,661 ---- APPEND_TO_BUF; } + /** Safely store an integer into a buffer. + * \param i integer to store. + * \param buff buffer to store into. + * \param bp pointer to pointer to insertion point in buff. + * \return 0 on success, non-zero on failure. + */ int safe_integer(int i, char *buff, char **bp) { return format_long(i, buff, bp, BUFFER_LEN); } + /** Safely store an unsigned integer into a buffer. + * \param i integer to store. + * \param buff buffer to store into. + * \param bp pointer to pointer to insertion point in buff. + * \return 0 on success, non-zero on failure. + */ int safe_uinteger(unsigned int i, char *buff, char **bp) { return safe_str(unparse_uinteger(i), buff, bp); } + /** Safely store an unsigned integer into a short buffer. + * \param i integer to store. + * \param buff buffer to store into. + * \param bp pointer to pointer to insertion point in buff. + * \return 0 on success, non-zero on failure. + */ int safe_integer_sbuf(int i, char *buff, char **bp) { return format_long(i, buff, bp, SBUF_LEN); } + /** Safely store a dbref into a buffer. + * Don't store partial dbrefs. + * \param d dbref to store. + * \param buff buffer to store into. + * \param bp pointer to pointer to insertion point in buff. + * \retval 0 success. + * \retval 1 failure. + */ int safe_dbref(dbref d, char *buff, char **bp) { char *saved = *bp; if (safe_chr('#', buff, bp)) { *bp = saved; *************** *** 581,615 **** } int safe_number(NVAL n, char *buff, char **bp) { - /* Adds a number to a string, being careful not to overflow buffer */ const char *c; APPEND_ARGS; - c = unparse_number(n); APPEND_TO_BUF; } int safe_str(const char *c, char *buff, char **bp) { - /* copies a string into a buffer, making sure there's no overflow. */ APPEND_ARGS; - if (!c || !*c) return 0; - APPEND_TO_BUF; - } int safe_str_space(const char *c, char *buff, char **bp) { - /* copies a string into a buffer, making sure there's no overflow. - * puts it in quotes if there's space in it. */ APPEND_ARGS; char *saved = *bp; --- 669,716 ---- } + /** Safely store a number into a buffer. + * \param n number to store. + * \param buff buffer to store into. + * \param bp pointer to pointer to insertion point in buff. + * \retval 0 success. + * \retval 1 failure. + */ int safe_number(NVAL n, char *buff, char **bp) { const char *c; APPEND_ARGS; c = unparse_number(n); APPEND_TO_BUF; } + /** Safely store a string into a buffer. + * \param c string to store. + * \param buff buffer to store into. + * \param bp pointer to pointer to insertion point in buff. + * \retval 0 success. + * \retval 1 failure. + */ int safe_str(const char *c, char *buff, char **bp) { APPEND_ARGS; if (!c || !*c) return 0; APPEND_TO_BUF; } + /** Safely store a string into a buffer, quoting it if it contains a space. + * \param c string to store. + * \param buff buffer to store into. + * \param bp pointer to pointer to insertion point in buff. + * \retval 0 success. + * \retval 1 failure. + */ int safe_str_space(const char *c, char *buff, char **bp) { APPEND_ARGS; char *saved = *bp; *************** *** 629,634 **** --- 730,744 ---- } + /** Safely store a string of known length into a buffer + * This is an optimization of safe_str for when we know the string's length. + * \param s string to store. + * \param len length of s. + * \param buff buffer to store into. + * \param bp pointer to pointer to insertion point in buff. + * \retval 0 success. + * \retval 1 failure. + */ int safe_strl(const char *s, int len, char *buff, char **bp) { *************** *** 651,656 **** --- 761,774 ---- return len - clen; } + /** Safely fill a string with a given character a given number of times. + * \param x character to fill with. + * \param n number of copies of character to fill in. + * \param buff buffer to store into. + * \param bp pointer to pointer to insertion point in buff. + * \retval 0 success. + * \retval 1 failure (filled to end of buffer, but more was requested). + */ int safe_fill(char x, size_t n, char *buff, char **bp) { *************** *** 682,725 **** /* skip_space and seek_char are essentially right out of the 2.0 code */ char * skip_space(const char *s) { - /* returns pointer to the next non-space char in s, or NULL if s == NULL - * or *s == NULL or s has only spaces. - */ - char *c = (char *) s; while (c && *c && isspace((unsigned char) *c)) c++; return c; } char * seek_char(const char *s, char c) { - /* similar to strchr(). returns a pointer to the next char in s which - * matches c, or a pointer to the terminating null at the end of s. - */ - char *p = (char *) s; while (p && *p && (*p != c)) p++; return p; } int u_strlen(const unsigned char *s) { return strlen((const char *) s); } unsigned char * u_strcpy(unsigned char *target, const unsigned char *source) { return (unsigned char *) strcpy((char *) target, (const char *) source); } char * replace_string(const char *RESTRICT old, const char *RESTRICT newbit, const char *RESTRICT string) --- 800,862 ---- /* skip_space and seek_char are essentially right out of the 2.0 code */ + /** Return a pointer to the next non-space character in a string, or NULL. + * We return NULL if given a null string or a string with only spaces. + * \param s string to search for non-spaces. + * \return pointer to next non-space character in s. + */ char * skip_space(const char *s) { char *c = (char *) s; while (c && *c && isspace((unsigned char) *c)) c++; return c; } + /** Return a pointer to next char in s which matches c, or to the terminating + * null at the end of s. + * \param s string to search. + * \param c character to search for. + * \return pointer to next occurence of c or to the end of s. + */ char * seek_char(const char *s, char c) { char *p = (char *) s; while (p && *p && (*p != c)) p++; return p; } + /** Unsigned char version of strlen. + * \param s string. + * \return length of s. + */ int u_strlen(const unsigned char *s) { return strlen((const char *) s); } + /** Unsigned char version of strcpy. Equally dangerous. + * \param target destination for copy. + * \param source string to copy. + * \return pointer to copy. + */ unsigned char * u_strcpy(unsigned char *target, const unsigned char *source) { return (unsigned char *) strcpy((char *) target, (const char *) source); } + /** Search for all copies of old in string, and replace each with newbit. + * The replaced string is returned, newly allocated. + * \param old string to find. + * \param newbit string to replace old with. + * \param string string to search for old in. + * \return allocated string with replacements performed. + */ char * replace_string(const char *RESTRICT old, const char *RESTRICT newbit, const char *RESTRICT string) *************** *** 754,759 **** --- 891,904 ---- /* Replace two tokens in a string at once. All-around better than calling * replace_string() twice */ + /** Search for all copies of two old strings, and replace each with a + * corresponding newbit. + * The replaced string is returned, newly allocated. + * \param old array of two strings to find. + * \param newbits array of two strings to replace old with. + * \param string string to search for old. + * \return allocated string with replacements performed. + */ char * replace_string2(const char *old[2], const char *newbits[2], const char *RESTRICT string) *************** *** 800,805 **** --- 945,956 ---- } + /** Given a string and a separator, trim leading and trailing spaces + * if the separator is a space. This destructively modifies the string. + * \param str string to trim. + * \param sep separator character. + * \return pointer to (trimmed) string. + */ char * trim_space_sep(char *str, char sep) { *************** *** 819,824 **** --- 970,981 ---- return str; } + /** Find the start of the next token in a string. + * If the separator is a space, we magically skip multiple spaces. + * \param str the string. + * \param sep the token separator character. + * \return pointer to start of next token in string. + */ char * next_token(char *str, char sep) { *************** *** 836,849 **** return str; } char * split_token(char **sp, char sep) { - /* Get next token from string as a null-terminated string, depending - * on the separator character. This destructively modifies the string. - * Code from 2.0. - */ - char *str, *save; save = str = *sp; --- 993,1009 ---- return str; } + /** Split out the next token from a string, destructively modifying it. + * As usually, if the separator is a space, we skip multiple spaces. + * The string's address is update to be past the token, and the token + * is returned. This code from TinyMUSH 2.0. + * \param sp pointer to string to split from. + * \param sep token separator. + * \return pointer to token, now null-terminated. + */ char * split_token(char **sp, char sep) { char *str, *save; save = str = *sp; *************** *** 866,875 **** return save; } int do_wordcount(char *str, char sep) { - /* count the number of words in a string */ int n; if (!*str) --- 1026,1039 ---- return save; } + /** Count the number of tokens in a string. + * \param str string to count. + * \param sep token separator. + * \return number of tokens in str. + */ int do_wordcount(char *str, char sep) { int n; if (!*str) *************** *** 878,904 **** return n; } ! /* Pretty much straight from Tiny 2.2, we see if str and target ! * match in the first min chars */ int - minmatch(const char *str, const char *target, int min) - { - while (*str && *target && (DOWNCASE(*str) == DOWNCASE(*target))) { - str++; - target++; - min--; - } - if (*str) - return 0; - if (!*target) - return 1; - return ((min <= 0) ? 1 : 0); - } - - /* Strlen that ignores ansi and HTML sequences */ - - int ansi_strlen(const char *p) { int i = 0; --- 1042,1052 ---- return n; } ! /** A version of strlen that ignores ansi and HTML sequences. ! * \param p string to get length of. ! * \return length of string p, not including ansi/html sequences. */ int ansi_strlen(const char *p) { int i = 0; *************** *** 921,927 **** return i; } ! /* Returns true length of string up to numchars visible characters. */ int ansi_strnlen(const char *p, size_t numchars) --- 1069,1080 ---- return i; } ! /** Returns the apparent length of a string, up to numchars visible ! * characters. The apparent length skips over nonprinting ansi and ! * tags. ! * \param p string. ! * \param numchars maximum size to report. ! * \return apparent length of string. */ int ansi_strnlen(const char *p, size_t numchars) *************** *** 949,956 **** return i; } ! /* Given a string, a word, and a separator, remove first occurence * of the word from the string. Destructive. */ char * remove_word(char *list, char *word, char sep) --- 1102,1114 ---- return i; } ! /** Given a string, a word, and a separator, remove first occurence * of the word from the string. Destructive. + * \param list a string containing a separated list. + * \param word a word to remove from the list. + * \param sep the separator between list items. + * \return pointer to static buffer containing list without first occurence + * of word. */ char * remove_word(char *list, char *word, char sep) *************** *** 980,985 **** --- 1138,1149 ---- return buff; } + /** Return the next name in a list. A name may be a single word, or + * a quoted string. This is used by things like page/list. The list's + * pointer is advanced to the next name in the list. + * \param head pointer to pointer to string of names. + * \return pointer to static buffer containing next name. + */ char * next_in_list(const char **head) { *************** *** 1011,1017 **** } ! /* Strip all ansi and html markup from a string */ char * remove_markup(const char *orig, size_t * s_len) { --- 1175,1185 ---- } ! /** Strip all ansi and html markup from a string. ! * \param orig string to strip. ! * \param s_len address to store length of stripped string, if provided. ! * \return pointer to static buffer containing stripped string. ! */ char * remove_markup(const char *orig, size_t * s_len) { *************** *** 1045,1058 **** } ! /* Append an int to the string. Returns a true value on failure. * This will someday take extra arguments for use with our version * of snprintf. Please try not to use it. */ - /* maxlen = total length of string. - buf[maxlen - 1] = place where \0 will go. - buf[maxlen - 2] = last visible character. - */ static int format_long(long val, char *buff, char **bp, int maxlen) { --- 1213,1229 ---- } ! /** Safely append an int to a string. Returns a true value on failure. * This will someday take extra arguments for use with our version * of snprintf. Please try not to use it. + * maxlen = total length of string. + * buf[maxlen - 1] = place where \0 will go. + * buf[maxlen - 2] = last visible character. + * \param val value to append. + * \param buff string to append to. + * \param bp pointer to pointer to insertion point in buff. + * \param maxlen total length of string. */ static int format_long(long val, char *buff, char **bp, int maxlen) { *************** *** 1140,1145 **** --- 1311,1324 ---- } #if defined(HAS_STRXFRM) && !defined(WIN32) + /** A locale-sensitive strncmp. + * \param s1 first string to compare. + * \param s2 second string to compare. + * \param t number of characters to compare. + * \retval -1 s1 collates before s2. + * \retval 0 s1 collates the same as s2. + * \retval 1 s1 collates after s2. + */ int strncoll(const char *s1, const char *s2, size_t t) { *************** *** 1166,1171 **** --- 1345,1357 ---- return result; } + /** A locale-sensitive strcasecmp. + * \param s1 first string to compare. + * \param s2 second string to compare. + * \retval -1 s1 collates before s2. + * \retval 0 s1 collates the same as s2. + * \retval 1 s1 collates after s2. + */ int strcasecoll(const char *s1, const char *s2) { *************** *** 1186,1191 **** --- 1372,1385 ---- return result; } + /** A locale-sensitive strncasecmp. + * \param s1 first string to compare. + * \param s2 second string to compare. + * \param t number of characters to compare. + * \retval -1 s1 collates before s2. + * \retval 0 s1 collates the same as s2. + * \retval 1 s1 collates after s2. + */ int strncasecoll(const char *s1, const char *s2, size_t t) { *************** *** 1213,1218 **** --- 1407,1416 ---- } #endif /* HAS_STRXFRM && !WIN32 */ + /** Return a string pointer past any ansi/html markup at the start. + * \param p a string. + * \return pointer to string after any initial ansi/html markup. + */ char * skip_leading_ansi(const char *p) { *************** *** 1233,1238 **** --- 1431,1443 ---- } + /** Convert a string into an ansi_string. + * This takes a string that may contain ansi/html markup codes and + * converts it to an ansi_string structure that separately stores + * the plain string and the markup codes for each character. + * \param src string to parse. + * \return pointer to an ansi_string structure representing the src string. + */ ansi_string * parse_ansi_string(const char *src) { *************** *** 1266,1271 **** --- 1471,1477 ---- src++; p++; } + data->text[p] = '\0'; while (p <= data->len) { data->codes[p] = NULL; *************** *** 1279,1286 **** } void ! populate_codes(ansi_string * as) { size_t p; char *current = NULL; --- 1485,1496 ---- } + /** Fill up an ansi_string with codes so that when a code starts it + * applies to all the following characters until there's a new code. + * \param as pointer to an ansi_string to populate codes in. + */ void ! populate_codes(ansi_string *as) { size_t p; char *current = NULL; *************** *** 1298,1307 **** current = mush_strdup(ANSI_NORMAL, "markup_codes"); as->codes[p] = mush_strdup(current, "markup_codes"); } } void ! depopulate_codes(ansi_string * as) { size_t p, m; int normal = 1; --- 1508,1523 ---- current = mush_strdup(ANSI_NORMAL, "markup_codes"); as->codes[p] = mush_strdup(current, "markup_codes"); } + if (current) + mush_free(current, "markup_codes"); } + /** Strip out codes from an ansi_string, leaving in only the codes where + * they change. + * \param as pointer to an ansi_string. + */ void ! depopulate_codes(ansi_string *as) { size_t p, m; int normal = 1; *************** *** 1359,1366 **** return s && *s == TAG_START && *(s + 1) == '/'; } void ! free_ansi_string(ansi_string * as) { int p; --- 1575,1585 ---- return s && *s == TAG_START && *(s + 1) == '/'; } + /** Free an ansi_string. + * \param as pointer to ansi_string to free. + */ void ! free_ansi_string(ansi_string *as) { int p; *************** *** 1373,1380 **** mush_free(as, "ansi_string"); } int ! safe_ansi_string(ansi_string * as, size_t start, size_t len, char *buff, char **bp) { int p, q; --- 1592,1608 ---- mush_free(as, "ansi_string"); } + /** Safely append an ansi_string into a buffer as a real string. + * \param as pointer to ansi_string to append. + * \param start position in as to start copying from. + * \param len length in characters to copy from as. + * \param buff buffer to insert into. + * \param bp pointer to pointer to insertion point of buff. + * \retval 0 success. + * \retval 1 failure. + */ int ! safe_ansi_string(ansi_string *as, size_t start, size_t len, char *buff, char **bp) { int p, q; *************** *** 1459,1468 **** return 0; } ! /* Given the current item number in a list, whether it's the last item * in the list, the list's output separator, a conjunction, * and a punctuation mark to use between items, store the appropriate * inter-item stuff into the given buffer safely. */ void safe_itemizer(int cur_num, int done, const char *delim, const char *conjoin, --- 1687,1705 ---- return 0; } ! /** Safely append a list item to a buffer, possibly with punctuation ! * and conjunctions. ! * Given the current item number in a list, whether it's the last item * in the list, the list's output separator, a conjunction, * and a punctuation mark to use between items, store the appropriate * inter-item stuff into the given buffer safely. + * \param cur_num current item number of the item to append. + * \param done 1 if this is the final item. + * \param delim string to insert after most items (comma). + * \param conjoin string to insert before last time ("and"). + * \param space output delimiter. + * \param buff buffer to append to. + * \param bp pointer to pointer to insertion point in buff. */ void safe_itemizer(int cur_num, int done, const char *delim, const char *conjoin, *** 1_7_7.309/src/strdup.c Sun, 01 Dec 2002 21:14:41 -0600 dunemush (pennmush/b/34_strdup.c 1.3 660) --- 1_7_7.365(w)/src/strdup.c Wed, 09 Apr 2003 14:19:27 -0500 dunemush (pennmush/b/34_strdup.c 1.4 660) *************** *** 1,7 **** - /* strdup.c */ - - /* Strdup routine for systems without one. */ #include "config.h" #include --- 1,11 ---- + /** + * \file strdup.c + * + * \brief strdup routine for systems without one. + * + * + */ #include "config.h" #include *************** *** 15,23 **** #ifndef HAS_STRDUP char *strdup(const char *s); char * ! strdup(s) ! const char *s; { int len; char *dup = NULL; --- 19,30 ---- #ifndef HAS_STRDUP char *strdup(const char *s); + /** strdup for systems without one. + * \param s string to duplicate. + * \return newly-allocated copy of s + */ char * ! strdup(const char *s) { int len; char *dup = NULL; *** 1_7_7.309/src/speech.c Mon, 03 Mar 2003 21:59:06 -0600 dunemush (pennmush/b/35_speech.c 1.21.1.2.1.3.1.5.1.1.1.7.1.3.1.1.1.8.1.1.1.1.1.1.1.10.1.2.1.13.2.4.1.1.3.2 660) --- 1_7_7.365(w)/src/speech.c Wed, 09 Apr 2003 14:19:27 -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.5 660) *************** *** 1,13 **** /* speech.c */ #include "copyrite.h" #include "config.h" - - /* Commands which involve speaking */ #include #include #include - #include "conf.h" #include "ansi.h" #include "externs.h" --- 1,17 ---- + /** + * \file speech.c + * + * \brief Speech-related commands in PennMUSH. + * + * + */ /* speech.c */ #include "copyrite.h" #include "config.h" #include #include #include #include "conf.h" #include "ansi.h" #include "externs.h" *************** *** 32,38 **** void propagate_sound(dbref thing, const char *msg); static void do_audible_stuff(dbref loc, dbref *excs, int numexcs, const char *msg); ! void do_one_remit(dbref player, const char *target, const char *msg, int noisy); dbref na_zemit(dbref current, void *data); extern int i_comp(const void *s1, const void *s2); static const char *spname(dbref thing); --- 36,43 ---- void propagate_sound(dbref thing, const char *msg); static void do_audible_stuff(dbref loc, dbref *excs, int numexcs, const char *msg); ! static void do_one_remit(dbref player, const char *target, const char *msg, ! int noisy); dbref na_zemit(dbref current, void *data); extern int i_comp(const void *s1, const void *s2); static const char *spname(dbref thing); *************** *** 54,59 **** --- 59,73 ---- } } + /** Can player pemit to target? + * You can pemit if you're pemit_all, if you're pemitting to yourself, + * if you're pemitting to a non-player, or if you pass target's + * pagelock and target isn't HAVEN. + * \param player dbref attempting to pemit. + * \param target target dbref to pemit to. + * \retval 1 player may pemit to target. + * \retval 0 player may not pemit to target. + */ int okay_pemit(dbref player, dbref target) { *************** *** 85,90 **** --- 99,109 ---- } } + /** The teach command. + * \param player the enactor. + * \param cause the object causing the command to run. + * \param tbuf1 the command being taught. + */ void do_teach(dbref player, dbref cause, const char *tbuf1) { *************** *** 116,128 **** recurse = 1; /* Protect use from recursive teach */ notify_except(Contents(loc), NOTHING, tprintf(T("%s types --> %s%s%s"), spname(player), ! ANSI_HILITE, tbuf1, ANSI_NORMAL)); command = mush_strdup(tbuf1, "string"); /* process_command is destructive */ process_command(player, command, cause, 1); mush_free(command, "string"); recurse = 0; /* Ok, we can be called again safely */ } void do_say(dbref player, const char *tbuf1) { --- 135,151 ---- recurse = 1; /* Protect use from recursive teach */ notify_except(Contents(loc), NOTHING, tprintf(T("%s types --> %s%s%s"), spname(player), ! ANSI_HILITE, tbuf1, ANSI_NORMAL), NA_INTERACTION); command = mush_strdup(tbuf1, "string"); /* process_command is destructive */ process_command(player, command, cause, 1); mush_free(command, "string"); recurse = 0; /* Ok, we can be called again safely */ } + /** The say command. + * \param player the enactor. + * \param tbuf1 the message to say. + */ void do_say(dbref player, const char *tbuf1) { *************** *** 143,151 **** /* notify everybody */ notify_format(player, T("You say, \"%s\""), tbuf1); notify_except(Contents(loc), player, ! tprintf(T("%s says, \"%s\""), spname(player), tbuf1)); } void do_oemit(dbref player, const char *arg1, const char *arg2) { --- 166,183 ---- /* notify everybody */ notify_format(player, T("You say, \"%s\""), tbuf1); notify_except(Contents(loc), player, ! tprintf(T("%s says, \"%s\""), spname(player), tbuf1), ! NA_INTERACTION); } + /** The oemit command. + * \verbatim + * This implements @oemit. + * \endverbatim + * \param player the enactor. + * \param arg1 the player or room/player to omit from the emit. + * \param arg2 the message to emit. + */ void do_oemit(dbref player, const char *arg1, const char *arg2) { *************** *** 188,193 **** --- 220,233 ---- oemit_notify_except(loc, who, loc, arg2); } + /** The oemit/list command. + * \verbatim + * This implements @oemit/list. + * \endverbatim + * \param player the enactor. + * \param list the list of dbrefs to oemit from the emit. + * \param message the message to emit. + */ void do_oemit_list(dbref player, char *list, const char *message) { *************** *** 287,292 **** --- 327,338 ---- } } + /** The whisper command. + * \param player the enactor. + * \param arg1 name of the object to whisper to. + * \param arg2 message to whisper. + * \param noisy if 1, others overhear that a whisper has occurred. + */ void do_whisper(dbref player, const char *arg1, const char *arg2, int noisy) { *************** *** 409,423 **** mush_free((Malloc_t) tbuf, "string"); } void do_pemit_list(dbref player, char *list, const char *message, int nospoof) { - /* Send a message to a list of dbrefs. To avoid repeated generation - * of the NOSPOOF string, we set it up the first time we encounter - * something Nospoof, and then check for it thereafter. - * The list is destructively modified. - */ - char *bp, *p; char *nsbuf, *nspbuf; char *l; --- 455,472 ---- mush_free((Malloc_t) tbuf, "string"); } + /** Send a message to a list of dbrefs. To avoid repeated generation + * of the NOSPOOF string, we set it up the first time we encounter + * something Nospoof, and then check for it thereafter. + * The list is destructively modified. + * \param player the enactor. + * \param list the list of players to pemit to, destructively modified. + * \param message the message to pemit. + * \param nospoof if 0, this is an nspemit; if 1, honor nospoof. + */ void do_pemit_list(dbref player, char *list, const char *message, int nospoof) { char *bp, *p; char *nsbuf, *nspbuf; char *l; *************** *** 469,474 **** --- 518,530 ---- } + /** Send a message to an object. + * \param player the enactor. + * \param arg1 the name of the object to pemit to. + * \param arg2 the message to pemit. + * \param silent if 1, don't provide feedback to the pemitter. + * \param nospoof if 0, this is an nspemit; if 1, honor nospoof. + */ void do_pemit(dbref player, const char *arg1, const char *arg2, int silent, int nospoof) *************** *** 510,515 **** --- 566,576 ---- } } + /** The pose and semipose command. + * \param player the enactor. + * \param tbuf1 the message to pose. + * \param space if 1, put a space between name and pose; if 0, don't (semipose) + */ void do_pose(dbref player, const char *tbuf1, int space) { *************** *** 527,544 **** /* notify everybody */ if (!space) notify_except(Contents(loc), NOTHING, ! tprintf("%s %s", spname(player), tbuf1)); else notify_except(Contents(loc), NOTHING, ! tprintf("%s%s", spname(player), tbuf1)); } void do_wall(dbref player, const char *message, enum wall_type target, int emit) { - /* privs is 0 for wizard wizwall, 1 for royalty-wizard wizwall, - * 2 is for general wall - */ const char *gap = "", *prefix; const char *mask; int pose = 0; --- 588,608 ---- /* notify everybody */ if (!space) notify_except(Contents(loc), NOTHING, ! tprintf("%s %s", spname(player), tbuf1), NA_INTERACTION); else notify_except(Contents(loc), NOTHING, ! tprintf("%s%s", spname(player), tbuf1), NA_INTERACTION); } + /** The *wall commands. + * \param player the enactor. + * \param message message to broadcast. + * \param target type of broadcast (all, royalty, wizard) + * \param emit if 1, this is a wallemit. + */ void do_wall(dbref player, const char *message, enum wall_type target, int emit) { const char *gap = "", *prefix; const char *mask; int pose = 0; *************** *** 621,626 **** --- 685,699 ---- } } + /** The page command. + * \param player the enactor. + * \param arg1 the list of players to page. + * \param arg2 the message to page. + * \param cause the object that caused the command to run. + * \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) *************** *** 735,743 **** /* Reset tbuf2 to use later */ tp2 = tbuf2; ! /* We now have an array of good[] dbrefs, a gcount of the good ones, ! * and a tbuf with bad ones. ! */ /* We don't know what the heck's going on here, but we're not paging * anyone, this looks like a spam attack. */ --- 808,816 ---- /* Reset tbuf2 to use later */ tp2 = tbuf2; ! /* We now have an array of good[] dbrefs, a gcount of the good ones, ! * and a tbuf with bad ones. ! */ /* We don't know what the heck's going on here, but we're not paging * anyone, this looks like a spam attack. */ *************** *** 896,901 **** --- 969,981 ---- free((Malloc_t) hp); } + /** A notify_anything function for formatting speaker data for NOSPOOF. + * \param speaker the speaker. + * \param func unused. + * \param fdata unused. + * \param para if 1, format for paranoid nospoof; if 0, normal nospoof. + * \return formatted string. + */ char * ns_esnotify(dbref speaker, na_lookup func __attribute__ ((__unused__)), void *fdata __attribute__ ((__unused__)), int para) *************** *** 918,929 **** } int filter_found(dbref thing, const char *msg, int flag) - /* 0 for @filter, 1 for @infilter */ { - /* check to see if the message matches the filter pattern on thing */ - char *filter; ATTR *a; char *p, *bp; --- 998,1013 ---- } + /** Does a message match a filter pattern on an object? + * \param thing object with the filter. + * \param msg message to match. + * \param flag if 0, filter; if 1, infilter. + * \retval 1 message matches filter. + * \retval 0 message does not match filter. + */ int filter_found(dbref thing, const char *msg, int flag) { char *filter; ATTR *a; char *p, *bp; *************** *** 931,937 **** * by failing to free the storage * allocated by safe_uncompress */ - int i; int matched = 0; --- 1015,1020 ---- *************** *** 965,971 **** return matched; } ! /* Copies thing/PREFIX + msg into tbuf1 */ void make_prefixstr(dbref thing, const char *msg, char *tbuf1) { --- 1048,1058 ---- return matched; } ! /** Copy a message into a buffer, adding an object's PREFIX attribute. ! * \param thing object with prefix attribute. ! * \param msg message. ! * \param tbuf1 destination buffer. ! */ void make_prefixstr(dbref thing, const char *msg, char *tbuf1) { *************** *** 1006,1017 **** return; } void propagate_sound(dbref thing, const char *msg) { - /* pass a message on, for AUDIBLE, prepending a prefix, unless the - * message matches a filter pattern. - */ char tbuf1[BUFFER_LEN]; dbref loc = Location(thing); dbref pass[2]; --- 1093,1106 ---- return; } + /* pass a message on, for AUDIBLE, prepending a prefix, unless the + * message matches a filter pattern. + * \param thing object to check for filter and prefix. + * \param msg message to pass. + */ void propagate_sound(dbref thing, const char *msg) { char tbuf1[BUFFER_LEN]; dbref loc = Location(thing); dbref pass[2]; *************** *** 1064,1071 **** } } void ! notify_except(dbref first, dbref exception, const char *msg) { dbref loc; dbref pass[2]; --- 1153,1167 ---- } } + /** notify_anthing() wrapper to notify everyone in a location except one + * object. + * \param first object in location to notify. + * \param exception dbref of object not to notify, or NOTHING. + * \param msg message to send. + * \param flags flags to pass to notify_anything(). + */ void ! notify_except(dbref first, dbref exception, const char *msg, int flags) { dbref loc; dbref pass[2]; *************** *** 1081,1091 **** pass[0] = loc; pass[1] = exception; ! notify_anything(orator, na_except, pass, &ns_esnotify, 0, msg); do_audible_stuff(loc, &pass[1], 1, msg); } void notify_except2(dbref first, dbref exc1, dbref exc2, const char *msg) { --- 1177,1195 ---- pass[0] = loc; pass[1] = exception; ! ! notify_anything(orator, na_except, pass, &ns_esnotify, flags, msg); do_audible_stuff(loc, &pass[1], 1, msg); } + /** notify_anthing() wrapper to notify everyone in a location except two + * objects. + * \param first object in location to notify. + * \param exc1 dbref of one object not to notify, or NOTHING. + * \param exc2 dbref of another object not to notify, or NOTHING. + * \param msg message to send. + */ void notify_except2(dbref first, dbref exc1, dbref exc2, const char *msg) { *************** *** 1107,1113 **** pass[1] = exc1; pass[2] = exc2; ! notify_anything(orator, na_except2, pass, NULL, 0, msg); do_audible_stuff(loc, &pass[1], 2, msg); } --- 1211,1217 ---- pass[1] = exc1; pass[2] = exc2; ! notify_anything(orator, na_except2, pass, NULL, NA_INTERACTION, msg); do_audible_stuff(loc, &pass[1], 2, msg); } *************** *** 1134,1148 **** do_audible_stuff(loc, &pass[1], 2, msg); } void do_think(dbref player, const char *message) { - /* privately tell yourself a message */ - notify(player, message); } void do_emit(dbref player, const char *tbuf1) { --- 1238,1261 ---- do_audible_stuff(loc, &pass[1], 2, msg); } + /** The think command. + * \param player the enactor. + * \param message the message to think. + */ void do_think(dbref player, const char *message) { notify(player, message); } + /** The emit command. + * \verbatim + * This implements @emit. + * \endverbatim + * \param player the enactor. + * \param tbuf1 the message to emit. + */ void do_emit(dbref player, const char *tbuf1) { *************** *** 1163,1169 **** do_audible_stuff(loc, NULL, 0, tbuf1); } ! void do_one_remit(dbref player, const char *target, const char *msg, int noisy) { dbref room; --- 1276,1288 ---- do_audible_stuff(loc, NULL, 0, tbuf1); } ! /** Remit a message to a single room. ! * \param player the enactor. ! * \param target string containing dbref of room to remit in. ! * \param msg message to emit. ! * \param noisy if 1, give enactor feedback. ! */ ! static void do_one_remit(dbref player, const char *target, const char *msg, int noisy) { dbref room; *************** *** 1191,1196 **** --- 1310,1324 ---- } } + /** Remit a message + * \verbatim + * This implements @remit. + * \endverbatim + * \param player the enactor. + * \param arg1 string containing dbref(s) of rooms to remit it. + * \param arg2 message to emit. + * \param flags for remit. + */ void do_remit(dbref player, char *arg1, const char *arg2, int flags) { *************** *** 1205,1210 **** --- 1333,1343 ---- } } + /** Emit a message to the absolute location of enactor. + * \param player the enactor. + * \param tbuf1 message to emit. + * \param silent if 0, give feedback to enactor. + */ void do_lemit(dbref player, const char *tbuf1, int silent) { *************** *** 1240,1245 **** --- 1373,1383 ---- } } + /** notify_anything() function for zone emits. + * \param current unused. + * \param data array of notify data. + * \return last object in zone, or NOTHING. + */ dbref na_zemit(dbref current __attribute__ ((__unused__)), void *data) { *************** *** 1270,1275 **** --- 1408,1421 ---- return this; } + /** The zemit command. + * \verbatim + * This implements @zemit. + * \endverbatim + * \param player the enactor. + * \param arg1 string containing dbref of ZMO. + * \param arg2 message to emit. + */ void do_zemit(dbref player, const char *arg1, const char *arg2) { *** 1_7_7.309/src/sig.c Mon, 07 Oct 2002 17:51:39 -0500 dunemush (pennmush/b/37_sig.c 1.19 660) --- 1_7_7.365(w)/src/sig.c Wed, 09 Apr 2003 14:19:27 -0500 dunemush (pennmush/b/37_sig.c 1.20 660) *************** *** 1,22 **** ! /* Signal handling routines for Penn. */ #include "config.h" #include "externs.h" #include - #include "confmagic.h" #ifndef HAS_SIGPROCMASK static Sigfunc saved_handlers[NSIG]; #endif ! /* We're going to rewrite the signal() function in terms of * sigaction, where available, to ensure consistent semantics. * We want signal handlers to remain installed, and we want * signals (except SIGALRM) to restart system calls which they * interrupt. This is how bsd signals work, and what we'd like. * This function is essentially example 10.12 from Stevens' ! * _Advanced Programming in the Unix Environment_ */ Sigfunc install_sig_handler(int signo, Sigfunc func) --- 1,31 ---- ! /** ! * \file sig.c ! * ! * \brief Signal handling routines for PennMUSH. ! * ! * ! */ #include "config.h" #include "externs.h" #include #include "confmagic.h" #ifndef HAS_SIGPROCMASK static Sigfunc saved_handlers[NSIG]; #endif ! /** Our own version of signal(). ! * We're going to rewrite the signal() function in terms of * sigaction, where available, to ensure consistent semantics. * We want signal handlers to remain installed, and we want * signals (except SIGALRM) to restart system calls which they * interrupt. This is how bsd signals work, and what we'd like. * This function is essentially example 10.12 from Stevens' ! * _Advanced Programming in the Unix Environment_. ! * \param signo signal number. ! * \param func signal handler function to install. ! * \return former signal handler for signo. */ Sigfunc install_sig_handler(int signo, Sigfunc func) *************** *** 37,42 **** --- 46,55 ---- #endif } + /** Reinstall a signal handler. + * \param signo the signal number. + * \param func signal handler function to reload. + */ void reload_sig_handler(int signo __attribute__ ((__unused__)), Sigfunc func __attribute__ ((__unused__))) *************** *** 46,51 **** --- 59,67 ---- #endif } + /** Set a signal to be ignored. + * \param signo signal number to ignore. + */ void ignore_signal(int signo) { *************** *** 60,66 **** #endif } ! /* These don't really work right without sigprocmask(), but we try */ void block_a_signal(int signo) { --- 76,85 ---- #endif } ! /** Set a signal to block. ! * These don't really work right without sigprocmask(), but we try. ! * \param signo signal number to block. ! */ void block_a_signal(int signo) { *************** *** 75,80 **** --- 94,103 ---- #endif } + /** Unblock a signal. + * These don't really work right without sigprocmask(), but we try. + * \param signo signal number to unblock. + */ void unblock_a_signal(int signo) { *************** *** 91,96 **** --- 114,121 ---- #endif } + /** Block all signals. + */ void block_signals(void) { *** 1_7_7.309/src/set.c Tue, 11 Mar 2003 17:02:55 -0600 dunemush (pennmush/b/38_set.c 1.26.1.5.1.1.2.1.1.1.1.1.1.11.1.1.1.5 660) --- 1_7_7.365(w)/src/set.c Wed, 09 Apr 2003 14:19:27 -0500 dunemush (pennmush/b/38_set.c 1.26.1.5.1.1.2.1.1.1.1.1.1.11.1.1.1.9 660) *************** *** 1,9 **** ! /* set.c */ #include "copyrite.h" #include "config.h" - - /* commands which set parameters */ #include #include #include --- 1,13 ---- ! /** ! * \file set.c ! * ! * \brief PennMUSH commands that set parameters. ! * ! * ! */ #include "copyrite.h" #include "config.h" #include #include #include *************** *** 54,64 **** static void copy_attrib_flags(dbref player, dbref target, ATTR *atr, int flags); void ! do_name(player, name, newname) ! dbref player; ! const char *name; ! char *newname; { dbref thing; char *password; --- 58,73 ---- static void copy_attrib_flags(dbref player, dbref target, ATTR *atr, int flags); + /** Rename something. + * \verbatim + * This implements @name. + * \endverbatim + * \param player the enactor. + * \param name current name of object to rename. + * \param newname new name for object. + */ void ! do_name(dbref player, const char *name, char *newname) { dbref thing; char *password; *************** *** 141,152 **** } } void ! do_chown(player, name, newobj, preserve) ! dbref player; ! const char *name; ! const char *newobj; ! int preserve; { dbref thing; dbref newowner = NOTHING; --- 150,166 ---- } } + /** Change an object's owner. + * \verbatim + * This implements @chown. + * \endverbatim + * \param player the enactor. + * \param name name of object to change owner of. + * \param newobj name of new owner for object. + * \param preserve if 1, preserve privileges and don't halt the object. + */ void ! do_chown(dbref player, const char *name, const char *newobj, int preserve) { dbref thing; dbref newowner = NOTHING; *************** *** 216,227 **** } static int ! chown_ok(player, thing, newowner) ! dbref player; ! dbref thing; ! dbref newowner; { - /* Cant' touch garbage */ if (IsGarbage(thing)) return 0; --- 230,237 ---- } static int ! chown_ok(dbref player, dbref thing, dbref newowner) { /* Cant' touch garbage */ if (IsGarbage(thing)) return 0; *************** *** 269,281 **** } ! /* Actually change the ownership of something, and fix bits */ void ! chown_object(player, thing, newowner, preserve) ! dbref player; ! dbref thing; ! dbref newowner; ! int preserve; { undestroy(player, thing); if (God(player)) { --- 279,292 ---- } ! /* Actually change the ownership of something, and fix bits. ! * \param player the enactor. ! * \param thing object to change ownership of. ! * \param newowner new owner for thing. ! * \param preserve if 1, preserve privileges and don't halt. ! */ void ! chown_object(dbref player, dbref thing, dbref newowner, int preserve) { undestroy(player, thing); if (God(player)) { *************** *** 307,312 **** --- 318,334 ---- } + /** Change an object's zone. + * \verbatim + * This implements @chzone. + * \endverbatim + * \param player the enactor. + * \param name name of the object to change zone of. + * \param newobj name of new ZMO. + * \param noisy if 1, notify player about success and failure. + * \retval 0 failed to change zone. + * \retval 1 successfully changed zone. + */ int do_chzone(dbref player, char const *name, char const *newobj, int noisy) { *************** *** 371,377 **** } } - /* Don't allow chzone to objects without elocks! * If no lock is set, set a default lock (warn if zmo are used for control) * This checks for many trivial elocks (canuse/1, where &canuse=1) --- 393,398 ---- *************** *** 430,447 **** return 1; } struct af_args { ! int f; ! char const *flag; }; static int ! af_helper(player, thing, pattern, atr, args) ! dbref player; ! dbref thing; ! char const *pattern __attribute__ ((__unused__)); ! ATTR *atr; ! void *args; { struct af_args *af = args; --- 451,466 ---- return 1; } + /** Structure for af_helper() data. */ struct af_args { ! int f; /**< flag bits */ ! char const *flag; /**< flag name */ }; static int ! af_helper(dbref player, dbref thing, ! char const *pattern ! __attribute__ ((__unused__)), ATTR *atr, void *args) { struct af_args *af = args; *************** *** 467,477 **** } static void ! copy_attrib_flags(player, target, atr, flags) ! dbref player; ! dbref target; ! ATTR *atr; ! int flags; { if (!atr) return; --- 486,492 ---- } static void ! copy_attrib_flags(dbref player, dbref target, ATTR *atr, int flags) { if (!atr) return; *************** *** 484,495 **** AL_FLAGS(atr) = flags; } void ! do_attrib_flags(player, obj, atrname, flag) ! dbref player; ! const char *obj; ! const char *atrname; ! const char *flag; { struct af_args af; dbref thing; --- 499,513 ---- AL_FLAGS(atr) = flags; } + /** Set a flag on an attribute. + * \param player the enactor. + * \param obj the name of the object with the attribute. + * \param atrname the name of the attribute. + * \param flag the name of the flag to set or clear. + */ void ! do_attrib_flags(dbref player, const char *obj, const char *atrname, ! const char *flag) { struct af_args af; dbref thing; *************** *** 516,526 **** } int ! do_set(player, name, flag) ! dbref player; ! const char *name; ! char *flag; { dbref thing; int her, listener; --- 534,551 ---- } + /** Set a flag, attribute flag, or attribute. + * \verbatim + * This implements @set. + * \endverbatim + * \param player the enactor. + * \param name the first (left) argument to the command. + * \param flag the second (right) argument to the command. + * \retval 1 successful set. + * \retval 0 failure to set. + */ int ! do_set(dbref player, const char *name, char *flag) { dbref thing; int her, listener; *************** *** 565,583 **** return 1; } void ! do_cpattr(player, oldpair, newpair, move, noflagcopy) ! dbref player; ! char *oldpair; ! char **newpair; ! int move; ! int noflagcopy; ! { ! /* the command is of the format: ! * @cpattr oldobj/oldattr = newobj1/newattr1, newobj2/newattr2, etc. ! * If move = 1, it's @mvattr, erase original attrib. ! */ ! dbref oldobj, newobj; char tbuf1[BUFFER_LEN], tbuf2[BUFFER_LEN]; int i; --- 590,610 ---- return 1; } + /** Copy or move an attribute. + * \verbatim + * This implements @cpattr and @mvattr. + * the command is of the format: + * @cpattr oldobj/oldattr = newobj1/newattr1, newobj2/newattr2, etc. + * \endverbatim + * \param player the enactor. + * \param oldpair the obj/attribute pair to copy from. + * \param newpair array of obj/attribute pairs to copy to. + * \param move if 1, move rather than copy. + * \param noflagcopy if 1, don't copy associated flags. + */ void ! do_cpattr(dbref player, char *oldpair, char **newpair, int move, int noflagcopy) ! { dbref oldobj, newobj; char tbuf1[BUFFER_LEN], tbuf2[BUFFER_LEN]; int i; *************** *** 658,669 **** } static int ! gedit_helper(player, thing, pattern, a, args) ! dbref player; ! dbref thing; ! char const *pattern __attribute__ ((__unused__)); ! ATTR *a; ! void *args; { int ansi_long_flag = 0; const char *r; --- 685,693 ---- } static int ! gedit_helper(dbref player, dbref thing, ! char const *pattern ! __attribute__ ((__unused__)), ATTR *a, void *args) { int ansi_long_flag = 0; const char *r; *************** *** 764,774 **** return 1; } void ! do_gedit(player, it, argv) ! dbref player; ! char *it; ! char **argv; { dbref thing; char tbuf1[BUFFER_LEN]; --- 788,803 ---- return 1; } + /** Edit an attribute. + * \verbatim + * This implements @edit obj/attribute = {search}, {replace} + * \endverbatim + * \param player the enactor. + * \param it the object/attribute pair. + * \param argv array containing the search and replace strings. + */ void ! do_gedit(dbref player, char *it, char **argv) { dbref thing; char tbuf1[BUFFER_LEN]; *************** *** 800,811 **** notify(player, T("No matching attributes.")); } ! void ! do_trigger(player, object, argv) ! dbref player; ! char *object; ! char **argv; { dbref thing; int a; --- 829,844 ---- notify(player, T("No matching attributes.")); } ! /** Trigger an attribute. ! * \verbatim ! * This implements @trigger obj/attribute = list-of-arguments. ! * \endverbatim ! * \param player the enactor. ! * \param object the object/attribute pair. ! * \param argv array of arguments. ! */ void ! do_trigger(dbref player, char *object, char **argv) { dbref thing; int a; *************** *** 846,857 **** } ! /* for lack of a better place, the use code is here */ ! void ! do_use(player, what) ! dbref player; ! const char *what; { dbref thing; --- 879,891 ---- } ! /** The use command. ! * It's here for lack of a better place. ! * \param player the enactor. ! * \param what name of the object to use. ! */ void ! do_use(dbref player, const char *what) { dbref thing; *************** *** 869,879 **** } } void ! do_parent(player, name, parent_name) ! dbref player; ! char *name; ! char *parent_name; { dbref thing; dbref parent; --- 903,918 ---- } } + /** Parent an object to another. + * \verbatim + * This implements @parent. + * \endverbatim + * \param player the enactor. + * \param name the name of the child object. + * \param parent_name the name of the new parent object. + */ void ! do_parent(dbref player, char *name, char *parent_name) { dbref thing; dbref parent; *************** *** 931,942 **** } static int ! wipe_helper(player, thing, pattern, atr, args) ! dbref player; ! dbref thing; ! char const *pattern; ! ATTR *atr; ! void *args __attribute__ ((__unused__)); { /* for added security, only God can modify wiz-only-modifiable * attributes using this command and wildcards. Wiping a specific --- 970,977 ---- } static int ! wipe_helper(dbref player, dbref thing, char const *pattern, ! ATTR *atr, void *args __attribute__ ((__unused__))) { /* for added security, only God can modify wiz-only-modifiable * attributes using this command and wildcards. Wiping a specific *************** *** 947,959 **** return do_set_atr(thing, AL_NAME(atr), NULL, player, 0) == 1; } void ! do_wipe(player, name) ! dbref player; ! char *name; { - /* obliterate attributes from an object */ - dbref thing; char *pattern; --- 982,997 ---- return do_set_atr(thing, AL_NAME(atr), NULL, player, 0) == 1; } + /** Clear an attribute. + * \verbatim + * This implements @wipe. + * \endverbatim + * \param player the enactor. + * \param name the object/attribute-pattern to wipe. + */ void ! do_wipe(dbref player, char *name) { dbref thing; char *pattern; *** 1_7_7.309/src/rob.c Wed, 01 Jan 2003 18:08:01 -0600 dunemush (pennmush/b/42_rob.c 1.18.1.2.1.3.1.3.1.8 660) --- 1_7_7.365(w)/src/rob.c Wed, 09 Apr 2003 14:19:27 -0500 dunemush (pennmush/b/42_rob.c 1.18.1.2.1.3.1.3.1.9 660) *************** *** 1,12 **** ! /* rob.c, for historical reasons */ #include "config.h" #include "copyrite.h" #include #include - - /* give and kill */ - #include "conf.h" #include "mushdb.h" #include "attrib.h" --- 1,18 ---- ! /** ! * \file rob.c ! * ! * \brief Kill and give. ! * ! * This file is called rob.c for historical reasons, and one day it'll ! * probably get folded into some other file. ! * ! * ! */ #include "config.h" #include "copyrite.h" #include #include #include "conf.h" #include "mushdb.h" #include "attrib.h" *************** *** 19,24 **** --- 25,36 ---- #include "game.h" #include "confmagic.h" + /** The kill command - send an object back home. + * \param player the enactor. + * \param what name of object to kill. + * \param cost amount to pay to kill. + * \param slay if 1, this is the wizard 'slay' command instead. + */ void do_kill(dbref player, const char *what, int cost, int slay) { *************** *** 116,121 **** --- 128,139 ---- } } + /** The give command. + * \param player the enactor/giver. + * \param recipient name of object to receive. + * \param amnt name of object to be transferred, or amount of pennies. + * \param silent if 1, hush the usual messages. + */ void do_give(dbref player, char *recipient, char *amnt, int silent) { *** 1_7_7.309/src/predicat.c Tue, 04 Feb 2003 22:13:06 -0600 dunemush (pennmush/b/44_predicat.c 1.1.1.34.1.1.1.3.1.4.2.13 660) --- 1_7_7.365(w)/src/predicat.c Wed, 09 Apr 2003 14:19:26 -0500 dunemush (pennmush/b/44_predicat.c 1.1.1.34.1.1.1.3.1.4.2.18 660) *************** *** 1,10 **** ! /* predicat.c */ #include "copyrite.h" #include "config.h" - /* Predicates for testing various conditions */ - #include #include #include --- 1,14 ---- ! /** ! * \file predicat.c ! * ! * \brief Predicates for testing various conditions in PennMUSH. ! * ! * ! */ #include "copyrite.h" #include "config.h" #include #include #include *************** *** 34,40 **** #include "confmagic.h" int forbidden_name(const char *name); - void sstrcat(char *string, char *app); void do_switch(dbref player, char *expression, char **argv, dbref cause, int first, int notifyme); void do_verb(dbref player, dbref cause, char *arg1, char **argv); --- 38,43 ---- *************** *** 48,57 **** #endif /* QUOTA */ extern PRIV attr_privs[]; char *WIN32_CDECL tprintf(const char *fmt, ...) { - /* this is a generic function used to generate a format string */ #ifdef HAS_VSNPRINTF static char buff[BUFFER_LEN]; #else --- 51,65 ---- #endif /* QUOTA */ extern PRIV attr_privs[]; + /** A generic function to generate a formatted string. The + * return value is a statically allocated buffer. + * + * \param fmt format string. + * \return formatted string. + */ char *WIN32_CDECL tprintf(const char *fmt, ...) { #ifdef HAS_VSNPRINTF static char buff[BUFFER_LEN]; #else *************** *** 72,78 **** return (buff); } ! /* Safer replacement for notify(player, tprintf(fmt, ...)) */ void WIN32_CDECL notify_format(dbref player, const char *fmt, ...) { --- 80,90 ---- return (buff); } ! /** Notify a player with a formatted string. ! * This is a safer replacement for notify(player, tprintf(fmt, ...)) ! * \param player player to notify. ! * \param fmt format string. ! */ void WIN32_CDECL notify_format(dbref player, const char *fmt, ...) { *************** *** 97,122 **** } int ! could_doit(player, thing) ! dbref player; ! dbref thing; { - /* lock evaluation -- determines if player passes lock on thing, for - * the purposes of picking up an object or moving through an exit - */ - if (!IsRoom(thing) && Location(thing) == NOTHING) return 0; return (eval_lock(player, thing, Basic_Lock)); } ! /* 1.7.4p2: Return value changed from void to int */ int ! charge_action(player, thing, awhat) ! dbref player; ! dbref thing; ! const char *awhat; { ATTR *b; char tbuf2[BUFFER_LEN]; --- 109,138 ---- } + /** lock evaluation -- determines if player passes lock on thing, for + * the purposes of picking up an object or moving through an exit. + * \param player to check against lock. + * \param thing thing to check the basic lock on. + * \retval 1 player passes lock. + * \retval 0 player fails lock. + */ int ! could_doit(dbref player, dbref thing) { if (!IsRoom(thing) && Location(thing) == NOTHING) return 0; return (eval_lock(player, thing, Basic_Lock)); } ! /** Execute an action on an object, and handle objects with limited charges. ! * \param player the enactor. ! * \param thing object being used. ! * \param awhat action attribute on object to be triggered. ! * \retval 0 no action taken. ! * \retval 1 action taken. ! */ int ! charge_action(dbref player, dbref thing, const char *awhat) { ATTR *b; char tbuf2[BUFFER_LEN]; *************** *** 149,186 **** } void ! did_it(player, thing, what, def, owhat, odef, awhat, loc) ! dbref player; ! dbref thing; ! const char *what; ! const char *def; ! const char *owhat; ! const char *odef; ! const char *awhat; ! dbref loc; { /* Bunch o' nulls */ static char *myenv[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; real_did_it(player, thing, what, def, owhat, odef, awhat, loc, myenv); } void ! real_did_it(player, thing, what, def, owhat, odef, awhat, loc, myenv) ! dbref player; ! dbref thing; ! const char *what; ! const char *def; ! const char *owhat; ! const char *odef; ! const char *awhat; ! dbref loc; ! char *myenv[10]; ! { ! /* executes the @attr, @oattr, @aattr for a command - gives a message ! * to the enactor and others in the room with the enactor, and executes ! * an action. We load wenv with the values in myenv. ! */ ATTR *d; char buff[BUFFER_LEN], *bp, *sp, *asave; --- 165,212 ---- } + /** A wrapper for real_did_it that clears the environment first. + * \param player the enactor. + * \param thing object being triggered. + * \param what message attribute for enactor. + * \param def default message to enactor. + * \param owhat message attribute for others. + * \param odef default message to others. + * \param awhat action attribute to trigger. + * \param loc location in which action is taking place. + */ void ! did_it(dbref player, dbref thing, const char *what, const char *def, ! const char *owhat, const char *odef, const char *awhat, dbref loc) { /* Bunch o' nulls */ static char *myenv[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; real_did_it(player, thing, what, def, owhat, odef, awhat, loc, myenv); } + + /** Take an action on an object and trigger attributes. + * \verbatim + * executes the @attr, @oattr, @aattr for a command - gives a message + * to the enactor and others in the room with the enactor, and executes + * an action. We load wenv with the values in myenv. + * \endverbatim + * + * \param player the enactor. + * \param thing object being triggered. + * \param what message attribute for enactor. + * \param def default message to enactor. + * \param owhat message attribute for others. + * \param odef default message to others. + * \param awhat action attribute to trigger. + * \param loc location in which action is taking place. + * \param myenv copy of the environment. + */ void ! real_did_it(dbref player, dbref thing, const char *what, const char *def, ! const char *owhat, const char *odef, const char *awhat, dbref loc, ! char *myenv[10]) ! { ATTR *d; char buff[BUFFER_LEN], *bp, *sp, *asave; *************** *** 259,265 **** charge_action(player, thing, awhat); } ! /* BEWARE: * * first_visible() does not behave as intended. It _should_ return the first * object in `thing' that is !DARK. However, because of the controls() check --- 285,293 ---- charge_action(player, thing, awhat); } ! /** Return the first object near another object that is visible to a player. ! * ! * BEWARE: * * first_visible() does not behave as intended. It _should_ return the first * object in `thing' that is !DARK. However, because of the controls() check *************** *** 268,279 **** * The behavior is left as is because so many functions in fundb.c rely on * the incorrect behavior to return expected values. The lv*() functions * also make rewriting this fairly pointless. */ - dbref ! first_visible(player, thing) ! dbref player; ! dbref thing; { int lck = 0; int ldark; --- 296,308 ---- * The behavior is left as is because so many functions in fundb.c rely on * the incorrect behavior to return expected values. The lv*() functions * also make rewriting this fairly pointless. + * + * \param player the looker. + * \param thing an object in the location to be inspected. + * \return dbref of first visible object or NOTHING. */ dbref ! first_visible(dbref player, dbref thing) { int lck = 0; int ldark; *************** *** 305,317 **** ! int ! can_see(player, thing, can_see_loc) ! dbref player; ! dbref thing; ! int can_see_loc; { /* * 1) your own body isn't listed in a 'look' 2) exits aren't listed in a * 'look' 3) unconnected (sleeping) players aren't listed in a 'look' --- 334,352 ---- ! /** Can a player see something? ! * \param player the looker. ! * \param thing object to be seen. ! * \param can_see_loc 1 if player can see the location, 0 if location is dark. ! * \retval 1 player can see thing. ! * \retval 0 player can not see thing. ! */ int ! can_see(dbref player, dbref thing, int can_see_loc) { + if (!can_interact(thing, player, INTERACT_SEE)) + return 0; + /* * 1) your own body isn't listed in a 'look' 2) exits aren't listed in a * 'look' 3) unconnected (sleeping) players aren't listed in a 'look' *************** *** 329,347 **** return (Light(thing) && !DarkLegal(thing)); } int controls(dbref who, dbref what) { - /* Wizard controls everything - * Untrusted objects control only themselves. - * owners control their stuff - * something which is in the enterlock of a ZMO controls non-INHERIT - * and non-player objects. - * INHERIT checks between two objects are checked in the code for the - * specific function in question (do_trigger, do_set, etc.) - * Those who pass the enterlock of a ZoneMaster control his objects, - * but not the ZoneMaster himself. - */ struct boolexp *c; if (!GoodObject(what)) --- 364,389 ---- return (Light(thing) && !DarkLegal(thing)); } + /** Can a player control a thing? + * The control rules are, in order: + * Only God controls God. + * Wizards control everything else. + * Nothing else controls a wizard, and only royalty control royalty. + * Mistrusted objects control only themselves. + * Objects with the same owner control each other, unless the + * target object is TRUST and the would-be controller isn't. + * If ZMOs allow control, and you pass the ZMO, you control. + * If the owner is a Zone Master, and you pass the ZM, you control. + * If you pass the control lock, you control. + * Otherwise, no dice. + * \param who object attempting to control. + * \param what object to be controlled. + * \retval 1 who controls what. + * \retval 0 who doesn't control what. + */ int controls(dbref who, dbref what) { struct boolexp *c; if (!GoodObject(what)) *************** *** 381,396 **** return 0; } int ! can_pay_fees(who, pennies) ! dbref who; ! int pennies; ! { ! /* does who have enough pennies to pay for something, and if something ! * is being built, does who have enough quota? Wizards, roys ! * aren't subject to either. ! */ ! /* check database size -- EVERYONE is subject to this! */ if (DBTOP_MAX && (db_top >= DBTOP_MAX + 1) && (first_free == NOTHING)) { notify(who, T("Sorry, there is no more room in the database.")); --- 423,441 ---- return 0; } + /** Can someone pay for something (in cash and quota)? + * Does who have enough pennies to pay for something, and if something + * is being built, does who have enough quota? Wizards, roys + * aren't subject to either. This function not only checks that they + * can afford it, but actually charges them. + * \param who player attempting to pay. + * \param pennies cost in pennies. + * \retval 1 who can pay. + * \retval 0 who can't pay. + */ int ! can_pay_fees(dbref who, int pennies) ! { /* check database size -- EVERYONE is subject to this! */ if (DBTOP_MAX && (db_top >= DBTOP_MAX + 1) && (first_free == NOTHING)) { notify(who, T("Sorry, there is no more room in the database.")); *************** *** 415,427 **** return 1; } void ! giveto(who, pennies) ! dbref who; ! dbref pennies; { - /* give who pennies */ - /* wizards and royalty don't need pennies */ if (NoPay(who)) return; --- 460,472 ---- return 1; } + /** Transfer pennies to a player. + * \param who recipient. + * \param pennies amount of pennies to give. + */ void ! giveto(dbref who, int pennies) { /* wizards and royalty don't need pennies */ if (NoPay(who)) return; *************** *** 433,442 **** s_Pennies(who, Pennies(who) + pennies); } int ! payfor(who, cost) ! dbref who; ! int cost; { /* subtract cost from who's pennies */ --- 478,491 ---- s_Pennies(who, Pennies(who) + pennies); } + /** Debit a player's pennies, if they can afford it. + * \param who player to debit. + * \param cost number of pennies to debit. + * \retval 1 player successfully debited. + * \retval 0 player can't afford the cost. + */ int ! payfor(dbref who, int cost) { /* subtract cost from who's pennies */ *************** *** 452,466 **** #ifdef QUOTA int ! get_current_quota(who) ! dbref who; { - /* figure out a player's quota. Add the RQUOTA attribute if he doesn't - * have one already. This function returns the REMAINING quota, not - * the TOTAL limit. - */ - ATTR *a; int i; int limit; --- 501,516 ---- #ifdef QUOTA + /** Retrieve the amount of quote remaining to a player. + * Figure out a player's quota. Add the RQUOTA attribute if he doesn't + * have one already. This function returns the REMAINING quota, not + * the TOTAL limit. + * \param who player to check. + * \return player's remaining quota. + */ int ! get_current_quota(dbref who) { ATTR *a; int i; int limit; *************** *** 493,505 **** } void ! change_quota(who, payment) ! dbref who; ! int payment; { - /* add or subtract from quota */ - /* wizards and royalty don't need a quota */ if (NoQuota(who)) return; --- 543,555 ---- } + /** Add or subtract from a player's quota. + * \param who object whose owner has the quota changed. + * \param payment amount to add to quota (may be negative). + */ void ! change_quota(dbref who, int payment) { /* wizards and royalty don't need a quota */ if (NoQuota(who)) return; *************** *** 508,522 **** tprintf("%d", get_current_quota(who) + payment), GOD, NOTHING); } static int ! pay_quota(who, cost) ! dbref who; ! int cost; { - /* determine if we've got enough quota to pay for an object, - * and, if so, return true, and subtract from the quota. - */ - int curr; /* wizards and royalty don't need a quota */ --- 558,572 ---- tprintf("%d", get_current_quota(who) + payment), GOD, NOTHING); } + /** Debit a player's quota, if they can afford it. + * \param who player whose quota is to be debitted. + * \param cost amount of quota to be charged. + * \retval 1 quota successfully debitted. + * \retval 0 not enough quota to debit. + */ static int ! pay_quota(dbref who, int cost) { int curr; /* wizards and royalty don't need a quota */ *************** *** 535,545 **** } #endif /* QUOTA */ int forbidden_name(const char *name) { - /* checks to see if name is in the forbidden names file */ - char buf[BUFFER_LEN], *newlin, *ptr; FILE *fp; char *upname; --- 585,598 ---- } #endif /* QUOTA */ + /** Is a name in the forbidden names file? + * \param name name to check. + * \retval 1 name is forbidden. + * \retval 0 name is not forbidden. + */ int forbidden_name(const char *name) { char buf[BUFFER_LEN], *newlin, *ptr; FILE *fp; char *upname; *************** *** 567,577 **** return 0; } int ok_name(const char *n) { - /* is name valid for an object? */ - const unsigned char *p, *name = (const unsigned char *) n; if (!name || !*name) --- 620,638 ---- return 0; } + /** Is a name valid for an object? + * This involves several checks. + * Names may not have leading or trailing spaces. + * Names must be only printable characters. + * Names may not exceed the length limit. + * Names may not start with certain tokens, or be "me", "home", "here" + * \param n name to check. + * \retval 1 name is valid. + * \retval 0 name is not valid. + */ int ok_name(const char *n) { const unsigned char *p, *name = (const unsigned char *) n; if (!name || !*name) *************** *** 610,620 **** && strcasecmp((char *) name, "here")); } int ok_player_name(const char *name) { - /* is name okay for a player? */ - const unsigned char *scan, *good; if (!ok_name(name) || forbidden_name(name) || --- 671,688 ---- && strcasecmp((char *) name, "here")); } + /** Is a name a valid player name? + * Player names must be valid object names, but also not forbidden, + * subject to a different length limit, and subject to more stringent + * restrictions on valid characters. Finally, it can't be the same as + * an existing player name or alias. + * \param name name to check. + * \retval 1 name is valid for players. + * \retval 0 name is not valid for players. + */ int ok_player_name(const char *name) { const unsigned char *scan, *good; if (!ok_name(name) || forbidden_name(name) || *************** *** 634,645 **** return (lookup_player(name) == NOTHING); } int ! ok_password(password) ! const char *password; { - /* is password an acceptable password? */ - const char *scan; if (*password == '\0') return 0; --- 702,717 ---- return (lookup_player(name) == NOTHING); } + /** Is a password acceptable? + * Acceptable passwords must be non-null and must contain only + * printable characters and no whitespace. + * \param password password to check. + * \retval 1 password is acceptable. + * \retval 0 password is not acceptable. + */ int ! ok_password(const char *password) { const char *scan; if (*password == '\0') return 0; *************** *** 653,665 **** return 1; } int ok_command_name(const char *name) { - /* is name ok for a command or function? - * It must begin with an uppercase alpha, and contain only - * uppercase alpha, numbers, or underscore thereafter. - */ const unsigned char *p; if (!isupper((unsigned char) *name)) return 0; --- 725,740 ---- return 1; } + /** Is a name ok for a command or function? + * It must begin with an uppercase alpha, and contain only + * uppercase alpha, numbers, or underscore thereafter. + * \param name name to check. + * \retval 1 name is acceptable. + * \retval 0 name is not acceptable. + */ int ok_command_name(const char *name) { const unsigned char *p; if (!isupper((unsigned char) *name)) return 0; *************** *** 675,706 **** return 1; } void ! sstrcat(string, app) ! char *string; ! char *app; ! { ! char *s; ! char tbuf1[BUFFER_LEN]; ! ! if ((strlen(app) + strlen(string)) >= BUFFER_LEN) ! return; ! sprintf(tbuf1, "%s", app); ! for (s = tbuf1; *s; s++) ! if ((*s == ',') || (*s == ';')) ! *s = ' '; ! strcat(string, tbuf1); ! } ! ! /* for lack of better place the @switch code is here */ ! void ! do_switch(player, expression, argv, cause, first, notifyme) ! dbref player; ! char *expression; ! char **argv; ! dbref cause; ! int first; /* 0, match all, 1, match first */ ! int notifyme; { int any = 0, a; char buff[BUFFER_LEN], *bp; --- 750,770 ---- return 1; } + /* The switch command. + * \verbatim + * For lack of better place the @switch code is here. + * @switch expression=args + * \endverbatim + * \param player the enactor. + * \param expression the expression to test against cases. + * \param argv array of cases and actions. + * \param cause the object that caused this code to run. + * \param first if 1, run only first matching case; if 0, run all matching cases. + * \param notifyme if 1, perform a notify after executing matched cases. + */ void ! do_switch(dbref player, char *expression, char **argv, dbref cause, ! int first, int notifyme) { int any = 0, a; char buff[BUFFER_LEN], *bp; *************** *** 748,757 **** parse_que(player, "@notify me", cause); } dbref ! parse_match_possessive(player, str) ! dbref player; ! const char *str; { char *box; /* name of container */ char *obj; /* name of object */ --- 812,827 ---- parse_que(player, "@notify me", cause); } + /** Parse possessive matches. + * This function parses strings of the form "Sam's bag" and attempts + * to match "bag" in the contents of "Sam". It returns NOTHING if + * there's no possessive 's in the string. + * \param player the enactor/looker. + * \param str a string to check for possessive matches. + * \return matching dbref or NOTHING. + */ dbref ! parse_match_possessive(dbref player, const char *str) { char *box; /* name of container */ char *obj; /* name of object */ *************** *** 783,798 **** } void ! page_return(player, target, type, message, def) ! dbref player; ! dbref target; ! const char *type; ! const char *message; ! const char *def; { - /* code for auto-return page - HAVEN, IDLE, and AWAY messages */ - ATTR *d; char buff[BUFFER_LEN], *bp, *asave; char const *ap; --- 853,869 ---- } + /** Autoreply messages for pages (HAVEN, IDLE, AWAY). + * \param player the paging player. + * \param target the paged player. + * \param type type of message to return. + * \param message name of attribute containing the message. + * \param def default message to return. + */ void ! page_return(dbref player, dbref target, const char *type, ! const char *message, const char *def) { ATTR *d; char buff[BUFFER_LEN], *bp, *asave; char const *ap; *************** *** 822,835 **** } } dbref ! where_is(thing) ! dbref thing; { - /* returns "real" location of object. This is the location for players - * and things, source for exits, and NOTHING for rooms. - */ - if (!GoodObject(thing)) return NOTHING; switch (Typeof(thing)) { --- 893,907 ---- } } + /* Returns the apparent location of object. + * This is the location for players and things, source for exits, and + * NOTHING for rooms. + * \param thing object to get location of. + * \return apparent location of object (NOTHING for rooms). + */ dbref ! where_is(dbref thing) { if (!GoodObject(thing)) return NOTHING; switch (Typeof(thing)) { *************** *** 842,857 **** } } int ! nearby(obj1, obj2) ! dbref obj1; ! dbref obj2; ! { ! /* returns 1 if obj1 is "nearby" object2. "Nearby" is defined as: ! * obj1 is in the same room as obj2, obj1 is being carried by ! * obj2, obj1 is carrying obj2. Returns 0 if object isn't nearby ! * or the input is invalid. ! */ dbref loc1, loc2; if (!GoodObject(obj1) || !GoodObject(obj2)) --- 914,933 ---- } } + /* Are two objects near each other? + * Returns 1 if obj1 is "nearby" object2. "Nearby" is a commutative + * relation defined as: + * obj1 is in the same room as obj2, obj1 is being carried by + * obj2, or obj1 is carrying obj2. + * Returns 0 if object isn't nearby or the input is invalid. + * \param obj1 first object. + * \param obj2 second object. + * \retval 1 the objects are near each other. + * \retval 0 the objects are not near each other. + */ int ! nearby(dbref obj1, dbref obj2) ! { dbref loc1, loc2; if (!GoodObject(obj1) || !GoodObject(obj2)) *************** *** 865,879 **** return 0; } void ! do_verb(player, cause, arg1, argv) ! dbref player; ! dbref cause; ! char *arg1; ! char **argv; { - /* user-defined verbs */ - dbref victim; dbref actor; int i; --- 941,958 ---- return 0; } + /* User-defined verbs. + * \verbatim + * This implements the @verb command. + * \endverbatim + * \param player the enactor. + * \param cause the object causing this command to run. + * \param arg1 the object to read verb attributes from. + * \param argv the array of remaining arguments to the verb command. + */ void ! do_verb(dbref player, dbref cause, char *arg1, char **argv) { dbref victim; dbref actor; int i; *************** *** 940,960 **** charge_action(actor, victim, upcasestr(argv[6])); } struct guh_args { ! char *buff; ! char *bp; ! char *lookfor; ! int len; ! int insensitive; }; static int ! grep_util_helper(player, thing, pattern, atr, args) ! dbref player __attribute__ ((__unused__)); ! dbref thing __attribute__ ((__unused__)); ! char const *pattern __attribute__ ((__unused__)); ! ATTR *atr; ! void *args; { struct guh_args *guh = args; int found; --- 1019,1039 ---- charge_action(actor, victim, upcasestr(argv[6])); } + /** Structure for passing arguments to grep_util_helper(). + */ struct guh_args { ! char *buff; /**< Buffer for output */ ! char *bp; /**< Pointer to buff's current position */ ! char *lookfor; /**< String to grep for */ ! int len; /**< Length of lookfor */ ! int insensitive; /**< If 1, case-insensitive match; if 0, sensitive */ }; static int ! grep_util_helper(dbref player __attribute__ ((__unused__)), ! dbref thing __attribute__ ((__unused__)), ! char const *pattern ! __attribute__ ((__unused__)), ATTR *atr, void *args) { struct guh_args *guh = args; int found; *************** *** 977,996 **** return found; } char * ! grep_util(player, thing, pattern, lookfor, len, insensitive) ! dbref player; ! dbref thing; ! char *pattern; ! char *lookfor; ! int len; ! int insensitive; ! /* strlen(lookfor) */ ! /* 1 if case-insensitive grep, 0 if not */ { - /* returns a list of attributes which match on - * whose contents have - */ struct guh_args guh; guh.buff = (char *) mush_malloc(BUFFER_LEN + 1, "grep_util.buff"); --- 1056,1076 ---- return found; } + /** Utility function for grep funtions/commands. + * This function returns a list of attributes on an object that + * match a name pattern and contain another string. + * \param player the enactor. + * \param thing object to check attributes on. + * \param pattern wildcard pattern for attributes to check. + * \param lookfor string to find within each attribute. + * \param len length of lookfor. + * \param insensitive if 1, case-insensitive matching; if 0, case-sensitive. + * \return string containing list of attribute names with matching data. + */ char * ! grep_util(dbref player, dbref thing, char *pattern, char *lookfor, ! int len, int insensitive) { struct guh_args guh; guh.buff = (char *) mush_malloc(BUFFER_LEN + 1, "grep_util.buff"); *************** *** 1003,1021 **** return guh.buff; } struct gh_args { ! char *lookfor; ! int len; ! int insensitive; }; static int ! grep_helper(player, thing, pattern, atr, args) ! dbref player; ! dbref thing __attribute__ ((__unused__)); ! char const *pattern __attribute__ ((__unused__)); ! ATTR *atr; ! void *args; { struct gh_args *gh = args; int found; --- 1083,1099 ---- return guh.buff; } + /** Structure for grep_helper() arguments. */ struct gh_args { ! char *lookfor; /**< Pattern to look for. */ ! int len; /**< Length of lookfor. */ ! int insensitive; /**< if 1, case-insensitive matching; if 0, sensitive */ }; static int ! grep_helper(dbref player, dbref thing __attribute__ ((__unused__)), ! char const *pattern ! __attribute__ ((__unused__)), ATTR *atr, void *args) { struct gh_args *gh = args; int found; *************** *** 1053,1060 **** return found; } ! /* lookfor is an unparsed arg. flag is 0 for list and 1 for hilite. ! * insensitive is 0 for case-sensitive, 1 for case-insensitive */ void do_grep(dbref player, char *obj, char *lookfor, int flag, int insensitive) --- 1131,1145 ---- return found; } ! /** The grep command ! * \verbatim ! * This implements @grep. ! * \endverbatim ! * \param player the enactor. ! * \param obj string containing obj/attr pattern to grep through. ! * \param lookfor unparsed string to search for. ! * \param flag if 0, return attribute names; if 1, return attrib text. ! * \param insensitive if 1, case-insensitive match; if 0, sensitive. */ void do_grep(dbref player, char *obj, char *lookfor, int flag, int insensitive) *** 1_7_7.309/src/plyrlist.c Wed, 24 Jul 2002 16:12:39 -0500 dunemush (pennmush/b/46_plyrlist.c 1.5.1.1.1.3 660) --- 1_7_7.365(w)/src/plyrlist.c Wed, 09 Apr 2003 14:19:26 -0500 dunemush (pennmush/b/46_plyrlist.c 1.5.1.1.1.3.1.1 660) *************** *** 1,5 **** - /* plyrlist.c */ #include "config.h" #include --- 1,11 ---- + /** + * \file plyrlist.c + * + * \brief Player list management for PennMUSH. + * + * + */ #include "config.h" #include *************** *** 23,36 **** static void init_hft(void); static void ! init_hft() { hashinit(&htab_player_list, 256, sizeof(dbref)); hft_initialized = 1; } void ! clear_players() { if (hft_initialized) hashflush(&htab_player_list, 256); --- 29,43 ---- static void init_hft(void); static void ! init_hft(void) { hashinit(&htab_player_list, 256, sizeof(dbref)); hft_initialized = 1; } + /** Clear the player list htab. */ void ! clear_players(void) { if (hft_initialized) hashflush(&htab_player_list, 256); *************** *** 39,44 **** --- 46,55 ---- } + /** Add a player to the player list htab. + * \param player dbref of player to add. + * \param alias name to use as hash table key for player, if given. + */ void add_player(dbref player, const char *alias) { *************** *** 50,55 **** --- 61,70 ---- hashadd(strupper(Name(player)), (void *) player, &htab_player_list); } + /** Look up a player in the player list htab (or by dbref). + * \param name name of player to find. + * \return dbref of player, or NOTHING. + */ dbref lookup_player(const char *name) { *************** *** 80,85 **** --- 95,104 ---- */ } + /** Remove a player from the player list htab. + * \param player dbref of player to remove. + * \param alias key to remove if given. + */ void delete_player(dbref player, const char *alias) { *** 1_7_7.309/src/player.c Wed, 05 Mar 2003 16:05:56 -0600 dunemush (pennmush/b/47_player.c 1.15.1.1.1.1.1.4.1.6.1.9 660) --- 1_7_7.365(w)/src/player.c Wed, 09 Apr 2003 14:19:26 -0500 dunemush (pennmush/b/47_player.c 1.15.1.1.1.1.1.4.1.6.1.10 660) *************** *** 1,4 **** ! /* player.c */ #include "copyrite.h" #include "config.h" --- 1,10 ---- ! /** ! * \file player.c ! * ! * \brief Player creation and connection for PennMUSH. ! * ! * ! */ #include "copyrite.h" #include "config.h" *************** *** 52,61 **** extern struct db_stat_info current_state; int ! password_check(player, password) ! dbref player; ! const char *password; { ATTR *a; char *saved; --- 58,71 ---- extern struct db_stat_info current_state; + /** Check a player's password against a given string. + * \param player dbref of player. + * \param password plaintext password string to check. + * \retval 1 password matches (or player has no password). + * \retval 0 password fails to match. + */ int ! password_check(dbref player, const char *password) { ATTR *a; char *saved; *************** *** 103,108 **** --- 113,127 ---- return 1; } + /** Check to see if someone can connect to a player. + * \param name name of player to connect to. + * \param password password of player to connect to. + * \param host host from which connection is being attempted. + * \param ip ip address from which connection is being attempted. + * \param errbuf buffer to return connection errors. + * \return dbref of connected player object or NOTHING for failure + * (with reason for failure returned in errbuf). + */ dbref connect_player(const char *name, const char *password, const char *host, const char *ip, char *errbuf) *************** *** 174,188 **** return player; } ! /* This function returns NOTHING if the player name was bad, and ! * AMBIGUOUS if the player password was bad */ dbref ! create_player(name, password, host, ip) ! const char *name; ! const char *password; ! const char *host; ! const char *ip; { if (!ok_player_name(name)) { do_log(LT_CONN, 0, 0, T("Failed creation (bad name) from %s"), host); --- 193,209 ---- return player; } ! /* Attempt to create a new player object. ! * \param name name of player to create. ! * \param password initial password of created player. ! * \param host host from which creation is attempted. ! * \param ip ip address from which creation is attempted. ! * \return dbref of created player, NOTHING if bad name, AMBIGUOUS if bad ! * password. */ dbref ! create_player(const char *name, const char *password, const char *host, ! const char *ip) { if (!ok_player_name(name)) { do_log(LT_CONN, 0, 0, T("Failed creation (bad name) from %s"), host); *************** *** 210,221 **** #endif #ifdef HAS_SENDMAIL dbref ! email_register_player(name, email, host, ip) ! const char *name; ! const char *email; ! const char *host; ! const char *ip; { char *p; char passwd[BUFFER_LEN]; --- 231,248 ---- #endif #ifdef HAS_SENDMAIL + /** Attempt to register a new player at the connect screen. + * If registration is allowed, a new player object is created with + * a random password which is emailed to the registering player. + * \param name name of player to register. + * \param email email address to send registration details. + * \param host host from which registration is being attempted. + * \param ip ip address from which registration is being attempted. + * \return dbref of created player or NOTHING if creation failed. + */ dbref ! email_register_player(const char *name, const char *email, const char *host, ! const char *ip) { char *p; char passwd[BUFFER_LEN]; *************** *** 327,337 **** } #else dbref ! email_register_player(name, email, host, ip) ! const char *name; ! const char *email; ! const char *host; ! const char *ip; { do_log(LT_CONN, 0, 0, T("Failed registration (no sendmail) from %s"), host); return NOTHING; --- 354,361 ---- } #else dbref ! email_register_player(const char *name, const char *email, const char *host, ! const char *ip) { do_log(LT_CONN, 0, 0, T("Failed registration (no sendmail) from %s"), host); return NOTHING; *************** *** 339,349 **** #endif static dbref ! make_player(name, password, host, ip) ! const char *name; ! const char *password; ! const char *host; ! const char *ip; { dbref player; --- 363,370 ---- #endif static dbref ! make_player(const char *name, const char *password, const char *host, ! const char *ip) { dbref player; *************** *** 417,427 **** } void ! do_password(player, old, newobj) ! dbref player; ! const char *old; ! const char *newobj; { if (!password_check(player, old)) { notify(player, T("Suffering from memory loss? See a wizard!")); --- 438,453 ---- } + /** Change a player's password. + * \verbatim + * This function implements @password. + * \endverbatim + * \param player the enactor. + * \param old player's current password. + * \param newobj player's desired new password. + */ void ! do_password(dbref player, const char *old, const char *newobj) { if (!password_check(player, old)) { notify(player, T("Suffering from memory loss? See a wizard!")); *************** *** 433,443 **** } } void ! check_last(player, host, ip) ! dbref player; ! const char *host; ! const char *ip; { char *s; ATTR *a; --- 459,473 ---- } } + /** Processing related to players' last connections. + * Here we check to see if a player gets a paycheck, tell them their + * last connection site, and update all their LAST* attributes. + * \param player dbref of player. + * \param host hostname of player's current connection. + * \param ip ip address of player's current connection. + */ void ! check_last(dbref player, const char *host, const char *ip) { char *s; ATTR *a; *************** *** 481,491 **** } ! /* This is called on a failed connection */ void ! check_lastfailed(player, host) ! dbref player; ! const char *host; { char *s; char last_place[BUFFER_LEN], *bp; --- 511,522 ---- } ! /** Update the LASTFAILED attribute on a failed connection. ! * \param player dbref of player. ! * \param host host from which connection attempt failed. ! */ void ! check_lastfailed(dbref player, const char *host) { char *s; char last_place[BUFFER_LEN], *bp; *** 1_7_7.309/src/parse.c Tue, 18 Mar 2003 21:23:40 -0600 dunemush (pennmush/b/48_parse.c 1.23.1.10.1.2.1.1.1.1.1.2.1.2.1.10 660) --- 1_7_7.365(w)/src/parse.c Wed, 09 Apr 2003 14:19:26 -0500 dunemush (pennmush/b/48_parse.c 1.23.1.10.1.2.1.1.1.1.1.2.1.2.1.14 660) *************** *** 1,4 **** ! /* parse.c */ #include "copyrite.h" --- 1,11 ---- ! /** ! * \file parse.c ! * ! * \brief The PennMUSH function/expression parser ! * ! * The most important function in this file is process_expression. ! * ! */ #include "copyrite.h" *************** *** 40,49 **** extern sig_atomic_t cpu_time_limit_hit; extern int cpu_limit_warning_sent; struct debug_info { ! char *string; ! Debug_Info *prev; ! Debug_Info *next; }; FUNCTION_PROTO(fun_gfun); --- 47,57 ---- extern sig_atomic_t cpu_time_limit_hit; extern int cpu_limit_warning_sent; + /** Structure for storing DEBUG output in a linked list */ struct debug_info { ! char *string; /**< A DEBUG string */ ! Debug_Info *prev; /**< Previous node in the linked list */ ! Debug_Info *next; /**< Next node in the linked list */ }; FUNCTION_PROTO(fun_gfun); *************** *** 91,99 **** #endif dbref ! parse_dbref(str) ! char const *str; { /* Make sure string is strictly in format "#nnn". * Otherwise, possesives will be fouled up. --- 99,110 ---- #endif + /** Given a string, parse out a dbref. + * \param str string to parse. + * \return dbref contained in the string, or NOTHING if not a valid dbref. + */ dbref ! parse_dbref(char const *str) { /* Make sure string is strictly in format "#nnn". * Otherwise, possesives will be fouled up. *************** *** 114,122 **** return num; } int ! parse_boolean(str) ! char const *str; { if (TINY_BOOLEANS) { return (atoi(str) ? 1 : 0); --- 125,142 ---- return num; } + /** Given a string, parse out a boolean value. + * The meaning of boolean is fuzzy. To TinyMUSH, any string that begins with + * a non-zero number is true, and everything else is false. + * To PennMUSH, negative dbrefs are false, non-negative dbrefs are true, + * 0 is false, all other numbers are true, empty or blank strings are false, + * and all other strings are true. + * \param str string to parse. + * \retval 1 str represents a true value. + * \retval 0 str represents a false value. + */ int ! parse_boolean(char const *str) { if (TINY_BOOLEANS) { return (atoi(str) ? 1 : 0); *************** *** 126,146 **** * Zero is false, all other numbers are true. * Empty (or space only) strings are false, all other strings are true. */ ! if (!str) return 0; ! if (str[0] == '#' && str[1] == '-') /* check like this so error msgs */ ! return 0; /* are false */ if (is_strict_number(str)) return parse_number(str) != 0; /* avoid rounding problems */ while (*str == ' ') str++; return *str != '\0'; /* force to 1 or 0 */ } } int ! is_boolean(str) ! char const *str; { if (TINY_BOOLEANS) return is_integer(str); --- 146,178 ---- * Zero is false, all other numbers are true. * Empty (or space only) strings are false, all other strings are true. */ ! /* Null strings are false */ ! if (!str || !*str) return 0; ! /* Negative dbrefs are false - actually anything starting #-, ! * which will also cover our error messages. */ ! if (*str == '#' && *(str + 1) && (*(str + 1) == '-')) ! return 0; ! /* Non-zero numbers are true, zero is false */ if (is_strict_number(str)) return parse_number(str) != 0; /* avoid rounding problems */ + /* Skip blanks */ while (*str == ' ') str++; + /* If there's any non-blanks left, it's true */ return *str != '\0'; /* force to 1 or 0 */ } } + /** Is a string a boolean value? + * To TinyMUSH, any integer is a boolean value. To PennMUSH, any + * string at all is boolean. + * \param str string to check. + * \retval 1 string is a valid boolean. + * \retval 0 string is not a valid boolean. + */ int ! is_boolean(char const *str) { if (TINY_BOOLEANS) return is_integer(str); *************** *** 148,156 **** return 1; } int ! is_dbref(str) ! char const *str; { if (!str || (*str != NUMBER_TOKEN) || !*(str + 1)) return 0; --- 180,194 ---- return 1; } + /** Is a string a dbref? + * A dbref is a string starting with a #, optionally followed by a -, + * and then followed by at least one digit, and nothing else. + * \param str string to check. + * \retval 1 string is a dbref. + * \retval 0 string is not a dbref. + */ int ! is_dbref(char const *str) { if (!str || (*str != NUMBER_TOKEN) || !*(str + 1)) return 0; *************** *** 162,170 **** return !*str; } int ! is_integer(str) ! char const *str; { char *end; --- 200,215 ---- return !*str; } + /** Is string an integer? + * To TinyMUSH, any string is an integer. To PennMUSH, a string that + * passes strtol is an integer, and a blank string is an integer + * if NULL_EQ_ZERO is turned on. + * \param str string to check. + * \retval 1 string is an integer. + * \retval 0 string is not an integer. + */ int ! is_integer(char const *str) { char *end; *************** *** 184,192 **** return 1; } int ! is_uinteger(str) ! char const *str; { char *end; --- 229,244 ---- return 1; } + /** Is string an uinteger? + * To TinyMUSH, any string is an uinteger. To PennMUSH, a string that + * passes strtoul is an uinteger, and a blank string is an uinteger + * if NULL_EQ_ZERO is turned on. + * \param str string to check. + * \retval 1 string is an uinteger. + * \retval 0 string is not an uinteger. + */ int ! is_uinteger(char const *str) { char *end; *************** *** 209,217 **** return 1; } int ! is_strict_number(str) ! char const *str; { char *end; NVAL val; --- 261,274 ---- return 1; } + /** Is string a number by the strict definition? + * A strict number is a non-null string that passes strtod. + * \param str string to check. + * \retval 1 string is a strict number. + * \retval 0 string is not a strict number. + */ int ! is_strict_number(char const *str) { char *end; NVAL val; *************** *** 224,232 **** return end > str; } int ! is_strict_integer(str) ! const char *str; { char *end; int val; --- 281,294 ---- return end > str; } + /** Is string an integer by the strict definition? + * A strict integer is a non-null string that passes strtol. + * \param str string to check. + * \retval 1 string is a strict integer. + * \retval 0 string is not a strict integer. + */ int ! is_strict_integer(char const *str) { char *end; int val; *************** *** 239,247 **** return end > str; } int ! is_number(str) ! char const *str; { /* If we're emulating Tiny, anything is a number */ if (TINY_MATH) --- 301,315 ---- return end > str; } + /** Is string a number? + * To TinyMUSH, any string is a number. To PennMUSH, a strict number is + * a number, and a blank string is a number if NULL_EQ_ZERO is turned on. + * \param str string to check. + * \retval 1 string is a number. + * \retval 0 string is not a number. + */ int ! is_number(char const *str) { /* If we're emulating Tiny, anything is a number */ if (TINY_MATH) *************** *** 261,279 **** #ifdef WIN32 #pragma warning( disable : 4761) /* NJG: disable warning re conversion */ #endif ! /* Function and other substitution evaluation. */ int ! process_expression(buff, bp, str, executor, caller, enactor, ! eflags, tflags, pe_info) ! char *buff; ! char **bp; ! char const **str; ! dbref executor; ! dbref caller; ! dbref enactor; ! int eflags; ! int tflags; ! PE_Info *pe_info; { int debugging = 0, made_info = 0; char *debugstr = NULL, *sourcestr = NULL; --- 329,390 ---- #ifdef WIN32 #pragma warning( disable : 4761) /* NJG: disable warning re conversion */ #endif ! ! ! /** Function and other substitution evaluation. ! * This is the PennMUSH function/expression parser. Big stuff. ! * ! * All results are returned in buff, at the point *bp. bp is likely ! * not equal to buff, so make no assumptions about writing at the ! * start of the buffer. *bp must be updated to point at the next ! * place to be filled (ala safe_str() and safe_chr()). Be very ! * careful about not overflowing buff; use of safe_str() and safe_chr() ! * for all writes into buff is highly recommended. ! * ! * nargs is the count of the number of arguments passed to the function, ! * and args is an array of pointers to them. args will have at least ! * nargs elements, or 10 elements, whichever is greater. The first ten ! * elements are initialized to NULL for ease of porting functions from ! * the old style, but relying on such is considered bad form. ! * The argument strings are stored in BUFFER_LEN buffers, but reliance ! * on that size is also considered bad form. The argument strings may ! * be modified, but modifying the pointers to the argument strings will ! * cause crashes. ! * ! * executor corresponds to %!, the object invoking the function. ! * caller corresponds to %@, the last object to do a U() or similar. ! * enactor corresponds to %#, the object that started the whole mess. ! * Note that fun_ufun() and similar must swap around these parameters ! * in calling process_expression(); no checks are made in the parser ! * itself to maintain these values. ! * ! * called_as contains a pointer to the name of the function called ! * (taken from the function table). This may be used to distinguish ! * multiple functions which use the same C function for implementation. ! * ! * pe_info holds context information used by the parser. It should ! * be passed untouched to process_expression(), if it is called. ! * pe_info should be treated as a black box; its structure and contents ! * may change without notice. ! * ! * Normally, p_e() returns 0. It returns 1 upon hitting the CPU time limit. ! * ! * \param buff buffer to store returns of parsing. ! * \param bp pointer to pointer into buff marking insert position. ! * \param str string to parse. ! * \param executor dbref of the object invoking the function. ! * \param caller dbref of the last object to use u() ! * \param enactor dbref of the enactor. ! * \param eflags flags to control what is evaluated. ! * \param tflags flags to control what terminates an expression. ! * \param pe_info pointer to parser context data. ! * \retval 0 success. ! * \retval 1 CPU time limit exceeded. ! */ int ! process_expression(char *buff, char **bp, char const **str, ! dbref executor, dbref caller, dbref enactor, ! int eflags, int tflags, PE_Info * pe_info) { int debugging = 0, made_info = 0; char *debugstr = NULL, *sourcestr = NULL; *** 1_7_7.309/src/move.c Wed, 12 Mar 2003 12:31:02 -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.14 660) --- 1_7_7.365(w)/src/move.c Wed, 09 Apr 2003 14:19:26 -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.16 660) *************** *** 365,371 **** if ((loc = Location(player)) != NOTHING && !Dark(player) && !Dark(loc)) { /* tell everybody else */ notify_except(Contents(loc), player, ! tprintf(T("%s goes home."), Name(player))); } /* give the player the messages */ notify(player, T("There's no place like home...")); --- 365,371 ---- if ((loc = Location(player)) != NOTHING && !Dark(player) && !Dark(loc)) { /* tell everybody else */ notify_except(Contents(loc), player, ! tprintf(T("%s goes home."), Name(player)), NA_INTERACTION); } /* give the player the messages */ notify(player, T("There's no place like home...")); *************** *** 806,812 **** /** The follow command. * follow tries to start following * follow alone lists who you're following ! * \param the enactor. * \param arg name of object to follow. */ void --- 806,812 ---- /** The follow command. * follow tries to start following * follow alone lists who you're following ! * \param player the enactor. * \param arg name of object to follow. */ void *** 1_7_7.309/src/match.c Tue, 11 Mar 2003 18:09:44 -0600 dunemush (pennmush/c/2_match.c 1.24.1.1.1.4.1.1.1.1.1.1.1.1.1.1.1.18 660) --- 1_7_7.365(w)/src/match.c Wed, 09 Apr 2003 14:19:26 -0500 dunemush (pennmush/c/2_match.c 1.24.1.1.1.4.1.1.1.1.1.1.1.1.1.1.1.20 660) *************** *** 506,513 **** (*exact_matches_to_go)--; (*matches_to_go)--; return MATCH_EXACT; ! } else if (!strcasecmp(Name(first), name) || ! (GoodObject(alias_match) && (alias_match == first))) { /* An exact match, but there may be others */ (*exact_matches_to_go)--; (*matches_to_go)--; --- 506,514 ---- (*exact_matches_to_go)--; (*matches_to_go)--; return MATCH_EXACT; ! } else if (can_interact(first, who, INTERACT_MATCH) && ! (!strcasecmp(Name(first), name) || ! (GoodObject(alias_match) && (alias_match == first)))) { /* An exact match, but there may be others */ (*exact_matches_to_go)--; (*matches_to_go)--; *************** *** 524,530 **** *match = first; match_type = MATCH_EXACT; } ! } else if ((match_type != MATCH_EXACT) && string_match(Name(first), name)) { /* A partial match, and we haven't done an exact match yet */ (*matches_to_go)--; if (nth_match) { --- 525,532 ---- *match = first; match_type = MATCH_EXACT; } ! } else if ((match_type != MATCH_EXACT) && string_match(Name(first), name) ! && can_interact(first, who, INTERACT_MATCH)) { /* A partial match, and we haven't done an exact match yet */ (*matches_to_go)--; if (nth_match) { *************** *** 572,584 **** /* Store an absolute dbref match if given */ absolute = match_absolute(name); DOLIST(exit_tmp, Exits(first)) { ! if (exit_tmp == absolute) { /* Absolute match. Return immediately */ *match = exit_tmp; (*exact_matches_to_go)--; (*matches_to_go)--; return MATCH_EXACT; ! } else if (check_alias(name, Name(exit_tmp))) { /* Matched an exit alias, but there may be more */ (*exact_matches_to_go)--; (*matches_to_go)--; --- 574,588 ---- /* Store an absolute dbref match if given */ absolute = match_absolute(name); DOLIST(exit_tmp, Exits(first)) { ! ! if ((exit_tmp == absolute) && (can_interact(exit_tmp, who, INTERACT_MATCH))) { /* Absolute match. Return immediately */ *match = exit_tmp; (*exact_matches_to_go)--; (*matches_to_go)--; return MATCH_EXACT; ! } else if (check_alias(name, Name(exit_tmp)) ! && (can_interact(exit_tmp, who, INTERACT_MATCH))) { /* Matched an exit alias, but there may be more */ (*exact_matches_to_go)--; (*matches_to_go)--; *** 1_7_7.309/src/look.c Mon, 03 Mar 2003 22:58:44 -0600 dunemush (pennmush/c/4_look.c 1.21.1.2.1.9.1.1.1.1.1.4 660) --- 1_7_7.365(w)/src/look.c Wed, 09 Apr 2003 14:19:26 -0500 dunemush (pennmush/c/4_look.c 1.21.1.2.1.9.1.1.1.1.1.5 660) *************** *** 98,104 **** renv[j][0] = '\0'; bp = arg; DOLIST(thing, Exits(loc)) { ! if (!(DarkLegal(thing) || (Dark(loc) && !Light(thing)))) { if (bp != arg) safe_chr(' ', arg, &bp); safe_dbref(thing, arg, &bp); --- 98,105 ---- renv[j][0] = '\0'; bp = arg; DOLIST(thing, Exits(loc)) { ! if ((!(DarkLegal(thing) || (Dark(loc) && !Light(thing)))) ! && can_interact(thing, player, INTERACT_SEE)) { if (bp != arg) safe_chr(' ', arg, &bp); safe_dbref(thing, arg, &bp); *************** *** 127,133 **** /* Scan the room and see if there are any visible exits */ if (Dark(loc)) { for (thing = Exits(loc); thing != NOTHING; thing = Next(thing)) { ! if (!(DarkLegal(thing)) && Light(thing)) { total_count++; if (!Transparented(loc) || Opaque(thing)) exit_count++; --- 128,135 ---- /* Scan the room and see if there are any visible exits */ if (Dark(loc)) { for (thing = Exits(loc); thing != NOTHING; thing = Next(thing)) { ! if (!DarkLegal(thing) && Light(thing) && ! can_interact(thing, player, INTERACT_SEE)) { total_count++; if (!Transparented(loc) || Opaque(thing)) exit_count++; *************** *** 135,141 **** } } else { for (thing = Exits(loc); thing != NOTHING; thing = Next(thing)) { ! if (!(DarkLegal(thing))) { total_count++; if (!Transparented(loc) || Opaque(thing)) exit_count++; --- 137,143 ---- } } else { for (thing = Exits(loc); thing != NOTHING; thing = Next(thing)) { ! if (!DarkLegal(thing) && can_interact(thing, player, INTERACT_SEE)) { total_count++; if (!Transparented(loc) || Opaque(thing)) exit_count++; *************** *** 156,162 **** notify_by(loc, player, pbuff); for (thing = Exits(loc); thing != NOTHING; thing = Next(thing)) { ! if (!DarkLegal(thing) && (!Dark(loc) || Light(thing))) { strcpy(pbuff, Name(thing)); if ((p = strchr(pbuff, ';'))) *p = '\0'; --- 158,165 ---- notify_by(loc, player, pbuff); for (thing = Exits(loc); thing != NOTHING; thing = Next(thing)) { ! if (!DarkLegal(thing) && (!Dark(loc) || Light(thing)) ! && can_interact(thing, player, INTERACT_SEE)) { strcpy(pbuff, Name(thing)); if ((p = strchr(pbuff, ';'))) *p = '\0'; *** 1_7_7.309/src/game.c Thu, 06 Mar 2003 12:01:42 -0600 dunemush (pennmush/c/10_game.c 1.50.1.8.1.1.1.1.2.1.1.1.2.1.1.4.1.1.1.1.1.1.1.1.1.1.2.1.1.2.1.1.1.1.1.1.1.2.1.1.1.2.1.1.1.1.1.1.1.1.1.5.1.3.1.2.1.2.1.1.1.1.1.2 660) --- 1_7_7.365(w)/src/game.c Wed, 09 Apr 2003 14:19:26 -0500 dunemush (pennmush/c/10_game.c 1.50.1.8.1.1.1.1.2.1.1.1.2.1.1.4.1.1.1.1.1.1.1.1.1.1.2.1.1.2.1.1.1.1.1.1.1.2.1.1.1.2.1.1.1.1.1.1.1.1.1.5.1.3.1.2.1.2.1.1.1.1.1.3 660) *************** *** 1782,1788 **** --- 1782,1790 ---- #ifdef HAS_GETRUSAGE struct rusage usage; #endif + #ifndef WIN32 char tbuf1[BUFFER_LEN]; + #endif Pid_t pid; int psize; *** 1_7_7.309/src/funmath.c Thu, 27 Feb 2003 23:22:28 -0600 dunemush (pennmush/c/15_funmath.c 1.39.1.1.1.1.1.1.1.13 660) --- 1_7_7.365(w)/src/funmath.c Wed, 09 Apr 2003 14:19:25 -0500 dunemush (pennmush/c/15_funmath.c 1.39.1.1.1.1.1.1.1.10.1.2 660) *************** *** 1131,1137 **** static const char *special[] = { "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", ! "seventeen ", "eighteen", "nineteen" }; static const char *tens[] = { "", " ", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety" --- 1131,1137 ---- static const char *special[] = { "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", ! "seventeen", "eighteen", "nineteen" }; static const char *tens[] = { "", " ", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety" *** 1_7_7.309/src/fundb.c Tue, 18 Mar 2003 15:28:04 -0600 dunemush (pennmush/c/17_fundb.c 1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.7.1.3.1.3.1.3.1.2.1.2.1.3.2.1.2.1.2.1.1.1.1.4.1.1.1.1.1.1.1.1.1.1.1.3.1.1.2.2.2.1.1.1.1.1.1.8 660) --- 1_7_7.365(w)/src/fundb.c Wed, 09 Apr 2003 14:19:25 -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.9 660) *************** *** 510,515 **** --- 510,527 ---- { dbref it; + if (nargs == 2) { + if (!command_check_byname(executor, "@power") || fun->flags & FN_NOSIDEFX) { + safe_str(T(e_perm), buff, bp); + return; + } + #ifdef FUNCTION_SIDE_EFFECTS + do_power(executor, args[0], args[1]); + #else + safe_str(T(e_disabled), buff, bp); + #endif + return; + } it = match_thing(executor, args[0]); if (!GoodObject(it)) { safe_str(T(e_notvis), buff, bp); *** 1_7_7.309/src/function.c Tue, 18 Mar 2003 15:28:04 -0600 dunemush (pennmush/c/18_function.c 1.29.1.14.1.3.1.6.1.1.1.1.1.14.1.2.1.1.1.7.1.5 660) --- 1_7_7.365(w)/src/function.c Wed, 09 Apr 2003 14:19: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.11 660) *************** *** 47,55 **** * \param preserve pointer to array to store the q-registers in. */ void ! save_global_regs(funcname, preserve) ! const char *funcname; ! char *preserve[]; { int i; --- 47,53 ---- * \param preserve pointer to array to store the q-registers in. */ void ! save_global_regs(const char *funcname, char *preserve[]) { int i; *************** *** 68,76 **** * \param preserve pointer to array to restore the q-registers from. */ void ! restore_global_regs(funcname, preserve) ! const char *funcname; ! char *preserve[]; { int i; for (i = 0; i < NUMQ; i++) { --- 66,72 ---- * \param preserve pointer to array to restore the q-registers from. */ void ! restore_global_regs(const char *funcname, char *preserve[]) { int i; for (i = 0; i < NUMQ; i++) { *************** *** 87,94 **** * \param preserve pointer to array to restore the q-registers from. */ void ! load_global_regs(preserve) ! char *preserve[]; { int i; for (i = 0; i < NUMQ; i++) { --- 83,89 ---- * \param preserve pointer to array to restore the q-registers from. */ void ! load_global_regs(char *preserve[]) { int i; for (i = 0; i < NUMQ; i++) { *************** *** 105,116 **** * \param preserve pointer to array to store %0-%9 in. */ void ! save_global_env(funcname, preserve) ! const char *funcname __attribute__ ((__unused__)); ! char *preserve[]; { int i; - for (i = 0; i < 10; i++) preserve[i] = wenv[i]; } --- 100,109 ---- * \param preserve pointer to array to store %0-%9 in. */ void ! save_global_env(const char *funcname __attribute__ ((__unused__)), ! char *preserve[]) { int i; for (i = 0; i < 10; i++) preserve[i] = wenv[i]; } *************** *** 120,131 **** * \param preserve pointer to array to restore %0-%9 from. */ void ! restore_global_env(funcname, preserve) ! const char *funcname __attribute__ ((__unused__)); ! char *preserve[]; { int i; - for (i = 0; i < 10; i++) wenv[i] = preserve[i]; } --- 113,122 ---- * \param preserve pointer to array to restore %0-%9 from. */ void ! restore_global_env(const char *funcname __attribute__ ((__unused__)), ! char *preserve[]) { int i; for (i = 0; i < 10; i++) wenv[i] = preserve[i]; } *************** *** 145,157 **** * \retval 1 successfully returned a separator (maybe the default one). */ int ! delim_check(buff, bp, nfargs, fargs, sep_arg, sep) ! char *buff; ! char **bp; ! int nfargs; ! char *fargs[]; ! int sep_arg; ! char *sep; { /* Find a delimiter. */ --- 136,143 ---- * \retval 1 successfully returned a separator (maybe the default one). */ int ! delim_check(char *buff, char **bp, int nfargs, char *fargs[], int sep_arg, ! char *sep) { /* Find a delimiter. */ *************** *** 220,225 **** --- 206,212 ---- {"CEMIT", fun_cemit, 2, 3, FN_REG}, #endif {"CENTER", fun_center, 2, 3, FN_REG}, + {"CHILDREN", fun_lsearch, 1, 1, FN_REG}, {"CHR", fun_chr, 1, 1, FN_REG}, #ifdef CHAT_SYSTEM {"CFLAGS", fun_cflags, 1, 2, FN_REG}, *************** *** 412,418 **** {"PORTS", fun_ports, 1, 1, FN_REG}, {"POS", fun_pos, 2, 2, FN_REG}, {"POSS", fun_poss, 1, 1, FN_REG}, ! {"POWERS", fun_powers, 1, 1, FN_REG}, {"PUEBLO", fun_pueblo, 1, 1, FN_REG}, #ifdef QUOTA {"QUOTA", fun_quota, 1, 1, FN_REG}, --- 399,405 ---- {"PORTS", fun_ports, 1, 1, FN_REG}, {"POS", fun_pos, 2, 2, FN_REG}, {"POSS", fun_poss, 1, 1, FN_REG}, ! {"POWERS", fun_powers, 1, 2, FN_REG}, {"PUEBLO", fun_pueblo, 1, 1, FN_REG}, #ifdef QUOTA {"QUOTA", fun_quota, 1, 1, FN_REG}, *************** *** 804,833 **** restrict_function(const char *name, const char *restriction) { FUN *fp; if (!name || !*name) return 0; fp = func_hash_lookup(name); if (!fp) return 0; if (!strcasecmp(restriction, "nobody")) { ! fp->flags |= FN_DISABLED; } else if (string_prefix(restriction, "nogag")) { ! fp->flags |= FN_NOGAGGED; } else if (string_prefix(restriction, "nofix")) { ! fp->flags |= FN_NOFIXED; } else if (!strcasecmp(restriction, "noguest")) { ! fp->flags |= FN_NOGUEST; } else if (!strcasecmp(restriction, "admin")) { ! fp->flags |= FN_ADMIN; } else if (!strcasecmp(restriction, "wizard")) { ! fp->flags |= FN_WIZARD; } else if (!strcasecmp(restriction, "god")) { ! fp->flags |= FN_GOD; } else if (!strcasecmp(restriction, "nosidefx")) { ! fp->flags |= FN_NOSIDEFX; } else { return 0; } return 1; } --- 791,833 ---- restrict_function(const char *name, const char *restriction) { FUN *fp; + int clear = 0; + unsigned int flags = 0; + if (!name || !*name) return 0; fp = func_hash_lookup(name); if (!fp) return 0; + if (!restriction || !*restriction) + return 0; + if (*restriction == '!') { + restriction++; + clear = 1; + } if (!strcasecmp(restriction, "nobody")) { ! flags |= FN_DISABLED; } else if (string_prefix(restriction, "nogag")) { ! flags |= FN_NOGAGGED; } else if (string_prefix(restriction, "nofix")) { ! flags |= FN_NOFIXED; } else if (!strcasecmp(restriction, "noguest")) { ! flags |= FN_NOGUEST; } else if (!strcasecmp(restriction, "admin")) { ! flags |= FN_ADMIN; } else if (!strcasecmp(restriction, "wizard")) { ! flags |= FN_WIZARD; } else if (!strcasecmp(restriction, "god")) { ! flags |= FN_GOD; } else if (!strcasecmp(restriction, "nosidefx")) { ! flags |= FN_NOSIDEFX; } else { return 0; } + if (clear) + fp->flags &= ~flags; + else + fp->flags |= flags; return 1; } *************** *** 855,861 **** return; } if (restrict_function(name, restriction)) ! notify(player, T("Restricted.")); else notify(player, T("Restrict attempt failed.")); } --- 855,861 ---- return; } if (restrict_function(name, restriction)) ! notify(player, T("Restrictions modified.")); else notify(player, T("Restrict attempt failed.")); } *** 1_7_7.309/src/flags.c Tue, 11 Mar 2003 12:41:47 -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.38 660) --- 1_7_7.365(w)/src/flags.c Wed, 09 Apr 2003 14:19:25 -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.41 660) *************** *** 1190,1203 **** tp = tbuf1; safe_format(tbuf1, &tp, T("%s is no longer listening."), Name(thing)); *tp = '\0'; ! notify_except(Contents(Location(thing)), NOTHING, tbuf1); ! notify_except(Contents(thing), NOTHING, tbuf1); } if (IsRoom(thing) && is_flag(f, "MONITOR") && !hear && !Listener(thing)) { tp = tbuf1; safe_format(tbuf1, &tp, T("%s is no longer listening."), Name(thing)); *tp = '\0'; ! notify_except(Contents(thing), NOTHING, tbuf1); } if (is_flag(f, "AUDIBLE")) { switch (Typeof(thing)) { --- 1190,1203 ---- tp = tbuf1; safe_format(tbuf1, &tp, T("%s is no longer listening."), Name(thing)); *tp = '\0'; ! notify_except(Contents(Location(thing)), NOTHING, tbuf1, NA_INTERACTION); ! notify_except(Contents(thing), NOTHING, tbuf1, 0); } if (IsRoom(thing) && is_flag(f, "MONITOR") && !hear && !Listener(thing)) { tp = tbuf1; safe_format(tbuf1, &tp, T("%s is no longer listening."), Name(thing)); *tp = '\0'; ! notify_except(Contents(thing), NOTHING, tbuf1, NA_INTERACTION); } if (is_flag(f, "AUDIBLE")) { switch (Typeof(thing)) { *************** *** 1207,1223 **** safe_format(tbuf1, &tp, T("Exit %s is no longer broadcasting."), Name(thing)); *tp = '\0'; ! notify_except(Contents(Source(thing)), NOTHING, tbuf1); } break; case TYPE_ROOM: notify_except(Contents(thing), NOTHING, ! T("Audible exits in this room have been deactivated.")); break; case TYPE_THING: case TYPE_PLAYER: notify_except(Contents(thing), thing, ! T("This room is no longer broadcasting.")); notify(thing, T("Your contents can no longer be heard from outside.")); break; } --- 1207,1224 ---- safe_format(tbuf1, &tp, T("Exit %s is no longer broadcasting."), Name(thing)); *tp = '\0'; ! notify_except(Contents(Source(thing)), NOTHING, tbuf1, 0); } break; case TYPE_ROOM: notify_except(Contents(thing), NOTHING, ! T("Audible exits in this room have been deactivated."), ! 0); break; case TYPE_THING: case TYPE_PLAYER: notify_except(Contents(thing), thing, ! T("This room is no longer broadcasting."), 0); notify(thing, T("Your contents can no longer be heard from outside.")); break; } *************** *** 1251,1264 **** tp = tbuf1; safe_format(tbuf1, &tp, T("%s is now listening."), Name(thing)); *tp = '\0'; ! notify_except(Contents(Location(thing)), NOTHING, tbuf1); ! notify_except(Contents(thing), NOTHING, tbuf1); } if (IsRoom(thing) && is_flag(f, "MONITOR") && !hear && !listener) { tp = tbuf1; safe_format(tbuf1, &tp, T("%s is now listening."), Name(thing)); *tp = '\0'; ! notify_except(Contents(thing), NOTHING, tbuf1); } /* notify for audible exits */ if (is_flag(f, "AUDIBLE")) { --- 1252,1265 ---- tp = tbuf1; safe_format(tbuf1, &tp, T("%s is now listening."), Name(thing)); *tp = '\0'; ! notify_except(Contents(Location(thing)), NOTHING, tbuf1, NA_INTERACTION); ! notify_except(Contents(thing), NOTHING, tbuf1, 0); } if (IsRoom(thing) && is_flag(f, "MONITOR") && !hear && !listener) { tp = tbuf1; safe_format(tbuf1, &tp, T("%s is now listening."), Name(thing)); *tp = '\0'; ! notify_except(Contents(thing), NOTHING, tbuf1, 0); } /* notify for audible exits */ if (is_flag(f, "AUDIBLE")) { *************** *** 1269,1285 **** safe_format(tbuf1, &tp, T("Exit %s is now broadcasting."), Name(thing)); *tp = '\0'; ! notify_except(Contents(Source(thing)), NOTHING, tbuf1); } break; case TYPE_ROOM: notify_except(Contents(thing), NOTHING, ! T("Audible exits in this room have been activated.")); break; case TYPE_PLAYER: case TYPE_THING: notify_except(Contents(thing), thing, ! T("This room is now broadcasting.")); notify(thing, T("Your contents can now be heard from outside.")); break; } --- 1270,1286 ---- safe_format(tbuf1, &tp, T("Exit %s is now broadcasting."), Name(thing)); *tp = '\0'; ! notify_except(Contents(Source(thing)), NOTHING, tbuf1, 0); } break; case TYPE_ROOM: notify_except(Contents(thing), NOTHING, ! T("Audible exits in this room have been activated."), 0); break; case TYPE_PLAYER: case TYPE_THING: notify_except(Contents(thing), thing, ! T("This room is now broadcasting."), 0); notify(thing, T("Your contents can now be heard from outside.")); break; } *** 1_7_7.309/src/extchat.c Tue, 18 Mar 2003 15:28:37 -0600 dunemush (pennmush/c/23_extchat.c 1.1.1.1.1.1.1.1.1.2.1.1.1.3.1.1.1.5.1.1.1.1.1.5.1.2.1.3.1.3.1.1.1.4.1.2.1.6.1.2.1.1.2.4.2.9.1.2.1.2.1.3.1.2.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.2.1.1.2.1.1.2.1.1.1.1.1.22 660) --- 1_7_7.365(w)/src/extchat.c Wed, 09 Apr 2003 14:19:25 -0500 dunemush (pennmush/c/23_extchat.c 1.1.1.1.1.1.1.1.1.2.1.1.1.3.1.1.1.5.1.1.1.1.1.5.1.2.1.3.1.3.1.1.1.4.1.2.1.6.1.2.1.1.2.4.2.9.1.2.1.2.1.3.1.2.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.2.1.1.2.1.1.2.1.1.1.1.1.24 660) *************** *** 81,87 **** static void channel_reallocate_buffer(CHAN *c, int lines); static void channel_free_buffer(CHAN *c); static void channel_push_buffer(CHAN *c, char *tbuf1); ! static void channel_shift_buffer(CHAN *c); static int channel_buffer_lines(CHAN *c); const char *chan_speak_lock = "ChanSpeakLock"; --- 81,87 ---- static void channel_reallocate_buffer(CHAN *c, int lines); static void channel_free_buffer(CHAN *c); static void channel_push_buffer(CHAN *c, char *tbuf1); ! static void channel_shift_buffer(CHAN *c, int space_needed); static int channel_buffer_lines(CHAN *c); const char *chan_speak_lock = "ChanSpeakLock"; *************** *** 2781,2790 **** int room = len + sizeof(len) + sizeof(time_t) + 1; if (!ChanBuffer(c)) return; ! if (ChanBufferEnd(c) > ChanBuffer(c)) { ! while ((ChanBufferSize(c) - (ChanBufferEnd(c) - ChanBuffer(c))) < room) ! channel_shift_buffer(c); ! } memcpy(ChanBufferEnd(c), &len, sizeof(len)); ChanBufferEnd(c) += sizeof(len); memcpy(ChanBufferEnd(c), &mudtime, sizeof(time_t)); --- 2781,2789 ---- int room = len + sizeof(len) + sizeof(time_t) + 1; if (!ChanBuffer(c)) return; ! if ((ChanBufferEnd(c) > ChanBuffer(c)) && ! ((ChanBufferSize(c) - (ChanBufferEnd(c) - ChanBuffer(c))) < room)) ! channel_shift_buffer(c, room); memcpy(ChanBufferEnd(c), &len, sizeof(len)); ChanBufferEnd(c) += sizeof(len); memcpy(ChanBufferEnd(c), &mudtime, sizeof(time_t)); *************** *** 2795,2814 **** } static void ! channel_shift_buffer(CHAN *c) { char *p = ChanBuffer(c); ! int size; ! if (!*p) ! return; /* Shouldn't happen */ ! /* First 4 bytes is the size of the first string, not including \0 */ ! memcpy(&size, p, sizeof(size)); ! /* Jump to the start of the next string */ ! p += size + sizeof(size) + sizeof(time_t) + 1; ! /* Shift everything here and after up to the front */ ! memmove(ChanBuffer(c), p, ChanBufferEnd(c) - p); ! ChanBufferEnd(c) -= (p - ChanBuffer(c)); ! ChanNumBuffered(c)--; } /* Size of buffer in lines */ --- 2794,2821 ---- } static void ! channel_shift_buffer(CHAN *c, int space_needed) { char *p = ChanBuffer(c); ! int size, jump; ! int skipped = 0; ! ! while (*p && space_needed > 0) { ! /* First 4 bytes is the size of the first string, not including \0 */ ! memcpy(&size, p, sizeof(size)); ! /* Jump to the start of the next string */ ! jump = size + sizeof(size) + sizeof(time_t) + 1; ! p += jump; ! space_needed -= jump; ! skipped++; ! } ! ! if (*p) { ! /* Shift everything here and after up to the front */ ! memmove(ChanBuffer(c), p, ChanBufferEnd(c) - p); ! ChanBufferEnd(c) -= (p - ChanBuffer(c)); ! ChanNumBuffered(c) -= skipped; ! } } /* Size of buffer in lines */ *************** *** 2851,2858 **** return; if (ChanBufferSize(c) > bytes) { /* Shrinking the buffer */ ! while ((ChanBufferEnd(c) - ChanBuffer(c)) >= bytes) ! channel_shift_buffer(c); } ChanBuffer(c) = (char *) realloc(ChanBuffer(c), bytes); ChanBufferSize(c) = bytes; --- 2858,2865 ---- return; if (ChanBufferSize(c) > bytes) { /* Shrinking the buffer */ ! if ((ChanBufferEnd(c) - ChanBuffer(c)) >= bytes) ! channel_shift_buffer(c, ChanBufferEnd(c) - ChanBuffer(c) - bytes); } ChanBuffer(c) = (char *) realloc(ChanBuffer(c), bytes); ChanBufferSize(c) = bytes; *** 1_7_7.309/src/destroy.c Wed, 05 Mar 2003 16:05:56 -0600 dunemush (pennmush/c/24_destroy.c 1.24.2.2.1.3.1.1.1.1.1.1.1.4.1.15 660) --- 1_7_7.365(w)/src/destroy.c Wed, 09 Apr 2003 14:19:25 -0500 dunemush (pennmush/c/24_destroy.c 1.24.2.2.1.3.1.1.1.1.1.1.1.4.1.16 660) *************** *** 343,349 **** case TYPE_ROOM: /* wait until dbck */ notify_except(Contents(thing), NOTHING, ! T("The room shakes and begins to crumble.")); if (Owns(player, thing)) notify_format(player, T("You will be rewarded shortly for %s."), --- 343,349 ---- case TYPE_ROOM: /* wait until dbck */ notify_except(Contents(thing), NOTHING, ! T("The room shakes and begins to crumble."), 0); if (Owns(player, thing)) notify_format(player, T("You will be rewarded shortly for %s."), *************** *** 749,755 **** dbref target; notify_except(Contents(thing), NOTHING, T ! ("The floor disappears under your feet, you fall through NOTHINGness and then:")); first = Contents(thing); Contents(thing) = NOTHING; /* send all objects to nowhere */ --- 749,756 ---- dbref target; notify_except(Contents(thing), NOTHING, T ! ("The floor disappears under your feet, you fall through NOTHINGness and then:"), ! 0); first = Contents(thing); Contents(thing) = NOTHING; /* send all objects to nowhere */ *** 1_7_7.309/src/conf.c Wed, 12 Mar 2003 12:31:02 -0600 dunemush (pennmush/c/31_conf.c 1.41.2.3.1.3.1.2.1.15.1.1.1.1.1.2 660) --- 1_7_7.365(w)/src/conf.c Wed, 09 Apr 2003 14:19:25 -0500 dunemush (pennmush/c/31_conf.c 1.41.2.3.1.3.1.2.1.15.1.1.1.1.1.3 660) *************** *** 668,673 **** --- 668,676 ---- CONF *cp; char *p; + if (!val) + return 0; /* NULL val is no good, but "" is ok */ + /* Was this "restrict_command "? If so, do it */ if (!strcasecmp(opt, "restrict_command")) { if (!restrictions) *************** *** 1311,1320 **** safe_str(T("#-1 NO SUCH OPTION"), buff, bp); return; } - if (!args[1] || !*args[1]) { - safe_str(T("#-1 NO VALUE GIVEN"), buff, bp); - return; - } if (!config_set(args[0], args[1], 1, 0) && !config_set(args[0], args[1], 1, 1)) { safe_str(T("#-1 UNABLE TO SET OPTION"), buff, bp); --- 1314,1319 ---- *** 1_7_7.309/src/command.c Sun, 16 Mar 2003 15:51:04 -0600 dunemush (pennmush/c/36_command.c 1.56.1.1.1.1.1.1.1.2.1.1.1.1.1.5.1.2.1.1.1.1.1.2.1.3.1.10.1.1.2.4.2.15 660) --- 1_7_7.365(w)/src/command.c Wed, 09 Apr 2003 14:19:24 -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.3 660) *************** *** 728,733 **** --- 728,735 ---- f++; i++; t++; + if (i == MAX_ARG) + done = 1; } if (split && (*f == '=')) { rhs_present = 1; *** 1_7_7.309/src/cmds.c Mon, 24 Mar 2003 12:05:49 -0600 dunemush (pennmush/c/37_cmds.c 1.33.1.1.1.2.1.2.2.3.1.1.1.2.1.1.1.3.1.8.1.1.2.2.2.10 660) --- 1_7_7.365(w)/src/cmds.c Wed, 09 Apr 2003 14:19:24 -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.11 660) *************** *** 145,154 **** notify(player, T("What did you want to set?")); return; } - if (!arg_right || !*arg_right) { - notify(player, T("What did you want to set that to?")); - return; - } if (!config_set(arg_left, arg_right, 1, 0) && !config_set(arg_left, arg_right, 1, 1)) notify(player, T("Couldn't set that option")); --- 145,150 ---- *** 1_7_7.309/src/bsd.c Tue, 18 Mar 2003 16:19:42 -0600 dunemush (pennmush/c/38_bsd.c 1.58.1.11.1.2.1.5.1.7.1.14.1.13.1.9.1.4.1.2.1.12.1.1.1.1.1.2.1.1.1.13.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.8.2.1.1.1.1.1.1.1.1.2.1.1.1.1.1.1.1.10 660) --- 1_7_7.365(w)/src/bsd.c Wed, 09 Apr 2003 14:19:24 -0500 dunemush (pennmush/c/38_bsd.c 1.58.1.11.1.2.1.5.1.7.1.14.1.13.1.9.1.4.1.2.1.12.1.1.1.1.1.2.1.1.1.13.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.8.2.1.1.1.1.1.1.1.1.2.1.1.1.1.1.1.1.13 660) *************** *** 1225,1233 **** safe_str(hi ? hi->hostname : "", tbuf1, &bp); *bp = '\0'; if (Forbidden_Site(tbuf1) || Forbidden_Site(tbuf2)) { ! do_log(LT_CONN, 0, 0, "[%d/%s/%s] %s (%s %s)", ! newsock, tbuf1, tbuf2, T("Refused connection"), T("remote port"), ! hi ? hi->port : T("(unknown)")); shutdown(newsock, 2); closesocket(newsock); #ifndef WIN32 --- 1225,1236 ---- safe_str(hi ? hi->hostname : "", tbuf1, &bp); *bp = '\0'; if (Forbidden_Site(tbuf1) || Forbidden_Site(tbuf2)) { ! if (!Deny_Silent_Site(tbuf1, AMBIGUOUS) ! || !Deny_Silent_Site(tbuf2, AMBIGUOUS)) { ! do_log(LT_CONN, 0, 0, "[%d/%s/%s] %s (%s %s)", newsock, tbuf1, tbuf2, ! T("Refused connection"), T("remote port"), ! hi ? hi->port : T("(unknown)")); ! } shutdown(newsock, 2); closesocket(newsock); #ifndef WIN32 *************** *** 1852,1860 **** if (getnameinfo(&raddr.addr, rlen, NULL, 0, port, sizeof port, NI_NUMERICHOST | NI_NUMERICSERV) != 0) perror("getting remote port number"); ! else ! do_log(LT_CONN, 0, 0, T("[%d/%s] Refused connection (remote port %s)"), ! fd, buf, port); shutdown(fd, 2); closesocket(fd); FD_CLR(fd, &info_pending); --- 1855,1866 ---- if (getnameinfo(&raddr.addr, rlen, NULL, 0, port, sizeof port, NI_NUMERICHOST | NI_NUMERICSERV) != 0) perror("getting remote port number"); ! else { ! if (!Deny_Silent_Site(buf, AMBIGUOUS)) { ! do_log(LT_CONN, 0, 0, T("[%d/%s] Refused connection (remote port %s)"), ! fd, buf, port); ! } ! } shutdown(fd, 2); closesocket(fd); FD_CLR(fd, &info_pending); *************** *** 1978,1985 **** /* Oops, just deal with buf */ } if (Forbidden_Site(buf) || (bp && Forbidden_Site(bp))) { ! do_log(LT_CONN, 0, 0, T("[%d/%s/%s] Refused connection."), fd, ! bp ? bp : "", buf); shutdown(fd, 2); closesocket(fd); return; --- 1984,1993 ---- /* Oops, just deal with buf */ } if (Forbidden_Site(buf) || (bp && Forbidden_Site(bp))) { ! if (!Deny_Silent_Site(buf, AMBIGUOUS) || !Deny_Silent_Site(bp, AMBIGUOUS)) { ! do_log(LT_CONN, 0, 0, T("[%d/%s/%s] Refused connection."), fd, ! bp ? bp : "", buf); ! } shutdown(fd, 2); closesocket(fd); return; *************** *** 2504,2526 **** if (!options.login_allow || !under_limit || (Guest(player) && !options.guest_allow)) { if (!options.login_allow) { - fcache_dump(d, fcache.down_fcache, (unsigned char *) asterisk_line); if (cf_downmotd_msg && *cf_downmotd_msg) raw_notify(player, cf_downmotd_msg); } else if (MAX_LOGINS && !under_limit) { - fcache_dump(d, fcache.full_fcache, (unsigned char *) asterisk_line); if (cf_fullmotd_msg && *cf_fullmotd_msg) raw_notify(player, cf_fullmotd_msg); } if (!Can_Login(player)) { - raw_notify(player, asterisk_line); /* when the connection has been refused, we want to update the * LASTFAILED info on the player */ check_lastfailed(player, d->addr); return 0; ! } else ! raw_notify(player, asterisk_line); } #ifdef USE_MAILER d->mailp = find_exact_starting_point(player); --- 2512,2530 ---- if (!options.login_allow || !under_limit || (Guest(player) && !options.guest_allow)) { if (!options.login_allow) { if (cf_downmotd_msg && *cf_downmotd_msg) raw_notify(player, cf_downmotd_msg); } else if (MAX_LOGINS && !under_limit) { if (cf_fullmotd_msg && *cf_fullmotd_msg) raw_notify(player, cf_fullmotd_msg); } if (!Can_Login(player)) { /* when the connection has been refused, we want to update the * LASTFAILED info on the player */ check_lastfailed(player, d->addr); return 0; ! } } #ifdef USE_MAILER d->mailp = find_exact_starting_point(player); *************** *** 3342,3363 **** orator = player; if (cf_motd_msg && *cf_motd_msg) { - raw_notify(player, asterisk_line); raw_notify(player, cf_motd_msg); } raw_notify(player, " "); if (Hasprivs(player) && cf_wizmotd_msg && *cf_wizmotd_msg) { ! if (!cf_motd_msg || !*cf_motd_msg) raw_notify(player, asterisk_line); raw_notify(player, cf_wizmotd_msg); } - raw_notify(player, asterisk_line); ! notify_except(Contents(player), player, tbuf1); /* added to allow player's inventory to hear a player connect */ if (!Dark(player)) ! notify_except(Contents(loc), player, tbuf1); /* clear the environment for possible actions */ for (j = 0; j < 10; j++) --- 3346,3365 ---- orator = player; if (cf_motd_msg && *cf_motd_msg) { raw_notify(player, cf_motd_msg); } raw_notify(player, " "); if (Hasprivs(player) && cf_wizmotd_msg && *cf_wizmotd_msg) { ! if (cf_motd_msg && *cf_motd_msg) raw_notify(player, asterisk_line); raw_notify(player, cf_wizmotd_msg); } ! notify_except(Contents(player), player, tbuf1, 0); /* added to allow player's inventory to hear a player connect */ if (!Dark(player)) ! notify_except(Contents(loc), player, tbuf1, NA_INTERACTION); /* clear the environment for possible actions */ for (j = 0; j < 10; j++) *************** *** 3426,3434 **** sprintf(tbuf1, T("%s has disconnected."), Name(player)); if (!Dark(player)) ! notify_except(Contents(loc), player, tbuf1); /* notify contents */ ! notify_except(Contents(player), player, tbuf1); /* clear the environment for possible actions */ for (j = 0; j < 10; j++) --- 3428,3436 ---- sprintf(tbuf1, T("%s has disconnected."), Name(player)); if (!Dark(player)) ! notify_except(Contents(loc), player, tbuf1, NA_INTERACTION); /* notify contents */ ! notify_except(Contents(player), player, tbuf1, 0); /* clear the environment for possible actions */ for (j = 0; j < 10; j++) *************** *** 3470,3478 **** sprintf(tbuf1, T("%s has partially disconnected."), Name(player)); if (!Dark(player)) ! notify_except(Contents(loc), player, tbuf1); /* notify contents */ ! notify_except(Contents(player), player, tbuf1); } #ifdef CHAT_SYSTEM --- 3472,3480 ---- sprintf(tbuf1, T("%s has partially disconnected."), Name(player)); if (!Dark(player)) ! notify_except(Contents(loc), player, tbuf1, NA_INTERACTION); /* notify contents */ ! notify_except(Contents(player), player, tbuf1, 0); } #ifdef CHAT_SYSTEM *************** *** 4304,4312 **** safe_str(hi ? hi->hostname : "", tbuf1, &bp); *bp = '\0'; if (Forbidden_Site(tbuf1) || Forbidden_Site(tbuf2)) { ! do_log(LT_CONN, 0, 0, ! T("[%d/%s] Refused connection (remote port %s)"), ! socketClient, tbuf1, hi->port); shutdown(socketClient, 2); closesocket(socketClient); continue; --- 4306,4316 ---- safe_str(hi ? hi->hostname : "", tbuf1, &bp); *bp = '\0'; if (Forbidden_Site(tbuf1) || Forbidden_Site(tbuf2)) { ! if (!Deny_Silent_Site(tbuf1, AMBIGUOUS) ! || !Deny_Silent_Site(tbuf2, AMBIGUOUS)) { ! do_log(LT_CONN, 0, 0, T("[%d/%s] Refused connection (remote port %s)"), ! socketClient, tbuf1, hi->port); ! } shutdown(socketClient, 2); closesocket(socketClient); continue; *** 1_7_7.309/src/attrib.c Sun, 09 Feb 2003 14:41:06 -0600 dunemush (pennmush/c/40_attrib.c 1.15.1.2.1.5.1.1.1.3.1.3.1.2.1.2.1.2.2.1.1.2.1.2.1.2.1.1.1.3.1.1.1.1.1.1.3.6 660) --- 1_7_7.365(w)/src/attrib.c Wed, 09 Apr 2003 14:19:24 -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.7 660) *************** *** 879,889 **** if (!s && !was_listener && !Hearer(thing)) { notify_except(contents, thing, tprintf(T("%s loses its ears and becomes deaf."), ! Name(thing))); } else if (s && !was_hearer && !was_listener) { notify_except(contents, thing, tprintf(T("%s grows ears and can now hear."), ! Name(thing))); } } } --- 879,889 ---- if (!s && !was_listener && !Hearer(thing)) { notify_except(contents, thing, tprintf(T("%s loses its ears and becomes deaf."), ! Name(thing)), NA_INTERACTION); } else if (s && !was_hearer && !was_listener) { notify_except(contents, thing, tprintf(T("%s grows ears and can now hear."), ! Name(thing)), NA_INTERACTION); } } } *** 1_7_7.309/src/Makefile Tue, 18 Mar 2003 16:19:42 -0600 dunemush (pennmush/c/44_Makefile 1.21.1.13.1.3 700) --- 1_7_7.365(w)/src/Makefile Mon, 31 Mar 2003 23:08:40 -0600 dunemush (pennmush/c/44_Makefile 1.21.1.13.1.6 700) *************** *** 236,243 **** -T COMSORTSTRUC -T CHANUSER -T Signal_t -T Sigfunc -T univptr_t \ -T __ptr_t -T __malloc_size_t -T HASHENT -T HASHTAB -T COMMAND_INFO \ -T CHANLIST -T Malloc_t -T Free_t -T MATH -T socklen_t \ ! -T StrNode -T IDENT -T Size_t -T Port_t -T help_file \ ! $$file ; done) clean: -rm -f *.o --- 236,243 ---- -T COMSORTSTRUC -T CHANUSER -T Signal_t -T Sigfunc -T univptr_t \ -T __ptr_t -T __malloc_size_t -T HASHENT -T HASHTAB -T COMMAND_INFO \ -T CHANLIST -T Malloc_t -T Free_t -T MATH -T socklen_t \ ! -T StrNode -T IDENT -T Size_t -T Port_t -T help_file -T PTAB \ ! -T SHS_INFO -T ansi_string $$file ; done) clean: -rm -f *.o *** 1_7_7.309/hdrs/version.h Mon, 24 Mar 2003 12:05:49 -0600 dunemush (pennmush/c/47_version.h 1.32.1.2.1.7.1.9.1.1.1.17.1.16 660) --- 1_7_7.365(w)/hdrs/version.h Wed, 09 Apr 2003 14:19:28 -0500 dunemush (pennmush/c/47_version.h 1.32.1.2.1.7.1.9.1.1.1.17.1.16 660) *************** *** 1,3 **** ! #define VERSION "PennMUSH version 1.7.7 patchlevel 12 [03/21/2003]" ! #define SHORTVN "PennMUSH 1.7.7p12" ! #define NUMVERSION 001007007012 --- 1,3 ---- ! #define VERSION "PennMUSH version 1.7.7 patchlevel 13 [04/09/2003]" ! #define SHORTVN "PennMUSH 1.7.7p13" ! #define NUMVERSION 001007007013 *** 1_7_7.309/hdrs/shs.h Thu, 30 Jan 2003 13:16:01 -0600 dunemush (pennmush/c/48_shs.h 1.4 660) --- 1_7_7.365(w)/hdrs/shs.h Wed, 09 Apr 2003 14:19:28 -0500 dunemush (pennmush/c/48_shs.h 1.5 660) *************** *** 22,28 **** BYTE reverse_wanted; /**< true to reverse (little_endian) false to not */ } SHS_INFO; ! void shsInit(SHS_INFO * shsInfo); ! void shsUpdate(SHS_INFO * shsInfo, const BYTE * buffer, int count); ! void shsFinal(SHS_INFO * shsInfo); #endif --- 22,28 ---- BYTE reverse_wanted; /**< true to reverse (little_endian) false to not */ } SHS_INFO; ! void shsInit(SHS_INFO *shsInfo); ! void shsUpdate(SHS_INFO *shsInfo, const BYTE * buffer, int count); ! void shsFinal(SHS_INFO *shsInfo); #endif *** 1_7_7.309/hdrs/parse.h Fri, 03 Jan 2003 19:29:59 -0600 dunemush (pennmush/c/51_parse.h 1.10.1.8 660) --- 1_7_7.365(w)/hdrs/parse.h Wed, 09 Apr 2003 14:19:28 -0500 dunemush (pennmush/c/51_parse.h 1.10.1.10 660) *************** *** 41,47 **** */ extern int parse_boolean(char const *str); ! extern dbref parse_dbref(const char *s); #define parse_integer(str) strtol(str, NULL, 10) #define parse_uinteger(str) strtoul(str, NULL, 10) --- 41,47 ---- */ extern int parse_boolean(char const *str); ! extern dbref parse_dbref(char const *str); #define parse_integer(str) strtol(str, NULL, 10) #define parse_uinteger(str) strtoul(str, NULL, 10) *** 1_7_7.309/hdrs/externs.h Sun, 16 Feb 2003 22:15:00 -0600 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.10 660) --- 1_7_7.365(w)/hdrs/externs.h Wed, 09 Apr 2003 14:19:27 -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.2 660) *************** *** 87,93 **** #define NA_PUPPET 0x0040 /* Ok to puppet */ #define NA_PUPPET2 0x0080 /* Message to a player from a puppet */ #define NA_MUST_PUPPET 0x0100 /* Ok to puppet even in same room */ ! typedef dbref (*na_lookup) (dbref, void *); extern void notify_anything(dbref speaker, na_lookup func, --- 87,94 ---- #define NA_PUPPET 0x0040 /* Ok to puppet */ #define NA_PUPPET2 0x0080 /* Message to a player from a puppet */ #define NA_MUST_PUPPET 0x0100 /* Ok to puppet even in same room */ ! #define NA_INTERACTION 0x0200 /* Message follows interaction rules */ ! #define NA_INTER_DIDIT 0x0400 /* Message is from @verb or ilk */ typedef dbref (*na_lookup) (dbref, void *); extern void notify_anything(dbref speaker, na_lookup func, *************** *** 260,268 **** /* From speech.c */ extern char *ns_esnotify(dbref speaker, na_lookup func, void *fdata, int para); ! extern void notify_except(dbref first, dbref exception, const char *msg); ! extern void notify_except2 ! (dbref first, dbref exc1, dbref exc2, const char *msg); /* Return thing/PREFIX + msg */ extern void make_prefixstr(dbref thing, const char *msg, char *tbuf1); extern int filter_found(dbref thing, const char *msg, int flag); --- 261,270 ---- /* From speech.c */ extern char *ns_esnotify(dbref speaker, na_lookup func, void *fdata, int para); ! extern void notify_except(dbref first, dbref exception, const char *msg, ! int flags); ! extern void notify_except2(dbref first, dbref exc1, dbref exc2, ! const char *msg); /* Return thing/PREFIX + msg */ extern void make_prefixstr(dbref thing, const char *msg, char *tbuf1); extern int filter_found(dbref thing, const char *msg, int flag); *************** *** 305,313 **** extern ansi_string *parse_ansi_string(const char *src) __attribute_malloc__; ! extern void free_ansi_string(ansi_string * as); ! extern void populate_codes(ansi_string * as); ! extern void depopulate_codes(ansi_string * as); #ifdef WIN32 #define strncoll(s1,s2,n) _strncoll((s1), (s2), (n)) #define strcasecoll(s1,s2) _stricoll((s1), (s2)) --- 307,315 ---- extern ansi_string *parse_ansi_string(const char *src) __attribute_malloc__; ! extern void free_ansi_string(ansi_string *as); ! extern void populate_codes(ansi_string *as); ! extern void depopulate_codes(ansi_string *as); #ifdef WIN32 #define strncoll(s1,s2,n) _strncoll((s1), (s2), (n)) #define strcasecoll(s1,s2) _stricoll((s1), (s2)) *************** *** 348,354 **** safe_chr((x) ? '1' : '0', (buf), (bufp)) /* Append X characters to the end of a string, taking ansi and html codes into account. */ ! extern int safe_ansi_string(ansi_string * as, size_t start, size_t len, char *buff, char **bp); /* Append N copies of the character X to the end of a string */ extern int safe_fill(char x, size_t n, char *buff, char **bp); --- 350,356 ---- safe_chr((x) ? '1' : '0', (buf), (bufp)) /* Append X characters to the end of a string, taking ansi and html codes into account. */ ! extern int safe_ansi_string(ansi_string *as, size_t start, size_t len, char *buff, char **bp); /* Append N copies of the character X to the end of a string */ extern int safe_fill(char x, size_t n, char *buff, char **bp); *************** *** 366,372 **** extern const char *standard_tokens[2]; /* ## and #@ */ extern char *trim_space_sep(char *str, char sep); extern int do_wordcount(char *str, char sep); - extern int minmatch(const char *str, const char *target, int min); extern char *remove_word(char *list, char *word, char sep); extern char *next_in_list(const char **head); extern void safe_itemizer(int cur_num, int done, const char *delim, --- 368,373 ---- *************** *** 406,411 **** --- 407,414 ---- extern long get_random_long(long low, long high); extern char *shortname(dbref it); extern dbref absolute_room(dbref it); + int can_interact(dbref from, dbref to, int type); + /* From warnings.c */ extern void run_topology(void); *************** *** 482,487 **** --- 485,492 ---- void local_data_create(dbref object); void local_data_clone(dbref clone, dbref source); void local_data_free(dbref object); + int local_can_interact_first(dbref from, dbref to, int type); + int local_can_interact_last(dbref from, dbref to, int type); /* flaglocal.c */ void local_flags(void); *** 1_7_7.309/Makefile.SH Sun, 23 Feb 2003 11:04:26 -0600 dunemush (pennmush/d/30_Makefile.S 1.14.1.1.1.7.1.2 700) --- 1_7_7.365(w)/Makefile.SH Wed, 26 Mar 2003 09:47:07 -0600 dunemush (pennmush/d/30_Makefile.S 1.14.1.1.1.7.1.1.1.2 700) *************** *** 73,88 **** @echo "You must cp options.h.dist to options.h and edit it." exit 1 ! hdrs/cmds.h: src/cmds.c src/command.c src/cque.c src/help.c src/set.c (cd utils; sh mkcmds.sh commands) ! hdrs/switches.h: src/SWITCHES (cd utils; sh mkcmds.sh switches) #src/switchinc.c: hdrs/switches.h # (cd utils; sh mkcmds.sh switches) ! hdrs/funs.h: src/fun*.c src/bsd.c src/conf.c src/extmail.c src/help.c src/wiz.c (cd utils; sh mkcmds.sh functions) hdrs/patches.h: patches/* --- 73,88 ---- @echo "You must cp options.h.dist to options.h and edit it." exit 1 ! hdrs/cmds.h: src/cmds.c src/command.c src/cque.c src/help.c src/set.c Patchlevel (cd utils; sh mkcmds.sh commands) ! hdrs/switches.h: src/SWITCHES Patchlevel (cd utils; sh mkcmds.sh switches) #src/switchinc.c: hdrs/switches.h # (cd utils; sh mkcmds.sh switches) ! hdrs/funs.h: src/fun*.c src/bsd.c src/conf.c src/extmail.c src/help.c src/wiz.c Patchlevel (cd utils; sh mkcmds.sh functions) hdrs/patches.h: patches/* *** 1_7_7.309/Configure Sat, 22 Feb 2003 15:29:30 -0600 dunemush (pennmush/d/32_Configure 1.21.1.4.1.1.1.1.1.1.1.11 710) --- 1_7_7.365(w)/Configure Tue, 08 Apr 2003 22:03:04 -0500 dunemush (pennmush/d/32_Configure 1.21.1.4.1.1.1.1.1.1.1.7.1.2 710) *************** *** 343,348 **** --- 343,349 ---- d_timelocal='' d_toupper='' d_uptime='' + d_urandom='' d_uwait3='' d_uwait='' d_voidsig='' *************** *** 5176,5181 **** --- 5177,5191 ---- 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 *************** *** 6825,6830 **** --- 6835,6841 ---- d_timelocal='$d_timelocal' d_toupper='$d_toupper' d_uptime='$d_uptime' + d_urandom='$d_urandom' d_usgnames='$d_usgnames' d_uwait3='$d_uwait3' d_uwait='$d_uwait' *** 1_7_7.309/options.h.dist Sun, 22 Dec 2002 01:05:36 -0600 dunemush (pennmush/d/33_options.h. 1.10.1.1.1.1.1.2.1.1.1.1.1.1.1.3.1.6.1.2.2.3 600) --- 1_7_7.365(w)/options.h.dist Wed, 26 Mar 2003 14:46:26 -0600 dunemush (pennmush/d/33_options.h. 1.10.1.1.1.1.1.2.1.1.1.1.1.1.1.3.1.6.1.2.2.3.1.1 600) *************** *** 204,215 **** */ /* #define ONLINE_REG /* */ ! /* If defined, adds support for the ON_VACATION flag, which a player * can set to indicate that they're going to be away from the MUSH * for vacation (and which a wizard can test for when doing player purges, ! * or which can aid other players, etc). This flag is automatically ! * cleared when a player logs in, so it should be set just before the ! * player leaves for vacation */ /* #define VACATION_FLAG /* */ --- 204,213 ---- */ /* #define ONLINE_REG /* */ ! /* If defined, adds support for the ON-VACATION flag, which a player * can set to indicate that they're going to be away from the MUSH * for vacation (and which a wizard can test for when doing player purges, ! * or which can aid other players, etc). */ /* #define VACATION_FLAG /* */ *** 1_7_7.309/src/strtree.c Sun, 01 Dec 2002 21:14:41 -0600 dunemush (pennmush/d/35_strtree.c 1.14.1.6 660) --- 1_7_7.365(w)/src/strtree.c Wed, 09 Apr 2003 14:19:27 -0500 dunemush (pennmush/d/35_strtree.c 1.14.1.8 660) *************** *** 1,4 **** ! /* This is a string table implemented as a red-black tree. * * There are a couple of peculiarities about this implementation: * --- 1,9 ---- ! /** ! * \file strtree.c ! * ! * \brief String tables for PennMUSH. ! * ! * This is a string table implemented as a red-black tree. * * There are a couple of peculiarities about this implementation: * *************** *** 22,29 **** * (5) The strings are stored in the table _unaligned_. If * you try to use this for anything other than strings, * expect alignment problems. ! */ ! /* This string table is _NOT_ reentrant. If you try to use this * in a multithreaded environment, you will probably get burned. */ --- 27,34 ---- * (5) The strings are stored in the table _unaligned_. If * you try to use this for anything other than strings, * expect alignment problems. ! * ! * This string table is _NOT_ reentrant. If you try to use this * in a multithreaded environment, you will probably get burned. */ *************** *** 75,83 **** void st_stats(dbref player, StrTree *root, const char *name); static void delete_node(StrNode *node); void ! st_init(root) ! StrTree *root; { assert(root); root->root = NULL; --- 80,90 ---- void st_stats(dbref player, StrTree *root, const char *name); static void delete_node(StrNode *node); + /** Initialize a string tree. + * \param root pointer to root of string tree. + */ void ! st_init(StrTree *root) { assert(root); root->root = NULL; *************** *** 86,93 **** } static void ! delete_node(node) ! StrNode *node; { if (node->left) delete_node(node->left); --- 93,99 ---- } static void ! delete_node(StrNode *node) { if (node->left) delete_node(node->left); *************** *** 97,105 **** } void ! st_flush(root) ! StrTree *root; { if (!root->root) return; --- 103,113 ---- } + /** Clear a string tree. + * \param root pointer to root of string tree. + */ void ! st_flush(StrTree *root) { if (!root->root) return; *************** *** 109,128 **** root->mem = 0; } void ! st_stats_header(player) ! dbref player; { notify(player, "Tree Entries Leaves MinDep Max Avg PermEnt AvgTmpC ~Memory"); } ! /* Statistics about the tree */ void ! st_stats(player, root, name) ! dbref player; ! StrTree *root; ! const char *name; { unsigned long bytes; int maxdepth = 0, mindepth = 0, avgdepth = 0, leaves = 0; --- 117,139 ---- root->mem = 0; } + /** Header for string tree stats. + * \param player player to notify with header. + */ void ! st_stats_header(dbref player) { notify(player, "Tree Entries Leaves MinDep Max Avg PermEnt AvgTmpC ~Memory"); } ! /** Statistics about the tree. ! * \param player player to notify with header. ! * \param root pointer to root of string tree. ! * \param name name of string tree, for row header. ! */ void ! st_stats(dbref player, StrTree *root, const char *name) { unsigned long bytes; int maxdepth = 0, mindepth = 0, avgdepth = 0, leaves = 0; *************** *** 141,149 **** * while modifying depth. */ static void ! st_left_rotate(tree_depth, root) ! int tree_depth; ! StrNode **root; { StrNode *x; StrNode *y; --- 152,158 ---- * while modifying depth. */ static void ! st_left_rotate(int tree_depth, StrNode **root) { StrNode *x; StrNode *y; *************** *** 163,171 **** } static void ! st_right_rotate(tree_depth, root) ! int tree_depth; ! StrNode **root; { StrNode *y; StrNode *x; --- 172,178 ---- } static void ! st_right_rotate(int tree_depth, StrNode **root) { StrNode *y; StrNode *x; *************** *** 184,199 **** path[tree_depth - 1]->left = x; } ! /* Tree insert. If the string is already in the tree, bump its usage * count and return the tree's version. Otherwise, allocate a new tree * node, copy the string into the node, insert it into the tree, and * return the new node's string. */ - char const * ! st_insert(s, root) ! char const *s; ! StrTree *root; { int tree_depth; StrNode *n; --- 191,206 ---- path[tree_depth - 1]->left = x; } ! /** String tree insert. If the string is already in the tree, bump its usage * count and return the tree's version. Otherwise, allocate a new tree * node, copy the string into the node, insert it into the tree, and * return the new node's string. + * \param s string to insert in tree. + * \param root pointer to root of string tree. + * \return string inserted or NULL. */ char const * ! st_insert(char const *s, StrTree *root) { int tree_depth; StrNode *n; *************** *** 310,320 **** return n->string; } ! /* Tree find. Basically the first part of insert. */ char const * ! st_find(s, root) ! char const *s; ! StrTree *root; { int tree_depth; StrNode *n; --- 317,329 ---- return n->string; } ! /** Tree find. Basically the first part of insert. ! * \param s string to find. ! * \param root pointer to root of string tree. ! * \return string if found, or NULL. ! */ char const * ! st_find(char const *s, StrTree *root) { int tree_depth; StrNode *n; *************** *** 340,352 **** return NULL; } ! /* Tree delete. Decrement the usage count of the string, unless the * count is pegged. If count reaches zero, delete. */ void ! st_delete(s, root) ! char const *s; ! StrTree *root; { int tree_depth; StrNode *y; --- 349,361 ---- return NULL; } ! /** Tree delete. Decrement the usage count of the string, unless the * count is pegged. If count reaches zero, delete. + * \param s string to find and delete. + * \param root pointer to root of string tree. */ void ! st_delete(char const *s, StrTree *root) { int tree_depth; StrNode *y; *************** *** 381,393 **** y->info -= ST_USE_STEP; return; } - /* - printf("deleting node: %s\nPath:", s); - for (cmp = 0; cmp < tree_depth; cmp++) - printf(" %s", path[cmp]->string); - printf("\n"); - st_print(); - */ if (y->left && y->right) { /* It has two children. We need to swap with successor. */ int z_depth; --- 390,395 ---- *************** *** 432,444 **** /* We are now looking at a node with less than two children */ assert(!y->left || !y->right); - /* - printf("single child node: %s\nPath:", y->string); - for (cmp = 0; cmp < tree_depth; cmp++) - printf(" %s", path[cmp]->string); - printf("\n"); - st_print(); - */ /* Move the child (if any) up */ if (y->left) x = y->left; --- 434,439 ---- *************** *** 529,538 **** if (x) x->info &= ~ST_RED; } - /* - printf("done:\n"); - st_print(); - */ root->mem -= strlen(s) + 1; mush_free(y, "StrNode"); root->count--; --- 524,529 ---- *************** *** 540,549 **** /* Print the tree, for debugging purposes. */ static void ! st_print_tree(node, tree_depth, lead) ! StrNode *node; ! int tree_depth; ! int lead; { static char leader[ST_MAX_DEPTH * 2 + 1]; char tmp; --- 531,537 ---- /* Print the tree, for debugging purposes. */ static void ! st_print_tree(StrNode *node, int tree_depth, int lead) { static char leader[ST_MAX_DEPTH * 2 + 1]; char tmp; *************** *** 573,581 **** st_print_tree(node->right, tree_depth + 1, '`'); } void ! st_print(root) ! StrTree *root; { printf("---- print\n"); if (root->root) --- 561,571 ---- st_print_tree(node->right, tree_depth + 1, '`'); } + /** Print a string tree (for debugging). + * \param root pointer to root of string tree. + */ void ! st_print(StrTree *root) { printf("---- print\n"); if (root->root) *************** *** 587,598 **** (StrNode *node, int *maxdepth, int *mindepth, int *avgdepth, int *leaves, unsigned long *perms, unsigned long *nperms, int count); static void ! st_depth_helper(node, maxdepth, mindepth, avgdepth, leaves, perms, nperms, ! count) ! StrNode *node; ! int *maxdepth, *mindepth, *avgdepth, *leaves; ! unsigned long *perms, *nperms; ! int count; { if (!node) return; --- 577,585 ---- (StrNode *node, int *maxdepth, int *mindepth, int *avgdepth, int *leaves, unsigned long *perms, unsigned long *nperms, int count); static void ! st_depth_helper(StrNode *node, int *maxdepth, int *mindepth, ! int *avgdepth, int *leaves, unsigned long *perms, ! unsigned long *nperms, int count) { if (!node) return; *************** *** 625,635 **** /* Find the depth and number of permanment nodes */ ! void ! st_traverse_stats(node, maxdepth, mindepth, avgdepth, leaves, perms, nperms) ! StrNode *node; ! int *maxdepth, *mindepth, *avgdepth, *leaves; ! unsigned long *perms, *nperms; { *maxdepth = 0; *mindepth = node ? (ST_MAX_DEPTH + 1) : 0; --- 612,620 ---- /* Find the depth and number of permanment nodes */ ! static void ! st_traverse_stats(StrNode *node, int *maxdepth, int *mindepth, int *avgdepth, ! int *leaves, unsigned long *perms, unsigned long *nperms) { *maxdepth = 0; *mindepth = node ? (ST_MAX_DEPTH + 1) : 0; *** 1_7_7.309/hdrs/mysocket.h Thu, 30 Jan 2003 13:16:01 -0600 dunemush (pennmush/e/51_mysocket.h 1.14 660) --- 1_7_7.365(w)/hdrs/mysocket.h Wed, 09 Apr 2003 14:19:28 -0500 dunemush (pennmush/e/51_mysocket.h 1.17 660) *************** *** 73,78 **** --- 73,82 ---- /* Win32 uses closesocket() to close a socket, and so will we */ #ifndef WIN32 #define closesocket(s) close(s) + #else + extern void shutdownsock(DESC *d); + extern BOOL GetErrorMessage(const DWORD dwError, LPTSTR lpszError, const UINT + nMaxError); #endif *** 1_7_7.309/src/mysocket.c Sun, 08 Dec 2002 22:35:42 -0600 dunemush (pennmush/f/0_mysocket.c 1.16.1.1.1.1.1.1.1.4.1.4.1.6 660) --- 1_7_7.365(w)/src/mysocket.c Wed, 09 Apr 2003 14:19:26 -0500 dunemush (pennmush/f/0_mysocket.c 1.16.1.1.1.1.1.1.1.4.1.4.1.8 660) *************** *** 1,3 **** --- 1,10 ---- + /** + * \file mysocket.c + * + * \brief Socket routines for PennMUSH. + * + * + */ #include "copyrite.h" #include "config.h" *************** *** 97,102 **** --- 104,116 ---- #ifndef INFOSLAVE + /** Given a sockaddr structure, try to look up and return hostname info. + * If we can't get a hostname from DNS (or if we're not using DNS), + * we settle for the IP address. + * \param host pointer to a sockaddr structure. + * \param len length of host structure. + * \return static hostname_info structure with hostname and port. + */ struct hostname_info * hostname_convert(struct sockaddr *host, int len) { *************** *** 113,118 **** --- 127,137 ---- return &hi; } + /** Given a sockaddr structure, try to look up and return ip address info. + * \param host pointer to a sockaddr structure. + * \param len length of host structure. + * \return static hostname_info structure with ip address and port. + */ struct hostname_info * ip_convert(struct sockaddr *host, int len) { *************** *** 130,137 **** } #endif /* INFOSLAVE */ ! /* Open a tcp connection to a given host and port. Basically * tcp_connect from UNPv1 */ int make_socket_conn(const char *host, struct sockaddr *myiterface, --- 149,162 ---- } #endif /* INFOSLAVE */ ! /** Open a tcp connection to a given host and port. Basically * tcp_connect from UNPv1 + * \param host hostname or ip address to connect to, as a string. + * \param myiterface pointer to sockaddr structure for specific interface. + * \param myilen length of myiterface + * \param port port to connect to. + * \param timeout pointer to timeout for connection. + * \return file descriptor for connected socket, or -1 for failure. */ int make_socket_conn(const char *host, struct sockaddr *myiterface, *************** *** 208,215 **** return s; } ! /* Start listening to TCP on a given port. Basically tcp_listen * from UNPv1 */ int make_socket(Port_t port, union sockaddr_u *addr, socklen_t *len, --- 233,245 ---- return s; } ! /** Start listening to TCP on a given port. Basically tcp_listen * from UNPv1 + * \param port port to listen on. + * \param addr pointer to sockaddr to copy address data from. + * \param len length of addr. + * \param host hostname or address to listen on, as a string. + * \return file descriptor of listening socket, or -1 for failure. */ int make_socket(Port_t port, union sockaddr_u *addr, socklen_t *len, *************** *** 293,298 **** --- 323,331 ---- } + /** Make a socket do nonblocking i/o. + * \param s file descriptor of socket. + */ void make_nonblocking(int s) { *************** *** 324,335 **** #endif /* !macintosh */ } ! /* From UNP, with changes. If nsec > 0, we set the socket ! nonblocking and connect with timeout. The socket is STILL ! nonblocking after it returns. If nsec == 0, a normal blocking ! connect is done. ! ! Returns 0 on success, -1 on failure. */ int connect_nonb(int sockfd, const struct sockaddr *saptr, socklen_t salen, int *timeout) --- 357,374 ---- #endif /* !macintosh */ } ! /** Connect a socket, possibly making it nonblocking first. ! * From UNP, with changes. If nsec > 0, we set the socket ! * nonblocking and connect with timeout. The socket is STILL ! * nonblocking after it returns. If nsec == 0, a normal blocking ! * connect is done. ! * \param sockfd file descriptor of socket. ! * \param saptr pointer to sockaddr structure with connection data. ! * \param salen length of saptr. ! * \param timeout pointer to timeout value. If given, nonblocking connect. ! * \retval 0 success. ! * \retval -1 failure. ! */ int connect_nonb(int sockfd, const struct sockaddr *saptr, socklen_t salen, int *timeout) *** 1_7_7.309/win32/pennmush.dsp Tue, 26 Nov 2002 14:28:59 -0600 dunemush (pennmush/f/9_pennmush.d 1.10 660) --- 1_7_7.365(w)/win32/pennmush.dsp Wed, 26 Mar 2003 09:34:22 -0600 dunemush (pennmush/f/9_pennmush.d 1.11 660) *************** *** 42,48 **** # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c ! # ADD CPP /nologo /MT /W3 /GX /O2 /Ob0 /I "./hdrs" /I "./" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe --- 42,48 ---- # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c ! # ADD CPP /nologo /MT /W3 /GX /O2 /Ob0 /I "./hdrs" /I "./" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /I /Win32" " /c # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe *************** *** 50,56 **** # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 ! # ADD LINK32 advapi32.lib wsock32.lib winmm.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "pennmush - Win32 Debug" --- 50,56 ---- # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 ! # ADD LINK32 user32.lib winmm.lib wsock32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "pennmush - Win32 Debug" *************** *** 66,72 **** # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c ! # ADD CPP /nologo /MTd /W3 /GX /ZI /I "./hdrs" /I "./" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # SUBTRACT CPP /Ox /Ot /Os # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" --- 66,72 ---- # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c ! # ADD CPP /nologo /MTd /W3 /GX /ZI /I "./win32" /I "./hdrs" /I "./" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # SUBTRACT CPP /Ox /Ot /Os # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" *************** *** 75,81 **** # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept ! # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib winmm.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ENDIF --- 75,81 ---- # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept ! # ADD LINK32 kernel32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib user32.lib winmm.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ENDIF *************** *** 153,158 **** --- 153,162 ---- # End Source File # Begin Source File + SOURCE=.\src\flaglocal.c + # End Source File + # Begin Source File + SOURCE=.\src\flags.c # End Source File # Begin Source File *************** *** 257,262 **** --- 261,270 ---- # End Source File # Begin Source File + SOURCE=.\src\notify.c + # End Source File + # Begin Source File + SOURCE=.\src\parse.c # End Source File # Begin Source File *************** *** 297,311 **** # End Source File # Begin Source File ! SOURCE=.\src\speech.c # End Source File # Begin Source File ! SOURCE=.\src\shs.c # End Source File # Begin Source File ! SOURCE=.\src\sig.c # End Source File # Begin Source File --- 305,319 ---- # End Source File # Begin Source File ! SOURCE=.\src\shs.c # End Source File # Begin Source File ! SOURCE=.\src\sig.c # End Source File # Begin Source File ! SOURCE=.\src\speech.c # End Source File # Begin Source File *** 1_7_7.309/win32/funs.h Tue, 25 Mar 2003 16:50:17 -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.2 660) --- 1_7_7.365(w)/win32/funs.h Wed, 09 Apr 2003 14:17:12 -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.3 660) *************** *** 316,318 **** --- 316,319 ---- FUNCTION_PROTO(fun_zemit); FUNCTION_PROTO(fun_zfun); FUNCTION_PROTO(fun_zone); + FUNCTION_PROTO(local_fun_silly); *** 1_7_7.309/win32/cmds.h Tue, 25 Mar 2003 16:50:17 -0600 dunemush (pennmush/f/15_cmds.h 1.9.1.4.1.1.1.1.1.1.1.1.2.1.1.1.2.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.9.1.7.2.4.1.2.3.1.1.2 660) --- 1_7_7.365(w)/win32/cmds.h Wed, 09 Apr 2003 14:17:11 -0500 dunemush (pennmush/f/15_cmds.h 1.9.1.4.1.1.1.1.1.1.1.1.2.1.1.1.2.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.9.1.7.2.4.1.2.3.1.1.3 660) *************** *** 62,67 **** --- 62,68 ---- COMMAND_PROTO(cmd_link); COMMAND_PROTO(cmd_list); COMMAND_PROTO(cmd_listmotd); + COMMAND_PROTO(cmd_local_silly); COMMAND_PROTO(cmd_lock); COMMAND_PROTO(cmd_log); COMMAND_PROTO(cmd_logwipe); *** 1_7_7.309/hdrs/mushtype.h Sun, 02 Feb 2003 10:43:44 -0600 dunemush (pennmush/f/20_mushtype.h 1.2.1.1.1.10 660) --- 1_7_7.365(w)/hdrs/mushtype.h Wed, 09 Apr 2003 14:19:28 -0500 dunemush (pennmush/f/20_mushtype.h 1.2.1.1.1.12 660) *************** *** 23,28 **** --- 23,32 ---- #define ANY_OWNER (-2) /* For lstats and @stat */ + #define INTERACT_SEE 0x1 + #define INTERACT_HEAR 0x2 + #define INTERACT_MATCH 0x4 + typedef unsigned char *object_flag_type; /* Boolexps and locks */ *** 1_7_7.309/game/txt/hlp/pennconf.hlp Sun, 16 Feb 2003 22:29:15 -0600 dunemush (pennmush/f/43_pennconf.h 1.8 600) --- 1_7_7.365(w)/game/txt/hlp/pennconf.hlp Thu, 27 Mar 2003 21:05:08 -0600 dunemush (pennmush/f/43_pennconf.h 1.9 600) *************** *** 129,135 **** haspower_restricted=: Is haspower() available only to objects with see_all? safer_ufun=: Are objects stopped from evaluting attributes on ! objects with more privledges than themselves? & @config limits Limits and other constants. --- 129,135 ---- haspower_restricted=: Is haspower() available only to objects with see_all? safer_ufun=: Are objects stopped from evaluting attributes on ! objects with more privileges than themselves? & @config limits Limits and other constants. *************** *** 141,147 **** no limit. If -1, limited by the number of guest players in the db. idle_timeout=: The number of minutes a connection can be idle before getting booted. 0 means no limit. ! whisper_loudness=: The percentage change of a whisper/noisy being heard. starting_quota=: How much quota new players get. starting_money=: How many pennies new players get. --- 141,147 ---- no limit. If -1, limited by the number of guest players in the db. idle_timeout=: The number of minutes a connection can be idle before getting booted. 0 means no limit. ! whisper_loudness=: The percentage chance of a whisper/noisy being heard. starting_quota=: How much quota new players get. starting_money=: How many pennies new players get. *************** *** 202,207 **** reversed? tiny_math=: Is a string where a number is expected considered a 0? - tiny_attrs=: Are attribute names, flags and owners displayed - Tiny-style? silent_pemit=: Does @pemit default to @pemit/silent? --- 202,205 ---- *** 1_7_7.309/src/ptab.c Wed, 08 Jan 2003 12:36:12 -0600 dunemush (pennmush/g/8_ptab.c 1.7 660) --- 1_7_7.365(w)/src/ptab.c Wed, 09 Apr 2003 14:19:27 -0500 dunemush (pennmush/g/8_ptab.c 1.8 660) *************** *** 1,3 **** --- 1,10 ---- + /** + * \file ptab.c + * + * \brief Prefix tables for PennMUSH. + * + * + */ #include "config.h" #include "copyrite.h" #include *************** *** 8,22 **** #include "memcheck.h" #include "confmagic.h" typedef struct ptab_entry { ! void *data; ! char key[BUFFER_LEN]; } ptab_entry; #define PTAB_SIZE (sizeof(struct ptab_entry) - BUFFER_LEN) void ! ptab_init(PTAB * tab) { if (!tab) return; --- 15,37 ---- #include "memcheck.h" #include "confmagic.h" + static int ptab_find_exact_nun(PTAB *tab, const char *key); + static int WIN32_CDECL ptab_cmp(const void *, const void *); + + /** A ptab entry. */ typedef struct ptab_entry { ! void *data; /**< pointer to data */ ! char key[BUFFER_LEN]; /**< the index key */ } ptab_entry; + /** The memory usage of a ptab entry, not including data. */ #define PTAB_SIZE (sizeof(struct ptab_entry) - BUFFER_LEN) + /** Initialize a ptab. + * \param tab pointer to a ptab. + */ void ! ptab_init(PTAB *tab) { if (!tab) return; *************** *** 24,31 **** tab->tab = NULL; } void ! ptab_free(PTAB * tab) { if (!tab) return; --- 39,49 ---- tab->tab = NULL; } + /** Free all entries in a ptab. + * \param tab pointer to a ptab. + */ void ! ptab_free(PTAB *tab) { if (!tab) return; *************** *** 39,46 **** tab->state = tab->maxlen = tab->len = tab->current = 0; } void * ! ptab_find(PTAB * tab, const char *key) { int nun; --- 57,71 ---- tab->state = tab->maxlen = tab->len = tab->current = 0; } + /** Search a ptab for an entry that prefix-matches a given key. + * We search through unique prefixes of keys in the table to try + * to match the key we're looking for. + * \param tab pointer to a ptab. + * \param key key to search for. + * \return void pointer to ptab data indexed by key, or NULL if none. + */ void * ! ptab_find(PTAB *tab, const char *key) { int nun; *************** *** 109,130 **** return NULL; } void * ! ptab_find_exact(PTAB * tab, const char *key) { int nun; if (!tab || !key || tab->state) ! return NULL; if (tab->len < 10) { /* Just do a linear search for small tables */ int cmp; for (nun = 0; nun < tab->len; nun++) { cmp = strcasecmp(tab->tab[nun]->key, key); if (cmp == 0) ! return tab->tab[nun]->data; else if (cmp > 0) ! return NULL; } } else { /* Binary search of the index */ int left = 0; --- 134,173 ---- return NULL; } + /** Search a ptab for an entry that exactly matches a given key. + * We search through full names of keys in the table to try + * to match the key we're looking for. + * \param tab pointer to a ptab. + * \param key key to search for. + * \return void pointer to ptab data indexed by key, or NULL if none. + */ void * ! ptab_find_exact(PTAB *tab, const char *key) ! { ! int nun; ! nun = ptab_find_exact_nun(tab, key); ! if (nun < 0) ! return NULL; ! else ! return tab->tab[nun]->data; ! } ! ! static int ! ptab_find_exact_nun(PTAB *tab, const char *key) { int nun; if (!tab || !key || tab->state) ! return -1; if (tab->len < 10) { /* Just do a linear search for small tables */ int cmp; for (nun = 0; nun < tab->len; nun++) { cmp = strcasecmp(tab->tab[nun]->key, key); if (cmp == 0) ! return nun; else if (cmp > 0) ! return -1; } } else { /* Binary search of the index */ int left = 0; *************** *** 140,146 **** cmp = strcasecmp(key, tab->tab[nun]->key); if (cmp == 0) ! return tab->tab[nun]->data; if (left == right) break; if (cmp < 0) --- 183,189 ---- cmp = strcasecmp(key, tab->tab[nun]->key); if (cmp == 0) ! return nun; if (left == right) break; if (cmp < 0) *************** *** 149,159 **** left = nun + 1; } } ! return NULL; } static void ! delete_entry(PTAB * tab, int n) { mush_free(tab->tab[n], "ptab.entry"); --- 192,202 ---- left = nun + 1; } } ! return -1; } static void ! delete_entry(PTAB *tab, int n) { mush_free(tab->tab[n], "ptab.entry"); *************** *** 168,229 **** tab->len--; } void ! ptab_delete(PTAB * tab, const char *key) { int nun; ! ! if (!tab || !key || tab->state) ! return; ! ! if (tab->len < 10) { /* Just do a linear search for small tables */ ! int cmp; ! for (nun = 0; nun < tab->len; nun++) { ! cmp = strcasecmp(tab->tab[nun]->key, key); ! if (cmp == 0) ! delete_entry(tab, nun); ! else if (cmp > 0) ! return; ! } ! } else { /* Binary search of the index */ ! int left = 0; ! int cmp; ! int right = tab->len - 1; ! ! while (1) { ! nun = (left + right) / 2; ! ! if (left > right) ! break; ! ! cmp = strcasecmp(key, tab->tab[nun]->key); ! ! if (cmp == 0) { ! delete_entry(tab, nun); ! return; ! } ! if (left == right) ! break; ! if (cmp < 0) ! right = nun - 1; ! else /* cmp > 0 */ ! left = nun + 1; ! } ! } return; } ! ! void ! ptab_start_inserts(PTAB * tab) { if (!tab) return; tab->state = 1; } - static int WIN32_CDECL ptab_cmp(const void *, const void *); static int WIN32_CDECL ptab_cmp(const void *a, const void *b) { --- 211,241 ---- tab->len--; } + /** Delete a ptab entry indexed by key. + * \param tab pointer to a ptab. + * \param key key to search for. + */ void ! ptab_delete(PTAB *tab, const char *key) { int nun; ! nun = ptab_find_exact_nun(tab, key); ! if (nun >= 0) ! delete_entry(tab, nun); return; } ! /** Put a ptab into insertion state. ! * \param tab pointer to a ptab. ! */ void ! ptab_start_inserts(PTAB *tab) { if (!tab) return; tab->state = 1; } static int WIN32_CDECL ptab_cmp(const void *a, const void *b) { *************** *** 233,240 **** return strcasecmp((*ra)->key, (*rb)->key); } void ! ptab_end_inserts(PTAB * tab) { struct ptab_entry **tmp; if (!tab) --- 245,255 ---- return strcasecmp((*ra)->key, (*rb)->key); } + /** Complete the ptab insertion process by re-sorting the entries. + * \param tab pointer to a ptab. + */ void ! ptab_end_inserts(PTAB *tab) { struct ptab_entry **tmp; if (!tab) *************** *** 249,256 **** tab->maxlen = tab->len + 10; } void ! ptab_insert(PTAB * tab, const char *key, void *data) { int lamed; --- 264,276 ---- tab->maxlen = tab->len + 10; } + /** Insert an entry into a ptab. + * \param tab pointer to a ptab. + * \param key key to insert entry under. + * \param data pointer to entry data. + */ void ! ptab_insert(PTAB *tab, const char *key, void *data) { int lamed; *************** *** 283,290 **** } void * ! ptab_firstentry_new(PTAB * tab, char *key) { if (!tab || tab->len == 0) return NULL; --- 303,317 ---- } + /** Return the data (and optionally the key) of the first entry in a ptab. + * This function resets the 'current' index in the ptab to the start + * of the table. + * \param tab pointer to a ptab. + * \param key memory location to store first key unless NULL is passed in. + * \return void pointer to data from first entry, or NULL if none. + */ void * ! ptab_firstentry_new(PTAB *tab, char *key) { if (!tab || tab->len == 0) return NULL; *************** *** 294,301 **** return tab->tab[0]->data; } void * ! ptab_nextentry_new(PTAB * tab, char *key) { if (!tab || tab->current >= tab->len) return NULL; --- 321,334 ---- return tab->tab[0]->data; } + /** Return the data (and optionally the key) of the next entry in a ptab. + * This function increments the 'current' index in the ptab. + * \param tab pointer to a ptab. + * \param key memory location to store next key unless NULL is passed in. + * \return void pointer to data from next entry, or NULL if none. + */ void * ! ptab_nextentry_new(PTAB *tab, char *key) { if (!tab || tab->current >= tab->len) return NULL; *************** *** 304,317 **** return tab->tab[tab->current++]->data; } void ptab_stats_header(dbref player) { notify_format(player, "Table Entries AvgComparisons %39s", "~Memory"); } void ! ptab_stats(dbref player, PTAB * tab, const char *pname) { int mem, nun; --- 337,358 ---- return tab->tab[tab->current++]->data; } + /** Header for report of ptab stats. + * \param player player to notify with table header. + */ void ptab_stats_header(dbref player) { notify_format(player, "Table Entries AvgComparisons %39s", "~Memory"); } + /** Data for one line of report of ptab stats. + * \param player player to notify with table. + * \param tab pointer to ptab to summarize stats for. + * \param pname name of ptab, for row header. + */ void ! ptab_stats(dbref player, PTAB *tab, const char *pname) { int mem, nun; *** 1_7_7.309/win32/pennmush.vcproj Sun, 16 Feb 2003 22:32:29 -0600 dunemush (pennmush/g/18_pennmush.v 1.5 660) --- 1_7_7.365(w)/win32/pennmush.vcproj Wed, 26 Mar 2003 09:16:37 -0600 dunemush (pennmush/g/18_pennmush.v 1.6 660) *************** *** 256,261 **** --- 256,264 ---- RelativePath=".\src\mysocket.c"> + + p'. For example, 'help 1.7.2p3' ! 1.7.7: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ! 1.7.6: 0, 1, 2, 3, 4, 5, 6, 7, 8 1.7.5: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 1.7.4: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 --- 4417,4424 ---- For information on a specific patchlevel of one of the versions listed, type 'help p'. For example, 'help 1.7.2p3' ! 1.7.7: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 ! 1.7.6: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 1.7.5: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 1.7.4: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 *** 1_7_7.309/game/txt/hlp/pennv176.hlp Mon, 24 Mar 2003 12:05:49 -0600 dunemush (pennmush/g/33_pennv176.h 1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.2 660) --- 1_7_7.365(w)/game/txt/hlp/pennv176.hlp Wed, 09 Apr 2003 14:19:24 -0500 dunemush (pennmush/g/33_pennv176.h 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 660) *************** *** 1,3 **** --- 1,17 ---- + & 1.7.6p9 + Version 1.7.6 patchlevel 9 April 9, 2003 + + Fixes: + * index-files.pl now produces a sensible warning for duplicate + help topics, rather than a perl warning. Suggested by Cheetah@M*U*S*H. + * Spellnum cosmetic bug with 'seventeen' fixed. Report by Jules@M*U*S*H. + * Another wrap() buglet tracked down and fixed. Probably the one + reported by Nymeria@M*U*S*H. + * Memory leak in flip() and scramble() fixed. + * Configure test for /dev/urandom from 1.7.5 got left out by mistake. + * Critical overflow bug in command argument parsing fixed. + + & 1.7.6p8 Version 1.7.6 patchlevel 8 March 21, 2003 *** 1_7_7.309/game/txt/hlp/pennv177.hlp Tue, 25 Mar 2003 16:50:17 -0600 dunemush (pennmush/g/34_pennv177.h 1.18 660) --- 1_7_7.365(w)/game/txt/hlp/pennv177.hlp Wed, 09 Apr 2003 14:19:24 -0500 dunemush (pennmush/g/34_pennv177.h 1.29 660) *************** *** 1,4 **** ! & 1.7.7p12 & 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.7.7p13 & 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,47 ---- A list of the patchlevels associated with each release can be read in 'help patchlevels'. + Version 1.7.7 patchlevel 13 April 9, 2003 + + Major changes: + * Interactions (something like "realms" in mux2). Two functions + in local.c can now be used to control conditions under which + objects can see, hear, or match each other. Possibly useful for + implementing umbral worlds, etc. Patch by Vadiv@M*U*S*H. + Functions: + * children(), syntactic sugar for lsearch(all,parent,). + Suggested by Kyieren@M*U*S*H. Patch by BlaZe@M*U*S*H. + * powers() can now take a second argument to set an @power. + Suggested by Rob@BtFMUSH. + Minor changes: + * @config/set can now set null strings. Suggested by Cheetah@M*U*S*H. + * In restart, set LC_ALL as well as LANG from the given LANG value, + in case the user's got an LC_ALL in their shell. + * The channel buffer shifting code has gotten much more efficient. + Suggested by [TAP]. + * @function/restrict can accept arguments of the form '!' + to clear a restriction. Suggested by Saturn@M3. + * Most of the asterisk lines between different login message files + have been removed. Suggested by Vadiv@M*U*S*H most recently. + Fixes: + * Fixes from 1.7.6p9. + * Win32 portability fixes. [EEH] + * deny_silent in access.cnf was ignored in several cases, and no + longer is. Patch by Cloud@Sci-Fi Chat + * Help fixes by Cheetah@M*U*S*H and LeeLaLimaLLama@M*U*S*H. + + + & 1.7.7p12 Version 1.7.7 patchlevel 12 March 21, 2003 Commands: *** 1_7_7.309/src/notify.c Tue, 18 Mar 2003 21:23:40 -0600 dunemush (pennmush/g/35_notify.c 1.2 660) --- 1_7_7.365(w)/src/notify.c Wed, 09 Apr 2003 14:19:26 -0500 dunemush (pennmush/g/35_notify.c 1.4 660) *************** *** 1011,1016 **** --- 1011,1026 ---- if (IsPlayer(target)) { if (!Connected(target) && options.login_allow && under_limit) continue; + + if (flags & NA_INTERACTION) { + if ((flags & NA_INTER_DIDIT) && + !can_interact(speaker, target, INTERACT_SEE)) + continue; + else if (!(flags & NA_INTER_DIDIT) + && !can_interact(speaker, target, INTERACT_HEAR)) + continue; + } + for (d = descriptor_list; d; d = d->next) { if (d->connected && d->player == target) { poutput = notify_type(d);