Changeset 465
- Timestamp:
- 08/16/06 01:12:13 (2 years ago)
- Files:
-
- 1.7.7/CHANGES.177 (modified) (1 diff)
- 1.7.7/Patchlevel (modified) (1 diff)
- 1.7.7/game/txt/hlp/penncmd.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/chunk.h (modified) (1 diff)
- 1.7.7/hdrs/command.h (modified) (1 diff)
- 1.7.7/hdrs/dbdefs.h (modified) (1 diff)
- 1.7.7/hdrs/extchat.h (modified) (2 diffs)
- 1.7.7/hdrs/externs.h (modified) (1 diff)
- 1.7.7/hdrs/extmail.h (modified) (1 diff)
- 1.7.7/hdrs/game.h (modified) (3 diffs)
- 1.7.7/hdrs/version.h (modified) (1 diff)
- 1.7.7/hints/darwin.sh (modified) (1 diff)
- 1.7.7/src/bsd.c (modified) (3 diffs)
- 1.7.7/src/bufferq.c (modified) (3 diffs)
- 1.7.7/src/chunk.c (modified) (2 diffs)
- 1.7.7/src/cmds.c (modified) (7 diffs)
- 1.7.7/src/cque.c (modified) (3 diffs)
- 1.7.7/src/extchat.c (modified) (12 diffs)
- 1.7.7/src/extmail.c (modified) (6 diffs)
- 1.7.7/src/flags.c (modified) (1 diff)
- 1.7.7/src/funstr.c (modified) (1 diff)
- 1.7.7/src/game.c (modified) (2 diffs)
- 1.7.7/src/log.c (modified) (1 diff)
- 1.7.7/src/look.c (modified) (4 diffs)
- 1.7.7/src/move.c (modified) (5 diffs)
- 1.7.7/src/mysocket.c (modified) (1 diff)
- 1.7.7/src/predicat.c (modified) (2 diffs)
- 1.7.7/src/rob.c (modified) (4 diffs)
- 1.7.7/src/version.c (modified) (1 diff)
- 1.7.7/src/wiz.c (modified) (7 diffs)
- 1.7.7/win32/config.h (modified) (1 diff)
- 1.7.7/win32/pennmush.dsp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
1.7.7/CHANGES.177
r463 r465 18 18 19 19 ========================================================================== 20 21 Version 1.7.7 patchlevel 33 June 3, 2004 22 23 Minor changes (internals): 24 * IsPlayer, etc. macros rewritten for clarity by Luke@M*U*S*H. 25 * Use enums in place of some more #defines and magic numbers. [SW] 26 * New did_it_with() hc function simplifies passing a dbref as %0 27 to did_it actions. [SW] 28 Fixes: 29 * The SQL_OK power could get double-added. If this happened to you, 30 delete one of them and double-check that all sql-using objects 31 still have the power set. Report by Mordie@M*U*S*H. 32 * Missing include in game.c fixed. 33 * Improper include in bufferq.c fixed. Report by Leona and Walker@M*U*S*H. 34 * Obsolete bzero() uses removed. [SW] 35 * New win32/pennmush.dsp. 36 * Help fix by bleeder@M*U*S*H. 37 * Mac OS X linting [SW]. 38 20 39 21 40 Version 1.7.7 patchlevel 32 May 26, 2004 1.7.7/Patchlevel
r463 r465 1 1 Do not edit this file. It is maintained by the official PennMUSH patches. 2 This is PennMUSH 1.7.7p3 22 This is PennMUSH 1.7.7p33 1.7.7/game/txt/hlp/penncmd.hlp
r463 r465 2644 2644 or 'exit'. It defaults to 'any'. 2645 2645 <setperms> specifies the space-separated list of permissions for who can 2646 set and/or see the power. See 'help powerpermissions' for details.2646 set and/or see the power. See 'help flag permissions' for details. 2647 2647 It defaults to 'any' 2648 2648 <unsetperms> specifies the space-separated list of permissions for who 1.7.7/game/txt/hlp/pennv177.hlp
r463 r465 1 & 1.7.7p3 21 & 1.7.7p33 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 33 June 3, 2004 15 16 Minor changes (internals): 17 * IsPlayer, etc. macros rewritten for clarity by Luke@M*U*S*H. 18 * Use enums in place of some more #defines and magic numbers. [SW] 19 * New did_it_with() hc function simplifies passing a dbref as %0 20 to did_it actions. [SW] 21 Fixes: 22 * The SQL_OK power could get double-added. If this happened to you, 23 delete one of them and double-check that all sql-using objects 24 still have the power set. Report by Mordie@M*U*S*H. 25 * Missing include in game.c fixed. 26 * Improper include in bufferq.c fixed. Report by Leona and Walker@M*U*S*H. 27 * Obsolete bzero() uses removed. [SW] 28 * New win32/pennmush.dsp. 29 * Help fix by bleeder@M*U*S*H. 30 * Mac OS X linting [SW]. 31 32 33 & 1.7.7p32 14 34 Version 1.7.7 patchlevel 32 May 26, 2004 15 35 1.7.7/game/txt/hlp/pennvOLD.hlp
r463 r465 4419 4419 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 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 4421 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33 4422 4422 1.7.6: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 4423 4423 1.7.5: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 1.7.7/hdrs/chunk.h
r445 r465 23 23 int chunk_num_swapped(void); 24 24 void chunk_init(void); 25 void chunk_stats(dbref player, int which); 25 enum chunk_stats_type { CSTATS_SUMMARY, CSTATS_REGIONG, CSTATS_PAGINGG, 26 CSTATS_FREESPACEG, CSTATS_REGION, CSTATS_PAGING 27 }; 28 void chunk_stats(dbref player, enum chunk_stats_type which); 26 29 void chunk_new_period(void); 27 30 1.7.7/hdrs/command.h
r463 r465 7 7 #define SW_CLR(m,n) (m[(n) >> 3] &= ~(1 << ((n) & 0x7))) 8 8 #define SW_ISSET(m,n) (m[(n) >> 3] & (1 << ((n) & 0x7))) 9 #define SW_ZERO(m) bzero(m, NUM_BYTES)9 #define SW_ZERO(m) memset(m, 0, NUM_BYTES) 10 10 11 11 /* These are type restrictors */ 1.7.7/hdrs/dbdefs.h
r463 r465 63 63 64 64 /* Check for a specific one */ 65 #define IsPlayer(x) ( !!(Typeof(x) & TYPE_PLAYER))66 #define IsRoom(x) ( !!(Typeof(x) & TYPE_ROOM))67 #define IsThing(x) ( !!(Typeof(x) & TYPE_THING))68 #define IsExit(x) ( !!(Typeof(x) & TYPE_EXIT))65 #define IsPlayer(x) ((Typeof(x) & TYPE_PLAYER) == TYPE_PLAYER) 66 #define IsRoom(x) ((Typeof(x) & TYPE_ROOM) == TYPE_ROOM) 67 #define IsThing(x) ((Typeof(x) & TYPE_THING) == TYPE_THING) 68 #define IsExit(x) ((Typeof(x) & TYPE_EXIT) == TYPE_EXIT) 69 69 /* Was Destroyed() */ 70 #define IsGarbage(x) ( !!(Typeof(x) & TYPE_GARBAGE))71 #define Marked(x) ( !!(db[(x)].type & TYPE_MARKED))70 #define IsGarbage(x) ((Typeof(x) & TYPE_GARBAGE) == TYPE_GARBAGE) 71 #define Marked(x) ((db[(x)].type & TYPE_MARKED) == TYPE_MARKED) 72 72 73 73 #define IS(thing,type,flag) \ 1.7.7/hdrs/extchat.h
r463 r465 205 205 206 206 /* For use in channel matching */ 207 #define CMATCH_NONE 0 208 #define CMATCH_EXACT 1 209 #define CMATCH_PARTIAL 2 210 #define CMATCH_AMBIG 3 207 enum cmatch_type { CMATCH_NONE, CMATCH_EXACT, CMATCH_PARTIAL, CMATCH_AMBIG }; 211 208 #define CMATCHED(i) (((i) == CMATCH_EXACT) | ((i) == CMATCH_PARTIAL)) 212 209 … … 239 236 extern void do_chan_admin 240 237 (dbref player, char *name, const char *perms, int flag); 241 extern int find_channel(const char *p, CHAN **chan, dbref player); 242 extern int find_channel_partial(const char *p, CHAN **chan, dbref player); 238 extern enum cmatch_type find_channel(const char *p, CHAN **chan, dbref player); 239 extern enum cmatch_type find_channel_partial(const char *p, CHAN **chan, 240 dbref player); 243 241 extern void do_channel_list(dbref player, const char *partname); 244 242 extern int do_chat_by_name 1.7.7/hdrs/externs.h
r463 r465 291 291 const char *def, const char *owhat, const char *odef, 292 292 const char *awhat, dbref loc); 293 extern int did_it_with(dbref player, dbref thing, const char *what, 294 const char *def, const char *owhat, const char *odef, 295 const char *awhat, dbref loc, dbref env0, dbref env1, 296 int flags); 293 297 extern int did_it_interact(dbref player, dbref thing, const char *what, 294 298 const char *def, const char *owhat, 1.7.7/hdrs/extmail.h
r459 r465 82 82 extern int mdb_top; 83 83 extern void do_mail(dbref player, char *arg1, char *arg2); 84 extern void do_mail_stats(dbref player, char *name, int full); 84 enum mail_stats_type { MSTATS_COUNT, MSTATS_READ, MSTATS_SIZE }; 85 extern void do_mail_stats(dbref player, char *name, enum mail_stats_type full); 85 86 extern void do_mail_debug(dbref player, const char *action, const char *victim); 86 87 extern void do_mail_nuke(dbref player); 1.7.7/hdrs/game.h
r463 r465 32 32 extern void do_wait 33 33 (dbref player, dbref cause, char *arg1, char *cmd, int until); 34 extern void do_queue(dbref player, const char *what, int flag); 34 enum queue_type { QUEUE_ALL, QUEUE_NORMAL, QUEUE_SUMMARY, QUEUE_QUICK }; 35 extern void do_queue(dbref player, const char *what, enum queue_type flag); 35 36 extern void do_halt1(dbref player, const char *arg1, const char *arg2); 36 37 extern void do_allhalt(dbref player); … … 63 64 64 65 /* From look.c */ 65 extern void do_examine(dbref player, const char *name, int brief, int all); 66 enum exam_type { EXAM_NORMAL, EXAM_BRIEF, EXAM_MORTAL }; 67 extern void do_examine(dbref player, const char *name, enum exam_type flag, 68 int all); 66 69 extern void do_inventory(dbref player); 67 70 extern void do_find(dbref player, const char *name, char **argv); … … 160 163 extern void do_newpassword 161 164 (dbref player, const char *name, const char *password); 162 extern void do_boot(dbref player, const char *name, int flag); 165 enum boot_type { BOOT_NAME, BOOT_DESC, BOOT_SELF }; 166 extern void do_boot(dbref player, const char *name, enum boot_type flag); 163 167 extern void do_chzoneall(dbref player, const char *name, const char *target); 164 168 extern int force_by_number(dbref player, char *command); 1.7.7/hdrs/version.h
r463 r465 1 #define VERSION "PennMUSH version 1.7.7 patchlevel 31 [05/26/2004]" 2 #define SHORTVN "PennMUSH 1.7.7p32" 3 #define NUMVERSION 001007007032 1 #define VERSION "1.7.7" 2 #define PATCHLEVEL "33" 3 #define PATCHDATE "[06/03/2004]" 4 #define NUMVERSION 001007007033 1.7.7/hints/darwin.sh
r275 r465 1 1 usenm="n" 2 2 cdecl='' 3 d_attribut='undef' 3 1.7.7/src/bsd.c
r463 r465 1671 1671 /* ARGSUSED */ 1672 1672 static DESC * 1673 initializesock(int s, char *addr, char *ip, int use_ssl) 1673 initializesock(int s, char *addr, char *ip, int use_ssl 1674 __attribute__ ((__unused__))) 1674 1675 { 1675 1676 DESC *d; … … 2558 2559 /* ARGSUSED */ 2559 2560 static int 2560 process_input(DESC *d, int output_ready )2561 process_input(DESC *d, int output_ready __attribute__ ((__unused__))) 2561 2562 { 2562 2563 int got = 0; … … 3387 3388 queue_string_eol(call_by, tprintf("Connected: %d", count)); 3388 3389 queue_string_eol(call_by, tprintf("Size: %d", db_top)); 3389 queue_string_eol(call_by, tprintf("Version: %s ", SHORTVN));3390 queue_string_eol(call_by, tprintf("Version: %sp%s", VERSION, PATCHLEVEL)); 3390 3391 #ifdef PATCHES 3391 3392 queue_string_eol(call_by, tprintf("Patches: %s", PATCHES)); 1.7.7/src/bufferq.c
r463 r465 17 17 #include <stddef.h> 18 18 #include <stdarg.h> 19 #include <stdlib.h> 19 20 #ifdef I_SYS_TIME 20 21 #include <sys/time.h> … … 24 25 #include <sys/types.h> 25 26 #endif 26 #include <malloc.h>27 27 28 28 #include "conf.h" … … 31 31 #include "dbdefs.h" 32 32 #include "bufferq.h" 33 #include "mymalloc.h" 33 34 #include "log.h" 34 35 #include "confmagic.h" 1.7.7/src/chunk.c
r463 r465 220 220 221 221 #include <string.h> 222 #include <stdlib.h> 222 223 223 224 #include <fcntl.h> … … 2629 2630 * Display either the statistics summary or one of the histograms. 2630 2631 * \param player the player to display it to, or NOTHING to log it. 2631 * \param which 0 for the summary, 1 for the region histogram, 2632 * 2 for the paging histogram, or 3 for the freespace histogram, 2633 * 4 for the region stats, 5 for the paging counts. 2632 * \param which what type of information to display. 2634 2633 */ 2635 2634 void 2636 chunk_stats(dbref player, intwhich)2635 chunk_stats(dbref player, enum chunk_stats_type which) 2637 2636 { 2638 2637 switch (which) { 2639 case 0:2638 case CSTATS_SUMMARY: 2640 2639 chunk_statistics(player); 2641 2640 break; 2642 case 1:2641 case CSTATS_REGIONG: 2643 2642 chunk_histogram(player, chunk_regionhist(), 2644 2643 "Chart number of regions (y) vs. references (x)"); 2645 2644 break; 2646 case 2:2645 case CSTATS_PAGINGG: 2647 2646 chunk_histogram(player, stat_paging_histogram, 2648 2647 "Chart pages in/out (y) vs. references (x)"); 2649 2648 break; 2650 case 3:2649 case CSTATS_FREESPACEG: 2651 2650 chunk_histogram(player, chunk_freehist(), 2652 2651 "Chart region free space (y) vs. references (x)"); 2653 2652 break; 2654 case 4:2653 case CSTATS_REGION: 2655 2654 chunk_region_statistics(player); 2656 2655 break; 2657 case 5:2656 case CSTATS_PAGING: 2658 2657 chunk_page_stats(player); 2659 2658 break; 1.7.7/src/cmds.c
r463 r465 84 84 COMMAND (cmd_boot) { 85 85 if (SW_ISSET(sw, SWITCH_PORT)) 86 do_boot(player, arg_left, 1);86 do_boot(player, arg_left, BOOT_DESC); 87 87 else if (SW_ISSET(sw, SWITCH_ME)) 88 do_boot(player, (char *) NULL, 2);89 else 90 do_boot(player, arg_left, 0);88 do_boot(player, (char *) NULL, BOOT_SELF); 89 else 90 do_boot(player, arg_left, BOOT_NAME); 91 91 } 92 92 … … 159 159 160 160 COMMAND (cmd_create) { 161 do_create(player, arg_left, atol(arg_right));161 do_create(player, arg_left, parse_integer(arg_right)); 162 162 } 163 163 … … 474 474 /* First, mail commands that can be used even if you're gagged */ 475 475 if (SW_ISSET(sw, SWITCH_STATS)) 476 do_mail_stats(player, arg_left, 0);476 do_mail_stats(player, arg_left, MSTATS_COUNT); 477 477 else if (SW_ISSET(sw, SWITCH_DSTATS)) 478 do_mail_stats(player, arg_left, 1);478 do_mail_stats(player, arg_left, MSTATS_READ); 479 479 else if (SW_ISSET(sw, SWITCH_FSTATS)) 480 do_mail_stats(player, arg_left, 2);480 do_mail_stats(player, arg_left, MSTATS_SIZE); 481 481 else if (SW_ISSET(sw, SWITCH_DEBUG)) 482 482 do_mail_debug(player, arg_left, arg_right); … … 671 671 COMMAND (cmd_ps) { 672 672 if (SW_ISSET(sw, SWITCH_ALL)) 673 do_queue(player, arg_left, 1);673 do_queue(player, arg_left, QUEUE_ALL); 674 674 else if (SW_ISSET(sw, SWITCH_SUMMARY) || SW_ISSET(sw, SWITCH_COUNT)) 675 do_queue(player, arg_left, 2);675 do_queue(player, arg_left, QUEUE_SUMMARY); 676 676 else if (SW_ISSET(sw, SWITCH_QUICK)) 677 do_queue(player, arg_left, 3);678 else 679 do_queue(player, arg_left, 0);677 do_queue(player, arg_left, QUEUE_QUICK); 678 else 679 do_queue(player, arg_left, QUEUE_NORMAL); 680 680 } 681 681 … … 793 793 else if (SW_ISSET(sw, SWITCH_CHUNKS)) { 794 794 if (SW_ISSET(sw, SWITCH_REGIONS)) 795 chunk_stats(player, 4);795 chunk_stats(player, CSTATS_REGION); 796 796 else 797 chunk_stats(player, 0);797 chunk_stats(player, CSTATS_SUMMARY); 798 798 } else if (SW_ISSET(sw, SWITCH_REGIONS)) 799 chunk_stats(player, 1);799 chunk_stats(player, CSTATS_REGIONG); 800 800 else if (SW_ISSET(sw, SWITCH_PAGING)) 801 chunk_stats(player, 2);801 chunk_stats(player, CSTATS_PAGINGG); 802 802 else if (SW_ISSET(sw, SWITCH_FREESPACE)) 803 chunk_stats(player, 3);803 chunk_stats(player, CSTATS_FREESPACEG); 804 804 else 805 805 do_stats(player, arg_left); … … 919 919 920 920 COMMAND (cmd_brief) { 921 do_examine(player, arg_left, 1, 0);921 do_examine(player, arg_left, EXAM_BRIEF, 0); 922 922 } 923 923 … … 929 929 int all = SW_ISSET(sw, SWITCH_ALL); 930 930 if (SW_ISSET(sw, SWITCH_BRIEF)) 931 do_examine(player, arg_left, 1, all);931 do_examine(player, arg_left, EXAM_BRIEF, all); 932 932 else if (SW_ISSET(sw, SWITCH_DEBUG)) 933 933 do_debug_examine(player, arg_left); 934 934 else if (SW_ISSET(sw, SWITCH_MORTAL)) 935 do_examine(player, arg_left, 2, all);936 else 937 do_examine(player, arg_left, 0, all);935 do_examine(player, arg_left, EXAM_MORTAL, all); 936 else 937 do_examine(player, arg_left, EXAM_NORMAL, all); 938 938 } 939 939 1.7.7/src/cque.c
r459 r465 894 894 */ 895 895 void 896 do_queue(dbref player, const char *what, intflag)896 do_queue(dbref player, const char *what, enum queue_type flag) 897 897 { 898 898 dbref victim = NOTHING; … … 902 902 int pq = 0, oq = 0, wq = 0, sq = 0; 903 903 int tpq = 0, toq = 0, twq = 0, tsq = 0; 904 if (flag == 2 || flag == 3)904 if (flag == QUEUE_SUMMARY || flag == QUEUE_QUICK) 905 905 quick = 1; 906 if (flag == 1 || flag == 2) {906 if (flag == QUEUE_ALL || flag == QUEUE_SUMMARY) { 907 907 all = 1; 908 908 victim = player; … … 928 928 929 929 if (!quick) { 930 if (all == 1)930 if (all == QUEUE_ALL) 931 931 notify(player, T("Queue for : all")); 932 932 else 1.7.7/src/extchat.c
r463 r465 65 65 static int yesno(const char *str); 66 66 static int canstilladd(dbref player); 67 static int find_channel_partial_on(const char *name, CHAN **chan, dbref player); 68 static int find_channel_partial_off 69 (const char *name, CHAN **chan, dbref player); 67 static enum cmatch_type find_channel_partial_on(const char *name, CHAN **chan, 68 dbref player); 69 static enum cmatch_type find_channel_partial_off(const char *name, CHAN **chan, 70 dbref player); 70 71 static char *list_cflags(CHAN *c); 71 72 static char *list_cuflags(CHANUSER *u); … … 150 151 list_partial_matches(player, name, PMATCH_ALL); \ 151 152 return; \ 153 default: \ 154 break; \ 152 155 } \ 153 156 } while (0) … … 688 691 * \retval CMATCH_NONE no match for channel name. 689 692 */ 690 int 693 enum cmatch_type 691 694 find_channel(const char *name, CHAN **chan, dbref player) 692 695 { … … 743 746 * \retval CMATCH_NONE no match for channel name. 744 747 */ 745 int 748 enum cmatch_type 746 749 find_channel_partial(const char *name, CHAN **chan, dbref player) 747 750 { … … 830 833 * \retval CMATCH_NONE no match for channel name. 831 834 */ 832 static int835 static enum cmatch_type 833 836 find_channel_partial_on(const char *name, CHAN **chan, dbref player) 834 837 { … … 879 882 * \retval CMATCH_NONE no match for channel name. 880 883 */ 881 static int884 static enum cmatch_type 882 885 find_channel_partial_off(const char *name, CHAN **chan, dbref player) 883 886 { … … 1110 1113 list_partial_matches(player, name, PMATCH_OFF); 1111 1114 return; 1115 default: 1116 break; 1112 1117 } 1113 1118 if (!Chan_Can_See(chan, player)) { … … 1172 1177 list_partial_matches(player, name, PMATCH_ON); 1173 1178 return; 1179 default: 1180 break; 1174 1181 } 1175 1182 u = onchannel(player, chan); … … 1397 1404 list_partial_matches(player, name, PMATCH_ALL); 1398 1405 return; 1406 default: 1407 break; 1399 1408 } 1400 1409 if (!Chan_Can_See(chan, player)) { … … 2427 2436 CHAN *chan = NULL; 2428 2437 CHANUSER *u; 2429 int i;2430 2438 dbref who; 2431 i = find_channel(args[0], &chan, executor); 2432 switch ( i) {2439 2440 switch (find_channel(args[0], &chan, executor)) { 2433 2441 case CMATCH_NONE: 2434 2442 notify(executor, T("No such channel.")); … … 2437 2445 notify(executor, T("I can't tell which channel you mean.")); 2438 2446 return; 2447 default: 2448 break; 2439 2449 } 2440 2450 … … 2686 2696 safe_str("#-2 AMBIGUOUS CHANNEL MATCH", buff, bp); 2687 2697 return; 2698 default: 2699 break; 2688 2700 } 2689 2701 1.7.7/src/extmail.c
r463 r465 1222 1222 * \param player the enactor. 1223 1223 * \param name name of player whose mail stats are to be checked (NULL for all) 1224 * \param full level of verbosity: 0 = just count messages, 1 = break down by 1225 * read/unread, 2 = include space usage. 1224 * \param full level of verbosity: MSTATS_COUNT = just count messages, 1225 * MSTATS_READ = break down by read/unread, MSTATS_SIZE = include 1226 * space usage. 1226 1227 */ 1227 1228 void 1228 do_mail_stats(dbref player, char *name, intfull)1229 do_mail_stats(dbref player, char *name, enum mail_stats_type full) 1229 1230 { 1230 1231 dbref target; … … 1272 1273 } 1273 1274 if (target == AMBIGUOUS) { /* stats for all */ 1274 if (full == 0) {1275 if (full == MSTATS_COUNT) { 1275 1276 notify_format(player, 1276 1277 T("There are %d messages in the mail spool."), mdb_top); 1277 1278 return; 1278 } else if (full == 1) {1279 } else if (full == MSTATS_READ) { 1279 1280 for (mp = HEAD; mp != NULL; mp = mp->next) { 1280 1281 if (Cleared(mp)) … … 1319 1320 /* individual stats */ 1320 1321 1321 if (full == 0) {1322 if (full == MSTATS_COUNT) { 1322 1323 /* just count number of messages */ 1323 1324 for (mp = HEAD; mp != NULL; mp = mp->next) { … … 1340 1341 else 1341 1342 fu++; 1342 if (full == 2)1343 if (full == MSTATS_SIZE) 1343 1344 fchars += strlen(get_message(mp)); 1344 1345 } … … 1352 1353 else 1353 1354 tu++; 1354 if (full == 2)1355 if (full == MSTATS_SIZE) 1355 1356 tchars += strlen(get_message(mp)); 1356 1357 } … … 1359 1360 notify_format(player, T("Mail statistics for %s:"), Name(target)); 1360 1361 1361 if (full == 1) {1362 if (full == MSTATS_READ) { 1362 1363 notify_format(player, T("%d messages sent, %d unread, %d cleared."), 1363 1364 fc + fr + fu, fu, fc); 1.7.7/src/flags.c
r463 r465 1766 1766 Flagspace_Lookup(n, ns); 1767 1767 /* Don't double-add */ 1768 if ((f = match_flag_ns(n, name)))1768 if ((f = match_flag_ns(n, strupper(name)))) 1769 1769 return f; 1770 1770 f = new_flag(); 1.7.7/src/funstr.c
r463 r465 661 661 char rawstr[BUFFER_LEN]; 662 662 char *ip, *op; 663 int i, len;663 size_t i, len; 664 664 char *c; 665 665 ansi_string *as; 1.7.7/src/game.c
r463 r465 35 35 #endif 36 36 #include <stdlib.h> 37 #include <stdarg.h> 37 38 #ifdef I_UNISTD 38 39 #include <unistd.h> … … 529 530 530 531 mush_panic(c); 532 _exit(136); /* Not reached but kills warnings */ 531 533 } 532 534 1.7.7/src/log.c
r463 r465 16 16 #include <string.h> 17 17 #include <stdarg.h> 18 #include <stdlib.h> 18 19 #ifdef I_SYS_TIME 19 20 #include <sys/time.h> 1.7.7/src/look.c
r463 r465 673 673 */ 674 674 void 675 do_examine(dbref player, const char *name, int brief, int all)675 do_examine(dbref player, const char *name, enum exam_type flag, int all) 676 676 { 677 677 dbref thing; … … 715 715 return; 716 716 } 717 if ( brief == 2) {717 if (flag == EXAM_MORTAL) { 718 718 ok = 0; 719 719 } else { … … 743 743 notify(player, flag_description(player, thing)); 744 744 } 745 if (EX_PUBLIC_ATTRIBS && ( brief != 1)) {745 if (EX_PUBLIC_ATTRIBS && (flag != EXAM_BRIEF)) { 746 746 a = atr_get_noparent(thing, "DESCRIBE"); 747 747 if (a) { … … 781 781 782 782 /* show attributes */ 783 switch ( brief) {784 case 0:/* Standard */783 switch (flag) { 784 case EXAM_NORMAL: /* Standard */ 785 785 if (EX_PUBLIC_ATTRIBS || ok) 786 786 look_atrs(player, thing, NULL, all); 787 787 break; 788 case 1:/* Brief */789 break; 790 case 2:/* Mortal */788 case EXAM_BRIEF: /* Brief */ 789 break; 790 case EXAM_MORTAL: /* Mortal */ 791 791 if (EX_PUBLIC_ATTRIBS) 792 792 mortal_look_atrs(player, thing, NULL, all); 1.7.7/src/move.c
r463 r465 515 515 long match_flags = 516 516 MAT_NEIGHBOR | MAT_ABSOLUTE | MAT_CHECK_KEYS | MAT_NEAR | MAT_ENGLISH; 517 char *myenv[10]; 518 int i; 517 519 518 if (!IsRoom(loc) && !EnterOk(loc) && !controls(player, loc)) { 520 519 notify(player, T("Permission denied.")); … … 568 567 did_it(player, thing, "SUCCESS", tbuf1, "OSUCCESS", tbuf2, "ASUCCESS", 569 568 NOTHING); 570 myenv[0] = (char *) mush_malloc(BUFFER_LEN, "dbref"); 571 sprintf(myenv[0], "#%d", thing); 572 for (i = 1; i < 10; i++) 573 myenv[i] = NULL; 574 real_did_it(player, player, "RECEIVE", NULL, "ORECEIVE", NULL, 575 "ARECEIVE", NOTHING, myenv, NA_INTER_SEE); 576 mush_free(myenv[0], "dbref"); 569 did_it_with(player, player, "RECEIVE", NULL, "ORECEIVE", NULL, 570 "ARECEIVE", NOTHING, thing, NOTHING, NA_INTER_HEAR); 577 571 } else 578 572 fail_lock(player, thing, Basic_Lock, … … 615 609 did_it(player, thing, "SUCCESS", tbuf1, "OSUCCESS", tbuf2, 616 610 "ASUCCESS", NOTHING); 617 myenv[0] = (char *) mush_malloc(BUFFER_LEN, "dbref"); 618 sprintf(myenv[0], "#%d", thing); 619 for (i = 1; i < 10; i++) 620 myenv[i] = NULL; 621 real_did_it(player, player, "RECEIVE", NULL, "ORECEIVE", NULL, 622 "ARECEIVE", NOTHING, myenv, NA_INTER_SEE); 623 mush_free(myenv[0], "dbref"); 611 did_it_with(player, player, "RECEIVE", NULL, "ORECEIVE", NULL, 612 "ARECEIVE", NOTHING, thing, NOTHING, NA_INTER_HEAR); 624 613 } else 625 614 fail_lock(player, thing, Basic_Lock, T("You can't pick that up."), … … 775 764 /* Now do the work, if we should. That includes triggering messages */ 776 765 if (empty_ok) { 777 int i;778 766 char tbuf1[BUFFER_LEN], tbuf2[BUFFER_LEN], *tp; 779 char *myenv[10]; 767 780 768 count++; 781 769 /* Get messages */ … … 794 782 did_it(player, item, "SUCCESS", tbuf1, "OSUCCESS", tbuf2, "ASUCCESS", 795 783 NOTHING); 796 myenv[0] = (char *) mush_malloc(BUFFER_LEN, "dbref"); 797 sprintf(myenv[0], "#%d", item); 798 for (i = 1; i < 10; i++) 799 myenv[i] = NULL; 800 real_did_it(player, player, "RECEIVE", NULL, "ORECEIVE", NULL, 801 "ARECEIVE", NOTHING, myenv, NA_INTER_SEE); 802 mush_free(myenv[0], "dbref"); 784 did_it_with(player, player, "RECEIVE", NULL, "ORECEIVE", NULL, 785 "ARECEIVE", NOTHING, item, NOTHING, NA_INTER_HEAR); 803 786 } 804 787 /* Drop messages */ 1.7.7/src/mysocket.c
r463 r465 994 994 995 995 if (hintsp == NULL) { 996 bzero(&hints, sizeof(hints));996 memset(&hints, 0, sizeof(hints)); 997 997 hints.ai_family = AF_UNSPEC; 998 998 } else 1.7.7/src/predicat.c
r463 r465 152 152 { 153 153 /* Bunch o' nulls */ 154 static char *myenv[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};154 static char *myenv[10] = { NULL }; 155 155 return real_did_it(player, thing, what, def, owhat, odef, awhat, loc, myenv, 156 156 NA_INTER_HEAR); 157 } 158 159 /** A wrapper for real_did_it that can set %0 and %1 to dbrefs. 160 * \param player the enactor. 161 * \param thing object being triggered. 162 * \param what message attribute for enactor. 163 * \param def default message to enactor. 164 * \param owhat message attribute for others. 165 * \param odef default message to others. 166 * \param awhat action attribute to trigger. 167 * \param loc location in which action is taking place. 168 * \param env0 dbref to pass as %0, or NOTHING. 169 * \param env1 dbref to pass as %1, or NOTHING. 170 * \param flags interaction flags to pass to real_did_it. 171 * \retval 0 no attributes were present, only defaults were used if given. 172 * \retval 1 some attributes were evaluated and used. 173 */ 174 int 175 did_it_with(dbref player, dbref thing, const char *what, const char *def, 176 const char *owhat, const char *odef, const char *awhat, 177 dbref loc, dbref env0, dbref env1, int flags) 178 { 179 char *myenv[10] = { NULL }; 180 char e0[SBUF_LEN], e1[SBUF_LEN], *ep; 181 182 if (env0 != NOTHING) { 183 ep = e0; 184 safe_dbref(env0, e0, &ep); 185 *ep = '\0'; 186 myenv[0] = e0; 187 } 188 189 if (env1 != NOTHING) { 190 ep = e1; 191 safe_dbref(env1, e1, &ep); 192 *ep = '\0'; 193 myenv[1] = e1; 194 } 195 196 return real_did_it(player, thing, what, def, owhat, odef, awhat, loc, myenv, 197 flags); 157 198 } 158 199 … … 177 218 { 178 219 /* Bunch o' nulls */ 179 static char *myenv[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};220 static char *myenv[10] = { NULL }; 180 221 return real_did_it(player, thing, what, def, owhat, odef, awhat, loc, myenv, 181 222 flags); 1.7.7/src/rob.c
r463 r465 146 146 char tbuf1[BUFFER_LEN]; 147 147 char *bp; 148 char *myenv[10];149 int i;150 148 151 149 /* If we have a recipient, but no amnt, try parsing for … … 211 209 212 210 /* Notify the giver with their GIVE message */ 213 myenv[0] = (char *) mush_malloc(BUFFER_LEN, "dbref");214 myenv[1] = (char *) mush_malloc(BUFFER_LEN, "dbref");215 sprintf(myenv[0], "#%d", thing);216 sprintf(myenv[1], "#%d", who);217 for (i = 2; i < 10; i++)218 myenv[i] = NULL;219 211 bp = tbuf1; 220 212 safe_format(tbuf1, &bp, T("You gave %s to %s."), Name(thing), 221 213 Name(who)); 222 214 *bp = '\0'; 223 real_did_it(player, player, "GIVE", tbuf1, "OGIVE", NULL,224 "AGIVE", NOTHING, myenv, NA_INTER_SEE);215 did_it_with(player, player, "GIVE", tbuf1, "OGIVE", NULL, 216 "AGIVE", NOTHING, thing, who, NA_INTER_SEE); 225 217 226 218 /* Notify the object that it's been given */ … … 234 226 Name(thing)); 235 227 *bp = '\0'; 236 sprintf(myenv[1], "#%d", player); 237 real_did_it(who, who, "RECEIVE", tbuf1, "ORECEIVE", NULL, 238 "ARECEIVE", NOTHING, myenv, NA_INTER_SEE); 239 240 mush_free(myenv[0], "dbref"); 241 mush_free(myenv[1], "dbref"); 228 did_it_with(who, who, "RECEIVE", tbuf1, "ORECEIVE", NULL, 229 "ARECEIVE", NOTHING, thing, player, NA_INTER_SEE); 242 230 } else 243 231 notify(player, T("Permission denied.")); … … 268 256 notify_format(player, T("You don't have that many %s to give!"), MONIES); 269 257 } else { 270 char *pay_env[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};258 char *pay_env[10] = { NULL }; 271 259 char paid[SBUF_LEN], *pb; 272 260 1.7.7/src/version.c
r425 r465 42 42 notify_format(player, T("Last restarted: %s"), buff); 43 43 44 notify_format(player, "%s", VERSION); 44 notify_format(player, "PennMUSH version %s patchlevel %s %s", VERSION, 45 PATCHLEVEL, PATCHDATE); 45 46 #ifdef PATCHES 46 47 notify_format(player, "Patches: %s", PATCHES); 1.7.7/src/wiz.c
r463 r465 741 741 * \param player the enactor. 742 742 * \param name name of the player or descriptor to boot. 743 * \param flag 0=normal, 1=boot by descriptor, 2=self-boot743 * \param flag the type of booting to do. 744 744 */ 745 745 void 746 do_boot(dbref player, const char *name, intflag)746 do_boot(dbref player, const char *name, enum boot_type flag) 747 747 { 748 748 dbref victim; … … 751 751 victim = NOTHING; 752 752 switch (flag) { 753 case 2:753 case BOOT_SELF: 754 754 /* self boot */ 755 755 victim = player; 756 756 break; 757 case 1:757 case BOOT_DESC: 758 758 /* boot by descriptor */ 759 759 victim = find_player_by_desc(atoi(name)); 760 760 if (victim == player) 761 flag = 2;761 flag = BOOT_SELF; 762 762 else if (victim == NOTHING) { 763 763 d = port_desc(atoi(name)); … … 769 769 } 770 770 break; 771 case 0:771 case BOOT_NAME: 772 772 /* boot by name */ 773 773 if ((victim = … … 778 778 } 779 779 if (victim == player) 780 flag = 2;780 flag = BOOT_SELF; 781 781 break; 782 782 } … … 792 792 /* look up descriptor */ 793 793 switch (flag) {
