This is patch17 to PennMUSH 1.7.7. After applying this patch, you will have version 1.7.7p17 To apply this patch, save it to a file in your top-level MUSH directory, and do the following: patch -p1 < 1.7.7-patch17 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: * SSL support, including server and client authentication as options. This should be considered experimental. New ssl() function returns 1 if a player/descriptor is using SSL, 0 otherwise. New file README.SSL documents how to set up SSL. Two things to note: - SSL connections are dropped on @shutdown/reboot, so SSL users may wish to write client triggers to reconnect. - Output flushing behaves slightly differently for SSL connections. * The way lock keys are handled internally has been rewritten to allow them to be tracked by the same chunk-management code that handles attributes. [SW] * @mail message texts are now stored with the chunk-management code. [SW] * The new code can no longer read databases created by versions of Penn before 1.7.5p0. If you need to do this, load it in 1.7.6, shutdown, and use that database. [SW] Minor changes: * A new minimal.db is distributed (older ones probably won't work, and this one probably won't work with older versions). [TAP] * Contents/exits lists and functions that use first_visible (like lcon, lexits, etc.) are now affected by INTERACT_SEE. Suggested by Prospero@Metro. * @chan/recall now displays the last 10 lines by default. Use @chan/recall =0 to get the full buffer. Suggested by [TAP]. * Various boolexp tweaks. [SW] * @power provides more verbose feedback. Suggested by Mordie@M*U*S*H. [SW] * Additional chunk tweaks, including limiting migrations to one per second. [TAP] * PROFILING #define for use when profiling the code (surprise). This just disables the CPU timer. * When matching $-commands, only call the slower capturing wildcard match function when we already know it succeeds, since it won't most of the time. The faster non-capturing function is checked first to find a match. [SW] * PCRE is initialized once, at startup, rather than testing to see if it has to be done before each place regular expressions are used. [SW] * The TERSE flag now applies to objects, not just players. Suggested by Aur@M*U*S*H. * The terminfo() function now returns SSL status as well. * help-like commands without arguments now use the command name as the argument. E.g. 'news' now looks for topic 'news', instead of 'help'. If not found, we fall back on help. Patch by Mike Griffiths. * When an object is zoned to an unlocked ZMO, the ZMO is now autolocked to =me instead of $me, because it's probably less confusing. Suggested by Luke@M*U*S*H. * @name now automatically trims leading and trailing spaces from its newname argument, to avoid confusing people who use edit() to generate new names and leave in spaces. Report by [TAP], patch by [SW]. Commands: * New 'logargs' and 'logname' restrictions in restrict.cnf allow per-command logging. Suggested by Saturn @ M3. Functions: * The sha1() function has been renamed sha0(), since that's what it really does. [TAP] * trimtiny() and trimpenn() work like trim(), but force the TM or Penn argument style. * New 'logargs' and 'logname' restrictions in restrict.cnf allow per-function logging. Suggested by Saturn @ M3. Fixes: * The side-effect version of name() was producing a weird return value. Reported by Saturn@M3. * Problems with restrict_command and restrict_function with multiple restrictions now fixed. Report by Sholevi@M*U*S*H. * stddef.h now included in src/extchat.c. Report by [EEH]. [SW] * INFO output now includes a missing newline. Report by [EEH]. [SW] * help BUILDER updated. Report by Laura Langland-Shula. * down.txt message wasn't being sent. Report by Sholevi@M*U*S*H. [SW] * New Win32 project files that include the chunk code. [EEH] * @chan/what no longer highlights the channel's name, as this is confusing if you use ansified channel names. Suggested by Oriens@Alexandria. * ex/mortal now operates more correctly. Report by Amy Kou'ai. * Fixes from 1.7.6p13. Prereq: 1.7.7p16 *** 1_7_7.487/Patchlevel Mon, 23 Jun 2003 11:10:04 -0500 dunemush (pennmush/5_Patchlevel 1.17.1.11.1.18 600) --- 1_7_7.550(w)/Patchlevel Mon, 11 Aug 2003 16:13:16 -0500 dunemush (pennmush/5_Patchlevel 1.17.1.11.1.19 600) *************** *** 1,2 **** Do not edit this file. It is maintained by the official PennMUSH patches. ! This is PennMUSH 1.7.7p16 --- 1,2 ---- Do not edit this file. It is maintained by the official PennMUSH patches. ! This is PennMUSH 1.7.7p17 *** 1_7_7.487/CHANGES.176 Mon, 23 Jun 2003 21:49:34 -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.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.2.1.1.1.1.1.1.1.2.1.1.1.1.1.1.1.2 600) --- 1_7_7.550(w)/CHANGES.176 Thu, 14 Aug 2003 09:48:31 -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.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.2.1.1.1.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.2.1.1.1.2 600) *************** *** 13,18 **** --- 13,31 ---- ========================================================================== + Version 1.7.6 patchlevel 13 August 11, 2003 + + Fixes: + * Calling panic() while in the middle of a panic dump would cause a loop. + Reported by [EEH]. [SW] + * Outdated mention of compose.csh removed from compose.sh.SH. + Reported by Cheetah@M*U*S*H. + * timestring() dealt wrongly with large arguments. Reported by + Jules@M*U*S*H. timefmt() had a similar problem, reported by + Luke@M*U*S*H. + * Better checking of db save failures. [SW] + + Version 1.7.6 patchlevel 12 June 23, 2003 Minor changes: *** 1_7_7.487/CHANGES.177 Mon, 23 Jun 2003 11:10:04 -0500 dunemush (pennmush/g/23_CHANGES 1.48.1.105 600) --- 1_7_7.550(w)/CHANGES.177 Sun, 17 Aug 2003 08:30:15 -0500 dunemush (pennmush/g/23_CHANGES 1.48.1.128 600) *************** *** 18,23 **** --- 18,97 ---- ========================================================================== + Version 1.7.7 patchlevel 17 August 11, 2003 + + Major changes: + * SSL support, including server and client authentication as options. + This should be considered experimental. New ssl() function returns 1 + if a player/descriptor is using SSL, 0 otherwise. New file README.SSL + documents how to set up SSL. Two things to note: + - SSL connections are dropped on @shutdown/reboot, so SSL users may + wish to write client triggers to reconnect. + - Output flushing behaves slightly differently for SSL connections. + * The way lock keys are handled internally has been rewritten to allow + them to be tracked by the same chunk-management code that handles + attributes. [SW] + * @mail message texts are now stored with the chunk-management code. [SW] + * The new code can no longer read databases created by versions of Penn + before 1.7.5p0. If you need to do this, load it in 1.7.6, shutdown, + and use that database. [SW] + Minor changes: + * A new minimal.db is distributed (older ones probably won't work, + and this one probably won't work with older versions). [TAP] + * Contents/exits lists and functions that use first_visible (like + lcon, lexits, etc.) are now affected by INTERACT_SEE. Suggested by + Prospero@Metro. + * @chan/recall now displays the last 10 lines by default. Use + @chan/recall =0 to get the full buffer. Suggested by [TAP]. + * Various boolexp tweaks. [SW] + * @power provides more verbose feedback. Suggested by Mordie@M*U*S*H. [SW] + * Additional chunk tweaks, including limiting migrations to one + per second. [TAP] + * PROFILING #define for use when profiling the code (surprise). This + just disables the CPU timer. + * When matching $-commands, only call the slower capturing wildcard match + function when we already know it succeeds, since it won't most of the time. + The faster non-capturing function is checked first to find a match. [SW] + * PCRE is initialized once, at startup, rather than testing to see if it has + to be done before each place regular expressions are used. [SW] + * The TERSE flag now applies to objects, not just players. Suggested + by Aur@M*U*S*H. + * The terminfo() function now returns SSL status as well. + * help-like commands without arguments now use the command name + as the argument. E.g. 'news' now looks for topic 'news', instead of + 'help'. If not found, we fall back on help. Patch by Mike Griffiths. + * When an object is zoned to an unlocked ZMO, the ZMO is now autolocked + to =me instead of $me, because it's probably less confusing. + Suggested by Luke@M*U*S*H. + * @name now automatically trims leading and trailing spaces from its + newname argument, to avoid confusing people who use edit() to + generate new names and leave in spaces. Report by [TAP], patch by [SW]. + Commands: + * New 'logargs' and 'logname' restrictions in restrict.cnf allow + per-command logging. Suggested by Saturn @ M3. + Functions: + * The sha1() function has been renamed sha0(), since that's what it + really does. [TAP] + * trimtiny() and trimpenn() work like trim(), but force the TM or + Penn argument style. + * New 'logargs' and 'logname' restrictions in restrict.cnf allow + per-function logging. Suggested by Saturn @ M3. + Fixes: + * The side-effect version of name() was producing a weird return + value. Reported by Saturn@M3. + * Problems with restrict_command and restrict_function with multiple + restrictions now fixed. Report by Sholevi@M*U*S*H. + * stddef.h now included in src/extchat.c. Report by [EEH]. [SW] + * INFO output now includes a missing newline. Report by [EEH]. [SW] + * help BUILDER updated. Report by Laura Langland-Shula. + * down.txt message wasn't being sent. Report by Sholevi@M*U*S*H. [SW] + * New Win32 project files that include the chunk code. [EEH] + * @chan/what no longer highlights the channel's name, as this is + confusing if you use ansified channel names. Suggested by + Oriens@Alexandria. + * ex/mortal now operates more correctly. Report by Amy Kou'ai. + * Fixes from 1.7.6p13. + Version 1.7.7 patchlevel 16 June 23, 2003 Commands: *************** *** 41,47 **** on demand instead of keeping running totals. [TAP] * @chan/what displays information about a channel's recall buffer, if any. [SW] ! * @chan/recall'ed lines are more clearly marked as such. Suggested by Oriens@Alexandria. [SW] * Consolidation of a common idiom used to format times throughout the source into a simple function call. [SW] --- 115,121 ---- on demand instead of keeping running totals. [TAP] * @chan/what displays information about a channel's recall buffer, if any. [SW] ! * @chan/recall'ed lines are more clearly marked as such. Suggested by Oriens@Alexandria. [SW] * Consolidation of a common idiom used to format times throughout the source into a simple function call. [SW] *************** *** 62,68 **** Fixes: * Problem with checking command flag masks when the number of ! flags was an even multiple of 8. Reported by Nymeria and Mordie@M*U*S*H. * Tweak to improve efficiency of ancestor checking code and delint warning reported by Cheetah@M*U*S*H. --- 136,142 ---- Fixes: * Problem with checking command flag masks when the number of ! flags was an even multiple of 8. Reported by Nymeria and Mordie@M*U*S*H. * Tweak to improve efficiency of ancestor checking code and delint warning reported by Cheetah@M*U*S*H. *************** *** 73,105 **** environment to, e.g., correctly lowercase accented characters. Report by Krad@M*U*S*H. * Modified several Makefile.SH targets to prevent Javelin from ! releasing patches that don't have the autogenerated files up-to-date for Windows folks. * Removed some dependence on typedefs that may or may not be in system header files. [SW] * Patch compiler warnings. [SW,EEH] * Help fixes by Mike Griffiths and Oriens@Alexandria. ! Version 1.7.7 patchlevel 14 May 22, 2003 Major changes: ! * Ancestors: an object can be configured to serve as an 'ultimate parent' of every room, exit, thing, or player, and attributes ! that are not found on an object or any of its parents may be inherited ! from the ancestor for that object type. The ORPHAN flag prevents ancestors from being used on an object. Patch by Walker@M*U*S*H. * Mail messages now track not only the dbref of the sender but the sender's creation time, so messages from dbrefs that have been ! nuked and recreated can be distinguished from messages from the original sender. This modifies the maildb and make it not usable with older versions. All existing @mail is grandfathered in, and can't be tracked this way. Suggested by Philip Mak. * New chunk memory allocator can be used to greatly reduce process memory requirements by swapping little-used attribute texts out ! to disk and caching often-used attribute texts in memory. This is incompatible with forking dumps, so if you use it, ! you'll do nonforking dumps. Configurable in mush.cnf, see comments there. [TAP] * Hardcode: new interaction type INTERACT_PRESENCE marks the arrival/departure/connection/disconnection/grows ears/loses ears --- 147,179 ---- environment to, e.g., correctly lowercase accented characters. Report by Krad@M*U*S*H. * Modified several Makefile.SH targets to prevent Javelin from ! releasing patches that don't have the autogenerated files up-to-date for Windows folks. * Removed some dependence on typedefs that may or may not be in system header files. [SW] * Patch compiler warnings. [SW,EEH] * Help fixes by Mike Griffiths and Oriens@Alexandria. ! Version 1.7.7 patchlevel 14 May 22, 2003 Major changes: ! * Ancestors: an object can be configured to serve as an 'ultimate parent' of every room, exit, thing, or player, and attributes ! that are not found on an object or any of its parents may be inherited ! from the ancestor for that object type. The ORPHAN flag prevents ancestors from being used on an object. Patch by Walker@M*U*S*H. * Mail messages now track not only the dbref of the sender but the sender's creation time, so messages from dbrefs that have been ! nuked and recreated can be distinguished from messages from the original sender. This modifies the maildb and make it not usable with older versions. All existing @mail is grandfathered in, and can't be tracked this way. Suggested by Philip Mak. * New chunk memory allocator can be used to greatly reduce process memory requirements by swapping little-used attribute texts out ! to disk and caching often-used attribute texts in memory. This is incompatible with forking dumps, so if you use it, ! you'll do nonforking dumps. Configurable in mush.cnf, see comments there. [TAP] * Hardcode: new interaction type INTERACT_PRESENCE marks the arrival/departure/connection/disconnection/grows ears/loses ears *************** *** 109,122 **** * strreplace() works like replace() for strings. [SW] * fraction(), for turning floating-point numbers into fractions. [SW] * root(), for finding roots higher than the square root. [SW] ! Minor changes: * We now use wrapper functions atr_value and safe_atr_value instead of uncompress(AL_STR(...)) or safe_uncompress(AL_STR(...)), so we can do future work with attribute storage cleanly. [TAP] * @*payment attributes now receive the amount of money paid in as %0. Suggested by Sholevi and Time@M*U*S*H. [SW] * Config options that take times now accept a notation describing what kind ! of units to use. For example, 3600s, 60m, 30m1800s, and 1h all refer to the same period of time. Suggested by Time@M*U*S*H. [SW] * Doxygen commenting of non-static members is essentially complete! Pennhacks see: http://www.pennmush.org/docs/1.7.7/html/ --- 183,196 ---- * strreplace() works like replace() for strings. [SW] * fraction(), for turning floating-point numbers into fractions. [SW] * root(), for finding roots higher than the square root. [SW] ! Minor changes: * We now use wrapper functions atr_value and safe_atr_value instead of uncompress(AL_STR(...)) or safe_uncompress(AL_STR(...)), so we can do future work with attribute storage cleanly. [TAP] * @*payment attributes now receive the amount of money paid in as %0. Suggested by Sholevi and Time@M*U*S*H. [SW] * Config options that take times now accept a notation describing what kind ! of units to use. For example, 3600s, 60m, 30m1800s, and 1h all refer to the same period of time. Suggested by Time@M*U*S*H. [SW] * Doxygen commenting of non-static members is essentially complete! Pennhacks see: http://www.pennmush.org/docs/1.7.7/html/ *************** *** 144,150 **** * @rejectmotd and @wizmotd set the wrong messages. Report by Konstantine Shirow. [SW] * Using @chan/buffer to resize a recall buffer gives feedback. Reported by ! Sholevi@M*U*S*H. [SW] * Help fix for grab() by Adu@AbryssMUSH. * You can no longer destroy the base_room (or default_home). Suggested by Philip Mak. [TAP] --- 218,224 ---- * @rejectmotd and @wizmotd set the wrong messages. Report by Konstantine Shirow. [SW] * Using @chan/buffer to resize a recall buffer gives feedback. Reported by ! Sholevi@M*U*S*H. [SW] * Help fix for grab() by Adu@AbryssMUSH. * You can no longer destroy the base_room (or default_home). Suggested by Philip Mak. [TAP] *************** *** 154,160 **** 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,). --- 228,234 ---- 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,). *************** *** 183,189 **** Commands: * @channel/buffer creates a buffer for a channel to store the most ! recent messages broadcast on the channel. @channel/recall can be used to recall them. These are not stored across reboots and should be set up by #1's @startup. Functions/Substitutions: --- 257,263 ---- Commands: * @channel/buffer creates a buffer for a channel to store the most ! recent messages broadcast on the channel. @channel/recall can be used to recall them. These are not stored across reboots and should be set up by #1's @startup. Functions/Substitutions: *************** *** 240,246 **** been removed (they are now always on). * New unconnected_idle_timeout directive in mush.cnf controls timeouts for connections idle at the connect screen. ! * New max_guests directive in mush.cnf can limit the number of guests allowed to connect at once. Suggested by Sholevi@M*U*SH. Minor Changes: * New lflags search class takes a list of flag names. --- 314,320 ---- been removed (they are now always on). * New unconnected_idle_timeout directive in mush.cnf controls timeouts for connections idle at the connect screen. ! * New max_guests directive in mush.cnf can limit the number of guests allowed to connect at once. Suggested by Sholevi@M*U*SH. Minor Changes: * New lflags search class takes a list of flag names. *************** *** 248,254 **** * Somewhat more informative message when you @chan/gag,hide,mute all channels at once. Suggested by Tanaku and Kevin@M*U*S*H. * Began commenting files using doxygen. ! * Internal code cleanup. Mostly converting some magic numbers to #define'd symbols, and some #define'd symbols to enums for better debugging and improved readability. Also some conversion of old K&R style functions. [SW] --- 322,328 ---- * Somewhat more informative message when you @chan/gag,hide,mute all channels at once. Suggested by Tanaku and Kevin@M*U*S*H. * Began commenting files using doxygen. ! * Internal code cleanup. Mostly converting some magic numbers to #define'd symbols, and some #define'd symbols to enums for better debugging and improved readability. Also some conversion of old K&R style functions. [SW] *************** *** 280,292 **** regardless of tiny_math and null_eq_zero settings. Reported by Intrevis@M*U*S*H. * Another fix to the new matcher. Bug report by Kyieren@M*U*S*H. ! * @flag/alias was broken. Fixed. Reported by Kevin@M*U*S*H. Version 1.7.7 patchlevel 8 January 27, 2003 Minor Changes: ! * command_add now expects to receive the flag list and the switch list as strings. Folks who hack into cmdlocal.c should take note and read example in the new cmdlocal.dst Fixes: --- 354,366 ---- regardless of tiny_math and null_eq_zero settings. Reported by Intrevis@M*U*S*H. * Another fix to the new matcher. Bug report by Kyieren@M*U*S*H. ! * @flag/alias was broken. Fixed. Reported by Kevin@M*U*S*H. Version 1.7.7 patchlevel 8 January 27, 2003 Minor Changes: ! * command_add now expects to receive the flag list and the switch list as strings. Folks who hack into cmdlocal.c should take note and read example in the new cmdlocal.dst Fixes: *************** *** 322,328 **** the object in many cases that previously required control. Provoked by bug reports by Intrevis@M*U*S*H and Philip Mak. Commands: ! * @flag allows God to manipulate flags within the game, including adding new flags. Flags additions/changes are maintained across reboots, so this command does not need to be run at every startup. Functions: --- 396,402 ---- the object in many cases that previously required control. Provoked by bug reports by Intrevis@M*U*S*H and Philip Mak. Commands: ! * @flag allows God to manipulate flags within the game, including adding new flags. Flags additions/changes are maintained across reboots, so this command does not need to be run at every startup. Functions: *************** *** 358,370 **** Fixes: * Fixes from 1.7.6p5. ! ! Version 1.7.7 patchlevel 4 January 2, 2003 Minor Changes: ! * When room_connects is on, @aconnect and @adisconnect also ! functions on things when players (dis)connect inside them. Suggested by Philip Mak. [SW] * Parser-enforced argument counts for user-defined @functions, as an option to @function. --- 432,444 ---- Fixes: * Fixes from 1.7.6p5. ! ! Version 1.7.7 patchlevel 4 January 2, 2003 Minor Changes: ! * When room_connects is on, @aconnect and @adisconnect also ! functions on things when players (dis)connect inside them. Suggested by Philip Mak. [SW] * Parser-enforced argument counts for user-defined @functions, as an option to @function. *************** *** 427,433 **** * Clients that understand telnet NAWS (See RFC 1073) can tell the mush what dimensions a given connection's display is. Added the width() and height() functions, and SCREENWIDTH and SCREENHEIGHT ! psuedo-commands for getting/setting this information from the mush. This changes the reboot.db format and requires a full shutdown. [SW] * Two new atoms for locks. "#true" in a lock is always evaluated as true (anyone can pass), and "#false" is always evaluated as false (no one --- 501,507 ---- * Clients that understand telnet NAWS (See RFC 1073) can tell the mush what dimensions a given connection's display is. Added the width() and height() functions, and SCREENWIDTH and SCREENHEIGHT ! psuedo-commands for getting/setting this information from the mush. This changes the reboot.db format and requires a full shutdown. [SW] * Two new atoms for locks. "#true" in a lock is always evaluated as true (anyone can pass), and "#false" is always evaluated as false (no one *************** *** 460,466 **** files that always succeed because they're standard C headers. [SW] * Removed the Size_t typedef in favor of the standard size_t. [SW] * Some optimization hints for the GCC and VS.NET compilers. [SW] ! * We try to be more conservative about when we show lines of asterisks around motd-type messages, to avoid showing them when there's no message. * Continued ansi-C-ification of function declarations. --- 534,540 ---- files that always succeed because they're standard C headers. [SW] * Removed the Size_t typedef in favor of the standard size_t. [SW] * Some optimization hints for the GCC and VS.NET compilers. [SW] ! * We try to be more conservative about when we show lines of asterisks around motd-type messages, to avoid showing them when there's no message. * Continued ansi-C-ification of function declarations. *** 1_7_7.487/game/txt/hlp/pennfunc.hlp Mon, 16 Jun 2003 23:42:42 -0500 dunemush (pennmush/16_pennfunc.h 1.2.1.50.1.1.1.1.1.2.1.7.1.8.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.1.1.1.1.1.1.1.1.9.1.1.1.1.1.3.1.1.1.1.1.1.1.1.1.1.1.1.1.4 600) --- 1_7_7.550(w)/game/txt/hlp/pennfunc.hlp Mon, 11 Aug 2003 16:29:53 -0500 dunemush (pennmush/16_pennfunc.h 1.2.1.50.1.1.1.1.1.2.1.7.1.8.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.1.1.1.1.1.1.1.1.9.1.1.1.1.1.3.1.1.1.1.1.1.1.1.1.1.1.1.1.7 600) *************** *** 111,117 **** conn() doing() height() hidden() idle() lports() lwho() mwho() ports() pueblo() ! terminfo() width() & Dbref functions Dbref functions return a dbref or list of dbrefs related to some value on an object. --- 111,117 ---- conn() doing() height() hidden() idle() lports() lwho() mwho() ports() pueblo() ! ssl() terminfo() width() & Dbref functions Dbref functions return a dbref or list of dbrefs related to some value on an object. *************** *** 200,206 **** ifelse() lcstr() left() lit() ljust() merge() mid() ord() pos() regedit() lpos() regmatch() repeat() reverse() right() ! rjust() scramble() secure() sha1() space() spellnum() squish() strcat() strinsert() stripaccents() stripansi() strlen() strmatch() strreplace() switch() trim() ucstr() wrap() --- 200,206 ---- ifelse() lcstr() left() lit() ljust() merge() mid() ord() pos() regedit() lpos() regmatch() repeat() reverse() right() ! rjust() scramble() secure() sha0() space() spellnum() squish() strcat() strinsert() stripaccents() stripansi() strlen() strmatch() strreplace() switch() trim() ucstr() wrap() *************** *** 2988,2997 **** You say, "1.0 1.000 1.1" > say setunion(1.1 1.0, 1.000, %b, f) You say, "1.0 1.1" ! & SHA1() ! sha1() ! Returns the SHA-1 cryptographic hash of the string. See RFC 3174 for more information. & SHL() shl(,) --- 2988,2997 ---- You say, "1.0 1.000 1.1" > say setunion(1.1 1.0, 1.000, %b, f) You say, "1.0 1.1" ! & SHA0() ! sha0() ! Returns the SHA cryptographic hash of the string. See RFC 3174 for more information. & SHL() shl(,) *************** *** 3184,3189 **** --- 3184,3198 ---- Returns the number of times the server has been rebooted with @shutdown/reboot since the last full startup. + & SSL() + ssl() + + This function returns 1 if the player is using an SSL connection, + and 0 otherwise. If SSL is disabled, it always returns 0. + Players can check the SSL status of their own connection. + The See_All power is required to check other connections. + + See also: terminfo() & STEP() step([/], , [, , ]) *************** *** 3384,3389 **** --- 3393,3399 ---- currently include: pueblo present if the client is in Pueblo mode. telnet present if the client understands the telnet protocol. + ssl present if the client is using an SSL/TLS connection. Other fields may be added in the future, if, for example, MXP support is ever added. *************** *** 3504,3509 **** --- 3514,3521 ---- & TRIM() trim([,][,]) + trimpenn([,][,]) + trimtiny([,][,]) This function trims leading and trailing characters from a string. The character trimmed is normally a space; if a second argument is *************** *** 3517,3523 **** to trim, since the trim style must be the third argument to the function. If the tiny_trim_fun config option is "yes", the character and style ! arguments are reversed. Examples: > say [trim( foo bar baz eek )] --- 3529,3536 ---- to trim, since the trim style must be the third argument to the function. If the tiny_trim_fun config option is "yes", the character and style ! arguments are reversed. Use trimpenn() or trimtiny() if you want to ! specify a particular argument sequence no matter how the option is set. Examples: > say [trim( foo bar baz eek )] *** 1_7_7.487/game/txt/hlp/pennflag.hlp Mon, 02 Jun 2003 13:18:13 -0500 dunemush (pennmush/17_pennflag.h 1.1.1.1.1.2.1.1.1.2.1.1.1.2.1.1.2.1.2.1.1.1.1.2.1.4.1.2.2.5 600) --- 1_7_7.550(w)/game/txt/hlp/pennflag.hlp Thu, 17 Jul 2003 15:27:54 -0500 dunemush (pennmush/17_pennflag.h 1.1.1.1.1.2.1.1.1.2.1.1.1.2.1.1.2.1.2.1.1.1.1.2.1.4.1.2.2.7 600) *************** *** 130,138 **** @create) to registered builders only. If you are on a MUSH that does this, you will not be able to use these commands unless you have the power. Only wizards can grant @powers. To see if building is limited, ! check @config. ! See also: POWERS, @power, @dig, @open, @create, @config & CHOWN_OK Flag: CHOWN_OK (things, rooms, exits) --- 130,138 ---- @create) to registered builders only. If you are on a MUSH that does this, you will not be able to use these commands unless you have the power. Only wizards can grant @powers. To see if building is limited, ! check @command for the various building commands. ! See also: POWERS, @power, @dig, @open, @create & CHOWN_OK Flag: CHOWN_OK (things, rooms, exits) *************** *** 599,612 **** The TEMPLE flag is no longer available in PennMUSH. Please see help changes for more information. & TERSE ! Flag: TERSE (players) When an object is set TERSE, it does not see the descriptions or success/failure messages in rooms. This is a useful flag if you're on a slow connection or you're moving through a familiar area and ! don't want to see tons of text. This flag is only valid for players; ! objects belonging to TERSE players are automatically considered to ! be TERSE. & TRANSPARENT Flag: TRANSPARENT (all types) --- 599,612 ---- The TEMPLE flag is no longer available in PennMUSH. Please see help changes for more information. & TERSE ! Flag: TERSE (players, things) When an object is set TERSE, it does not see the descriptions or success/failure messages in rooms. This is a useful flag if you're on a slow connection or you're moving through a familiar area and ! don't want to see tons of text. ! ! When a player is TERSE, all of their objects are considered to be TERSE. & TRANSPARENT Flag: TRANSPARENT (all types) *** 1_7_7.487/game/txt/hlp/penncmd.hlp Tue, 17 Jun 2003 16:38:13 -0500 dunemush (pennmush/18_penncmd.hl 1.2.1.1.1.47.1.1.1.1.1.3.1.4.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.2.1.10.1.1.1.1.1.1.1.1.1.5 600) --- 1_7_7.550(w)/game/txt/hlp/penncmd.hlp Mon, 11 Aug 2003 13:09:03 -0500 dunemush (pennmush/18_penncmd.hl 1.2.1.1.1.47.1.1.1.1.1.3.1.4.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.2.1.10.1.1.1.1.1.1.1.1.1.6 600) *************** *** 3429,3437 **** The /brief switch is equivalent to the 'brief' command. The /debug switch is wizard-only and shows raw values for certa ! in fields in an object. The /mortal switch shows an object as if you were a mortal other than ! the object's owner and is primarily useful to admins. The /all switch shows the values of VEILED attributes. & follow follow --- 3429,3438 ---- The /brief switch is equivalent to the 'brief' command. The /debug switch is wizard-only and shows raw values for certa ! in fields in an object. The /mortal switch shows an object as if you were a mortal other than ! the object's owner and is primarily useful to admins. This switch ! ignores the object's VISUAL flag (but not its attribute flags) The /all switch shows the values of VEILED attributes. & follow follow *** 1_7_7.487/game/txt/compose.sh.SH Thu, 29 Aug 2002 23:08:19 -0500 dunemush (pennmush/33_compose.sh 1.4 700) --- 1_7_7.550(w)/game/txt/compose.sh.SH Mon, 11 Aug 2003 16:43:01 -0500 dunemush (pennmush/33_compose.sh 1.5 700) *************** *** 51,57 **** # What subdirectories should we be processing? dir=$1 if $test ! -d $dir; then ! $echo "Usage: compose.csh " exit 0 fi --- 51,57 ---- # What subdirectories should we be processing? dir=$1 if $test ! -d $dir; then ! $echo "Usage: compose.sh " exit 0 fi *** 1_7_7.487/game/data/minimal.db Fri, 11 May 2001 18:11:50 -0500 dunemush (pennmush/38_minimal.db 1.2 600) --- 1_7_7.550(w)/game/data/minimal.db Sat, 05 Jul 2003 15:53:51 -0500 dunemush (pennmush/38_minimal.db 1.3 600) *************** *** 1,4 **** ! +V4191746 ~3 !0 "Room Zero" --- 1,4 ---- ! +V29353474 ~3 !0 "Room Zero" *************** *** 7,12 **** --- 7,13 ---- -1 -1 -1 + lockcount 0 1 -1 0 *************** *** 25,33 **** 0 -1 -1 ! _Enter|(=1) ! _Use|(=1) ! _Basic|(=1) 1 -1 0 --- 26,44 ---- 0 -1 -1 ! lockcount 3 ! type "Basic" ! creator 1 ! flags 2 ! key "=#1" ! type "Enter" ! creator 1 ! flags 2 ! key "=#1" ! type "Use" ! creator 1 ! flags 2 ! key "=#1" 1 -1 0 *************** *** 54,59 **** --- 65,71 ---- -1 -1 -1 + lockcount 0 1 -1 0 *** 1_7_7.487/game/mushcnf.dst Tue, 13 May 2003 12:26:58 -0500 dunemush (pennmush/41_mushcnf.ds 1.1.1.19.1.1.1.2.1.1.1.8.1.1.1.1.1.15 600) --- 1_7_7.550(w)/game/mushcnf.dst Sun, 17 Aug 2003 08:29:41 -0500 dunemush (pennmush/41_mushcnf.ds 1.1.1.19.1.1.1.2.1.1.1.8.1.1.1.1.1.17 600) *************** *** 14,20 **** # Name of your MUSH. Please change this. mud_name TinyMUSH ! # the port it's running on. port 4201 # Should we listen only on a specific IP address? If your host has --- 14,20 ---- # Name of your MUSH. Please change this. mud_name TinyMUSH ! # The port it's running on. See also ssl_port, later. port 4201 # Should we listen only on a specific IP address? If your host has *************** *** 151,164 **** # be able to do forking dumps. chunk_cache_memory 1000000 ! # The number of attributes that may be moved at one time, with no ! # net activity. The higher the value, the faster memory gets ! # defragmented, but at a greater CPU cost. chunk_migrate 500 ! # The number of attributes that may be moved at one time, with net ! # activity. ! active_chunk_migrate 200 ### ### Limits, costs, and other constants --- 151,188 ---- # be able to do forking dumps. chunk_cache_memory 1000000 ! # The number of attributes that may be moved at one time, once per ! # second. The higher the value, the faster memory gets defragmented, ! # but at a greater CPU cost. chunk_migrate 500 ! ### ! ### SSL support ! ### ! ! # The port to listen on for SSL connections. This must be an unused ! # port other than the standard connection port. To disable SSL ! # connections, leave this set to 0. ! ssl_port 0 ! ! # The file containing the MUSH server's certificate and private key, ! # concatenated together, and with no password on the private key. ! # Obviously, this file should only be readable by the MUSH account ! # owner. If this is commented out, the server will not present a ! # certificate, so clients that attempt to authenticate the server ! # will fail. ! ssl_private_key_file server-key.crt ! ! # The file containing one or more certificates of certifying authorities ! # that the server should trust to certify clients who connect and ! # present certificates. A standard bundle of these is distributed ! # with openssl as 'ca-bundle.crt'. If commented out, the server will ! # not attempt client authentication. ! ssl_ca_file /usr/share/ssl/certs/ca-bundle.crt ! ! # Are clients *required* to present a valid certificate in order to ! # make an SSL connection? ! ssl_require_client_cert no ### ### Limits, costs, and other constants *** 1_7_7.487/src/wiz.c Mon, 28 Apr 2003 22:03:14 -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.11 660) --- 1_7_7.550(w)/src/wiz.c Mon, 18 Aug 2003 11:56:00 -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.14 660) *************** *** 1036,1043 **** void do_power(dbref player, const char *name, const char *power) { ! int pwr; ! const char *s; dbref thing; if (!Wizard(player)) { --- 1036,1042 ---- void do_power(dbref player, const char *name, const char *power) { ! int pwr, revoke_it = 0; dbref thing; if (!Wizard(player)) { *************** *** 1057,1079 **** notify(player, T("God is already all-powerful.")); return; } - /* move past the not token if there is one */ - for (s = power; *s && ((*s == NOT_TOKEN) || isspace((unsigned char) *s)); - s++) ; ! if (*s == '\0') { notify(player, T("You must specify a power.")); return; } ! pwr = find_power(s); if (pwr == -1) { notify(player, T("That is not a power.")); return; } ! if (*power == NOT_TOKEN) { Powers(thing) &= ~pwr; if (!AreQuiet(player, thing)) ! notify_format(player, T("%s - power removed."), Name(thing)); do_log(LT_WIZ, player, thing, T("Power Removed: %s"), power); } else { if (Hasprivs(thing) && (pwr == IS_GUEST)) { --- 1056,1084 ---- notify(player, T("God is already all-powerful.")); return; } ! /* move past leading whitespace and the not token if there is one */ ! while (isspace((unsigned char) *power)) ! power++; ! if (*power == NOT_TOKEN) { ! power++; ! revoke_it = 1; ! } ! ! if (*power == '\0') { notify(player, T("You must specify a power.")); return; } ! ! pwr = find_power(power); if (pwr == -1) { notify(player, T("That is not a power.")); return; } ! if (revoke_it) { Powers(thing) &= ~pwr; if (!AreQuiet(player, thing)) ! notify_format(player, T("%s - %s power removed."), Name(thing), power); do_log(LT_WIZ, player, thing, T("Power Removed: %s"), power); } else { if (Hasprivs(thing) && (pwr == IS_GUEST)) { *************** *** 1082,1088 **** } Powers(thing) |= pwr; if (!AreQuiet(player, thing)) ! notify_format(player, T("%s - power granted."), Name(thing)); do_log(LT_WIZ, player, thing, T("Power Granted: %s"), power); } } --- 1087,1093 ---- } Powers(thing) |= pwr; if (!AreQuiet(player, thing)) ! notify_format(player, T("%s - %s power granted."), Name(thing), power); do_log(LT_WIZ, player, thing, T("Power Granted: %s"), power); } } *************** *** 2015,2020 **** --- 2020,2026 ---- paranoid_checkpt = 1; } fork_and_dump(0); + #ifndef PROFILING #ifndef WIN32 /* Some broken libcs appear to retain the itimer across exec! * So we make sure that if we get a SIGPROF in our next incarnation, *************** *** 2022,2027 **** --- 2028,2037 ---- */ ignore_signal(SIGPROF); #endif + #ifdef HAS_OPENSSL + close_ssl_connections(); + #endif + #endif dump_reboot_db(); #ifdef INFO_SLAVE kill_info_slave(); *** 1_7_7.487/src/wild.c Mon, 28 Apr 2003 00:35:06 -0500 dunemush (pennmush/b/24_wild.c 1.11.1.1.1.8.1.1.1.4.1.2.1.2 660) --- 1_7_7.550(w)/src/wild.c Mon, 18 Aug 2003 11:56:00 -0500 dunemush (pennmush/b/24_wild.c 1.11.1.1.1.8.1.1.1.4.1.2.1.4 660) *************** *** 381,391 **** int offsets[99]; int subpatterns; - if (!tables) { - /* Initialize char tables so they match current locale. */ - tables = pcre_maketables(); - } - if ((re = pcre_compile(s, (cs ? 0 : PCRE_CASELESS), &errptr, &erroffset, tables)) == NULL) { /* --- 381,386 ---- *************** *** 456,469 **** int erroffset; int offsets[99]; int r; ! if (!tables) { ! /* Initialize char tables so they match current locale. */ ! tables = pcre_maketables(); ! } ! if ((re = pcre_compile(s, (cs ? 0 : PCRE_CASELESS), &errptr, &erroffset, ! tables)) == NULL) { /* * This is a matching error. We have an error message in * errptr that we can ignore, since we're doing --- 451,465 ---- int erroffset; int offsets[99]; int r; + int flags = 0; /* There's a PCRE_NO_AUTO_CAPTURE flag to turn all raw + ()'s into (?:)'s, which would be nice to use, + except that people might use backreferences in + their patterns. Argh. */ ! if (!cs) ! flags |= PCRE_CASELESS; ! if ((re = pcre_compile(s, flags, &errptr, &erroffset, tables)) == NULL) { /* * This is a matching error. We have an error message in * errptr that we can ignore, since we're doing *** 1_7_7.487/src/warnings.c Mon, 28 Apr 2003 22:37:00 -0500 dunemush (pennmush/b/25_warnings.c 1.21.1.1.1.5 660) --- 1_7_7.550(w)/src/warnings.c Mon, 18 Aug 2003 11:56:00 -0500 dunemush (pennmush/b/25_warnings.c 1.21.1.1.1.6 660) *************** *** 62,73 **** } tcheck; ! static int warning_lock_type(const struct boolexp *l); ! static void complain ! (dbref player, dbref i, const char *name, const char *desc, ...) __attribute__ ((__format__(__printf__, 4, 5))); ! static void check_lock(dbref player, dbref i, const char *name, ! struct boolexp *be); static void ct_generic(dbref player, dbref i, warn_type flags); static void ct_room(dbref player, dbref i, warn_type flags); static void ct_exit(dbref player, dbref i, warn_type flags); --- 62,71 ---- } tcheck; ! extern int warning_lock_type(const boolexp l); ! void complain(dbref player, dbref i, const char *name, const char *desc, ...) __attribute__ ((__format__(__printf__, 4, 5))); ! extern void check_lock(dbref player, dbref i, const char *name, boolexp be); static void ct_generic(dbref player, dbref i, warn_type flags); static void ct_room(dbref player, dbref i, warn_type flags); static void ct_exit(dbref player, dbref i, warn_type flags); *************** *** 96,119 **** {NULL, 0} }; ! /* This is really simple-minded for efficiency. Basically, if it's ! * unlocked, it's unlocked. If it's locked to something starting with ! * a specific db#, it's locked. Anything else, and we don't know. ! */ ! static int ! warning_lock_type(const struct boolexp *l) ! /* 0== unlocked. 1== locked, 2== sometimes */ ! { ! if (l == TRUE_BOOLEXP) ! return W_UNLOCKED; ! if (l->type == BOOLEXP_CONST || ! l->type == BOOLEXP_CARRY || ! l->type == BOOLEXP_IS || l->type == BOOLEXP_OWNER) ! return W_LOCKED; ! return (W_LOCKED | W_UNLOCKED); ! } ! ! static void complain(dbref player, dbref i, const char *name, const char *desc, ...) { #ifdef HAS_VSNPRINTF --- 94,100 ---- {NULL, 0} }; ! void complain(dbref player, dbref i, const char *name, const char *desc, ...) { #ifdef HAS_VSNPRINTF *************** *** 140,191 **** } static void - check_lock(dbref player, dbref i, const char *name, struct boolexp *be) - { - switch (be->type) { - case BOOLEXP_CONST: - case BOOLEXP_CARRY: - case BOOLEXP_IS: - case BOOLEXP_OWNER: - if (!GoodObject(be->thing) || IsGarbage(be->thing)) - complain(player, i, "lock-checks", - T("%s lock refers to garbage object"), name); - break; - case BOOLEXP_NOT: - check_lock(player, i, name, be->data.n); - break; - case BOOLEXP_OR: - case BOOLEXP_AND: - check_lock(player, i, name, be->data.sub.a); - check_lock(player, i, name, be->data.sub.b); - break; - case BOOLEXP_EVAL: - { - ATTR *a; - a = atr_get(i, be->data.atr_lock->name); - if (!a || !Can_Read_Attr(i, i, a)) - complain(player, i, "lock-checks", - T - ("%s lock has eval-lock that uses a nonexistant attribute '%s'."), - name, be->data.atr_lock->name); - } - break; - case BOOLEXP_IND: - if (!GoodObject(be->thing) || IsGarbage(be->thing)) - complain(player, i, "lock-checks", - T("%s lock refers to garbage object"), name); - else if (!(Can_Read_Lock(i, be->thing, be->data.ind_lock) && - getlock(be->thing, be->data.ind_lock) != TRUE_BOOLEXP)) - complain(player, i, "lock-checks", - T("%s lock has indirect lock to %s/%s that it can't read"), - name, unparse_object(player, be->thing), be->data.ind_lock); - break; - default: - break; - } - } - - static void ct_generic(dbref player, dbref i, warn_type flags) { if ((flags & W_LOCK_PROBS)) { --- 121,126 ---- *** 1_7_7.487/src/timer.c Mon, 28 Apr 2003 22:37:00 -0500 dunemush (pennmush/b/29_timer.c 1.29.1.7.1.8 660) --- 1_7_7.550(w)/src/timer.c Mon, 18 Aug 2003 11:55:59 -0500 dunemush (pennmush/b/29_timer.c 1.29.1.7.1.11 660) *************** *** 27,32 **** --- 27,35 ---- #endif #include "conf.h" + #include "dbdefs.h" + #include "lock.h" + #include "extmail.h" #include "match.h" #include "flags.h" #include "externs.h" *************** *** 49,54 **** --- 52,58 ---- extern void inactivity_check(void); extern void reopen_logs(void); + static void migrate_stuff(int amount); #ifndef WIN32 void hup_handler(int); *************** *** 96,106 **** --- 100,192 ---- install_sig_handler(SIGHUP, hup_handler); install_sig_handler(SIGUSR1, usr1_handler); #endif + #ifndef PROFILING #ifdef HAS_ITIMER install_sig_handler(SIGPROF, signal_cpu_limit); #endif + #endif } + /** Migrate some number of chunks. + * The requested amount is only a guideline; the actual amount + * migrated will be more or less due to always migrating all the + * attributes, locks, and mail on any given object together. + * \param amount the suggested number of attributes to migrate. + */ + static void + migrate_stuff(int amount) + { + static int start_obj = 0; + static chunk_reference_t **refs = NULL; + static int refs_size = 0; + int end_obj; + int actual; + ATTR *aptr; + lock_list *lptr; + MAIL *mp; + + if (db_top == 0) + return; + + end_obj = start_obj; + actual = 0; + do { + for (aptr = List(end_obj); aptr; aptr = AL_NEXT(aptr)) + if (aptr->data != NULL_CHUNK_REFERENCE) + actual++; + for (lptr = Locks(end_obj); lptr; lptr = L_NEXT(lptr)) + if (L_KEY(lptr) != NULL_CHUNK_REFERENCE) + actual++; + if (IsPlayer(end_obj)) { + for (mp = find_exact_starting_point(end_obj); mp; mp = mp->next) + if (mp->msgid != NULL_CHUNK_REFERENCE) + actual++; + } + end_obj = (end_obj + 1) % db_top; + } while (actual < amount && end_obj != start_obj); + + if (actual == 0) + return; + + if (!refs || actual > refs_size) { + if (refs) + mush_free((Malloc_t) refs, "migration reference array"); + refs = + (chunk_reference_t **) mush_malloc(actual * sizeof(chunk_reference_t *), + "migration reference array"); + refs_size = actual; + if (!refs) + panic("Could not allocate migration reference array"); + } + #ifdef DEBUG_MIGRATE + do_rawlog(LT_TRACE, "Migrate asked %d, actual objects #%d to #%d for %d", + amount, start_obj, (end_obj + db_top - 1) % db_top, actual); + #endif + + actual = 0; + do { + for (aptr = List(start_obj); aptr; aptr = AL_NEXT(aptr)) + if (aptr->data != NULL_CHUNK_REFERENCE) { + refs[actual] = &(aptr->data); + actual++; + } + for (lptr = Locks(start_obj); lptr; lptr = L_NEXT(lptr)) + if (L_KEY(lptr) != NULL_CHUNK_REFERENCE) { + refs[actual] = &(lptr->key); + actual++; + } + if (IsPlayer(start_obj)) { + for (mp = find_exact_starting_point(start_obj); mp; mp = mp->next) + if (mp->msgid != NULL_CHUNK_REFERENCE) { + refs[actual] = &(mp->msgid); + actual++; + } + } + start_obj = (start_obj + 1) % db_top; + } while (start_obj != end_obj); + + chunk_migration(actual, refs); + } /** Handle events that may need handling. * This routine is polled from bsd.c. At any call, it can handle *************** *** 138,143 **** --- 224,231 ---- do_second(); + migrate_stuff(CHUNK_MIGRATE_AMOUNT); + if (options.purge_counter <= mudtime) { /* Free list reconstruction */ options.purge_counter = options.purge_interval + mudtime; *************** *** 194,199 **** --- 282,288 ---- sig_atomic_t cpu_time_limit_hit = 0; /** Was the cpu time limit hit? */ int cpu_limit_warning_sent = 0; /** Have we issued a cpu limit warning? */ + #ifndef PROFILING #if defined(HAS_ITIMER) /** Handler for PROF signal. * Do the minimal work here - set a global variable and reload the handler. *************** *** 213,218 **** --- 302,308 ---- cpu_time_limit_hit = 1; } #endif + #endif int timer_set = 0; /**< Is a CPU timer set? */ /** Start the cpu timer (before running a command). *************** *** 220,225 **** --- 310,316 ---- void start_cpu_timer(void) { + #ifndef PROFILING cpu_time_limit_hit = 0; cpu_limit_warning_sent = 0; timer_set = 1; *************** *** 248,253 **** --- 339,345 ---- else timer_set = 0; #endif + #endif } /** Reset the cpu timer (after running a command). *************** *** 255,260 **** --- 347,353 ---- void reset_cpu_timer(void) { + #ifndef PROFILING if (timer_set) { #if defined(HAS_ITIMER) struct itimerval time_limit, time_left; *************** *** 271,274 **** --- 364,368 ---- cpu_time_limit_hit = 0; cpu_limit_warning_sent = 0; timer_set = 0; + #endif } *** 1_7_7.487/src/help.c Mon, 28 Apr 2003 22:37:00 -0500 dunemush (pennmush/f/32_help.c 1.4.1.2.1.1.1.3.2.2.1.1.2.1.1.2.1.2.1.2.1.3.1.13 660) --- 1_7_7.550(w)/src/help.c Mon, 18 Aug 2003 11:55:58 -0500 dunemush (pennmush/f/32_help.c 1.4.1.2.1.1.1.3.2.2.1.1.2.1.1.2.1.2.1.2.1.3.1.15 660) *************** *** 35,40 **** --- 35,41 ---- static void do_new_spitfile(dbref player, char *arg1, help_file *help_dat, int restricted); static const char *string_spitfile(help_file *help_dat, char *arg1); + static help_indx *help_find_entry(help_file *help_dat, const char *the_topic); static void help_build_index(help_file *h, int restricted); *************** *** 164,174 **** FILE *fp; char *p, line[LINE_SIZE + 1]; char the_topic[LINE_SIZE + 2]; size_t n; ! if (*arg1 == '\0') ! arg1 = (char *) "help"; ! else if (*arg1 == '&') { notify(player, T("Help topics don't start with '&'.")); return; } --- 165,177 ---- FILE *fp; char *p, line[LINE_SIZE + 1]; char the_topic[LINE_SIZE + 2]; + int default_topic = 0; size_t n; ! if (*arg1 == '\0') { ! default_topic = 1; ! arg1 = (char *) help_dat->command; ! } else if (*arg1 == '&') { notify(player, T("Help topics don't start with '&'.")); return; } *************** *** 190,239 **** return; } ! if (help_dat->entries < 10) { /* Just do a linear search for small files */ ! for (n = 0; n < help_dat->entries; n++) { ! if (string_prefix(help_dat->indx[n].topic, the_topic)) { ! entry = &help_dat->indx[n]; ! break; ! } ! } ! } else { /* Binary search of the index */ ! int left = 0; ! int cmp; ! int right = help_dat->entries - 1; ! ! while (1) { ! n = (left + right) / 2; ! ! if (left > right) ! break; ! ! cmp = strcasecmp(the_topic, help_dat->indx[n].topic); ! ! if (cmp == 0) { ! entry = &help_dat->indx[n]; ! break; ! } else if (cmp < 0) { ! /* We need to catch the first prefix */ ! if (string_prefix(help_dat->indx[n].topic, the_topic)) { ! int m; ! for (m = n - 1; m >= 0; m--) { ! if (!string_prefix(help_dat->indx[m].topic, the_topic)) ! break; ! } ! entry = &help_dat->indx[m + 1]; ! break; ! } ! if (left == right) ! break; ! right = n - 1; ! } else { /* cmp > 0 */ ! if (left == right) ! break; ! left = n + 1; ! } ! } ! } if (!entry) { notify_format(player, T("No entry for '%s'."), arg1); --- 193,201 ---- return; } ! entry = help_find_entry(help_dat, the_topic); ! if (!entry && default_topic) ! entry = help_find_entry(help_dat, (restricted ? "&help" : "help")); if (!entry) { notify_format(player, T("No entry for '%s'."), arg1); *************** *** 283,288 **** --- 245,304 ---- notify_format(player, T("%s output truncated."), help_dat->command); } + + static help_indx * + help_find_entry(help_file *help_dat, const char *the_topic) + { + size_t n; + help_indx *entry = NULL; + + if (help_dat->entries < 10) { /* Just do a linear search for small files */ + for (n = 0; n < help_dat->entries; n++) { + if (string_prefix(help_dat->indx[n].topic, the_topic)) { + entry = &help_dat->indx[n]; + break; + } + } + } else { /* Binary search of the index */ + int left = 0; + int cmp; + int right = help_dat->entries - 1; + + while (1) { + n = (left + right) / 2; + + if (left > right) + break; + + cmp = strcasecmp(the_topic, help_dat->indx[n].topic); + + if (cmp == 0) { + entry = &help_dat->indx[n]; + break; + } else if (cmp < 0) { + /* We need to catch the first prefix */ + if (string_prefix(help_dat->indx[n].topic, the_topic)) { + int m; + for (m = n - 1; m >= 0; m--) { + if (!string_prefix(help_dat->indx[m].topic, the_topic)) + break; + } + entry = &help_dat->indx[m + 1]; + break; + } + if (left == right) + break; + right = n - 1; + } else { /* cmp > 0 */ + if (left == right) + break; + left = n + 1; + } + } + } + return entry; + } + static void write_topic(long int p) { *** 1_7_7.487/src/set.c Tue, 17 Jun 2003 16:38:13 -0500 dunemush (pennmush/b/38_set.c 1.26.1.5.1.1.2.1.1.1.1.1.1.11.1.1.1.1.1.1.1.1.1.1.1.1.1.3 660) --- 1_7_7.550(w)/src/set.c Mon, 18 Aug 2003 11:55:59 -0500 dunemush (pennmush/b/38_set.c 1.26.1.5.1.1.2.1.1.1.1.1.1.11.1.1.1.1.1.1.1.1.1.1.1.1.1.8 660) *************** *** 72,77 **** --- 72,79 ---- dbref thing; char *password; + newname = trim_space_sep(newname, ' '); + if ((thing = match_controlled(player, name)) != NOTHING) { /* check for bad name */ if ((*newname == '\0') || strchr(newname, '[')) { *************** *** 135,141 **** delete_player(thing, NULL); set_name(thing, newname); add_player(thing, NULL); ! notify(player, T("Name set.")); return; } else { if (!ok_name(newname)) { --- 137,144 ---- delete_player(thing, NULL); set_name(thing, newname); add_player(thing, NULL); ! if (!AreQuiet(player, thing)) ! notify(player, T("Name set.")); return; } else { if (!ok_name(newname)) { *************** *** 146,152 **** /* everything ok, change the name */ set_name(thing, newname); ! notify(player, T("Name set.")); } } --- 149,156 ---- /* everything ok, change the name */ set_name(thing, newname); ! if (!AreQuiet(player, thing)) ! notify(player, T("Name set.")); } } *************** *** 398,406 **** * This checks for many trivial elocks (canuse/1, where &canuse=1) */ if (zone != NOTHING) { ! struct boolexp *key = getlock(zone, Zone_Lock); if (key == TRUE_BOOLEXP) { ! add_lock(GOD, zone, Zone_Lock, parse_boolexp(zone, "$me", Zone_Lock), -1); if (noisy && !ZONE_CONTROL_ZMP) notify(player, T("Unlocked ZMO - automatically zone-locking ZMO to its owner")); --- 402,410 ---- * This checks for many trivial elocks (canuse/1, where &canuse=1) */ if (zone != NOTHING) { ! boolexp key = getlock(zone, Zone_Lock); if (key == TRUE_BOOLEXP) { ! add_lock(GOD, zone, Zone_Lock, parse_boolexp(zone, "=me", Zone_Lock), -1); if (noisy && !ZONE_CONTROL_ZMP) notify(player, T("Unlocked ZMO - automatically zone-locking ZMO to its owner")); *************** *** 478,489 **** if (*af->flag == NOT_TOKEN) { AL_FLAGS(atr) &= ~af->f; ! if (!Quiet(player) && !(Quiet(thing) && (Owner(thing) == player))) notify_format(player, T("%s/%s - %s reset."), Name(thing), AL_NAME(atr), (af->flag + 1)); } else { AL_FLAGS(atr) |= af->f; ! if (!Quiet(player) && !(Quiet(thing) && (Owner(thing) == player))) notify_format(player, T("%s/%s - %s set."), Name(thing), AL_NAME(atr), af->flag); } --- 482,493 ---- if (*af->flag == NOT_TOKEN) { AL_FLAGS(atr) &= ~af->f; ! if (!AreQuiet(player, thing)) notify_format(player, T("%s/%s - %s reset."), Name(thing), AL_NAME(atr), (af->flag + 1)); } else { AL_FLAGS(atr) |= af->f; ! if (!AreQuiet(player, thing)) notify_format(player, T("%s/%s - %s set."), Name(thing), AL_NAME(atr), af->flag); } *************** *** 818,824 **** *tbufap = '\0'; if (do_set_atr(thing, AL_NAME(a), tbuf1, player, 0) && ! !Quiet(player) && !Quiet(thing)) { if (!ansi_long_flag && ShowAnsi(player)) notify_format(player, "%s - Set: %s", AL_NAME(a), tbuf_ansi); else --- 822,828 ---- *tbufap = '\0'; if (do_set_atr(thing, AL_NAME(a), tbuf1, player, 0) && ! !AreQuiet(player, thing)) { if (!ansi_long_flag && ShowAnsi(player)) notify_format(player, "%s - Set: %s", AL_NAME(a), tbuf_ansi); else *************** *** 911,917 **** wnxt[a] = argv[a + 1]; if (charge_action(player, thing, upcasestr(s))) { ! if (!Quiet(player) && !Quiet(thing)) notify_format(player, "%s - Triggered.", Name(thing)); } else { notify(player, T("No such attribute.")); --- 915,921 ---- wnxt[a] = argv[a + 1]; if (charge_action(player, thing, upcasestr(s))) { ! if (!AreQuiet(player, thing)) notify_format(player, "%s - Triggered.", Name(thing)); } else { notify(player, T("No such attribute.")); *************** *** 1006,1012 **** } /* everything is okay, do the change */ Parent(thing) = parent; ! if (!Quiet(player) && !(Quiet(thing) && (Owner(thing) == player))) notify(player, T("Parent changed.")); } --- 1010,1016 ---- } /* everything is okay, do the change */ Parent(thing) = parent; ! if (!AreQuiet(player, thing)) notify(player, T("Parent changed.")); } *** 1_7_7.487/src/predicat.c Tue, 06 May 2003 17:31:42 -0500 dunemush (pennmush/b/44_predicat.c 1.1.1.34.1.1.1.3.1.4.2.24 660) --- 1_7_7.550(w)/src/predicat.c Mon, 18 Aug 2003 11:55:59 -0500 dunemush (pennmush/b/44_predicat.c 1.1.1.34.1.1.1.3.1.4.2.26 660) *************** *** 339,354 **** ldark = IsPlayer(loc) ? Opaque(loc) : Dark(loc); while (GoodObject(thing)) { ! if (DarkLegal(thing) || (ldark && !Light(thing))) { ! if (!lck) { ! if (See_All(player) || (loc == player) || controls(player, loc)) return thing; ! lck = 1; ! } ! if (controls(player, thing)) /* this is what causes DARK objects to show */ return thing; ! } else { ! return thing; } thing = Next(thing); } --- 339,356 ---- ldark = IsPlayer(loc) ? Opaque(loc) : Dark(loc); while (GoodObject(thing)) { ! if (can_interact(thing, player, INTERACT_SEE)) { ! if (DarkLegal(thing) || (ldark && !Light(thing))) { ! if (!lck) { ! if (See_All(player) || (loc == player) || controls(player, loc)) ! return thing; ! lck = 1; ! } ! if (controls(player, thing)) /* this is what causes DARK objects to show */ return thing; ! } else { return thing; ! } } thing = Next(thing); } *************** *** 407,413 **** int controls(dbref who, dbref what) { ! struct boolexp *c; if (!GoodObject(what)) return 0; --- 409,415 ---- int controls(dbref who, dbref what) { ! boolexp c; if (!GoodObject(what)) return 0; *** 1_7_7.487/src/parse.c Mon, 28 Apr 2003 22:37:00 -0500 dunemush (pennmush/b/48_parse.c 1.23.1.10.1.2.1.1.1.1.1.2.1.2.1.17 660) --- 1_7_7.550(w)/src/parse.c Mon, 18 Aug 2003 11:55:59 -0500 dunemush (pennmush/b/48_parse.c 1.23.1.10.1.2.1.1.1.1.1.2.1.2.1.19 660) *************** *** 1044,1049 **** --- 1044,1066 ---- pe_info->fun_invocations++; fp->where.fun(fp, buff, bp, nfargs, fargs, arglens, executor, caller, enactor, fp->name, pe_info); + if (fp->flags & FN_LOGARGS) { + char logstr[BUFFER_LEN]; + char *logp; + int logi; + logp = logstr; + safe_str(fp->name, logstr, &logp); + safe_chr('(', logstr, &logp); + for (logi = 0; logi < nfargs; logi++) { + safe_str(fargs[logi], logstr, &logp); + if (logi + 1 < nfargs) + safe_str(fargs[logi], logstr, &logp); + } + safe_chr(')', logstr, &logp); + *logp = '\0'; + do_log(LT_CMD, executor, caller, "%s", logstr); + } else if (fp->flags & FN_LOGNAME) + do_log(LT_CMD, executor, caller, "%s()", fp->name); } else { dbref thing; ATTR *attrib; *** 1_7_7.487/src/look.c Mon, 23 Jun 2003 11:10:04 -0500 dunemush (pennmush/c/4_look.c 1.21.1.2.1.9.1.1.1.1.1.10 660) --- 1_7_7.550(w)/src/look.c Mon, 18 Aug 2003 11:55:58 -0500 dunemush (pennmush/c/4_look.c 1.21.1.2.1.9.1.1.1.1.1.11 660) *************** *** 39,44 **** --- 39,46 ---- static void look_exits(dbref player, dbref loc, const char *exit_name); static void look_contents(dbref player, dbref loc, const char *contents_name); static void look_atrs(dbref player, dbref thing, const char *mstr, int all); + static void mortal_look_atrs(dbref player, dbref thing, const char *mstr, + int all); static void look_simple(dbref player, dbref thing); static void look_description(dbref player, dbref thing, const char *def, const char *descname, const char *descformatname); *************** *** 372,377 **** --- 374,392 ---- } static void + mortal_look_atrs(dbref player, dbref thing, const char *mstr, int all) + { + if (all || (mstr && *mstr && !wildcard(mstr))) { + if (!atr_iter_get_visible(player, thing, mstr, look_helper, NULL) && mstr) + notify(player, T("No matching attributes.")); + } else { + if (!atr_iter_get_visible(player, thing, mstr, look_helper_veiled, NULL) + && mstr) + notify(player, T("No matching attributes.")); + } + } + + static void look_simple(dbref player, dbref thing) { int flag = 0; *************** *** 639,645 **** /** Examine an object. * \param player the enactor doing the examining. * \param name name of object to examine. ! * \param brief if 1, a brief examination. * \param all if 1, include veiled attributes. */ void --- 654,660 ---- /** Examine an object. * \param player the enactor doing the examining. * \param name name of object to examine. ! * \param brief if 1, a brief examination. if 2, a mortal examination. * \param all if 1, include veiled attributes. */ void *************** *** 749,757 **** notify_format(player, T("Last Modification: %s"), show_time(ModTime(thing), 0)); } ! if ((brief != 1) && (EX_PUBLIC_ATTRIBS || ok)) { ! look_atrs(player, thing, NULL, all); } /* show contents */ if ((Contents(thing) != NOTHING) && (ok || (!IsRoom(thing) && !Opaque(thing)))) { --- 764,784 ---- notify_format(player, T("Last Modification: %s"), show_time(ModTime(thing), 0)); } ! ! /* show attributes */ ! switch (brief) { ! case 0: /* Standard */ ! if (EX_PUBLIC_ATTRIBS || ok) ! look_atrs(player, thing, NULL, all); ! break; ! case 1: /* Brief */ ! break; ! case 2: /* Mortal */ ! if (EX_PUBLIC_ATTRIBS) ! mortal_look_atrs(player, thing, NULL, all); ! break; } + /* show contents */ if ((Contents(thing) != NOTHING) && (ok || (!IsRoom(thing) && !Opaque(thing)))) { *** 1_7_7.487/src/log.c Mon, 28 Apr 2003 00:35:06 -0500 dunemush (pennmush/c/5_log.c 1.10.1.2.2.4.1.1.2.2.1.4 660) --- 1_7_7.550(w)/src/log.c Mon, 18 Aug 2003 11:55:58 -0500 dunemush (pennmush/c/5_log.c 1.10.1.2.2.4.1.1.2.2.1.5 660) *************** *** 228,246 **** do_rawlog(logtype, "RPT: %s", tbuf1); break; case LT_CMD: ! if (options.log_commands) { ! strcpy(unp1, quick_unparse(player)); ! strcpy(unp2, quick_unparse(Location(player))); ! if (Suspect(player)) ! do_rawlog(logtype, T("CMD: SUSPECT %s in %s: %s"), unp1, unp2, tbuf1); ! else ! do_rawlog(logtype, T("CMD: %s in %s: %s"), unp1, unp2, tbuf1); } else { ! if (Suspect(player)) { ! strcpy(unp1, quick_unparse(player)); ! strcpy(unp2, quick_unparse(Location(player))); ! do_rawlog(logtype, T("CMD: SUSPECT %s in %s: %s"), unp1, unp2, tbuf1); ! } } break; case LT_WIZ: --- 228,242 ---- do_rawlog(logtype, "RPT: %s", tbuf1); break; case LT_CMD: ! strcpy(unp1, quick_unparse(player)); ! if (GoodObject(object)) { ! strcpy(unp2, quick_unparse(object)); ! do_rawlog(logtype, T("CMD: %s %s / %s: %s"), ! (Suspect(player) ? "SUSPECT" : ""), unp1, unp2, tbuf1); } else { ! strcpy(unp2, quick_unparse(Location(player))); ! do_rawlog(logtype, T("CMD: %s %s in %s: %s"), ! (Suspect(player) ? "SUSPECT" : ""), unp1, unp2, tbuf1); } break; case LT_WIZ: *** 1_7_7.487/src/lock.c Mon, 23 Jun 2003 21:49:34 -0500 dunemush (pennmush/c/6_lock.c 1.17.1.13.1.1.1.1.1.2 660) --- 1_7_7.550(w)/src/lock.c Mon, 18 Aug 2003 11:55:58 -0500 dunemush (pennmush/c/6_lock.c 1.17.1.13.1.1.1.1.1.6 660) *************** *** 83,112 **** /** Table of lock names and permissions */ const lock_list lock_types[] = { ! {"Basic", NULL, GOD, LF_PRIVATE, NULL}, ! {"Enter", NULL, GOD, LF_PRIVATE, NULL}, ! {"Use", NULL, GOD, LF_PRIVATE, NULL}, ! {"Zone", NULL, GOD, LF_PRIVATE, NULL}, ! {"Page", NULL, GOD, LF_PRIVATE, NULL}, ! {"Teleport", NULL, GOD, LF_PRIVATE, NULL}, ! {"Speech", NULL, GOD, LF_PRIVATE | LF_WIZARD, NULL}, ! {"Listen", NULL, GOD, LF_PRIVATE, NULL}, ! {"Command", NULL, GOD, LF_PRIVATE, NULL}, ! {"Parent", NULL, GOD, LF_PRIVATE, NULL}, ! {"Link", NULL, GOD, LF_PRIVATE, NULL}, ! {"Leave", NULL, GOD, LF_PRIVATE, NULL}, ! {"Drop", NULL, GOD, LF_PRIVATE, NULL}, ! {"Give", NULL, GOD, LF_PRIVATE, NULL}, ! {"Mail", NULL, GOD, LF_PRIVATE, NULL}, ! {"Follow", NULL, GOD, LF_PRIVATE, NULL}, ! {"Examine", NULL, GOD, LF_PRIVATE | LF_OWNER, NULL}, ! {"Chzone", NULL, GOD, LF_PRIVATE, NULL}, ! {"Forward", NULL, GOD, LF_PRIVATE | LF_OWNER, NULL}, ! {"Control", NULL, GOD, LF_PRIVATE | LF_OWNER, NULL}, ! {"Dropto", NULL, GOD, LF_PRIVATE, NULL}, ! {"Destroy", NULL, GOD, LF_PRIVATE | LF_OWNER, NULL}, /* Add new lock types just before this line. */ ! {NULL, NULL, GOD, 0, NULL} }; /** Table of lock permissions */ --- 83,112 ---- /** Table of lock names and permissions */ const lock_list lock_types[] = { ! {"Basic", TRUE_BOOLEXP, GOD, LF_PRIVATE, NULL}, ! {"Enter", TRUE_BOOLEXP, GOD, LF_PRIVATE, NULL}, ! {"Use", TRUE_BOOLEXP, GOD, LF_PRIVATE, NULL}, ! {"Zone", TRUE_BOOLEXP, GOD, LF_PRIVATE, NULL}, ! {"Page", TRUE_BOOLEXP, GOD, LF_PRIVATE, NULL}, ! {"Teleport", TRUE_BOOLEXP, GOD, LF_PRIVATE, NULL}, ! {"Speech", TRUE_BOOLEXP, GOD, LF_PRIVATE | LF_WIZARD, NULL}, ! {"Listen", TRUE_BOOLEXP, GOD, LF_PRIVATE, NULL}, ! {"Command", TRUE_BOOLEXP, GOD, LF_PRIVATE, NULL}, ! {"Parent", TRUE_BOOLEXP, GOD, LF_PRIVATE, NULL}, ! {"Link", TRUE_BOOLEXP, GOD, LF_PRIVATE, NULL}, ! {"Leave", TRUE_BOOLEXP, GOD, LF_PRIVATE, NULL}, ! {"Drop", TRUE_BOOLEXP, GOD, LF_PRIVATE, NULL}, ! {"Give", TRUE_BOOLEXP, GOD, LF_PRIVATE, NULL}, ! {"Mail", TRUE_BOOLEXP, GOD, LF_PRIVATE, NULL}, ! {"Follow", TRUE_BOOLEXP, GOD, LF_PRIVATE, NULL}, ! {"Examine", TRUE_BOOLEXP, GOD, LF_PRIVATE | LF_OWNER, NULL}, ! {"Chzone", TRUE_BOOLEXP, GOD, LF_PRIVATE, NULL}, ! {"Forward", TRUE_BOOLEXP, GOD, LF_PRIVATE | LF_OWNER, NULL}, ! {"Control", TRUE_BOOLEXP, GOD, LF_PRIVATE | LF_OWNER, NULL}, ! {"Dropto", TRUE_BOOLEXP, GOD, LF_PRIVATE, NULL}, ! {"Destroy", TRUE_BOOLEXP, GOD, LF_PRIVATE | LF_OWNER, NULL}, /* Add new lock types just before this line. */ ! {NULL, TRUE_BOOLEXP, GOD, 0, NULL} }; /** Table of lock permissions */ *************** *** 211,217 **** for (n = 0; n < LOCKS_PER_PAGE - 1; n++) { ll[n].type = NULL; ! ll[n].key = NULL; ll[n].creator = NOTHING; ll[n].flags = 0; ll[n].next = &ll[n + 1]; --- 211,217 ---- for (n = 0; n < LOCKS_PER_PAGE - 1; n++) { ll[n].type = NULL; ! ll[n].key = TRUE_BOOLEXP; ll[n].creator = NOTHING; ll[n].flags = 0; ll[n].next = &ll[n + 1]; *************** *** 219,225 **** ll[n].next = NULL; ll[n].type = NULL; ! ll[n].key = NULL; ll[n].creator = NOTHING; ll[n].flags = 0; --- 219,225 ---- ll[n].next = NULL; ll[n].type = NULL; ! ll[n].key = TRUE_BOOLEXP; ll[n].creator = NOTHING; ll[n].flags = 0; *************** *** 230,236 **** free_list = ll->next; ll->type = NULL; ! ll->key = NULL; return ll; } --- 230,236 ---- free_list = ll->next; ll->type = NULL; ! ll->key = TRUE_BOOLEXP; return ll; } *************** *** 239,245 **** free_lock(lock_list *ll) { ll->type = NULL; ! ll->key = NULL; ll->creator = NOTHING; ll->flags = 0; ll->next = free_list; --- 239,245 ---- free_lock(lock_list *ll) { ll->type = NULL; ! ll->key = TRUE_BOOLEXP; ll->creator = NOTHING; ll->flags = 0; ll->next = free_list; *************** *** 251,257 **** * \param type type of lock to find. * \return pointer to boolexp of lock. */ ! struct boolexp * getlock(dbref thing, lock_type type) { struct lock_list *ll = getlockstruct(thing, type); --- 251,257 ---- * \param type type of lock to find. * \return pointer to boolexp of lock. */ ! boolexp getlock(dbref thing, lock_type type) { struct lock_list *ll = getlockstruct(thing, type); *************** *** 266,272 **** * \param type type of lock to find. * \return pointer to boolexp of lock. */ ! struct boolexp * getlock_noparent(dbref thing, lock_type type) { struct lock_list *ll = getlockstruct_noparent(thing, type); --- 266,272 ---- * \param type type of lock to find. * \return pointer to boolexp of lock. */ ! boolexp getlock_noparent(dbref thing, lock_type type) { struct lock_list *ll = getlockstruct_noparent(thing, type); *************** *** 366,373 **** * \retval 1 success. */ int ! add_lock(dbref player, dbref thing, lock_type type, struct boolexp *key, ! int flags) { lock_list *ll, **t; lock_type real_type = type; --- 366,372 ---- * \retval 1 success. */ int ! add_lock(dbref player, dbref thing, lock_type type, boolexp key, int flags) { lock_list *ll, **t; lock_type real_type = type; *************** *** 439,446 **** * \retval 0 failure. */ int ! add_lock_raw(dbref player, dbref thing, lock_type type, struct boolexp *key, ! int flags) { lock_list *ll, **t; lock_type real_type = type; --- 438,444 ---- * \retval 0 failure. */ int ! add_lock_raw(dbref player, dbref thing, lock_type type, boolexp key, int flags) { lock_list *ll, **t; lock_type real_type = type; *************** *** 611,621 **** if ((thing = match_controlled(player, name)) != NOTHING) { if ((real_type = check_lock_type(player, thing, type)) != NULL) { if (getlock(thing, real_type) == TRUE_BOOLEXP) { ! if (!Quiet(player) && !(Quiet(thing) && (Owner(thing) == player))) notify_format(player, T("%s(%s) - %s (already) unlocked."), Name(thing), unparse_dbref(thing), real_type); } else if (delete_lock(player, thing, real_type)) { ! if (!Quiet(player) && !(Quiet(thing) && (Owner(thing) == player))) notify_format(player, T("%s(%s) - %s unlocked."), Name(thing), unparse_dbref(thing), real_type); ModTime(thing) = mudtime; --- 609,619 ---- if ((thing = match_controlled(player, name)) != NOTHING) { if ((real_type = check_lock_type(player, thing, type)) != NULL) { if (getlock(thing, real_type) == TRUE_BOOLEXP) { ! if (!AreQuiet(player, thing)) notify_format(player, T("%s(%s) - %s (already) unlocked."), Name(thing), unparse_dbref(thing), real_type); } else if (delete_lock(player, thing, real_type)) { ! if (!AreQuiet(player, thing)) notify_format(player, T("%s(%s) - %s unlocked."), Name(thing), unparse_dbref(thing), real_type); ModTime(thing) = mudtime; *************** *** 639,645 **** { lock_type real_type; dbref thing; ! struct boolexp *key; char *sp; /* check for '@lock /' */ --- 637,643 ---- { lock_type real_type; dbref thing; ! boolexp key; char *sp; /* check for '@lock /' */ *************** *** 680,686 **** if ((real_type = check_lock_type(player, thing, type)) != NULL) { /* everything ok, do it */ if (add_lock(player, thing, real_type, key, -1)) { ! if (!Quiet(player) && !(Quiet(thing) && (Owner(thing) == player))) notify_format(player, T("%s(%s) - %s locked."), Name(thing), unparse_dbref(thing), real_type); ModTime(thing) = mudtime; --- 678,684 ---- if ((real_type = check_lock_type(player, thing, type)) != NULL) { /* everything ok, do it */ if (add_lock(player, thing, real_type, key, -1)) { ! if (!AreQuiet(player, thing)) notify_format(player, T("%s(%s) - %s locked."), Name(thing), unparse_dbref(thing), real_type); ModTime(thing) = mudtime; *** 1_7_7.487/src/info_slave.c Mon, 28 Apr 2003 00:35:06 -0500 dunemush (pennmush/c/7_info_slave 1.9.1.4.1.5 660) --- 1_7_7.550(w)/src/info_slave.c Mon, 18 Aug 2003 11:55:58 -0500 dunemush (pennmush/c/7_info_slave 1.9.1.4.1.6 660) *************** *** 106,111 **** --- 106,112 ---- int len, size; IDENT *ident_result; char host[NI_MAXHOST]; + char lport[NI_MAXSERV]; int use_ident, use_dns, timeout; socklen_t llen, rlen; struct iovec dat[3]; *************** *** 186,191 **** --- 187,198 ---- else safe_str(host, buf, &bp); safe_chr('^', buf, &bp); + if (getnameinfo(&local.addr, llen, NULL, 0, lport, sizeof lport, + NI_NUMERICHOST | NI_NUMERICSERV) != 0) + safe_str("An error occured", buf, &bp); + else + safe_str(lport, buf, &bp); + safe_chr('^', buf, &bp); if (use_ident > 0) { timeout = use_ident; *** 1_7_7.487/src/game.c Mon, 23 Jun 2003 11:10:04 -0500 dunemush (pennmush/c/10_game.c 1.50.1.8.1.1.1.1.2.1.1.1.2.1.1.4.1.1.1.1.1.1.1.1.1.1.2.1.1.2.1.1.1.1.1.1.1.2.1.1.1.2.1.1.1.1.1.1.1.1.1.5.1.3.1.2.1.2.1.1.1.1.1.1.1.5 660) --- 1_7_7.550(w)/src/game.c Mon, 18 Aug 2003 11:55:58 -0500 dunemush (pennmush/c/10_game.c 1.50.1.8.1.1.1.1.2.1.1.1.2.1.1.4.1.1.1.1.1.1.1.1.1.1.2.1.1.2.1.1.1.1.1.1.1.2.1.1.1.2.1.1.1.1.1.1.1.1.1.5.1.3.1.2.1.2.1.1.1.1.1.1.1.1.1.10 660) *************** *** 59,64 **** --- 59,67 ---- #ifdef MEM_CHECK #include "memcheck.h" #endif + #ifdef HAS_OPENSSL + #include "myssl.h" + #endif #include "getpgsiz.h" #include "parse.h" #include "access.h" *************** *** 312,320 **** --- 315,325 ---- char tmpfl[2048]; FILE *f = NULL; + #ifndef PROFILING #ifndef WIN32 ignore_signal(SIGPROF); #endif + #endif #ifdef I_SETJMP if (setjmp(db_err)) { /* The dump failed. Disk might be full or something went bad with the *************** *** 322,330 **** --- 327,337 ---- do_rawlog(LT_ERR, T("ERROR! Database save failed.")); flag_broadcast("WIZARD ROYALTY", 0, T("GAME: ERROR! Database save failed!")); + #ifndef PROFILING #ifdef HAS_ITIMER install_sig_handler(SIGPROF, signal_cpu_limit); #endif + #endif return 1; } else { local_dump_database(); *************** *** 412,420 **** --- 419,429 ---- } #endif + #ifndef PROFILING #ifdef HAS_ITIMER install_sig_handler(SIGPROF, signal_cpu_limit); #endif + #endif return 0; } *************** *** 431,437 **** --- 440,456 ---- { const char *panicfile = options.crash_db; FILE *f = NULL; + static int already_panicking = 0; + + if (already_panicking) { + do_rawlog(LT_ERR, + T + ("PANIC: Attempted to panic because of '%s' while already panicking. Run in circles, scream and shout!"), + message); + _exit(133); + } + already_panicking = 1; do_rawlog(LT_ERR, "PANIC: %s", message); report(); flag_broadcast(0, 0, "EMERGENCY SHUTDOWN: %s", message); *************** *** 500,505 **** --- 519,528 ---- int child, nofork, status; epoch++; + #ifdef LOG_CHUNK_STATS + chunk_stats(NOTHING, 0); + chunk_stats(NOTHING, 1); + #endif do_rawlog(LT_CHECK, "CHECKPOINTING: %s.#%d#\n", dumpfile, epoch); if (NO_FORK) nofork = 1; *************** *** 508,516 **** if (!nofork && chunk_num_swapped()) { /* Ack, can't fork, 'cause we have stuff on disk... */ do_log(LT_ERR, 0, 0, ! "fork_and_dump: Attributes are swapped to disk, so nonforking dumps will be used."); flag_broadcast("WIZARD", 0, ! "DUMP: Attributes are swapped to disk, so nonforking dumps will be used."); nofork = 1; } #ifdef WIN32 --- 531,539 ---- if (!nofork && chunk_num_swapped()) { /* Ack, can't fork, 'cause we have stuff on disk... */ do_log(LT_ERR, 0, 0, ! "fork_and_dump: Data are swapped to disk, so nonforking dumps will be used."); flag_broadcast("WIZARD", 0, ! "DUMP: Data are swapped to disk, so nonforking dumps will be used."); nofork = 1; } #ifdef WIN32 *************** *** 567,572 **** --- 590,598 ---- flag_broadcast(0, 0, "%s", DUMP_NOFORK_COMPLETE); } } + #ifdef LOG_CHUNK_STATS + chunk_stats(NOTHING, 5); + #endif } /** Start up the MUSH. *************** *** 701,706 **** --- 727,739 ---- local_startup(); /* everything else ok. Restart all objects. */ do_restart(); + #ifdef HAS_OPENSSL + /* Set up ssl */ + if (!ssl_init()) { + fprintf(stderr, "SSL initialization failure\n"); + options.ssl_port = 0; /* Disable ssl */ + } + #endif } *************** *** 940,946 **** orator = player; if (options.log_commands || Suspect(player)) ! do_log(LT_CMD, player, 0, "%s", command); if Verbose (player) --- 973,979 ---- orator = player; if (options.log_commands || Suspect(player)) ! do_log(LT_CMD, player, NOTHING, "%s", command); if Verbose (player) *** 1_7_7.487/src/funtime.c Mon, 16 Jun 2003 23:53:35 -0500 dunemush (pennmush/c/12_funtime.c 1.11.1.14.1.3 660) --- 1_7_7.550(w)/src/funtime.c Mon, 18 Aug 2003 11:55:58 -0500 dunemush (pennmush/c/12_funtime.c 1.11.1.14.1.1.1.2 660) *************** *** 40,50 **** return; /* No field? Bad user. */ if (nargs == 2) { ! if (!is_uinteger(args[1])) { safe_str(T(e_uint), buff, bp); return; } - tt = parse_uinteger(args[1]); } else tt = mudtime; --- 40,61 ---- return; /* No field? Bad user. */ if (nargs == 2) { ! /* This is silly, but time_t is signed on several platforms, ! * so we can't assign an unsigned int to it safely ! */ ! if (!is_integer(args[1])) { ! safe_str(T(e_uint), buff, bp); ! return; ! } ! tt = parse_integer(args[1]); ! if (errno == ERANGE) { ! safe_str(T(e_range), buff, bp); ! return; ! } ! if (tt < 0) { safe_str(T(e_uint), buff, bp); return; } } else tt = mudtime; *************** *** 165,172 **** * If pad > 0, pad with 0's (i.e. 0d 0h 5m 1s) * If pad > 1, force all #'s to be 2 digits */ ! int secs, pad; ! int days, hours, mins; if (!is_uinteger(args[0])) { safe_str(T(e_uints), buff, bp); --- 176,183 ---- * If pad > 0, pad with 0's (i.e. 0d 0h 5m 1s) * If pad > 1, force all #'s to be 2 digits */ ! unsigned int secs, pad; ! unsigned int days, hours, mins; if (!is_uinteger(args[0])) { safe_str(T(e_uints), buff, bp); *************** *** 192,206 **** secs %= 60; if (pad || (days > 0)) { if (pad == 2) ! safe_format(buff, bp, "%02dd %02dh %02dm %02ds", days, hours, mins, secs); else ! safe_format(buff, bp, "%dd %2dh %2dm %2ds", days, hours, mins, secs); } else if (hours > 0) ! safe_format(buff, bp, "%2dh %2dm %2ds", hours, mins, secs); else if (mins > 0) ! safe_format(buff, bp, "%2dm %2ds", mins, secs); else ! safe_format(buff, bp, "%2ds", secs); } #ifdef HAS_GETDATE --- 203,217 ---- secs %= 60; if (pad || (days > 0)) { if (pad == 2) ! safe_format(buff, bp, "%02ud %02uh %02um %02us", days, hours, mins, secs); else ! safe_format(buff, bp, "%ud %2uh %2um %2us", days, hours, mins, secs); } else if (hours > 0) ! safe_format(buff, bp, "%2uh %2um %2us", hours, mins, secs); else if (mins > 0) ! safe_format(buff, bp, "%2um %2us", mins, secs); else ! safe_format(buff, bp, "%2us", secs); } #ifdef HAS_GETDATE *** 1_7_7.487/src/funstr.c Mon, 28 Apr 2003 22:37:00 -0500 dunemush (pennmush/c/13_funstr.c 1.28.1.1.1.2.1.4.1.6.1.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.2.1.3.1.5.1.3.1.2.1.1.1.1.1.1.1.1.1.7 660) --- 1_7_7.550(w)/src/funstr.c Mon, 18 Aug 2003 11:55:58 -0500 dunemush (pennmush/c/13_funstr.c 1.28.1.1.1.2.1.4.1.6.1.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.2.1.3.1.5.1.3.1.2.1.1.1.1.1.1.1.1.1.10 660) *************** *** 1011,1017 **** /* Alas, PennMUSH and TinyMUSH used different orders for the arguments. * We'll give the users an option about it */ ! if (TINY_TRIM_FUN) { trim_style_arg = 2; trim_char_arg = 3; } else { --- 1011,1023 ---- /* Alas, PennMUSH and TinyMUSH used different orders for the arguments. * We'll give the users an option about it */ ! if (!strcmp(called_as, "TRIMTINY")) { ! trim_style_arg = 2; ! trim_char_arg = 3; ! } else if (!strcmp(called_as, "TRIMPENN")) { ! trim_style_arg = 3; ! trim_char_arg = 2; ! } else if (TINY_TRIM_FUN) { trim_style_arg = 2; trim_char_arg = 3; } else { *** 1_7_7.487/src/funlist.c Thu, 01 May 2003 09:58:39 -0500 dunemush (pennmush/c/16_funlist.c 1.3.1.1.1.5.1.2.1.1.1.1.1.4.1.2.1.2.1.19.1.2.1.1.1.2.1.5.1.1.1.1.1.1.1.1.1.1.2.1.1.3.1.2.1.1.1.1.1.1.1.1.1.1.1.12.1.13 660) --- 1_7_7.550(w)/src/funlist.c Mon, 18 Aug 2003 11:55:58 -0500 dunemush (pennmush/c/16_funlist.c 1.3.1.1.1.5.1.2.1.1.1.1.1.4.1.2.1.2.1.19.1.2.1.1.1.2.1.5.1.1.1.1.1.1.1.1.1.1.2.1.1.3.1.2.1.1.1.1.1.1.1.1.1.1.1.12.1.14 660) *************** *** 2606,2616 **** int flags = 0, all = 0, match_offset = 0, len, funccount; int i; - if (!tables) { - /* Initialize char tables so they match current locale. */ - tables = pcre_maketables(); - } - if (called_as[strlen(called_as) - 1] == 'I') flags = PCRE_CASELESS; --- 2606,2611 ---- *************** *** 2763,2773 **** return; } - if (!tables) { - /* Initialize char tables so they match current locale. */ - tables = pcre_maketables(); - } - if ((re = pcre_compile(args[1], flags, &errptr, &erroffset, tables)) == NULL) { /* Matching error. */ safe_str(T("#-1 REGEXP ERROR: "), buff, bp); --- 2758,2763 ---- *************** *** 2839,2848 **** safe_str(T("#-1 INVALID GREP PATTERN"), buff, bp); return; } - if (!tables) { - /* Initialize char tables so they match current locale. */ - tables = pcre_maketables(); - } if (strcmp(called_as, "REGREPI") == 0) flags = PCRE_CASELESS; --- 2829,2834 ---- *************** *** 2915,2925 **** int flags = 0, all = 0; char *osep, osepd[2] = { '\0', '\0' }; - if (!tables) { - /* Initialize char tables so they match current locale. */ - tables = pcre_maketables(); - } - if (!delim_check(buff, bp, nargs, args, 3, &sep)) return; --- 2901,2906 ---- *** 1_7_7.487/src/fundb.c Mon, 23 Jun 2003 11:10:04 -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.15 660) --- 1_7_7.550(w)/src/fundb.c Mon, 18 Aug 2003 11:55:58 -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.16 660) *************** *** 1390,1397 **** do_name(executor, args[0], args[1]); #else safe_str(T(e_disabled), buff, bp); - return; #endif } it = match_thing(executor, args[0]); if (GoodObject(it)) --- 1390,1397 ---- do_name(executor, args[0], args[1]); #else safe_str(T(e_disabled), buff, bp); #endif + return; } it = match_thing(executor, args[0]); if (GoodObject(it)) *** 1_7_7.487/src/function.c Mon, 16 Jun 2003 23:42:42 -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.18 660) --- 1_7_7.550(w)/src/function.c Mon, 18 Aug 2003 11:55:58 -0500 dunemush (pennmush/c/18_function.c 1.29.1.14.1.3.1.6.1.1.1.1.1.14.1.2.1.1.1.7.1.22 660) *************** *** 449,455 **** {"SETDIFF", fun_setdiff, 2, 5, FN_REG}, {"SETINTER", fun_setinter, 2, 5, FN_REG}, {"SETUNION", fun_setunion, 2, 5, FN_REG}, ! {"SHA1", fun_sha1, 1, 1, FN_REG}, {"SHL", fun_shl, 2, 2, FN_REG}, {"SHR", fun_shr, 2, 2, FN_REG}, {"SHUFFLE", fun_shuffle, 1, 3, FN_REG}, --- 449,455 ---- {"SETDIFF", fun_setdiff, 2, 5, FN_REG}, {"SETINTER", fun_setinter, 2, 5, FN_REG}, {"SETUNION", fun_setunion, 2, 5, FN_REG}, ! {"SHA0", fun_sha0, 1, 1, FN_REG}, {"SHL", fun_shl, 2, 2, FN_REG}, {"SHR", fun_shr, 2, 2, FN_REG}, {"SHUFFLE", fun_shuffle, 1, 3, FN_REG}, *************** *** 462,467 **** --- 462,468 ---- {"SPELLNUM", fun_spellnum, 1, 1, FN_REG}, {"SPLICE", fun_splice, 3, 4, FN_REG}, {"SQUISH", fun_squish, 1, 2, FN_REG}, + {"SSL", fun_ssl, 1, 1, FN_REG}, {"STARTTIME", fun_starttime, 0, 0, FN_REG}, {"STEP", fun_step, 3, 5, FN_REG}, {"STRCAT", fun_strcat, 1, INT_MAX, FN_REG}, *************** *** 484,489 **** --- 485,492 ---- {"TIMEFMT", fun_timefmt, 1, 2, FN_REG}, {"TIMESTRING", fun_timestring, 1, 2, FN_REG}, {"TRIM", fun_trim, 1, 3, FN_REG}, + {"TRIMPENN", fun_trim, 1, 3, FN_REG}, + {"TRIMTINY", fun_trim, 1, 3, FN_REG}, {"TRUNC", fun_trunc, 1, 1, FN_REG}, {"TYPE", fun_type, 1, 1, FN_REG}, {"UCSTR", fun_ucstr, 1, -1, FN_REG}, *************** *** 798,838 **** 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; } --- 801,848 ---- FUN *fp; int clear = 0; unsigned int flags = 0; + char *tp; if (!name || !*name) return 0; fp = func_hash_lookup(name); if (!fp) return 0; ! while (restriction && *restriction) { ! if ((tp = strchr(restriction, ' '))) ! *tp++ = '\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 if (!strcasecmp(restriction, "logargs")) { ! flags |= FN_LOGARGS; ! } else if (!strcasecmp(restriction, "logname")) { ! flags |= FN_LOGNAME; ! } ! if (clear) ! fp->flags &= ~flags; ! else ! fp->flags |= flags; ! restriction = tp; } return 1; } *************** *** 1266,1271 **** --- 1276,1293 ---- first = 0; } + if (fp->flags & FN_LOGARGS) { + if (first == 0) + safe_strl(", ", 2, tbuf, &tp); + safe_str("LogArgs", tbuf, &tp); + first = 0; + } else if (fp->flags & FN_LOGNAME) { + if (first == 0) + safe_strl(", ", 2, tbuf, &tp); + safe_str("LogName", tbuf, &tp); + first = 0; + } + if (fp->flags & FN_NOGAGGED) { if (first == 0) *** 1_7_7.487/src/funcrypt.c Sun, 23 Feb 2003 16:38:26 -0600 dunemush (pennmush/c/19_funcrypt.c 1.10 660) --- 1_7_7.550(w)/src/funcrypt.c Mon, 18 Aug 2003 11:55:58 -0500 dunemush (pennmush/c/19_funcrypt.c 1.11 660) *************** *** 117,123 **** safe_boolean(password_check(it, args[1]), buff, bp); } ! FUNCTION(fun_sha1) { SHS_INFO shsInfo; shsInfo.reverse_wanted = (BYTE) options.reverse_shs; --- 117,123 ---- safe_boolean(password_check(it, args[1]), buff, bp); } ! FUNCTION(fun_sha0) { SHS_INFO shsInfo; shsInfo.reverse_wanted = (BYTE) options.reverse_shs; *** 1_7_7.487/src/flags.c Sat, 31 May 2003 16:38:17 -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.51 660) --- 1_7_7.550(w)/src/flags.c Mon, 18 Aug 2003 11:55:58 -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.52 660) *************** *** 110,116 **** F_INTERNAL | F_MDARK}, {"GAGGED", 'g', TYPE_PLAYER, PLAYER_GAGGED, F_WIZARD, F_WIZARD}, {"MYOPIC", 'm', TYPE_PLAYER, PLAYER_MYOPIC, F_ANY, F_ANY}, ! {"TERSE", 'x', TYPE_PLAYER, PLAYER_TERSE, F_ANY, F_ANY}, #ifdef JURY_OK {"JURY_OK", 'j', TYPE_PLAYER, PLAYER_JURY, F_ROYAL, F_ROYAL}, {"JUDGE", 'J', TYPE_PLAYER, PLAYER_JUDGE, F_ROYAL, F_ROYAL}, --- 110,116 ---- F_INTERNAL | F_MDARK}, {"GAGGED", 'g', TYPE_PLAYER, PLAYER_GAGGED, F_WIZARD, F_WIZARD}, {"MYOPIC", 'm', TYPE_PLAYER, PLAYER_MYOPIC, F_ANY, F_ANY}, ! {"TERSE", 'x', TYPE_PLAYER | TYPE_THING, PLAYER_TERSE, F_ANY, F_ANY}, #ifdef JURY_OK {"JURY_OK", 'j', TYPE_PLAYER, PLAYER_JURY, F_ROYAL, F_ROYAL}, {"JUDGE", 'J', TYPE_PLAYER, PLAYER_JUDGE, F_ROYAL, F_ROYAL}, *************** *** 608,616 **** --- 608,619 ---- static void flag_add_additional(void) { + FLAG *f; add_flag("MISTRUST", 'm', TYPE_THING | TYPE_EXIT | TYPE_ROOM, F_INHERIT, F_INHERIT); add_flag("ORPHAN", 'i', NOTYPE, F_ANY, F_ANY); + if ((f = match_flag("TERSE"))) + f->type |= TYPE_THING; local_flags(); } *** 1_7_7.487/src/extmail.c Mon, 23 Jun 2003 11:10:04 -0500 dunemush (pennmush/c/22_extmail.c 1.44.1.7.1.5.1.9.1.1.1.1.1.5 660) --- 1_7_7.550(w)/src/extmail.c Mon, 18 Aug 2003 11:55:58 -0500 dunemush (pennmush/c/22_extmail.c 1.44.1.7.1.5.1.9.1.1.1.1.1.7 660) *************** *** 129,134 **** --- 129,136 ---- static char *status_chars(MAIL *mp); static char *status_string(MAIL *mp); static int sign(int x); + static char *get_message(MAIL *mp); + static char *get_compressed_message(MAIL *mp); static char *get_subject(MAIL *mp); static char *get_sender(MAIL *mp, int full); static int was_sender(dbref player, MAIL *mp); *************** *** 162,167 **** --- 164,197 ---- * do_mail_subject - set the current mail subject *-------------------------------------------------------------------------*/ + /* Return the uncompressed text of a @mail in a static buffer */ + static char * + get_message(MAIL *mp) + { + static char text[BUFFER_LEN * 2]; + char tbuf[BUFFER_LEN * 2]; + + if (!mp) + return NULL; + + chunk_fetch(mp->msgid, tbuf, sizeof tbuf); + strcpy(text, uncompress(tbuf)); + return text; + } + + /* Return the compressed text of a @mail in a static buffer */ + static char * + get_compressed_message(MAIL *mp) + { + static char text[BUFFER_LEN * 2]; + + if (!mp) + return NULL; + + chunk_fetch(mp->msgid, text, sizeof text); + return text; + } + /* Return the subject of a mail message, or (no subject) */ static char * get_subject(MAIL *mp) *************** *** 527,533 **** notify(player, DASH_LINE); if (SUPPORT_PUEBLO) notify_noenter(player, tprintf("%c/SAMP%c", TAG_START, TAG_END)); ! strcpy(tbuf1, uncompress(mp->message)); notify(player, tbuf1); if (SUPPORT_PUEBLO) notify_format(player, "%cSAMP%c%s%c/SAMP%c", TAG_START, TAG_END, --- 557,563 ---- notify(player, DASH_LINE); if (SUPPORT_PUEBLO) notify_noenter(player, tprintf("%c/SAMP%c", TAG_START, TAG_END)); ! strcpy(tbuf1, get_message(mp)); notify(player, tbuf1); if (SUPPORT_PUEBLO) notify_format(player, "%cSAMP%c%s%c/SAMP%c", TAG_START, TAG_END, *************** *** 668,676 **** nextp = mp->next; /* then wipe */ mdb_top--; ! if (mp->subject != mp->message) ! free(mp->subject); ! free(mp->message); mush_free((Malloc_t) mp, "mail"); } else { nextp = mp->next; --- 698,705 ---- nextp = mp->next; /* then wipe */ mdb_top--; ! free(mp->subject); ! chunk_delete(mp->msgid); mush_free((Malloc_t) mp, "mail"); } else { nextp = mp->next; *************** *** 746,753 **** if (!temp) { notify(player, T("MAIL: You can't reply to nonexistant mail.")); } else { ! send_mail(player, temp->from, uncompress(mp->subject), ! (char *) mp->message, M_FORWARD | M_REPLY, 1, 0); num_recpts++; } } else { --- 775,785 ---- if (!temp) { notify(player, T("MAIL: You can't reply to nonexistant mail.")); } else { ! char tbuf1[BUFFER_LEN], tbuf2[BUFFER_LEN]; ! strcpy(tbuf1, uncompress(mp->subject)); ! strcpy(tbuf2, get_compressed_message(mp)); ! send_mail(player, temp->from, tbuf1, tbuf2, M_FORWARD | M_REPLY, ! 1, 0); num_recpts++; } } else { *************** *** 762,769 **** if (!GoodObject(target) || !IsPlayer(target)) { notify_format(player, T("No such unique player: %s."), current); } else { ! send_mail(player, target, uncompress(mp->subject), ! (char *) mp->message, M_FORWARD, 1, 0); num_recpts++; } } --- 794,803 ---- if (!GoodObject(target) || !IsPlayer(target)) { notify_format(player, T("No such unique player: %s."), current); } else { ! char tbuf1[BUFFER_LEN], tbuf2[BUFFER_LEN]; ! strcpy(tbuf1, uncompress(mp->subject)); ! strcpy(tbuf2, get_compressed_message(mp)); ! send_mail(player, target, tbuf1, tbuf2, M_FORWARD, 1, 0); num_recpts++; } } *************** *** 984,991 **** newp->subject = compress(sbuf); if (flags & M_FORWARD) { /* Forwarding passes the message already compressed */ ! newp->message = u_strdup((unsigned char *) message); } else { newmsg = (char *) mush_malloc(BUFFER_LEN, "string"); if (!newmsg) panic(T("Failed to allocate string in send_mail")); --- 1018,1028 ---- newp->subject = compress(sbuf); if (flags & M_FORWARD) { /* Forwarding passes the message already compressed */ ! int len = strlen(message) + 1; ! newp->msgid = chunk_create(message, len, 1); } else { + int len; + unsigned char *text; newmsg = (char *) mush_malloc(BUFFER_LEN, "string"); if (!newmsg) panic(T("Failed to allocate string in send_mail")); *************** *** 1006,1012 **** mush_free((Malloc_t) buff, "string"); } *nm = '\0'; ! newp->message = compress(newmsg); mush_free((Malloc_t) newmsg, "string"); } --- 1043,1052 ---- mush_free((Malloc_t) buff, "string"); } *nm = '\0'; ! text = compress(newmsg); ! len = strlen(text) + 1; ! newp->msgid = chunk_create(text, len, 1); ! free(text); mush_free((Malloc_t) newmsg, "string"); } *************** *** 1082,1090 **** /* walk the list */ for (mp = HEAD; mp != NULL; mp = nextp) { nextp = mp->next; ! if (mp->subject != mp->message) free(mp->subject); ! free(mp->message); mush_free((Malloc_t) mp, "mail"); } --- 1122,1130 ---- /* walk the list */ for (mp = HEAD; mp != NULL; mp = nextp) { nextp = mp->next; ! if (mp->subject) free(mp->subject); ! chunk_delete(mp->msgid); mush_free((Malloc_t) mp, "mail"); } *************** *** 1162,1170 **** nextp = mp->next; /* then wipe */ mdb_top--; ! if (mp->subject != mp->message) free(mp->subject); ! free(mp->message); mush_free((Malloc_t) mp, "mail"); } else if (!GoodObject(mp->from)) { /* Oops, it's from a player whose dbref is out of range! --- 1202,1210 ---- nextp = mp->next; /* then wipe */ mdb_top--; ! if (mp->subject) free(mp->subject); ! chunk_delete(mp->msgid); mush_free((Malloc_t) mp, "mail"); } else if (!GoodObject(mp->from)) { /* Oops, it's from a player whose dbref is out of range! *************** *** 1262,1274 **** for (mp = HEAD; mp != NULL; mp = mp->next) { if (Cleared(mp)) { fc++; ! cchars += strlen((char *) uncompress(mp->message)); } else if (Read(mp)) { fr++; ! fchars += strlen((char *) uncompress(mp->message)); } else { fu++; ! tchars += strlen((char *) uncompress(mp->message)); } } notify_format(player, --- 1302,1314 ---- for (mp = HEAD; mp != NULL; mp = mp->next) { if (Cleared(mp)) { fc++; ! cchars += strlen(get_message(mp)); } else if (Read(mp)) { fr++; ! fchars += strlen(get_message(mp)); } else { fu++; ! tchars += strlen(get_message(mp)); } } notify_format(player, *************** *** 1309,1315 **** else fu++; if (full == 2) ! fchars += strlen((char *) uncompress(mp->message)); } if (mp->to == target) { if (!tr && !tu) --- 1349,1355 ---- else fu++; if (full == 2) ! fchars += strlen(get_message(mp)); } if (mp->to == target) { if (!tr && !tu) *************** *** 1321,1327 **** else tu++; if (full == 2) ! tchars += strlen((char *) uncompress(mp->message)); } } --- 1361,1367 ---- else tu++; if (full == 2) ! tchars += strlen(get_message(mp)); } } *************** *** 1510,1516 **** /* That didn't work. Ok, try mailfun_fetch */ mp = mailfun_fetch(executor, nargs, args[0], args[1]); if (mp) { ! safe_str(uncompress(mp->message), buff, bp); return; } safe_str(T("#-1 INVALID MESSAGE OR PLAYER"), buff, bp); --- 1550,1556 ---- /* That didn't work. Ok, try mailfun_fetch */ mp = mailfun_fetch(executor, nargs, args[0], args[1]); if (mp) { ! safe_str(get_message(mp), buff, bp); return; } safe_str(T("#-1 INVALID MESSAGE OR PLAYER"), buff, bp); *************** *** 1667,1679 **** for (mp = HEAD; mp != NULL; mp = mp->next) { if (Cleared(mp)) { fc++; ! cchars += strlen((char *) uncompress(mp->message)); } else if (Read(mp)) { fr++; ! fchars += strlen((char *) uncompress(mp->message)); } else { fu++; ! tchars += strlen((char *) uncompress(mp->message)); } } /* FORMAT --- 1707,1719 ---- for (mp = HEAD; mp != NULL; mp = mp->next) { if (Cleared(mp)) { fc++; ! cchars += strlen(get_message(mp)); } else if (Read(mp)) { fr++; ! fchars += strlen(get_message(mp)); } else { fu++; ! tchars += strlen(get_message(mp)); } } /* FORMAT *************** *** 1713,1719 **** else fu++; if (full == 2) ! fchars += strlen((char *) uncompress(mp->message)); } if (mp->to == target) { if (!tr && !tu) --- 1753,1759 ---- else fu++; if (full == 2) ! fchars += strlen(get_message(mp)); } if (mp->to == target) { if (!tr && !tu) *************** *** 1725,1731 **** else tu++; if (full == 2) ! tchars += strlen((char *) uncompress(mp->message)); } } --- 1765,1771 ---- else tu++; if (full == 2) ! tchars += strlen(get_message(mp)); } } *************** *** 1822,1828 **** putstring(fp, uncompress(mp->subject)); else putstring(fp, ""); ! putstring(fp, uncompress(mp->message)); putref(fp, mp->read); count++; } --- 1862,1868 ---- putstring(fp, uncompress(mp->subject)); else putstring(fp, ""); ! putstring(fp, get_message(mp)); putref(fp, mp->read); count++; } *************** *** 1925,1930 **** --- 1965,1972 ---- { char nbuf1[8]; unsigned char *tbuf = NULL; + unsigned char *text; + int len; int mail_top = 0; int mail_flags = 0; int i = 0; *************** *** 1980,1990 **** if (mail_flags & MDBF_SUBJECT) { tbuf = compress(getstring_noalloc(fp)); } ! mp->message = compress(getstring_noalloc(fp)); if (mail_flags & MDBF_SUBJECT) mp->subject = tbuf; else { ! strcpy(sbuf, uncompress(mp->message)); mp->subject = compress(chopstr(sbuf, SUBJECT_LEN)); } mp->read = getref(fp); --- 2022,2035 ---- if (mail_flags & MDBF_SUBJECT) { tbuf = compress(getstring_noalloc(fp)); } ! text = compress(getstring_noalloc(fp)); ! len = strlen(text) + 1; ! mp->msgid = chunk_create(text, len, 1); ! free(text); if (mail_flags & MDBF_SUBJECT) mp->subject = tbuf; else { ! strcpy(sbuf, get_message(mp)); mp->subject = compress(chopstr(sbuf, SUBJECT_LEN)); } mp->read = getref(fp); *************** *** 2011,2021 **** tbuf = compress(getstring_noalloc(fp)); else tbuf = NULL; ! mp->message = compress(getstring_noalloc(fp)); if (tbuf) mp->subject = tbuf; else { ! strcpy(sbuf, uncompress(mp->message)); mp->subject = compress(chopstr(sbuf, SUBJECT_LEN)); } mp->read = getref(fp); --- 2056,2069 ---- tbuf = compress(getstring_noalloc(fp)); else tbuf = NULL; ! text = compress(getstring_noalloc(fp)); ! len = strlen(text) + 1; ! mp->msgid = chunk_create(text, len, 1); ! free(text); if (tbuf) mp->subject = tbuf; else { ! strcpy(sbuf, get_message(mp)); mp->subject = compress(chopstr(sbuf, SUBJECT_LEN)); } mp->read = getref(fp); *** 1_7_7.487/src/extchat.c Mon, 23 Jun 2003 11:10:04 -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.34 660) --- 1_7_7.550(w)/src/extchat.c Mon, 18 Aug 2003 11:55:57 -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.37 660) *************** *** 10,15 **** --- 10,16 ---- #include #include #include + #include #ifdef I_SYS_TYPES #include #endif *************** *** 1355,1361 **** CHAN *chan = NULL, *temp = NULL; long int type; int res; ! struct boolexp *key; char old[CHAN_NAME_LEN]; if (!name || !*name) { --- 1356,1362 ---- CHAN *chan = NULL, *temp = NULL; long int type; int res; ! boolexp key; char old[CHAN_NAME_LEN]; if (!name || !*name) { *************** *** 2080,2086 **** do_chan_lock(dbref player, const char *name, const char *lockstr, int whichlock) { CHAN *c; ! struct boolexp *key; const char *ltype; /* Make sure the channel exists */ --- 2081,2087 ---- do_chan_lock(dbref player, const char *name, const char *lockstr, int whichlock) { CHAN *c; ! boolexp key; const char *ltype; /* Make sure the channel exists */ *************** *** 2181,2187 **** for (c = channels; c; c = c->next) { strcpy(cleanp, remove_markup(ChanName(c), NULL)); if (Chan_Can_See(c, player) && string_prefix(cleanp, cleanname)) { ! notify_format(player, "%s<%s>%s", ANSI_HILITE, ChanName(c), ANSI_NORMAL); notify_format(player, T("Description: %s"), ChanTitle(c)); notify_format(player, T("Creator: %s"), Name(ChanCreator(c))); notify_format(player, T("Flags: %s"), --- 2182,2188 ---- for (c = channels; c; c = c->next) { strcpy(cleanp, remove_markup(ChanName(c), NULL)); if (Chan_Can_See(c, player) && string_prefix(cleanp, cleanname)) { ! notify(player, ChanName(c)); notify_format(player, T("Description: %s"), ChanTitle(c)); notify_format(player, T("Creator: %s"), Name(ChanCreator(c))); notify_format(player, T("Flags: %s"), *************** *** 2543,2549 **** { CHAN *c = NULL; char *p = NULL; ! struct boolexp *lock_ptr = NULL; int which_lock = 0; if ((p = strchr(args[0], '/'))) { --- 2544,2550 ---- { CHAN *c = NULL; char *p = NULL; ! boolexp lock_ptr = TRUE_BOOLEXP; int which_lock = 0; if ((p = strchr(args[0], '/'))) { *************** *** 2898,2904 **** { CHAN *chan; CHANUSER *u; ! int num_lines = INT_MAX; char *p; int size; time_t timestamp; --- 2899,2905 ---- { CHAN *chan; CHANUSER *u; ! int num_lines = 10; /* Default if none is given */ char *p; int size; time_t timestamp; *************** *** 2909,2917 **** return; } if (lines && *lines) { ! if (is_integer(lines)) num_lines = parse_integer(lines); ! else { notify(player, T("How many lines did you want to recall?")); return; } --- 2910,2920 ---- return; } if (lines && *lines) { ! if (is_integer(lines)) { num_lines = parse_integer(lines); ! if (num_lines == 0) ! num_lines = INT_MAX; ! } else { notify(player, T("How many lines did you want to recall?")); return; } *************** *** 2968,2973 **** --- 2971,2980 ---- p += size + 1; } notify(player, T("CHAT: End recall")); + if (!lines || !*lines) + notify_format(player, + T("CHAT: To recall the entire buffer, use @chan/recall %s=0"), + ChanName(chan)); } /** Set the size of a channel's buffer in maximum lines. *** 1_7_7.487/src/db.c Thu, 01 May 2003 21:17:12 -0500 dunemush (pennmush/c/25_db.c 1.26.1.1.1.1.1.6.1.15 660) --- 1_7_7.550(w)/src/db.c Mon, 18 Aug 2003 11:55:57 -0500 dunemush (pennmush/c/25_db.c 1.26.1.1.1.1.1.6.1.1.1.3 660) *************** *** 77,88 **** static void db_grow(dbref newtop); - #ifdef DUMP_OLD_LOCKS - static void putbool_subexp(FILE * f, struct boolexp *b); - #endif static void db_write_obj_basic(FILE * f, dbref i, struct object *o); int db_paranoid_write_object(FILE * f, dbref i, int flag); - static struct boolexp *getboolexp1(FILE * f, const char *type); void putlocks(FILE * f, lock_list *l); void getlocks(dbref i, FILE * f); void get_new_locks(dbref i, FILE * f); --- 77,84 ---- *************** *** 265,271 **** OUTPUT(putc('\n', f)); } - #ifndef DUMP_OLD_LOCKS static void get_logical_line(FILE * f, char **label, char **value) --- 261,266 ---- *************** *** 396,425 **** } static void - db_write_string(FILE * f, char const *s) - { - putc('"', f); - while (*s) { - if (*s == '"' || *s == '\\') - putc('\\', f); - putc(*s, f); - s++; /* done separately because putc() is a macro */ - } - putc('"', f); - } - - static void db_write_labeled_string(FILE * f, char const *label, char const *value) { db_write_label(f, label); ! db_write_string(f, value); ! putc('\n', f); } static void db_write_labeled_number(FILE * f, char const *label, int value) { ! fprintf(f, "%s %d\n", label, value); } /** Write a boolexp to a file in unparsed (text) form. --- 391,406 ---- } static void db_write_labeled_string(FILE * f, char const *label, char const *value) { db_write_label(f, label); ! putstring(f, value); } static void db_write_labeled_number(FILE * f, char const *label, int value) { ! OUTPUT(fprintf(f, "%s %d\n", label, value)); } /** Write a boolexp to a file in unparsed (text) form. *************** *** 427,433 **** * \param b pointer to boolexp to write. */ void ! putboolexp(FILE * f, struct boolexp *b) { db_write_labeled_string(f, "key", unparse_boolexp(GOD, b, UB_DBREF)); } --- 408,414 ---- * \param b pointer to boolexp to write. */ void ! putboolexp(FILE * f, boolexp b) { db_write_labeled_string(f, "key", unparse_boolexp(GOD, b, UB_DBREF)); } *************** *** 453,551 **** } } - - #else /* DUMP_OLD_LOCKS */ - - static void - putbool_subexp(FILE * f, struct boolexp *b) - { - switch (b->type) { - case BOOLEXP_IS: - OUTPUT(putc('(', f)); - OUTPUT(putc(IS_TOKEN, f)); - putbool_subexp(f, b->data.sub.a); - OUTPUT(putc(')', f)); - break; - case BOOLEXP_CARRY: - OUTPUT(putc('(', f)); - OUTPUT(putc(IN_TOKEN, f)); - putbool_subexp(f, b->data.sub.b); - OUTPUT(putc(')', f)); - break; - case BOOLEXP_OWNER: - OUTPUT(putc('(', f)); - OUTPUT(putc(OWNER_TOKEN, f)); - putbool_subexp(f, b->sub1); - OUTPUT(putc(')', f)); - break; - case BOOLEXP_IND: - OUTPUT(putc('(', f)); - OUTPUT(putc(AT_TOKEN, f)); - putbool_subexp(f, b->sub1); - OUTPUT(putc(')', f)); - break; - case BOOLEXP_AND: - OUTPUT(putc('(', f)); - putbool_subexp(f, b->sub1); - OUTPUT(putc(AND_TOKEN, f)); - putbool_subexp(f, b->sub2); - OUTPUT(putc(')', f)); - break; - case BOOLEXP_OR: - OUTPUT(putc('(', f)); - putbool_subexp(f, b->sub1); - OUTPUT(putc(OR_TOKEN, f)); - putbool_subexp(f, b->sub2); - OUTPUT(putc(')', f)); - break; - case BOOLEXP_NOT: - OUTPUT(putc('(', f)); - OUTPUT(putc(NOT_TOKEN, f)); - putbool_subexp(f, b->sub1); - OUTPUT(putc(')', f)); - break; - case BOOLEXP_CONST: - OUTPUT(fprintf(f, "%d", b->thing)); - break; - case BOOLEXP_ATR: - putstring(f, b->data.atr_lock->name); - OUTPUT(putc(':', f)); - putstring(f, uncompress(b->data.atr_lock->text)); - break; - case BOOLEXP_EVAL: - putstring(f, b->data.atr_lock->name); - OUTPUT(putc('/', f)); - putstring(f, uncompress(b->data.atr_lock->text)); - break; - default: - break; - } - } - - void - putboolexp(FILE * f, struct boolexp *b) - { - if (b != TRUE_BOOLEXP) { - putbool_subexp(f, b); - } - OUTPUT(putc('\n', f)); - } - - void - putlocks(FILE * f, struct lock_list *l) - { - struct lock_list *ll; - for (ll = l; ll; ll = ll->next) { - OUTPUT(putc('_', f)); - OUTPUT(fputs(ll->type, f)); - OUTPUT(putc('|', f)); - putboolexp(f, ll->key); - /* putboolexp adds a '\n', so we won't. */ - } - } - - #endif - /** Write out the basics of an object. * This function writes out the basic information associated with an * object - just about everything but the attributes. --- 434,439 ---- *************** *** 908,1075 **** } } - static struct boolexp * - getboolexp1(FILE * f, const char *type) - { - struct boolexp *b, *t; - int c; - char tbuf1[BUFFER_LEN], tbuf2[BUFFER_LEN]; - - c = getc(f); - switch (c) { - case '\n': - ungetc(c, f); - return TRUE_BOOLEXP; - /* break; */ - case EOF: - do_rawlog(LT_ERR, "ERROR: Unexpected EOF in boolexp. Object #%d", errobj); - return TRUE_BOOLEXP; - /*NOTREACHED */ - break; - case '(': - b = alloc_bool(); - if ((c = getc(f)) == NOT_TOKEN) { - b->type = BOOLEXP_NOT; - b->data.n = getboolexp1(f, type); - if (getc(f) != ')') - goto error; - return b; - } else if (c == IS_TOKEN) { - b->type = BOOLEXP_IS; - t = getboolexp1(f, type); - b->thing = t->thing; - free_boolexp(t); - if (getc(f) != ')') - goto error; - return b; - } else if (c == IN_TOKEN) { - b->type = BOOLEXP_CARRY; - t = getboolexp1(f, type); - b->thing = t->thing; - free_boolexp(t); - if (getc(f) != ')') - goto error; - return b; - } else if (c == OWNER_TOKEN) { - b->type = BOOLEXP_OWNER; - t = getboolexp1(f, type); - b->thing = t->thing; - free_boolexp(t); - if (getc(f) != ')') - goto error; - return b; - } else if (c == AT_TOKEN) { - b->type = BOOLEXP_IND; - t = getboolexp1(f, type); - b->thing = t->thing; - free_boolexp(t); - b->data.ind_lock = st_insert(type, &atr_names); - if (getc(f) != ')') - goto error; - return b; - } else { - ungetc(c, f); - b->data.sub.a = getboolexp1(f, type); - switch (c = getc(f)) { - case AND_TOKEN: - b->type = BOOLEXP_AND; - break; - case OR_TOKEN: - b->type = BOOLEXP_OR; - break; - default: - goto error; - /* break */ - } - b->data.sub.b = getboolexp1(f, type); - if (getc(f) != ')') - goto error; - return b; - } - /* break; */ - case '-': - /* obsolete NOTHING key */ - /* eat it */ - while ((c = getc(f)) != '\n') - if (c == EOF) { - do_rawlog(LT_ERR, "ERROR: Unexpected EOF in boolexp. Object #%d", - errobj); - return TRUE_BOOLEXP; - } - ungetc(c, f); - return TRUE_BOOLEXP; - /* break */ - case '"': - /* Either a BOOLEXP_ATR or a BOOLEXP_EVAL */ - ungetc(c, f); - strcpy(tbuf1, getstring_noalloc(f)); - c = fgetc(f); - if (c == EOF) { - do_rawlog(LT_ERR, "ERROR: Unexpected EOF in boolexp. Object #%d", errobj); - return TRUE_BOOLEXP; - } - b = alloc_bool(); - b->type = (c == ':') ? BOOLEXP_ATR : BOOLEXP_EVAL; - b->data.atr_lock = alloc_atr(tbuf1, getstring_noalloc(f)); - return b; - default: - /* can be either a dbref or : seperated string */ - ungetc(c, f); - b = alloc_bool(); - b->type = BOOLEXP_CONST; - b->thing = 0; - - /* constant dbref */ - if (isdigit(c = getc(f))) { - while (isdigit(c)) { - b->thing = b->thing * 10 + c - '0'; - c = getc(f); - } - - if (c == ':') { /* old style boolexp lock */ - do_rawlog(LT_ERR, T("ERROR: Old-style @lock on object #%d\n"), errobj); - return TRUE_BOOLEXP; - } - ungetc(c, f); - return (b); - } else { - /* we indulge in a bit of a kludge. We either have a colon - * separated string (attribute lock) or a slash-separate string - * (eval lock). - */ - char *p = tbuf1, *s; - char savec; - - *p++ = c; - for (; ((c = getc(f)) != EOF) && (c != '\n') && (c != ':') - && (c != '/'); *p++ = c) ; - *p = '\0'; - if ((c == EOF) || (c == '\n')) - goto error; - if ((c != ':') && (c != '/')) - goto error; - savec = c; - for (s = tbuf2; - ((c = getc(f)) != EOF) && (c != '\n') && (c != ')' && (c != OR_TOKEN) - && (c != AND_TOKEN)); - *s++ = c) ; - if (c == EOF) - goto error; - *s++ = 0; - ungetc(c, f); - b->data.atr_lock = alloc_atr(tbuf1, tbuf2); - if (savec == ':') - b->type = BOOLEXP_ATR; - else - b->type = BOOLEXP_EVAL; - return (b); - } - } - error: - do_rawlog(LT_ERR, "ERROR: Unknown error in boolexp. Object #%d", errobj); - return TRUE_BOOLEXP; - } - /** Read a boolexp from a file. * This function reads a boolexp from a file. It expects the format that * put_boolexp writes out. --- 796,801 ---- *************** *** 1077,1098 **** * \param type pointer to lock type being read. * \return pointer to boolexp read. */ ! struct boolexp * getboolexp(FILE * f, const char *type) { ! struct boolexp *b; ! if (indb_flags & DBF_SPIFFY_LOCKS) { ! char *label, *val; ! get_logical_line(f, &label, &val); ! b = parse_boolexp(GOD, val, type); ! } else { ! b = getboolexp1(f, type); ! if (getc(f) != '\n') { ! do_rawlog(LT_ERR, "ERROR: Invalid boolexp format on object #%d", errobj); ! return TRUE_BOOLEXP; ! } ! } ! return b; } /** Read locks for an object. --- 803,814 ---- * \param type pointer to lock type being read. * \return pointer to boolexp read. */ ! boolexp getboolexp(FILE * f, const char *type) { ! char *label, *val; ! get_logical_line(f, &label, &val); ! return parse_boolexp(GOD, val, type); } /** Read locks for an object. *************** *** 1108,1114 **** dbref creator; int flags; char type[BUFFER_LEN]; ! struct boolexp *b; int count = 0, n; get_logical_line(f, &label, &val); --- 824,830 ---- dbref creator; int flags; char type[BUFFER_LEN]; ! boolexp b; int count = 0, n; get_logical_line(f, &label, &val); *************** *** 1144,1150 **** { /* Assumes it begins at the beginning of a line. */ int c; ! struct boolexp *b; char buf[BUFFER_LEN], *p; while ((c = getc(f)), c != EOF && c == '_') { p = buf; --- 860,866 ---- { /* Assumes it begins at the beginning of a line. */ int c; ! boolexp b; char buf[BUFFER_LEN], *p; while ((c = getc(f)), c != EOF && c == '_') { p = buf; *************** *** 1302,1308 **** int temp = 0; time_t temp_time = 0; int minimum_flags = ! DBF_NEW_STRINGS | DBF_TYPE_GARBAGE | DBF_SPLIT_IMMORTAL | DBF_NO_TEMPLE; #ifdef MEM_CHECK log_mem_check(); --- 1018,1025 ---- int temp = 0; time_t temp_time = 0; int minimum_flags = ! DBF_NEW_STRINGS | DBF_TYPE_GARBAGE | DBF_SPLIT_IMMORTAL | DBF_NO_TEMPLE | ! DBF_SPIFFY_LOCKS; #ifdef MEM_CHECK log_mem_check(); *************** *** 1336,1345 **** do_rawlog(LT_ERR, T("ERROR: Old database without required dbflags.")); return -1; } - if (!(indb_flags & (DBF_NEW_LOCKS | DBF_SPIFFY_LOCKS))) { - do_rawlog(LT_ERR, T("Error: Unsupported @lock format in database.")); - return -1; - } } else if (c == 'F') { (void) getstring_noalloc(f); flag_read_all(f); --- 1053,1058 ---- *************** *** 1368,1377 **** o->next = getref(f); o->parent = getref(f); o->locks = NULL; ! if (indb_flags & DBF_SPIFFY_LOCKS) ! get_new_locks(i, f); ! else ! getlocks(i, f); o->owner = getref(f); o->zone = getref(f); s_Pennies(i, getref(f)); --- 1081,1087 ---- o->next = getref(f); o->parent = getref(f); o->locks = NULL; ! get_new_locks(i, f); o->owner = getref(f); o->zone = getref(f); s_Pennies(i, getref(f)); *** 1_7_7.487/src/conf.c Tue, 17 Jun 2003 14:32:40 -0500 dunemush (pennmush/c/31_conf.c 1.41.2.3.1.3.1.2.1.15.1.1.1.1.1.1.1.2 660) --- 1_7_7.550(w)/src/conf.c Mon, 18 Aug 2003 11:55:57 -0500 dunemush (pennmush/c/31_conf.c 1.41.2.3.1.3.1.2.1.15.1.1.1.1.1.1.1.6 660) *************** *** 202,208 **** , {"port", cf_int, &options.port, 32000, 0, "net"} , ! {"sslport", cf_int, &options.sslport, 32000, 0, "net"} , {"use_dns", cf_bool, &options.use_dns, 2, 0, "net"} , --- 202,208 ---- , {"port", cf_int, &options.port, 32000, 0, "net"} , ! {"ssl_port", cf_int, &options.ssl_port, 32000, 0, "net"} , {"use_dns", cf_bool, &options.use_dns, 2, 0, "net"} , *************** *** 467,478 **** {"chunk_cache_memory", cf_int, &options.chunk_cache_memory, 1000000000, 65510 * 2, "files"} , ! {"chunk_migrate", cf_int, &options.chunk_migrate_inactive, 100000, 0, "limits"} , ! {"active_chunk_migrate", cf_int, &options.chunk_migrate_active, 100000, 0, ! "limits"} , {NULL, NULL, NULL, 0, 0, NULL} }; --- 467,486 ---- {"chunk_cache_memory", cf_int, &options.chunk_cache_memory, 1000000000, 65510 * 2, "files"} , ! {"chunk_migrate", cf_int, &options.chunk_migrate_amount, 100000, 0, "limits"} , ! #ifdef HAS_OPENSSL ! {"ssl_private_key_file", cf_str, options.ssl_private_key_file, ! sizeof options.ssl_private_key_file, 0, "files"} ! , ! {"ssl_ca_file", cf_str, options.ssl_ca_file, ! sizeof options.ssl_ca_file, 0, "files"} ! , ! {"ssl_require_client_cert", cf_bool, &options.ssl_require_client_cert, ! 2, 0, "net"} , + #endif {NULL, NULL, NULL, 0, 0, NULL} }; *************** *** 929,935 **** { strcpy(options.mud_name, "TinyMUSH"); options.port = 4201; ! options.sslport = 0; strcpy(options.input_db, "data/indb"); strcpy(options.output_db, "data/outdb"); strcpy(options.crash_db, "data/PANIC.db"); --- 937,943 ---- { strcpy(options.mud_name, "TinyMUSH"); options.port = 4201; ! options.ssl_port = 0; strcpy(options.input_db, "data/indb"); strcpy(options.output_db, "data/outdb"); strcpy(options.crash_db, "data/PANIC.db"); *************** *** 1081,1088 **** options.call_lim = 10000; strcpy(options.chunk_swap_file, "data/chunkswap"); options.chunk_cache_memory = 1000000; ! options.chunk_migrate_inactive = 500; ! options.chunk_migrate_active = 200; } /* Limit how many files we can nest */ --- 1089,1100 ---- options.call_lim = 10000; strcpy(options.chunk_swap_file, "data/chunkswap"); options.chunk_cache_memory = 1000000; ! options.chunk_migrate_amount = 500; ! #ifdef HAS_OPENSSL ! strcpy(options.ssl_private_key_file, ""); ! strcpy(options.ssl_ca_file, ""); ! options.ssl_require_client_cert = 0; ! #endif } /* Limit how many files we can nest */ *** 1_7_7.487/src/command.c Tue, 17 Jun 2003 16:38:13 -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.9 660) --- 1_7_7.550(w)/src/command.c Mon, 18 Aug 2003 11:55:57 -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.10 660) *************** *** 342,347 **** --- 342,349 ---- {"nogagged", CMD_T_NOGAGGED}, {"noguest", CMD_T_NOGUEST}, {"nofix", CMD_T_NOFIXED}, + {"logargs", CMD_T_LOGARGS}, + {"logname", CMD_T_LOGNAME}, #ifdef DANGEROUS {"listed", CMD_T_LISTED}, {"switches", CMD_T_SWITCHES}, *************** *** 1063,1068 **** --- 1065,1074 ---- run_hook(player, cause, &cmd->hooks.before, saveregs, 1); cmd->func(cmd, player, cause, sw, string, swp, ap, ls, lsa, rs, rsa); run_hook(player, cause, &cmd->hooks.after, saveregs, 0); + if (cmd->type & CMD_T_LOGARGS) + do_log(LT_CMD, player, cause, "%s", string); + else if (cmd->type & CMD_T_LOGNAME) + do_log(LT_CMD, player, cause, "%s", commandraw); } mush_free((Malloc_t) command, "string"); *************** *** 1087,1092 **** --- 1093,1100 ---- * wizard can only be used by wizards * god can only be used by god * noplayer can't be used by players, just objects/rooms/exits + * logargs log name and arguments when command is run + * logname log just name when command is run * \endverbatim * Return 1 on success, 0 on failure. * \param name name of command to restrict. *************** *** 1109,1115 **** return 0; while (restriction && *restriction) { ! if ((tp = strrchr(restriction, ' '))) *tp++ = '\0'; clear = 0; --- 1117,1123 ---- return 0; while (restriction && *restriction) { ! if ((tp = strchr(restriction, ' '))) *tp++ = '\0'; clear = 0; *************** *** 1234,1239 **** --- 1242,1251 ---- strccat(buff, &bp, "Eqsplit"); if (command->type & CMD_T_GOD) strccat(buff, &bp, "God"); + if (command->type & CMD_T_LOGARGS) + strccat(buff, &bp, "LogArgs"); + else if (command->type & CMD_T_LOGNAME) + strccat(buff, &bp, "LogName"); *bp = '\0'; notify_format(player, "Restrict : %s", buff); buff[0] = '\0'; *** 1_7_7.487/src/cmds.c Mon, 16 Jun 2003 23:36:52 -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.18 660) --- 1_7_7.550(w)/src/cmds.c Mon, 18 Aug 2003 11:55:57 -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.19 660) *************** *** 708,716 **** do_wall(player, arg_left, WALL_RW, SW_ISSET(sw, SWITCH_EMIT)); } - COMMAND (cmd_rwallemit) { - do_wall(player, arg_left, 1, 3); - } COMMAND (cmd_scan) { if (SW_ISSET(sw, SWITCH_ROOM)) --- 708,713 ---- *** 1_7_7.487/src/bsd.c Mon, 23 Jun 2003 11:10:04 -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.1.1.1.1.3 660) --- 1_7_7.550(w)/src/bsd.c Mon, 18 Aug 2003 11:55:57 -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.1.1.1.1.19 660) *************** *** 93,98 **** --- 93,99 ---- #include #endif + #include "chunk.h" #include "mushdb.h" #include "externs.h" #include "dbdefs.h" *************** *** 110,122 **** #include "ident.h" #include "strtree.h" #include "log.h" ! #ifdef MEM_CHECK #include "memcheck.h" #endif ! #include "mymalloc.h" - #include "extmail.h" #include "attrib.h" #include "game.h" --- 111,124 ---- #include "ident.h" #include "strtree.h" #include "log.h" ! #include "pcre.h" #ifdef MEM_CHECK #include "memcheck.h" #endif ! #ifdef HAS_OPENSSL ! #include "myssl.h" ! #endif #include "mymalloc.h" #include "extmail.h" #include "attrib.h" #include "game.h" *************** *** 150,155 **** --- 152,158 ---- void rusage_stats(void); #endif int que_next(void); /* from cque.c */ + extern int on_second; /**< Are we ready to do per-second processing? */ void dispatch(void); /* from timer.c */ dbref email_register_player(const char *name, const char *email, con