Changeset 477
- Timestamp:
- 08/16/06 01:31:08 (2 years ago)
- Files:
-
- 1.7.7/CHANGES.177 (modified) (1 diff)
- 1.7.7/MANIFEST (modified) (2 diffs)
- 1.7.7/Patchlevel (modified) (1 diff)
- 1.7.7/game/mushcnf.dst (modified) (3 diffs)
- 1.7.7/game/restrictcnf.dst (modified) (4 diffs)
- 1.7.7/game/txt/hlp/penncmd.hlp (modified) (1 diff)
- 1.7.7/game/txt/hlp/pennfunc.hlp (modified) (9 diffs)
- 1.7.7/game/txt/hlp/penntop.hlp (modified) (1 diff)
- 1.7.7/game/txt/hlp/pennv177.hlp (modified) (2 diffs)
- 1.7.7/game/txt/hlp/pennvOLD.hlp (modified) (1 diff)
- 1.7.7/hdrs/atr_tab.h (modified) (4 diffs)
- 1.7.7/hdrs/boolexp.h (modified) (1 diff)
- 1.7.7/hdrs/command.h (modified) (1 diff)
- 1.7.7/hdrs/compile.h (modified) (1 diff)
- 1.7.7/hdrs/dbio.h (added)
- 1.7.7/hdrs/externs.h (modified) (2 diffs)
- 1.7.7/hdrs/game.h (modified) (2 diffs)
- 1.7.7/hdrs/mushdb.h (modified) (1 diff)
- 1.7.7/hdrs/mushtype.h (modified) (1 diff)
- 1.7.7/hdrs/parse.h (modified) (1 diff)
- 1.7.7/hdrs/version.h (modified) (1 diff)
- 1.7.7/hints/freebsd_5.sh (added)
- 1.7.7/src/Makefile.SH (modified) (1 diff)
- 1.7.7/src/atr_tab.c (modified) (1 diff)
- 1.7.7/src/attrib.c (modified) (1 diff)
- 1.7.7/src/boolexp.c (modified) (6 diffs)
- 1.7.7/src/bsd.c (modified) (16 diffs)
- 1.7.7/src/cmds.c (modified) (1 diff)
- 1.7.7/src/command.c (modified) (10 diffs)
- 1.7.7/src/conf.c (modified) (1 diff)
- 1.7.7/src/cque.c (modified) (2 diffs)
- 1.7.7/src/db.c (modified) (42 diffs)
- 1.7.7/src/extchat.c (modified) (14 diffs)
- 1.7.7/src/extmail.c (modified) (2 diffs)
- 1.7.7/src/flags.c (modified) (12 diffs)
- 1.7.7/src/function.c (modified) (1 diff)
- 1.7.7/src/fundb.c (modified) (2 diffs)
- 1.7.7/src/funlist.c (modified) (2 diffs)
- 1.7.7/src/funstr.c (modified) (8 diffs)
- 1.7.7/src/game.c (modified) (6 diffs)
- 1.7.7/src/local.dst (modified) (2 diffs)
- 1.7.7/src/look.c (modified) (3 diffs)
- 1.7.7/src/malias.c (modified) (1 diff)
- 1.7.7/src/parse.c (modified) (1 diff)
- 1.7.7/src/player.c (modified) (1 diff)
- 1.7.7/src/rob.c (modified) (3 diffs)
- 1.7.7/src/services.c (modified) (3 diffs)
- 1.7.7/src/set.c (modified) (7 diffs)
- 1.7.7/src/utils.c (modified) (1 diff)
- 1.7.7/src/version.c (modified) (2 diffs)
- 1.7.7/src/warnings.c (modified) (5 diffs)
- 1.7.7/win32/cmds.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
1.7.7/CHANGES.177
r475 r477 18 18 19 19 ========================================================================== 20 21 Version 1.7.7 patchlevel 39 October 25, 2004 22 23 Major Changes: 24 * Game and chat database formats have been rewritten. They are 25 much more human-readable, can be extended with new fields 26 without using versioning flags, and provide better detection 27 and reporting of malformed databases. [SW] 28 * Chunk deref counts for locks are now stored in the database. [SW] 29 Commands: 30 * New 'buy' command for purchasing items from vendors that can offer 31 multiple items at multiple prices. Patch by Walker@M*U*S*H. 32 * restrict_command and @command/restrict can now include an 33 error message to be sent when the player can't use the command, 34 which supercedes more generic errors. Suggested by Philip Mak. 35 Patch by Walker@M*U*S*H. 36 Functions: 37 * lwho() can take an argument to produce the who list from that 38 player's viewpoint. Patch by Walker@M*U*S*H. 39 Fixes: 40 * nattr(obj/attrib) returns 1 when matching a non-wildcarded attrib. 41 Report by Impster@M*U*S*H. 42 * +chan <msg> is now converted to @chat <chan>=<msg> (with noeval) 43 so @chat hooks apply to +chatting too. Patch by Walker@M*U*S*H. 44 * You must be able to locate a player to perform elock() on them. 45 Report by Ambrosia. 46 * Help fixes by Sketch@M*U*S*H. 47 * Simplification of @version code. [SW] 48 * cemit() restrictions are now based on those of @cemit, instead 49 of @emit. Report by BlackPhyr. 50 * Setting queue_loss to 0 disables queue_loss. A bad idea, but 51 more consistent behavior. Suggested by K Moon. 52 * Examining objects always shows their actual number of coins, 53 whether or not they're admin or no_pay. 54 * Code cleanup in @edit and in char routines. [SW]. 55 * Wrong object checked when reporting money as unlimited. Report 56 by Nate Barney. [EEH] 57 * New hints/freebsd_5.sh. Suggested by James Lang. 58 * INFO command once again reports the server as "PennMUSH", 59 not just a version number. Report by Mark Hassman. 60 * Win32 linting. Builds with NT_TCP should work again (although 61 @shutdown/reboot under NT_TCP is still not functional). 62 Reorganization of the Win32 services macros. [EEH] 63 * Fix to bug with login attempts using literal encrypted strings. 64 Reported by Cadar and Mirrador. 65 * @ps/all shows the right label on top. Patch by qa'toq@bDv. 66 20 67 21 68 Version 1.7.7 patchlevel 38 August 25, 2004 1.7.7/MANIFEST
r471 r477 23 23 hdrs/copyrite.h 24 24 hdrs/dbdefs.h 25 hdrs/dbio.h 25 26 hdrs/extchat.h 26 27 hdrs/externs.h … … 140 141 hints/dec_osf.sh 141 142 hints/freebsd.sh 143 hints/freebsd_5.sh 142 144 hints/hpux.sh 143 145 hints/hpux-gcc.sh 1.7.7/Patchlevel
r475 r477 1 1 Do not edit this file. It is maintained by the official PennMUSH patches. 2 This is PennMUSH 1.7.7p3 82 This is PennMUSH 1.7.7p39 1.7.7/game/mushcnf.dst
r469 r477 261 261 function_invocation_limit 2500 262 262 263 # the maximum number of timeswe're allowed to recursively call the parser263 # the maximum depth we're allowed to recursively call the parser 264 264 # for a single expression. This limits how much the stack size can increase, 265 265 # which could be useful if your host limits your stack (it will prevent … … 268 268 # speaking, you won't ever see more than 8192 recursions, so that's 269 269 # probably an upper limit, but most sane code shouldn't need more 270 # than a couple thousand. Setting it to '0' means unlimited.271 call_limit 5000270 # than a couple hundred. Setting it to '0' means unlimited. 271 call_limit 100 272 272 273 273 # The maximum number of milliseconds of CPU time that a single queue entry … … 342 342 343 343 # One out of how many commands that are queued will cost the 344 # player a coin? 344 # player a coin? Setting this to 1 causes a coin to be lost with 345 # every command. Setting it to 0 disables coin loss for queued 346 # commands (and is a very bad idea). 345 347 queue_loss 63 346 348 1.7.7/game/restrictcnf.dst
r459 r477 1 1 # 2 2 # Commands to restrict 3 # Syntax: restrict_command <command> <restriction> 3 # Syntax: restrict_command <command> <restriction> [" <error message>] 4 4 # restrict_function <function> <restriction> 5 5 # <restriction> is a space separated list that may include: … … 18 18 # !<restriction> The opposite of a restriction (Command only). 19 19 # nosidefx The side-effect version of a function won't work (Function only). 20 # 21 # If <error message> is given to a restrict_command, it is sent to the player 22 # instead of a more generic, typically useless error message. 20 23 # 21 24 # Command restrictions typically also apply to side-effect functions that … … 58 61 59 62 # Uncomment to allow only admin or @powered builders to build 60 #restrict_command @open admin builder 61 #restrict_command @dig admin builder 63 #restrict_command @open admin builder " You need the builder power to do that. 64 #restrict_command @dig admin builder " You need the builder power to do that. 62 65 63 66 # Uncomment to disallow them to create objects 64 #restrict_command @create admin builder 67 #restrict_command @create admin builder " You need the builder power to do that. 65 68 66 69 # Used to be player_locate … … 68 71 69 72 # Used to be hate_dest 70 restrict_command @destroy noplayer 73 restrict_command @destroy noplayer " Use @recycle instead 71 74 72 75 # Used to be cemit_power 73 #restrict_command @cemit admin cemit 76 #restrict_command @cemit admin cemit " You can't @cemit without cemit @power 74 77 75 78 # Turn off ansi(). 1.7.7/game/txt/hlp/penncmd.hlp
r475 r477 3746 3746 3747 3747 See also: @lock, ENTER_OK, give, drop, @success, inventory 3748 & @abuy 3749 @abuy <object> = <action list> 3750 3751 Sets the actions to be taken after a player buys an item 3752 from PRICELIST. The item purchased is passed in as %0, 3753 and the amount paid as %1 3754 3755 See also: buy, @buy, @obuy, @pricelist, MONEY, ACTION LISTS 3756 & @buy 3757 @buy <object> [=<message>] 3758 3759 Sets the message that is shown to anyone who buys something from 3760 the object, using the 'buy' command. The item purchased is passed 3761 in as %0, and the amount paid as %1. 3762 3763 See also: buy, @abuy, @obuy, @pricelist, MONEY 3764 & @obuy 3765 @obuy <object> [=<message>] 3766 3767 Sets the message that will be show to others whenever someone buys 3768 an item from the object's PRICELIST using the 'buy' command. The 3769 name of the person giving the money will be automatically inserted at 3770 the beginning of the message. The item purchased is passed in as %0, 3771 and the amount paid as %1. 3772 3773 See also: buy, @abuy, @obuy, @pricelist, MONEY 3774 & @pricelist 3775 @pricelist <object>=<item1>:<price1>[,<price2>][ <item2>:...] 3776 3777 The PRICELIST attribute is a space-delimited list of item names 3778 and prices that are checked when the 'buy' command is run. 3779 3780 An item name may have '_'s where the player would use a space in 3781 the name. 3782 3783 A price is either a number (20), a range of numbers (10-30), or 3784 a minimum number (10+). 3785 3786 ex: 3787 @PRICELIST vendor=mansion:1000+ large_house:100-200 house:20,30,50 3788 3789 See also: buy, @abuy, @buy, @obuy, MONEY 3790 & buy 3791 buy <item>[ from <vendor>][ for <cost>] 3792 3793 When you try buying an item, PRICELIST attributes on nearby objects 3794 (or <vendor> if given) will be checked for matching item:costs. If 3795 <cost> is given, the first item that matches that cost will be purchased. 3796 Otherwise, the first matching item that you can afford will be purchased. 3797 3798 If the pricelist match contains a list of prices, 3799 ITEM:30,20,10, the first one you can afford will be the resulting price. 3800 3801 ex: 3802 > &PRICELIST vendor=coke:20 pepsi:20 3803 > &drink.coke vendor=You enjoy a delicious coke. 3804 > &drink.pepsi vendor=It tastes like a funny coke. 3805 > @BUY vendor=u(drink.%0) 3806 > buy coke 3807 You enjoy a delicious coke. 3808 3809 See also: @ABUY, @BUY, @PRICELIST 3748 3810 & give 3749 3811 give[/silent] <player>=<number> 1.7.7/game/txt/hlp/pennfunc.hlp
r471 r477 177 177 numbers, they will return an error or misbehave): 178 178 dec() div() floordiv() inc() mod() 179 remainder() 179 180 180 181 These functions operate on n-dimensional vectors. A vector … … 588 589 bound is returned. If it's higher than the higher bound, 589 590 the higher bound is returned. 591 592 See also: ceil(), floor(), round(), trunc() 590 593 & BXOR() 591 594 bxor(<integer>, <integer>,...) … … 609 612 610 613 Returns the least integral value greater than or equal to <number>. 614 615 See also: floor(), bound(), round(), trunc() 611 616 & CEMIT() 612 617 cemit(<channel>, <message>[, <noisy>]) … … 1330 1335 1331 1336 Returns the greatest integral value less than or equal to <number>. 1337 1338 See also: ceil(), bound(), round(), trunc() 1332 1339 & FMOD() 1333 1340 fmod(<number>,<divisor>) … … 2325 2332 & LWHO() 2326 2333 lwho() 2334 lwho(<viewer>) 2327 2335 2328 2336 This returns a list of the dbref numbers for all currently-connected 2329 2337 players. When mortals use this function, the dbref numbers of DARK 2330 2338 wizards or royalty do NOT appear on the dbref list. 2339 2340 If lwho() is given an argument, and used by an object that can see 2341 DARK and Hidden players, lwho() returns the output of lwho() from 2342 <viewer>'s point of view. 2331 2343 2332 2344 See also: mwho(), nwho(), xwho() … … 2468 2480 mean(<number>,...) 2469 2481 2470 Returns the mean (Average) of its arguments. 2482 Returns the mean (arithmetic average) of its arguments. 2483 2484 See also: median(), stddev() 2471 2485 & MEDIAN() 2472 2486 median(<number>,...) 2473 2487 2474 2488 Returns the median (the middlemost numerically) of its arguments. 2489 2490 See also: mean(), stddev() 2475 2491 & MEMBER() 2476 2492 member(<list>,<word>[,<delimiter>]) … … 3215 3231 0 and 6. 3216 3232 3233 See also: ceil(), floor(), bound(), trunc() 3217 3234 & S() 3218 3235 & S-FUNCTION … … 3674 3691 3675 3692 Returns the sample standard deviation of its arguments. 3693 3694 See also: mean(), median() 3676 3695 & STRCAT() 3677 3696 strcat(<string1>, <string2>) … … 4067 4086 "0" if there isn't one. For example, "val(101Dalmations)" => 101. 4068 4087 4088 See also: ceil(), floor(), bound(), round() 4069 4089 & TYPE() 4070 4090 type(<object>) 1.7.7/game/txt/hlp/penntop.hlp
r473 r477 1918 1918 1919 1919 In the config file, the syntax is: 1920 restrict_command command-name restriction 1920 restrict_command command-name restriction [" <error message>] 1921 1921 restrict_function function-name restriction 1922 1922 1923 1923 From the game: 1924 @command/restrict command-name=restriction 1924 @command/restrict command-name=restriction [" <error message>] 1925 1925 @function/restrict function-name=restriction 1926 1927 For commands, if <error message> is given, that message is sent to the 1928 player who runs it instead of a generic, unhelpful error message. 1926 1929 1927 1930 (Continued in restrict2) 1.7.7/game/txt/hlp/pennv177.hlp
r475 r477 1 & 1.7.7p3 81 & 1.7.7p39 2 2 & changes 3 3 This is a list of changes in this patchlevel which are probably of … … 12 12 be read in 'help patchlevels'. 13 13 14 Version 1.7.7 patchlevel 39 October 25, 2004 15 16 Major Changes: 17 * Game and chat database formats have been rewritten. They are 18 much more human-readable, can be extended with new fields 19 without using versioning flags, and provide better detection 20 and reporting of malformed databases. [SW] 21 * Chunk deref counts for locks are now stored in the database. [SW] 22 Commands: 23 * New 'buy' command for purchasing items from vendors that can offer 24 multiple items at multiple prices. Patch by Walker@M*U*S*H. 25 * restrict_command and @command/restrict can now include an 26 error message to be sent when the player can't use the command, 27 which supercedes more generic errors. Suggested by Philip Mak. 28 Patch by Walker@M*U*S*H. 29 Functions: 30 * lwho() can take an argument to produce the who list from that 31 player's viewpoint. Patch by Walker@M*U*S*H. 32 Fixes: 33 * nattr(obj/attrib) returns 1 when matching a non-wildcarded attrib. 34 Report by Impster@M*U*S*H. 35 * +chan <msg> is now converted to @chat <chan>=<msg> (with noeval) 36 so @chat hooks apply to +chatting too. Patch by Walker@M*U*S*H. 37 * You must be able to locate a player to perform elock() on them. 38 Report by Ambrosia. 39 * Help fixes by Sketch@M*U*S*H. 40 * Simplification of @version code. [SW] 41 * cemit() restrictions are now based on those of @cemit, instead 42 of @emit. Report by BlackPhyr. 43 * Setting queue_loss to 0 disables queue_loss. A bad idea, but 44 more consistent behavior. Suggested by K Moon. 45 * Examining objects always shows their actual number of coins, 46 whether or not they're admin or no_pay. 47 * Code cleanup in @edit and in char routines. [SW]. 48 * Wrong object checked when reporting money as unlimited. Report 49 by Nate Barney. [EEH] 50 * New hints/freebsd_5.sh. Suggested by James Lang. 51 * INFO command once again reports the server as "PennMUSH", 52 not just a version number. Report by Mark Hassman. 53 * Win32 linting. Builds with NT_TCP should work again (although 54 @shutdown/reboot under NT_TCP is still not functional). 55 Reorganization of the Win32 services macros. [EEH] 56 * Fix to bug with login attempts using literal encrypted strings. 57 Reported by Cadar and Mirrador. 58 * @ps/all shows the right label on top. Patch by qa'toq@bDv. 59 60 61 & 1.7.7p38 14 62 Version 1.7.7 patchlevel 38 August 25, 2004 15 63 1.7.7/game/txt/hlp/pennvOLD.hlp
r475 r477 4420 4420 1.7.7: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 4421 4421 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 4422 36, 37, 38 4422 36, 37, 38, 39 4423 4423 1.7.6: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 4424 4424 1.7.5: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 1.7.7/hdrs/atr_tab.h
r459 r477 9 9 ATTR attr[] = { 10 10 {"AAHEAR", AF_NOPROG | AF_PREFIXMATCH, NULL_CHUNK_REFERENCE, 0, NULL}, 11 {"ABUY", AF_NOPROG | AF_PREFIXMATCH, NULL_CHUNK_REFERENCE, 0, NULL}, 11 12 {"ACLONE", AF_NOPROG | AF_PREFIXMATCH, NULL_CHUNK_REFERENCE, 0, NULL}, 12 13 {"ACONNECT", AF_NOPROG | AF_PREFIXMATCH, NULL_CHUNK_REFERENCE, 0, NULL}, … … 42 43 {"AZENTER", AF_NOPROG | AF_PREFIXMATCH, NULL_CHUNK_REFERENCE, 0, NULL}, 43 44 {"AZLEAVE", AF_NOPROG | AF_PREFIXMATCH, NULL_CHUNK_REFERENCE, 0, NULL}, 45 {"BUY", AF_NOPROG | AF_PREFIXMATCH, NULL_CHUNK_REFERENCE, 0, NULL}, 44 46 {"CHARGES", AF_NOPROG | AF_PREFIXMATCH, NULL_CHUNK_REFERENCE, 0, NULL}, 45 47 {"COMMENT", AF_NOPROG | AF_MDARK | AF_WIZARD | AF_PREFIXMATCH, … … 110 112 NULL}, 111 113 {"NAMEFORMAT", AF_NOPROG | AF_PREFIXMATCH, NULL_CHUNK_REFERENCE, 0, NULL}, 114 {"OBUY", AF_NOPROG | AF_PREFIXMATCH, NULL_CHUNK_REFERENCE, 0, NULL}, 112 115 {"ODEATH", AF_NOPROG | AF_PREFIXMATCH, NULL_CHUNK_REFERENCE, 0, NULL}, 113 116 {"ODESCRIBE", AF_NOPROG | AF_PREFIXMATCH, NULL_CHUNK_REFERENCE, 0, NULL}, … … 137 140 {"OZLEAVE", AF_NOPROG | AF_PREFIXMATCH, NULL_CHUNK_REFERENCE, 0, NULL}, 138 141 {"PAYMENT", AF_NOPROG | AF_PREFIXMATCH, NULL_CHUNK_REFERENCE, 0, NULL}, 142 {"PRICELIST", AF_NOPROG | AF_PREFIXMATCH, NULL_CHUNK_REFERENCE, 0, NULL}, 139 143 {"PREFIX", AF_NOPROG | AF_PREFIXMATCH, NULL_CHUNK_REFERENCE, 0, NULL}, 140 144 {"RECEIVE", AF_NOPROG | AF_PREFIXMATCH, NULL_CHUNK_REFERENCE, 0, NULL}, 1.7.7/hdrs/boolexp.h
r449 r477 22 22 extern int eval_boolexp(dbref player, boolexp b, dbref target); 23 23 extern boolexp parse_boolexp(dbref player, const char *buf, lock_type ltype); 24 extern boolexp parse_boolexp_d(dbref player, const char *buf, lock_type ltype, 25 int derefs); 24 26 extern void free_boolexp(boolexp b); 25 27 boolexp getboolexp(FILE * f, const char *ltype); 1.7.7/hdrs/command.h
r465 r477 136 136 struct command_info { 137 137 const char *name; /**< Canonical name of the command */ 138 const char *restrict_message; /**< Message sent when command is restricted */ 138 139 command_func func; /**< Function to call when command is run */ 139 140 unsigned int type; /**< Types of objects that can use the command */ 1.7.7/hdrs/compile.h
r463 r477 47 47 #endif 48 48 49 /* Enable Win32 services support */ 50 #ifdef WIN32 51 #define WIN32SERVICES 52 #endif 49 53 50 #ifdef WIN32 54 /* Disable Win32 services support due to it failing to run properly 55 when compiling with MinGW32. Eventually I would like to correct 56 the issue. - EEH */ 57 #ifdef __MINGW32__ 58 #undef WIN32SERVICES 59 #endif 60 51 61 /* --------------- Stuff for Win32 services ------------------ */ 52 62 /* 53 54 63 When "exit" is called to handle an error condition, we really want to 55 64 terminate the game thread, not the whole process. 56 65 MS VS.NET (_MSC_VER >= 1200) requires the weird noreturn stuff. 57 58 66 */ 59 67 60 #if ndef __MINGW32__68 #ifdef WIN32SERVICES 61 69 #define exit(arg) Win32_Exit (arg) 70 void NORETURN WIN32_CDECL Win32_Exit(int exit_code); 62 71 #endif 63 void NORETURN WIN32_CDECL Win32_Exit(int exit_code);64 #endif /* WIN32 */65 72 66 73 #endif /* __COMPILE_H */ 1.7.7/hdrs/externs.h
r471 r477 524 524 extern void do_wcheck_all(dbref player); 525 525 extern void set_initial_warnings(dbref player); 526 extern const char *unparse_warnings(dbref thing); 526 extern const char *unparse_warnings(warn_type warnings); 527 extern warn_type parse_warnings(dbref player, const char *warnings); 527 528 528 529 /* From wild.c */ … … 590 591 591 592 /* From db.c */ 592 extern const char *getstring_noalloc(FILE * f); 593 593 594 extern const char *set_name(dbref obj, const char *newname); 594 extern long getref(FILE * f);595 extern void putref(FILE * f, long int ref);596 extern void putstring(FILE * f, const char *s);597 595 extern dbref new_object(void); 598 extern int db_write_object(FILE * f, dbref i);599 extern dbref db_write(FILE * f, int flag);600 extern dbref db_read(FILE * f);601 596 602 597 /* From filecopy.c */ 1.7.7/hdrs/game.h
r475 r477 54 54 extern int config_file_startup(const char *conf, int restrictions); 55 55 56 /* From db.c */57 extern int db_paranoid_write(FILE * f, int flag);58 59 56 /* From game.c */ 60 57 enum dump_type { DUMP_NORMAL, DUMP_DEBUG, DUMP_PARANOID }; … … 101 98 extern void do_kill(dbref player, const char *what, int cost, int slay); 102 99 extern void do_give(dbref player, char *recipient, char *amnt, int silent); 100 extern void do_buy(dbref player, char *item, char *from, int price); 103 101 104 102 /* From set.c */ 1.7.7/hdrs/mushdb.h
r467 r477 137 137 #define DBF_NEW_POWERS 0x40000 138 138 #define DBF_POWERS_LOGGED 0x80000 139 #define DBF_LABELS 0x100000 139 140 140 141 /* Reboot DB flag macros - these should be defined whether or not the 1.7.7/hdrs/mushtype.h
r463 r477 16 16 /* Dbref type */ 17 17 typedef int dbref; 18 19 /** The type that stores the warning bitmask */ 20 typedef long int warn_type; 18 21 19 22 /* special dbref's */ 1.7.7/hdrs/parse.h
r455 r477 43 43 extern int parse_boolean(char const *str); 44 44 extern dbref parse_dbref(char const *str); 45 extern dbref qparse_dbref(char const *str); 45 46 extern dbref parse_objid(char const *str); 46 47 1.7.7/hdrs/version.h
r475 r477 1 1 #define VERSION "1.7.7" 2 #define PATCHLEVEL "3 8"3 #define PATCHDATE "[ 08/25/2004]"4 #define NUMVERSION 00100700703 82 #define PATCHLEVEL "39" 3 #define PATCHDATE "[10/25/2004]" 4 #define NUMVERSION 001007007039 1.7.7/src/Makefile.SH
r469 r477 76 76 ../hdrs/attrib.h ../hdrs/boolexp.h ../hdrs/bufferq.h ../hdrs/case.h \ 77 77 ../hdrs/case.h ../hdrs/chunk.h ../hdrs/command.h ../hdrs/conf.h \ 78 ../hdrs/copyrite.h ../hdrs/dbdefs.h ../hdrs/ extchat.h \78 ../hdrs/copyrite.h ../hdrs/dbdefs.h ../hdrs/dbio.h ../hdrs/extchat.h \ 79 79 ../hdrs/externs.h ../hdrs/extmail.h ../hdrs/flags.h \ 80 80 ../hdrs/function.h ../hdrs/game.h ../hdrs/getpgsiz.h ../hdrs/help.h \ 1.7.7/src/atr_tab.c
r469 r477 49 49 {"locked", '+', AF_LOCKED, AF_LOCKED}, 50 50 {"safe", 'S', AF_SAFE, AF_SAFE}, 51 {"internal", '\0', AF_INTERNAL, AF_INTERNAL}, 51 52 {"prefixmatch", '\0', AF_PREFIXMATCH, AF_PREFIXMATCH}, 52 53 {"veiled", 'V', AF_VEILED, AF_VEILED}, 1.7.7/src/attrib.c
r469 r477 915 915 916 916 if (!wildcard(name) && name[len - 1] != '`') { 917 parent = thing; 917 918 if (doparent) 918 919 ptr = atr_get_with_parent(thing, strupper(name), &parent); 919 920 else 920 921 ptr = atr_get_noparent(thing, strupper(name)); 921 result = 0; 922 if (ptr && (mortal ? Is_Visible_Attr(parent, ptr) 923 : Can_Read_Attr(player, parent, ptr))) 924 result += 1; 922 925 } else { 923 926 StrTree seen; 1.7.7/src/boolexp.c
r469 r477 278 278 static void opt_thread_jumps(struct bvm_asm *a); 279 279 static void optimize_bvm_asm(struct bvm_asm *a); 280 static boolexp emit_bytecode(struct bvm_asm *a );280 static boolexp emit_bytecode(struct bvm_asm *a, int derefs); 281 281 static void free_bvm_asm(struct bvm_asm *a); 282 282 #ifdef DEBUG_BYTECODE … … 1531 1531 */ 1532 1532 static boolexp 1533 emit_bytecode(struct bvm_asm *a )1533 emit_bytecode(struct bvm_asm *a, int derefs) 1534 1534 { 1535 1535 boolexp b; … … 1597 1597 } 1598 1598 1599 b = chunk_create(bytecode, len, 1);1599 b = chunk_create(bytecode, len, derefs); 1600 1600 mush_free(bytecode, "boolexp.bytecode"); 1601 1601 return b; … … 1609 1609 * \param buf string representation of a boolexp. 1610 1610 * \param ltype the type of lock for which the boolexp is being parsed. 1611 * \param derefs the starting deref count for chunk storage. 1611 1612 * \return pointer to a newly allocated boolexp. 1612 1613 */ 1613 1614 boolexp 1614 parse_boolexp (dbref player, const char *buf, lock_type ltype)1615 parse_boolexp_d(dbref player, const char *buf, lock_type ltype, int derefs) 1615 1616 { 1616 1617 struct boolexp_node *ast; … … 1630 1631 } 1631 1632 optimize_bvm_asm(bvasm); 1632 bytecode = emit_bytecode(bvasm );1633 bytecode = emit_bytecode(bvasm, derefs); 1633 1634 #ifdef DEBUG_BYTECODE 1634 1635 printf("\nSource string: \"%s\"\n", buf); … … 1639 1640 free_bvm_asm(bvasm); 1640 1641 return bytecode; 1642 } 1643 1644 /** Compile a string into boolexp bytecode. 1645 * Given a textual representation of a boolexp in a string, parse it into 1646 * a syntax tree, compile to bytecode, and return a pointer to a boolexp 1647 * structure. 1648 * \param player the enactor. 1649 * \param buf string representation of a boolexp. 1650 * \param ltype the type of lock for which the boolexp is being parsed. 1651 * \return pointer to a newly allocated boolexp. 1652 */ 1653 boolexp 1654 parse_boolexp(dbref player, const char *buf, lock_type ltype) 1655 { 1656 return parse_boolexp_d(player, buf, ltype, 0); 1641 1657 } 1642 1658 1.7.7/src/bsd.c
r473 r477 29 29 #define MAXHOSTNAMELEN 32 30 30 #define LC_MESSAGES 6 31 #ifndef __MINGW32__32 void shutdown_checkpoint(void);33 #endif34 31 #else /* !WIN32 */ 35 32 #ifdef I_SYS_FILE … … 123 120 #include "attrib.h" 124 121 #include "game.h" 122 #include "dbio.h" 125 123 #include "confmagic.h" 126 124 #ifdef HAS_WAITPID … … 329 327 #endif 330 328 #ifndef BOOLEXP_DEBUGGING 331 #ifdef WIN32 329 #ifdef WIN32SERVICES 330 void shutdown_checkpoint(void); 332 331 void mainthread(int argc, char **argv); 333 332 #else … … 496 495 497 496 #ifndef BOOLEXP_DEBUGGING 498 #if defined(WIN32) && !defined(__MINGW32__)497 #ifdef WIN32SERVICES 499 498 /* Under WIN32, MUSH is a "service", so we just start a thread here. 500 499 * The real "main" is in win32/services.c … … 510 509 int 511 510 main(int argc, char **argv) 512 #endif /* WIN32 */511 #endif /* WIN32SERVICES */ 513 512 { 514 513 #ifdef AUTORESTART … … 721 720 722 721 /* someone has told us to shut down */ 723 #ifdef WIN32 724 #ifndef __MINGW32__ 722 #ifdef WIN32SERVICES 725 723 /* Keep service manager happy */ 726 724 shutdown_checkpoint(); 727 725 #endif 728 #endif729 726 730 727 shutdown_queues(); 731 728 732 #ifdef WIN32 733 #ifndef __MINGW32__ 729 #ifdef WIN32SERVICES 734 730 /* Keep service manager happy */ 735 731 shutdown_checkpoint(); 736 732 #endif 737 #endif738 733 739 734 close_sockets(); … … 744 739 #endif 745 740 746 #ifdef WIN32 747 #ifndef __MINGW32__ 741 #ifdef WIN32SERVICES 748 742 /* Keep service manager happy */ 749 743 shutdown_checkpoint(); 750 #endif751 744 #endif 752 745 … … 767 760 #endif 768 761 769 #ifdef WIN32 770 #ifndef __MINGW32__ 762 #ifdef WIN32SERVICES 771 763 /* Keep service manager happy */ 772 764 shutdown_checkpoint(); 773 #endif774 765 #endif 775 766 … … 789 780 closesocket(sock); 790 781 #ifdef WIN32 791 #if ndef __MINGW32__782 #ifdef WIN32SERVICES 792 783 shutdown_checkpoint(); 793 784 #endif … … 3357 3348 queue_string_eol(call_by, tprintf("Connected: %d", count)); 3358 3349 queue_string_eol(call_by, tprintf("Size: %d", db_top)); 3359 queue_string_eol(call_by, tprintf("Version: %sp%s", VERSION, PATCHLEVEL)); 3350 queue_string_eol(call_by, 3351 tprintf("Version: PennMUSH %sp%s", VERSION, PATCHLEVEL)); 3360 3352 #ifdef PATCHES 3361 3353 queue_string_eol(call_by, tprintf("Patches: %s", PATCHES)); … … 4080 4072 DESC *d; 4081 4073 int first; 4082 int powered = (*called_as == 'L'); 4074 dbref victim; 4075 int powered = ((*called_as == 'L') && Priv_Who(executor)); 4083 4076 4084 4077 first = 1; 4078 4079 if (nargs && args[0] && *args[0]) { 4080 /* An argument was given. Find the victim and choose the lowest 4081 * perms possible */ 4082 if (!powered) { 4083 safe_str(T(e_perm), buff, bp); 4084 return; 4085 } 4086 if ((victim = noisy_match_result(executor, args[0], NOTYPE, 4087 MAT_EVERYTHING)) == 0) { 4088 safe_str(T(e_notvis), buff, bp); 4089 return; 4090 } 4091 if (!Priv_Who(victim)) 4092 powered = 0; 4093 } 4094 4085 4095 DESC_ITER_CONN(d) { 4086 if (!Hidden(d) || (powered && Priv_Who(executor))) {4096 if (!Hidden(d) || powered) { 4087 4097 if (first) 4088 4098 first = 0; … … 4154 4164 match = d; 4155 4165 } 4156 return match ? difftime(mudtime, match->connected_at) : -1; 4166 if (match) { 4167 double result = difftime(mudtime, match->connected_at); 4168 return (int) result; 4169 } else 4170 return -1; 4157 4171 } 4158 4172 … … 4171 4185 match = d; 4172 4186 } 4173 return match ? difftime(mudtime, match->connected_at) : -1; 4187 if (match) { 4188 double result = difftime(mudtime, match->connected_at); 4189 return (int) result; 4190 } else 4191 return -1; 4174 4192 } 4175 4193 … … 4188 4206 match = d; 4189 4207 } 4190 return match ? difftime(mudtime, match->last_time) : -1; 4208 if (match) { 4209 double result = difftime(mudtime, match->last_time); 4210 return (int) result; 4211 } else 4212 return -1; 4191 4213 } 4192 4214 … … 4204 4226 match = d; 4205 4227 } 4206 return match ? difftime(mudtime, match->last_time) : -1; 4228 if (match) { 4229 double result = difftime(mudtime, match->last_time); 4230 return (int) result; 4231 } else 4232 return -1; 4207 4233 } 4208 4234 … … 4820 4846 #endif 4821 4847 4822 4823 extern jmp_buf db_err; /**< Jump buffer in the event of a dump error */4824 4848 4825 4849 /** Dump the descriptor list to our REBOOTFILE so we can restore it on reboot. 1.7.7/src/cmds.c
r475 r477 993 993 } 994 994 995 COMMAND (cmd_buy) { 996 char *from = NULL; 997 char *forwhat = NULL; 998 int price = -1; 999 1000 upcasestr(arg_left); 1001 1002 from = strstr(arg_left, " FROM "); 1003 forwhat = strstr(arg_left, " FOR "); 1004 if (from) { 1005 *from = '\0'; 1006 from += 6; 1007 } 1008 if (forwhat) { 1009 *forwhat = '\0'; 1010 forwhat += 5; 1011 } 1012 if (forwhat && !is_strict_integer(forwhat)) { 1013 notify(player, T("Buy for WHAT price?")); 1014 return; 1015 } else if (forwhat) { 1016 price = parse_integer(forwhat); 1017 if (price < 0) { 1018 notify(player, T("You can't buy things by taking money.")); 1019 return; 1020 } 1021 } 1022 1023 if (from) 1024 from = trim_space_sep(from, ' '); 1025 do_buy(player, arg_left, from, price); 1026 } 1027 995 1028 COMMAND (cmd_give) { 996 1029 do_give(player, arg_left, arg_right, (SW_ISSET(sw, SWITCH_SILENT))); 1.7.7/src/command.c
r475 r477 281 281 0, 0}, 282 282 283 {"BUY", NULL, cmd_buy, CMD_T_ANY | CMD_T_NOGAGGED, 0, 0}, 283 284 {"BRIEF", NULL, cmd_brief, CMD_T_ANY, 0, 0}, 284 285 {"DESERT", NULL, cmd_desert, CMD_T_PLAYER | CMD_T_THING, 0, 0}, … … 433 434 memset(cmd, 0, sizeof(COMMAND_INFO)); 434 435 cmd->name = name; 436 cmd->restrict_message = NULL; 435 437 cmd->func = func; 436 438 cmd->type = type; … … 908 910 replacer = "@EMIT"; 909 911 break; 912 case CHAT_TOKEN: 913 #ifdef CHAT_TOKEN_ALIAS 914 case CHAT_TOKEN_ALIAS: 915 #endif 916 /* parse_chat() destructively modifies the command to replace 917 * the first space with a '=' if the command is an actual 918 * chat command */ 919 if (parse_chat(player, p + 1) && command_check_byname(player, "@CHAT")) { 920 /* This is a "+chan foo" chat style 921 * We set noevtoken to keep its noeval way, and 922 * set the cmd to allow @hook. */ 923 replacer = "@CHAT"; 924 noevtoken = 1; 925 } 910 926 } 911 927 … … 918 934 * quite match. 919 935 */ 920 if (*p ==
