This is patch04 to PennMUSH 1.8.1. After applying this patch, you will have version 1.8.1p4 To apply this patch, save it to a file in your top-level MUSH directory, and do the following: patch -p1 < 1.8.1-patch04 make clean make install If you use GNU patch 2.2, you probably want the above to be 'patch -b -p1', not just 'patch -p1'. Unix (or cygwin) users need not worry about failed hunks in src/switchinc.c, hdrs/switches.h, hdrs/cmds.h, or hdrs/funs.h. These files are automatically rebuilt on compile. On the off chance they appear not to be, simply rm them and re-run make. Then @shutdown and restart your MUSH. - Alan/Javelin In this patch: Major Changes: * Errors in matching switches to commands are ignored when the command is hook/ignored or hook/overriden, so you can override a built-in command and provide your own switches. Suggested by Trinsec@M*U*S*H. Mail: * @mailfilter attribute causes incoming mail to be be automatically filed to a folder if it evaluates to a folder name/number. Patch by Sketch@M*U*S*H. Commands: * @prompt/@nsprompt work like @pemit/list, but add a telnet GOAHEAD at the end of the message when emitting to players; players whose clients handle GOAHEAD (e.g. tf) will get the message displayed as a prompt in the input window. Suggested by Trinsec@M*U*S*H. * The PROMPT_NEWLINES socket command can be used to add a newline after the GOAHEAD in a prompt, for clients that mix up prompt lines with other output. Functions: * namegrab() and namegraball(). Patch by Walker@M*U*S*H. * prompt() and nsprompt() (the function equivalents of @prompt/@nsprompt). * textentries(). Suggested by Trinsec@M*U*S*H. * cdesc(), cusers(), cmsgs(), cbuffer(), cstatus(), clflags() functions. Suggested by d'Ark@M*U*S*H. * numversion() returns Penn version as an integer (1008001004) for softcode use. Minor changes: * @chan/list works better for people who increase CHAN_NAME_LEN. Suggested by Trinsec@M*U*S*H. * Help fixes by Trinsec@M*U*S*H, Chili@M*U*S*H. * Several powers (tport_anything, tport_anywhere, no_money, no_quota, debit, sql_ok) are now aliased to TinyMUSH/TinyMUX equivalents as well, for better code portability. [3,MUX] Fixes: * center() behaves better when given a fourth argument but not a third one. Also fixes to cases where the right fill string is one longer than the left. Report by Ian@M*U*S*H * Fixes from 1.8.0p9. Prereq: 1.8.1p3 *** 1_8_1.151/Patchlevel Thu, 15 Sep 2005 18:27:55 -0500 dunemush (pennmush/5_Patchlevel 1.17.1.11.1.47 600) --- 1_8_1.192(w)/Patchlevel Tue, 06 Dec 2005 14:17:51 -0600 dunemush (pennmush/5_Patchlevel 1.17.1.11.1.48 600) *************** *** 1,2 **** Do not edit this file. It is maintained by the official PennMUSH patches. ! This is PennMUSH 1.8.1p3 --- 1,2 ---- Do not edit this file. It is maintained by the official PennMUSH patches. ! This is PennMUSH 1.8.1p4 *** 1_8_1.151/game/txt/hlp/pennmail.hlp Fri, 25 Feb 2005 16:36:49 -0600 dunemush (pennmush/15_pennmail.h 1.14 600) --- 1_8_1.192(w)/game/txt/hlp/pennmail.hlp Sun, 20 Nov 2005 15:49:54 -0600 dunemush (pennmush/15_pennmail.h 1.17 600) *************** *** 114,119 **** --- 114,141 ---- @mail/file = This command moves all messages in msg-list from the current folder to a new folder, . + + See also: @mailfilter + & @mailfilter + & mailfilter + The @mailfilter attribute specifies automatic filing of incoming + @mail messages into folders. When an @mail message is received, + the contents of @mailfilter are evaluated, with the following + arguments passed: + %0 dbref of message sender + %1 message subject + %2 message body + %3 message status flags (a string containing U, F, and/or R, + for urgent, forwarded, and/or reply, respectively) + + If @mailfilter evaluates to a folder name or number, the message + will be filed into that folder. If @mailfilter evaluates to a null + string, the message remains in the incoming folder. + + Example: Filter urgent messages into folder 1 + > @mailfilter me=if(strmatch(%3,*U*),1) + + See also: mail-folders & mail-admin The @mail command can also take the following switches: *************** *** 314,317 **** (i.e. you're delivering to yourself or you're a wizard) or pass their @lock/mailforward. An empty @lock/mailforward disallows forwarding to you, and is the default. - --- 336,338 ---- *** 1_8_1.151/game/txt/hlp/pennfunc.hlp Sat, 27 Aug 2005 13:36:28 -0500 dunemush (pennmush/16_pennfunc.h 1.2.1.50.1.1.1.1.1.2.1.7.1.8.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.1.1.1.1.1.1.1.1.9.1.1.1.1.1.3.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.26.1.1.1.1.1.1.1.5 600) --- 1_8_1.192(w)/game/txt/hlp/pennfunc.hlp Tue, 06 Dec 2005 14:21:30 -0600 dunemush (pennmush/16_pennfunc.h 1.2.1.50.1.1.1.1.1.2.1.7.1.8.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.1.1.1.1.1.1.1.1.9.1.1.1.1.1.3.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.26.1.1.1.1.1.1.1.12 600) *************** *** 100,107 **** to an object or objects. cemit() emit() lemit() nsemit() nslemit() ! nsoemit() nspemit() nsremit() nszemit() oemit() ! pemit() remit() zemit() & Connection functions Connection functions return information about the connections open on a game, or about specific connections. --- 100,107 ---- to an object or objects. cemit() emit() lemit() nsemit() nslemit() ! nsoemit() nspemit() nsprompt() nsremit() nszemit() ! oemit() pemit() prompt() remit() zemit() & Connection functions Connection functions return information about the connections open on a game, or about specific connections. *************** *** 144,153 **** element() elements() extract() first() grab() graball() index() insert() itemize() items() iter() last() ldelete() map() match() ! matchall() member() mix() munge() remove() ! replace() rest() revwords() setdiff() setinter() ! setunion() shuffle() sort() sortby() sortkey() ! splice() step() table() wordpos() words() See also: LISTS & Math functions --- 144,154 ---- element() elements() extract() first() grab() graball() index() insert() itemize() items() iter() last() ldelete() map() match() ! matchall() member() mix() munge() namegrab() ! namegraball() remove() replace() rest() revwords() ! setdiff() setinter() setunion() shuffle() sort() ! sortby() sortkey() splice() step() table() ! wordpos() words() See also: LISTS & Math functions *************** *** 221,228 **** isword() localize() link() list() lnum() null() objeval() open() pcreate() r-function rand() s-function scan() set() setq() ! setr() soundex() soundslike() tel() textfile() ! valid() wipe() @@() & @@() & NULL() --- 222,229 ---- isword() localize() link() list() lnum() null() objeval() open() pcreate() r-function rand() s-function scan() set() setq() ! setr() soundex() soundslike() tel() textentries() ! textfile() valid() wipe() @@() & @@() & NULL() *************** *** 2589,2594 **** --- 2590,2613 ---- that it will continue to do this for the time being. Don't rely on it. Related functions: FULLNAME(), ACCNAME(), INAME() + & NAMEGRAB() + & NAMEGRABALL() + namegrab(,) + namegraball(,) + + The namegrab() function, when given a list of dbrefs and a name, returns + the first dbref in the list that would match as if you were + checking num() or locate(). An exact match has priority over non-exact matches. + + namegraball() returns all dbrefs whose names would be matched by. + + eg: @@(#0: Room Zero. #1: One. #2: Master Room) + > th namegrab(#0 #1 #2,room) + #0 + > th namegrab(#0 #1 #2,master room) + #2 + > th namegraball(#0 #1 #2,room) + #0 #2 & NAND() nand(, ,...) *************** *** 2817,2831 **** In this case, you must control the object. & PEMIT() & NSPEMIT() pemit(,) nspemit(,) ! This function will send each object on the list a message, as per the @pemit/list command. It returns nothing. It respects page-locks and HAVEN flags on players. nspemit() is a wizard-only variation that works like @nspemit/list. ! & PI() pi() --- 2836,2859 ---- In this case, you must control the object. & PEMIT() & NSPEMIT() + & PROMPT() + & NSPROMPT() pemit(,) nspemit(,) + prompt(,) + nsprompt(,) ! pemit() will send each object on the list a message, as per the @pemit/list command. It returns nothing. It respects page-locks and HAVEN flags on players. nspemit() is a wizard-only variation that works like @nspemit/list. ! ! prompt() adds a telnet GOAHEAD to the end of the message, as per ! the @prompt command. nsprompt() is a wizard-only variation that ! works like @nsprompt. ! ! See also: @prompt, @nsprompt, PROMPT_NEWLINES & PI() pi() *************** *** 3631,3637 **** See also: mean(), median() & STRCAT() ! strcat(, ) Concatenates two strings together, with no space between them. For example, strcat(foo bar,baz blech) will return the string --- 3659,3665 ---- See also: mean(), median() & STRCAT() ! strcat(, [, ...]) Concatenates two strings together, with no space between them. For example, strcat(foo bar,baz blech) will return the string *************** *** 3831,3844 **** --- 3859,3879 ---- Players can use terminfo() on their own connections. Using it on other players is restricted to see_all objects. & TEXTFILE() + & TEXTENTRIES() & dynhelp() textfile(,) + textentries(,[,]) textfile() returns the text of entries from cached text files (such as "help", "news", "events", etc.) All whitespace and newlines are included, so you may want to edit %r's and squish the result if you plan to use the text as a list of words rather than a display. + textentries() returns the topic names of matching entries. + may include wildcards, in which case a list of matching topic names + will be return, separated by the string if one is + provided, and space-separated otherwise. + Examples: > say textfile(help,tel\() You say, " tel(,) *************** *** 3987,3992 **** --- 4022,4029 ---- See also: MERGE() & TRIM() + & TRIMPENN() + & TRIMTINY() trim([,][,]) trimpenn([,][,]) trimtiny([,][,]) *************** *** 4241,4254 **** 4 2 3 & VERSION() ! Function: version() ! ! Returns a string which contains various version information for the MUSH ! you're on. Example: > say version() ! You say "PennMUSH version 1.6.0 patchlevel 0 [1/10/96]" & VISIBLE() visible(,[/]) --- 4278,4296 ---- 4 2 3 & VERSION() ! & NUMVERSION() ! version() ! numversion() ! ! version() returns a string which contains various version information ! for the MUSH you're on. numversion() returns an integer representation ! of the version/patchlevel which can be used for softcode comparison. Example: > say version() ! You say "PennMUSH version 1.8.1 patchlevel 4 [12/06/2005]" ! > say numversion() ! You say "1008001004" & VISIBLE() visible(,[/]) *** 1_8_1.151/game/txt/hlp/penncmd.hlp Sat, 27 Aug 2005 13:36:28 -0500 dunemush (pennmush/18_penncmd.hl 1.2.1.1.1.47.1.1.1.1.1.3.1.4.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.2.1.10.1.1.1.1.1.1.1.1.1.1.1.47.1.1.1.2 600) --- 1_8_1.192(w)/game/txt/hlp/penncmd.hlp Thu, 03 Nov 2005 13:39:59 -0600 dunemush (pennmush/18_penncmd.hl 1.2.1.1.1.47.1.1.1.1.1.3.1.4.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.2.1.10.1.1.1.1.1.1.1.1.1.1.1.47.1.1.1.6 600) *************** *** 57,67 **** @find @force @function @gedit @grep @halt @lemit @listmotd @mail @map @notify @nsemit @nslemit @nsoemit @nspemit ! @nsremit @nszemit @oemit @password @pemit ! @ps @remit @restart @scan @search ! @select @stats @sweep @switch @teleport ! @trigger @verb @version @wait @whereis ! @zemit & @-WIZARD These '@' commands are only usable by wizards or privileged players: --- 57,67 ---- @find @force @function @gedit @grep @halt @lemit @listmotd @mail @map @notify @nsemit @nslemit @nsoemit @nspemit ! @nsprompt @nsremit @nszemit @oemit @password ! @pemit @prompt @ps @remit @restart ! @scan @search @select @stats @sweep ! @switch @teleport @trigger @verb @version ! @wait @whereis @zemit & @-WIZARD These '@' commands are only usable by wizards or privileged players: *************** *** 2280,2300 **** & @nsremit & @nszemit & @nsoemit @nsemit[/] [] @nslemit[/] @nspemit[/switches] = @nsremit[/switches] = . @nsoemit[/] [/] [...] = @nszemit = ! These wizard-only commands work like @emit, @lemit, @pemit, @remit, @oemit, and @zemit, respectively, but will not include nospoof information. They are meant to be used by commands in the master room where the nospoof information is just useless noise. They take all switches of their respective commands. ! See also: @emit, @lemit, @pemit, @remit, @oemit, @zemit, nsemit(), nslemit(), ! nspemit(), nsremit(), nsoemit(), nszemit() & @odeath @odeath [=] --- 2280,2303 ---- & @nsremit & @nszemit & @nsoemit + & @nsprompt @nsemit[/] [] @nslemit[/] @nspemit[/switches] = + @nsprompt[/switches] = @nsremit[/switches] = . @nsoemit[/] [/] [...] = @nszemit = ! These wizard-only commands work like @emit, @lemit, @pemit, @prompt, @remit, @oemit, and @zemit, respectively, but will not include nospoof information. They are meant to be used by commands in the master room where the nospoof information is just useless noise. They take all switches of their respective commands. ! See also: @emit, @lemit, @pemit, @prompt, @remit, @oemit, @zemit, ! nsemit(), nslemit(), nspemit(), nsprompt(), nsremit(), nsoemit(), ! nszemit(), PROMPT_NEWLINES & @odeath @odeath [=] *************** *** 2630,2635 **** --- 2633,2666 ---- This wizard-only command creates a player with the given name and password. + & @prompt + @prompt[/] = + + A variation of @pemit/list that adds a telnet GOAHEAD control code + to the end of messages sent to players. Players with clients + that handle GOAHEAD may get the message as a prompt in their + client's input area. + + @prompt supports the following @pemit switches: /silent, /noisy, + /spoof, /noeval + + See also: @pemit, @nsprompt, prompt(), nsprompt(), PROMPT_NEWLINES + & PROMPT_NEWLINES + PROMPT_NEWLINES <1|0> + + This socket-level command is used to indicate whether a newline should + be sent after the telnet GOAHEAD code issued by @prompt/prompt() + to telnet-capable clients. By default, in order to maximize + portability, newlines are sent. + + Some clients, like TinyFugue, are smart enough to interpret GOAHEAD and + treat prompts specially by putting them into their input window. These + clients do not require the newline, and sending the newline results in + a blank line in their output window. The 'PROMPT_NEWLINES 0' command + can be used to disable the newline and is recommended for users with + these clients. + + See also: @prompt, prompt() & @pemit @pemit[/] = *** 1_8_1.151/game/txt/hlp/pennchat.hlp Fri, 25 Feb 2005 13:31:23 -0600 dunemush (pennmush/19_pennchat.h 1.2.1.4.1.12 600) --- 1_8_1.192(w)/game/txt/hlp/pennchat.hlp Wed, 09 Nov 2005 10:30:46 -0600 dunemush (pennmush/19_pennchat.h 1.2.1.4.1.14 600) *************** *** 245,253 **** & CTITLE() ctitle(,) ! Returns @chan/title on . You must either be able to examine the object, or it must visible be on a channel which you are allowed to join. & CWHO() cwho() --- 245,272 ---- & CTITLE() ctitle(,) ! Returns 's @chan/title on . You must either be able to examine the object, or it must visible be on a channel which you are allowed to join. + & CSTATUS() + cstatus(,) + + Returns 's status with respect to , which may be + "Off", "On", or "Gag". You must either be able to examine the object, + or it must visible be on the channel; "Off" is returned for + objects that you can not see on the channel. + & CDESC() + & CUSERS() + & CMSGS() + & CBUFFER() + cdesc() + cusers() + cmsgs() + cbuffer() + + Return the description, number of users, number of messages, + or buffer size of , respectively. This information is + also displayed in @chan/list. & CWHO() cwho() *************** *** 264,269 **** --- 283,290 ---- & CFLAGS() cflags() cflags(,) + clflags() + clflags(,) With one argument, cflags() returns a list of flags set on the given channel, represented as a string of characters. See *************** *** 277,282 **** --- 298,306 ---- You must be able to see that channel and to examine the object to use this function. If the object is not on the channel, an error is returned. + + The clflags versions return a space-separated list of flag names, + rather than a string of flag characters. & CHANNELS() channels([]) channels() *************** *** 308,312 **** & Channel functions Channel functions work with the channel system. ! cemit() cflags() channels() clock() cowner() ! ctitle() cwho() --- 332,337 ---- & Channel functions Channel functions work with the channel system. ! cbuffer() cdesc() cemit() cflags() channels() ! clflags() clock() cmsgs() cowner() cstatus() ! ctitle() cusers() cwho() *** 1_8_1.151/src/local.dst Thu, 02 Sep 2004 11:04:56 -0500 dunemush (pennmush/b/19_local.dst 1.22 660) --- 1_8_1.192(w)/src/local.dst Mon, 12 Dec 2005 12:26:10 -0600 dunemush (pennmush/b/19_local.dst 1.23 660) *************** *** 45,51 **** /* Initial size of this hashtable should be close to the number of * add_config()'s you plan to do. */ ! hashinit(&local_options, 4, sizeof(CONF)); #ifdef EXAMPLE /* Call add_config for each config parameter you want to add. --- 45,51 ---- /* Initial size of this hashtable should be close to the number of * add_config()'s you plan to do. */ ! hashinit(&local_options, 4, sizeof(PENNCONF)); #ifdef EXAMPLE /* Call add_config for each config parameter you want to add. *** 1_8_1.151/src/unparse.c Sat, 27 Aug 2005 11:39:55 -0500 dunemush (pennmush/b/28_unparse.c 1.16.1.7.1.15 660) --- 1_8_1.192(w)/src/unparse.c Mon, 12 Dec 2005 12:26:11 -0600 dunemush (pennmush/b/28_unparse.c 1.16.1.7.1.16 660) *************** *** 211,217 **** strcpy(arg, unparse_dbref(loc)); global_eval_context.wenv[0] = arg; strcpy(arg2, defname); ! global_eval_context.wenv[1] = defname; sp = save = safe_atr_value(a); bp = tbuf1; process_expression(tbuf1, &bp, &sp, loc, player, player, --- 211,217 ---- strcpy(arg, unparse_dbref(loc)); global_eval_context.wenv[0] = arg; strcpy(arg2, defname); ! global_eval_context.wenv[1] = arg2; sp = save = safe_atr_value(a); bp = tbuf1; process_expression(tbuf1, &bp, &sp, loc, player, player, *** 1_8_1.151/src/help.c Tue, 08 Jun 2004 12:15:45 -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.23 660) --- 1_8_1.192(w)/src/help.c Mon, 12 Dec 2005 12:26:10 -0600 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.24 660) *************** *** 31,37 **** static void do_new_spitfile(dbref player, char *arg1, help_file *help_dat); 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 char *list_matching_entries(const char *pattern, help_file *help_dat); static void help_build_index(help_file *h, int restricted); --- 31,39 ---- static void do_new_spitfile(dbref player, char *arg1, help_file *help_dat); 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 char *list_matching_entries(char *pattern, help_file *help_dat, ! const char *sep); ! static const char *normalize_entry(help_file *help_dat, char *arg1); static void help_build_index(help_file *h, int restricted); *************** *** 69,75 **** if (wildcard(arg_left)) notify_format(player, T("Here are the entries which match '%s':\n%s"), ! arg_left, list_matching_entries(arg_left, h)); else do_new_spitfile(player, arg_left, h); } --- 71,77 ---- if (wildcard(arg_left)) notify_format(player, T("Here are the entries which match '%s':\n%s"), ! arg_left, list_matching_entries(arg_left, h, ", ")); else do_new_spitfile(player, arg_left, h); } *************** *** 454,476 **** return; } ! if (wildcard(args[1])) ! safe_str(list_matching_entries(args[1], h), buff, bp); ! else safe_str(string_spitfile(h, args[1]), buff, bp); } static const char * ! string_spitfile(help_file *help_dat, char *arg1) { ! help_indx *entry = NULL; ! FILE *fp; ! char line[LINE_SIZE + 1]; ! char the_topic[LINE_SIZE + 2]; ! size_t n; ! static char buff[BUFFER_LEN]; ! char *bp; if (*arg1 == '\0') arg1 = (char *) "help"; --- 456,495 ---- return; } ! if (wildcard(args[1])) { ! const char *entries = list_matching_entries(args[1], h, ", "); ! if (*entries) ! safe_str(entries, buff, bp); ! else ! safe_str(T("No matching help topics."), buff, bp); ! } else safe_str(string_spitfile(h, args[1]), buff, bp); } + /* ARGSUSED */ + FUNCTION(fun_textentries) + { + help_file *h; + const char *sep = " "; + + h = hashfind(strupper(args[0]), &help_files); + if (!h) { + safe_str(T("#-1 NO SUCH FILE"), buff, bp); + return; + } + if (h->admin && !Hasprivs(executor)) { + safe_str(T(e_perm), buff, bp); + return; + } + if (nargs > 2) + sep = args[2]; + safe_str(list_matching_entries(args[1], h, sep), buff, bp); + } static const char * ! normalize_entry(help_file *help_dat, char *arg1) { ! static char the_topic[LINE_SIZE + 2]; if (*arg1 == '\0') arg1 = (char *) "help"; *************** *** 483,494 **** sprintf(the_topic, "&%s", arg1); else strcpy(the_topic, arg1); if (!help_dat->indx || help_dat->entries == 0) return T("#-1 NO INDEX FOR FILE"); entry = help_find_entry(help_dat, the_topic); - if (!entry) { return T("#-1 NO ENTRY"); } --- 502,527 ---- sprintf(the_topic, "&%s", arg1); else strcpy(the_topic, arg1); + return the_topic; + } + + static const char * + string_spitfile(help_file *help_dat, char *arg1) + { + help_indx *entry = NULL; + FILE *fp; + char line[LINE_SIZE + 1]; + char the_topic[LINE_SIZE + 2]; + size_t n; + static char buff[BUFFER_LEN]; + char *bp; + + strcpy(the_topic, normalize_entry(help_dat, arg1)); if (!help_dat->indx || help_dat->entries == 0) return T("#-1 NO INDEX FOR FILE"); entry = help_find_entry(help_dat, the_topic); if (!entry) { return T("#-1 NO ENTRY"); } *************** *** 514,543 **** /** Return a string with all help entries that match a pattern */ static char * ! list_matching_entries(const char *pattern, help_file *help_dat) { static char buff[BUFFER_LEN]; int offset; char *bp; size_t n; ! ! bp = buff; if (help_dat->admin) offset = 1; /* To skip the leading & */ else offset = 0; for (n = 0; n < help_dat->entries; n++) if (quick_wild(pattern, help_dat->indx[n].topic + offset)) { safe_str(help_dat->indx[n].topic + offset, buff, &bp); ! safe_strl(", ", 2, buff, &bp); } if (bp > buff) ! *(bp - 2) = '\0'; else { - safe_str(T("No matching help topics."), buff, &bp); *bp = '\0'; } --- 547,593 ---- /** Return a string with all help entries that match a pattern */ static char * ! list_matching_entries(char *pattern, help_file *help_dat, const char *sep) { static char buff[BUFFER_LEN]; int offset; char *bp; size_t n; ! int len = 0; if (help_dat->admin) offset = 1; /* To skip the leading & */ else offset = 0; + if (!wildcard(pattern)) { + /* Quick way out, use the other kind of matching */ + char the_topic[LINE_SIZE + 2]; + help_indx *entry = NULL; + strcpy(the_topic, normalize_entry(help_dat, pattern)); + if (!help_dat->indx || help_dat->entries == 0) + return T("#-1 NO INDEX FOR FILE"); + entry = help_find_entry(help_dat, the_topic); + if (!entry) + return (char *) ""; + return (char *) (entry->topic + offset); + } + + bp = buff; + + if (sep) + len = strlen(sep); + for (n = 0; n < help_dat->entries; n++) if (quick_wild(pattern, help_dat->indx[n].topic + offset)) { safe_str(help_dat->indx[n].topic + offset, buff, &bp); ! if (sep) ! safe_strl(sep, len, buff, &bp); } if (bp > buff) ! *(bp - len) = '\0'; else { *bp = '\0'; } *** 1_8_1.151/src/speech.c Wed, 14 Sep 2005 22:36:42 -0500 dunemush (pennmush/b/35_speech.c 1.21.1.2.1.3.1.5.1.1.1.7.1.3.1.1.1.8.1.1.1.1.1.1.1.10.1.2.1.13.2.4.1.1.3.1.1.5.1.1.1.6.1.1.1.7.1.1.3.1.1.4 660) --- 1_8_1.192(w)/src/speech.c Mon, 12 Dec 2005 12:26:11 -0600 dunemush (pennmush/b/35_speech.c 1.21.1.2.1.3.1.5.1.1.1.7.1.3.1.1.1.8.1.1.1.1.1.1.1.10.1.2.1.13.2.4.1.1.3.1.1.5.1.1.1.6.1.1.1.7.1.1.3.1.1.6 660) *************** *** 454,470 **** Name(player), player, message); *bp = '\0'; } ! notify(who, nspbuf); } else { if (!nsbuf) { bp = nsbuf = mush_malloc(BUFFER_LEN, "string"); safe_format(nsbuf, &bp, "[%s->] %s", Name(player), message); *bp = '\0'; } ! notify(who, nsbuf); } } else { ! notify_must_puppet(who, message); } } } --- 454,479 ---- Name(player), player, message); *bp = '\0'; } ! if (flags & PEMIT_PROMPT) ! notify_prompt(who, nspbuf); ! else ! notify(who, nspbuf); } else { if (!nsbuf) { bp = nsbuf = mush_malloc(BUFFER_LEN, "string"); safe_format(nsbuf, &bp, "[%s->] %s", Name(player), message); *bp = '\0'; } ! if (flags & PEMIT_PROMPT) ! notify_prompt(who, nsbuf); ! else ! notify(who, nsbuf); } } else { ! if (flags & PEMIT_PROMPT) ! notify_prompt_must_puppet(who, message); ! else ! notify_must_puppet(who, message); } } } *** 1_8_1.151/src/game.c Wed, 01 Jun 2005 16:30:19 -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.12.1.3.1.7.1.2.2.1.1.32.1.2.2.1.1.1.1.4 660) --- 1_8_1.192(w)/src/game.c Mon, 12 Dec 2005 12:26:10 -0600 dunemush (pennmush/c/10_game.c 1.50.1.8.1.1.1.1.2.1.1.1.2.1.1.4.1.1.1.1.1.1.1.1.1.1.2.1.1.2.1.1.1.1.1.1.1.2.1.1.1.2.1.1.1.1.1.1.1.1.1.5.1.3.1.2.1.2.1.1.1.1.1.1.1.1.1.12.1.3.1.7.1.2.2.1.1.32.1.2.2.1.1.1.1.6 660) *************** *** 769,775 **** do_restart(); #ifdef HAS_OPENSSL /* Set up ssl */ ! if (!ssl_init()) { fprintf(stderr, "SSL initialization failure\n"); options.ssl_port = 0; /* Disable ssl */ } --- 769,777 ---- do_restart(); #ifdef HAS_OPENSSL /* Set up ssl */ ! if (!ssl_init ! (options.ssl_private_key_file, options.ssl_ca_file, ! options.ssl_require_client_cert)) { fprintf(stderr, "SSL initialization failure\n"); options.ssl_port = 0; /* Disable ssl */ } *** 1_8_1.151/src/funstr.c Mon, 22 Aug 2005 20:01:10 -0500 dunemush (pennmush/c/13_funstr.c 1.28.1.1.1.2.1.4.1.6.1.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.2.1.3.1.5.1.3.1.2.1.1.1.1.1.1.1.1.1.14.1.30 660) --- 1_8_1.192(w)/src/funstr.c Mon, 12 Dec 2005 12:26:10 -0600 dunemush (pennmush/c/13_funstr.c 1.28.1.1.1.2.1.4.1.6.1.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.2.1.3.1.5.1.3.1.2.1.1.1.1.1.1.1.1.1.14.1.33 660) *************** *** 937,943 **** if (lsp >= BUFFER_LEN) lsp = rsp = BUFFER_LEN - 1; ! if (!args[2] || !*args[2]) { /* Fast case for default fill with spaces */ safe_fill(' ', lsp, buff, bp); safe_strl(args[0], arglens[0], buff, bp); --- 937,943 ---- if (lsp >= BUFFER_LEN) lsp = rsp = BUFFER_LEN - 1; ! if ((!args[2] || !*args[2]) && (!args[3] || !*args[3])) { /* Fast case for default fill with spaces */ safe_fill(' ', lsp, buff, bp); safe_strl(args[0], arglens[0], buff, bp); *************** *** 947,952 **** --- 947,956 ---- /* args[2] contains the possibly ansi, multi-char fill string */ filllen = ansi_strlen(args[2]); + if (!filllen) { + safe_str(T("#-1 FILL ARGUMENT MAY NOT BE ZERO-LENGTH"), buff, bp); + return; + } as = parse_ansi_string(args[2]); fillq = lsp / filllen; fillr = lsp % filllen; *************** *** 962,967 **** --- 966,975 ---- if (nargs > 3) { if (args[3] && *args[3]) { filllen = ansi_strlen(args[3]); + if (!filllen) { + safe_str(T("#-1 FILL ARGUMENT MAY NOT BE ZERO-LENGTH"), buff, bp); + return; + } as = parse_ansi_string(args[3]); fillq = rsp / filllen; fillr = rsp % filllen; *************** *** 979,990 **** return; } /* No args[3], so we flip args[2] */ as = parse_ansi_string(fillstr); flip_ansi_string(as); safe_ansi_string(as, 0, as->len, buff, bp); - /* Is there an extra char left over we need to pad with? */ - if (rsp > lsp) - safe_ansi_string(as, 0, 1, buff, bp); free_ansi_string(as); } --- 987,1005 ---- return; } /* No args[3], so we flip args[2] */ + filllen = ansi_strlen(args[2]); + as = parse_ansi_string(args[2]); + fillq = rsp / filllen; + fillr = rsp % filllen; + fp = fillstr; + for (i = 0; i < fillq; i++) + safe_ansi_string(as, 0, as->len, fillstr, &fp); + safe_ansi_string(as, 0, fillr, fillstr, &fp); + *fp = '\0'; + free_ansi_string(as); as = parse_ansi_string(fillstr); flip_ansi_string(as); safe_ansi_string(as, 0, as->len, buff, bp); free_ansi_string(as); } *** 1_8_1.151/src/funmisc.c Tue, 30 Aug 2005 20:21:03 -0500 dunemush (pennmush/c/14_funmisc.c 1.30.1.1.1.41.1.8 660) --- 1_8_1.192(w)/src/funmisc.c Mon, 12 Dec 2005 12:26:10 -0600 dunemush (pennmush/c/14_funmisc.c 1.30.1.1.1.41.1.10 660) *************** *** 149,154 **** --- 149,170 ---- do_zemit(executor, args[0], args[1], flags); } + /* ARGSUSED */ + FUNCTION(fun_prompt) + { + int ns = string_prefix(called_as, "NS"); + int flags = PEMIT_LIST | PEMIT_PROMPT; + if (!command_check_byname(executor, ns ? "@nspemit" : "@pemit") || + fun->flags & FN_NOSIDEFX) { + safe_str(T(e_perm), buff, bp); + return; + } + orator = executor; + if (ns) + flags |= PEMIT_SPOOF; + do_pemit_list(executor, args[0], args[1], flags); + } + extern signed char qreg_indexes[UCHAR_MAX + 1]; /* ARGSUSED */ *************** *** 433,438 **** --- 449,460 ---- } /* ARGSUSED */ + FUNCTION(fun_numversion) + { + safe_integer(NUMVERSION, buff, bp); + } + + /* ARGSUSED */ FUNCTION(fun_starttime) { safe_str(show_time(globals.first_start_time, 0), buff, bp); *** 1_8_1.151/src/funlist.c Wed, 14 Sep 2005 21:59:40 -0500 dunemush (pennmush/c/16_funlist.c 1.3.1.1.1.5.1.2.1.1.1.1.1.4.1.2.1.2.1.19.1.2.1.1.1.2.1.5.1.1.1.1.1.1.1.1.1.1.2.1.1.3.1.2.1.1.1.1.1.1.1.1.1.1.1.12.1.14.1.7.1.20.1.1.1.1.1.6 660) --- 1_8_1.192(w)/src/funlist.c Mon, 12 Dec 2005 12:26:10 -0600 dunemush (pennmush/c/16_funlist.c 1.3.1.1.1.5.1.2.1.1.1.1.1.4.1.2.1.2.1.19.1.2.1.1.1.2.1.5.1.1.1.1.1.1.1.1.1.1.2.1.1.3.1.2.1.1.1.1.1.1.1.1.1.1.1.12.1.14.1.7.1.20.1.1.1.1.1.7 660) *************** *** 1839,1844 **** --- 1839,1950 ---- } /* ARGSUSED */ + FUNCTION(fun_namegraball) + { + /* Given a list of dbrefs and a string, it matches the + * name of the dbrefs against the string. + * grabnameall(#1 #2 #3,god) -> #1 + */ + + char *r, *s, sep; + dbref victim; + dbref absolute; + int first = 1; + + if (!delim_check(buff, bp, nargs, args, 3, &sep)) + return; + + absolute = parse_dbref(args[1]); + if (!RealGoodObject(absolute)) + absolute = NOTHING; + + if (*args[1]) { + s = trim_space_sep(args[0], sep); + do { + r = split_token(&s, sep); + victim = parse_dbref(r); + if (!RealGoodObject(victim)) + continue; /* Don't bother with garbage */ + if (!(string_match(Name(victim), args[1]) || (absolute == victim))) + continue; + if (!can_interact(victim, executor, INTERACT_MATCH)) + continue; + /* It matches, and is interact-able */ + if (!first) + safe_chr(sep, buff, bp); + safe_str(r, buff, bp); + first = 0; + } while (s); + } else { + /* Pull out all good objects (those that _have_ names) */ + s = trim_space_sep(args[0], sep); + do { + r = split_token(&s, sep); + victim = parse_dbref(r); + if (!RealGoodObject(victim)) + continue; /* Don't bother with garbage */ + if (!can_interact(victim, executor, INTERACT_MATCH)) + continue; + /* It's real, and is interact-able */ + if (!first) + safe_chr(sep, buff, bp); + safe_str(r, buff, bp); + first = 0; + } while (s); + } + } + + /* ARGSUSED */ + FUNCTION(fun_namegrab) + { + /* Given a list of dbrefs and a string, it matches the + * name of the dbrefs against the string. + */ + + char *r, *s, sep; + dbref victim; + dbref absolute; + char *exact_res, *res; + + exact_res = res = NULL; + + if (!delim_check(buff, bp, nargs, args, 3, &sep)) + return; + + absolute = parse_dbref(args[1]); + if (!RealGoodObject(absolute)) + absolute = NOTHING; + + /* Walk the wordstring, until we find the word we want. */ + s = trim_space_sep(args[0], sep); + do { + r = split_token(&s, sep); + victim = parse_dbref(r); + if (!RealGoodObject(victim)) + continue; /* Don't bother with garbage */ + /* Dbref match has top priority */ + if ((absolute == victim) && can_interact(victim, executor, INTERACT_MATCH)) { + safe_str(r, buff, bp); + return; + } + /* Exact match has second priority */ + if (!exact_res && !strcasecmp(Name(victim), args[1]) && + can_interact(victim, executor, INTERACT_MATCH)) { + exact_res = r; + } + /* Non-exact match. */ + if (!res && string_match(Name(victim), args[1]) && + can_interact(victim, executor, INTERACT_MATCH)) { + res = r; + } + } while (s); + if (exact_res) + safe_str(exact_res, buff, bp); + else if (res) + safe_str(res, buff, bp); + } + + /* ARGSUSED */ FUNCTION(fun_match) { /* compares two strings with possible wildcards, returns the *** 1_8_1.151/src/function.c Sat, 27 Aug 2005 12:39:22 -0500 dunemush (pennmush/c/18_function.c 1.29.1.14.1.3.1.6.1.1.1.1.1.14.1.2.1.1.1.7.1.22.1.11.1.3.1.24.1.4.1.2.2.1.1.1.1.8 660) --- 1_8_1.192(w)/src/function.c Mon, 12 Dec 2005 12:26:10 -0600 dunemush (pennmush/c/18_function.c 1.29.1.14.1.3.1.6.1.1.1.1.1.14.1.2.1.1.1.7.1.22.1.11.1.3.1.24.1.4.1.2.2.1.1.1.1.14 660) *************** *** 302,313 **** --- 302,319 ---- {"CASE", fun_switch, 3, INT_MAX, FN_NOPARSE}, {"CASEALL", fun_switch, 3, INT_MAX, FN_NOPARSE}, {"CAT", fun_cat, 1, INT_MAX, FN_REG}, + {"CBUFFER", fun_cinfo, 1, 1, FN_REG}, + {"CDESC", fun_cinfo, 1, 1, FN_REG}, {"CEMIT", fun_cemit, 2, 3, FN_REG}, {"CFLAGS", fun_cflags, 1, 2, FN_REG}, {"CHANNELS", fun_channels, 0, 2, FN_REG}, + {"CLFLAGS", fun_cflags, 1, 2, FN_REG}, {"CLOCK", fun_clock, 1, 2, FN_REG}, + {"CMSGS", fun_cinfo, 1, 1, FN_REG}, {"COWNER", fun_cowner, 1, 1, FN_REG}, + {"CSTATUS", fun_cstatus, 2, 2, FN_REG}, {"CTITLE", fun_ctitle, 2, 2, FN_REG}, + {"CUSERS", fun_cinfo, 1, 1, FN_REG}, {"CWHO", fun_cwho, 1, 1, FN_REG}, {"CENTER", fun_center, 2, 4, FN_REG}, {"CHILDREN", fun_lsearch, 1, 1, FN_REG}, *************** *** 479,484 **** --- 485,492 ---- {"MUNGE", fun_munge, 3, 5, FN_REG}, {"MWHO", fun_lwho, 0, 0, FN_REG}, {"NAME", fun_name, 0, 2, FN_REG}, + {"NAMEGRAB", fun_namegrab, 2, 3, FN_REG}, + {"NAMEGRABALL", fun_namegraball, 2, 3, FN_REG}, {"NAND", fun_nand, 1, INT_MAX, FN_REG}, {"NATTR", fun_nattr, 1, 1, FN_REG}, {"NATTRP", fun_nattr, 1, 1, FN_REG}, *************** *** 496,505 **** --- 504,515 ---- {"NSLEMIT", fun_lemit, 1, -1, FN_REG}, {"NSOEMIT", fun_oemit, 2, -2, FN_REG}, {"NSPEMIT", fun_pemit, 2, -2, FN_REG}, + {"NSPROMPT", fun_prompt, 2, -2, FN_REG}, {"NSREMIT", fun_remit, 2, -2, FN_REG}, {"NSZEMIT", fun_zemit, 2, -2, FN_REG}, {"NTHINGS", fun_dbwalker, 1, 1, FN_REG}, {"NUM", fun_num, 1, 1, FN_REG}, + {"NUMVERSION", fun_numversion, 0, 0, FN_REG}, {"NULL", fun_null, 1, INT_MAX, FN_REG}, {"NVCON", fun_dbwalker, 1, 1, FN_REG}, {"NVEXITS", fun_dbwalker, 1, 1, FN_REG}, *************** *** 529,534 **** --- 539,545 ---- {"POS", fun_pos, 2, 2, FN_REG}, {"POSS", fun_poss, 1, 1, FN_REG}, {"POWERS", fun_powers, 1, 2, FN_REG}, + {"PROMPT", fun_prompt, 2, -2, FN_REG}, {"PUEBLO", fun_pueblo, 1, 1, FN_REG}, {"QUOTA", fun_quota, 1, 1, FN_REG}, {"R", fun_r, 1, 1, FN_REG}, *************** *** 613,618 **** --- 624,630 ---- {"TABLE", fun_table, 1, 5, FN_REG}, {"TEL", fun_tel, 2, 4, FN_REG}, {"TERMINFO", fun_terminfo, 1, 1, FN_REG}, + {"TEXTENTRIES", fun_textentries, 2, 3, FN_REG}, {"TEXTFILE", fun_textfile, 2, 2, FN_REG}, {"TIME", fun_time, 0, 1, FN_REG}, {"TIMEFMT", fun_timefmt, 1, 2, FN_REG}, *** 1_8_1.151/src/flags.c Sat, 27 Aug 2005 12:39:22 -0500 dunemush (pennmush/c/20_flags.c 1.1.1.1.1.1.1.1.1.1.1.1.1.6.1.2.1.1.1.1.1.2.2.2.2.1.2.1.1.3.1.2.1.1.1.1.1.1.1.1.1.3.1.9.1.2.2.1.1.2.1.56.1.12.1.1.1.29.1.2.1.2.2.3 660) --- 1_8_1.192(w)/src/flags.c Mon, 12 Dec 2005 12:26:10 -0600 dunemush (pennmush/c/20_flags.c 1.1.1.1.1.1.1.1.1.1.1.1.1.6.1.2.1.1.1.1.1.2.2.2.2.1.2.1.1.3.1.2.1.1.1.1.1.1.1.1.1.3.1.9.1.2.2.1.1.2.1.56.1.12.1.1.1.29.1.2.1.2.2.4 660) *************** *** 845,853 **** for (i = 0; i < n->flagbits; i++) n->flags[i]->perms |= F_LOG; } ! add_power("Sql_Ok", '\0', NOTYPE, F_WIZARD | F_LOG, F_ANY); add_power("Debit", '\0', NOTYPE, F_WIZARD | F_LOG, F_ANY); add_power("Pueblo_Send", '\0', NOTYPE, F_WIZARD | F_LOG, F_ANY); } local_flags(n); --- 845,867 ---- for (i = 0; i < n->flagbits; i++) n->flags[i]->perms |= F_LOG; } ! flags = hashfind("POWER", &htab_flagspaces); ! f = add_power("Sql_Ok", '\0', NOTYPE, F_WIZARD | F_LOG, F_ANY); ! if (!match_power("Use_SQL")) ! flag_add(flags, "Use_SQL", f); add_power("Debit", '\0', NOTYPE, F_WIZARD | F_LOG, F_ANY); add_power("Pueblo_Send", '\0', NOTYPE, F_WIZARD | F_LOG, F_ANY); + /* Aliases for other servers */ + if ((f = match_power("tport_anything")) && !match_power("tel_anything")) + flag_add(flags, "tel_anything", f); + if ((f = match_power("tport_anywhere")) && !match_power("tel_anywhere")) + flag_add(flags, "tel_anywhere", f); + if ((f = match_power("no_money")) && !match_power("free_money")) + flag_add(flags, "free_money", f); + if ((f = match_power("no_quota")) && !match_power("free_quota")) + flag_add(flags, "free_quota", f); + if ((f = match_power("debit")) && !match_power("steal_money")) + flag_add(flags, "steal_money", f); } local_flags(n); *** 1_8_1.151/src/extmail.c Fri, 25 Feb 2005 16:36:49 -0600 dunemush (pennmush/c/22_extmail.c 1.44.1.7.1.5.1.9.1.1.1.1.1.32 660) --- 1_8_1.192(w)/src/extmail.c Mon, 12 Dec 2005 12:26:10 -0600 dunemush (pennmush/c/22_extmail.c 1.44.1.7.1.5.1.9.1.1.1.1.1.33 660) *************** *** 111,116 **** --- 111,118 ---- char *aname, char *subject, char *message, mail_flag flags, int silent, int nosig); + static void filter_mail(dbref from, dbref player, char *subject, + char *message, int mailnumber, mail_flag flags); static MAIL *find_insertion_point(dbref player); static int get_folder_number(dbref player, char *name); static char *get_folder_name(dbref player, int fld); *************** *** 1156,1161 **** --- 1158,1166 ---- T("MAIL: You have a new message (%d) from %s."), rc + uc + cc + 1, Name(player)); + /* Check @mailfilter */ + filter_mail(player, target, subject, message, rc + uc + cc + 1, flags); + if (AMAIL_ATTR && (atr_get_noparent(target, "AMAIL")) && (player != target) && Hasprivs(target)) did_it(player, target, NULL, NULL, NULL, NULL, "AMAIL", NOTHING); *************** *** 2552,2557 **** --- 2557,2598 ---- return tbuf1; } + /** Scan all mail folders for unread mail. + * \param player player to check for new mail (and to notify). + */ + void + check_all_mail(dbref player) + { + int folder; /* which folder */ + int rc; /* read messages */ + int uc; /* unread messages */ + int cc; /* cleared messages */ + int subtotal; /* total messages per iteration */ + int total = 0; /* total messages */ + + /* search through all the folders. */ + + for (folder = 0; folder <= MAX_FOLDERS; folder++) { + count_mail(player, folder, &rc, &uc, &cc); + subtotal = rc + uc + cc; + if (subtotal > 0) { + notify_format(player, + T + ("MAIL: %d messages in folder %d [%s] (%d unread, %d cleared)."), + subtotal, folder, get_folder_name(player, folder), uc, cc); + total += subtotal; + if (folder == 0 && (subtotal + 5) > MAIL_LIMIT) + notify_format(player, + T("MAIL: Warning! Limit on inbox messages is %d!"), + MAIL_LIMIT); + } + } + + if (!total) + notify(player, T("\nMAIL: You have no mail.\n")); + return; + } + /** Check for new mail. * \param player player to check for new mail (and to notify). * \param folder folder number to check. *************** *** 2721,2723 **** --- 2762,2840 ---- } return 1; /* Success */ } + + + /** Event for @mailfilter. + * \param from the @mailing player. + * \param player the player to act on. + * \param subject the subject of the @mail. + * \param message the body of the @mail. + * \param mailnumber the number of the @mail to file. + * \param flags the flags of the @mail. + */ + void + filter_mail(dbref from, dbref player, char *subject, + char *message, int mailnumber, mail_flag flags) + { + ATTR *f; + char buff[BUFFER_LEN], *bp, *asave; + char buf[FOLDER_NAME_LEN + 1]; + char *wsave[10], *rsave[NUMQ]; + char *arg, *arg2, *arg3, *arg4; + int j; + char const *ap; + static char tbuf1[6]; + + /* Does the player have a @mailfilter? */ + f = atr_get(player, "MAILFILTER"); + if (!f) + return; + + /* Handle this now so it doesn't clutter code */ + tbuf1[0] = '\0'; + if (flags & M_URGENT) + strcat(tbuf1, "U"); + if (flags & M_FORWARD) + strcat(tbuf1, "F"); + if (flags & M_REPLY) + strcat(tbuf1, "R"); + + arg = (char *) mush_malloc(BUFFER_LEN, "string"); + arg2 = (char *) mush_malloc(BUFFER_LEN, "string"); + arg3 = (char *) mush_malloc(BUFFER_LEN, "string"); + arg4 = (char *) mush_malloc(BUFFER_LEN, "string"); + if (!arg4) + mush_panic("Unable to allocate memory in mailfilter"); + save_global_regs("filter_mail", rsave); + save_global_env("filter_mail", wsave); + for (j = 0; j < 10; j++) + global_eval_context.wenv[j] = NULL; + for (j = 0; j < NUMQ; j++) + global_eval_context.renv[j][0] = '\0'; + strcpy(arg, unparse_dbref(from)); + global_eval_context.wenv[0] = arg; + strcpy(arg2, subject); + global_eval_context.wenv[1] = arg2; + strcpy(arg3, message); + global_eval_context.wenv[2] = arg3; + strcpy(arg4, tbuf1); + global_eval_context.wenv[3] = arg4; + + ap = asave = safe_atr_value(f); + bp = buff; + process_expression(buff, &bp, &ap, player, player, player, + PE_DEFAULT, PT_DEFAULT, NULL); + *bp = '\0'; + free((Malloc_t) asave); + if (*buff) { + sprintf(buf, "0:%d", mailnumber); + do_mail_file(player, buf, buff); + } + + mush_free((Malloc_t) arg, "string"); + mush_free((Malloc_t) arg2, "string"); + mush_free((Malloc_t) arg3, "string"); + mush_free((Malloc_t) arg4, "string"); + restore_global_env("filter_mail", wsave); + restore_global_regs("filter_mail", rsave); + } *** 1_8_1.151/src/extchat.c Tue, 18 Jan 2005 13:10:33 -0600 dunemush (pennmush/c/23_extchat.c 1.1.1.1.1.1.1.1.1.2.1.1.1.3.1.1.1.5.1.1.1.1.1.5.1.2.1.3.1.3.1.1.1.4.1.2.1.6.1.2.1.1.2.4.2.9.1.2.1.2.1.3.1.2.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.2.1.1.2.1.1.2.1.1.1.1.1.1.1.1.1.16.1.27.1.4.1.5 660) --- 1_8_1.192(w)/src/extchat.c Mon, 12 Dec 2005 12:26:10 -0600 dunemush (pennmush/c/23_extchat.c 1.1.1.1.1.1.1.1.1.2.1.1.1.3.1.1.1.5.1.1.1.1.1.5.1.2.1.3.1.3.1.1.1.4.1.2.1.6.1.2.1.1.2.4.2.9.1.2.1.2.1.3.1.2.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.2.1.1.2.1.1.2.1.1.1.1.1.1.1.1.1.16.1.27.1.4.1.8 660) *************** *** 66,73 **** dbref player); static enum cmatch_type find_channel_partial_off(const char *name, CHAN **chan, dbref player); ! static char *list_cflags(CHAN *c); ! static char *list_cuflags(CHANUSER *u); static void channel_join_self(dbref player, const char *name); static void channel_leave_self(dbref player, const char *name); static void do_channel_who(dbref player, CHAN *chan); --- 66,72 ---- dbref player); static enum cmatch_type find_channel_partial_off(const char *name, CHAN **chan, dbref player); ! static char *list_cuflags(CHANUSER *u, int verbose); static void channel_join_self(dbref player, const char *name); static void channel_leave_self(dbref player, const char *name); static void do_channel_who(dbref player, CHAN *chan); *************** *** 116,121 **** --- 115,127 ---- {NULL, '\0', 0, 0} }; + static PRIV chanuser_priv[] = { + {"Quiet", 'Q', CU_QUIET, CU_QUIET}, + {"Hide", 'H', CU_HIDE, CU_HIDE}, + {"Gag", 'G', CU_GAG, CU_GAG}, + {NULL, '\0', 0, 0} + }; + /** Get a player's CHANUSER entry if they're on a channel. * This function checks to see if a given player is on a given channel. *************** *** 2026,2033 **** CHANUSER *u; char numusers[BUFFER_LEN]; char cleanname[CHAN_NAME_LEN]; ! const char thirtyblanks[31] = " "; ! char blanks[31]; int numblanks; if (SUPPORT_PUEBLO) --- 2032,2039 ---- CHANUSER *u; char numusers[BUFFER_LEN]; char cleanname[CHAN_NAME_LEN]; ! char blanks[CHAN_NAME_LEN]; ! int len; int numblanks; if (SUPPORT_PUEBLO) *************** *** 2045,2053 **** TAG_START, TAG_END); else sprintf(numusers, "%5ld", ChanNumUsers(c)); ! numblanks = strlen(ChanName(c)) - strlen(cleanname); ! if (numblanks > 0 && numblanks < 31) { ! strcpy(blanks, thirtyblanks); blanks[numblanks] = '\0'; } else { blanks[0] = '\0'; --- 2051,2071 ---- TAG_START, TAG_END); else sprintf(numusers, "%5ld", ChanNumUsers(c)); ! /* Display length is strlen(cleanname), but actual length is ! * strlen(ChanName(c)). There are two different cases: ! * 1. actual length <= 30. No problems. ! * 2. actual length > 30, we must reduce the number of ! * blanks we add by the (actual length-30) because our ! * %-30s is going to overflow as well. ! */ ! len = strlen(ChanName(c)); ! numblanks = len - strlen(cleanname); ! if (numblanks > 0 && numblanks < CHAN_NAME_LEN) { ! memset(blanks, ' ', CHAN_NAME_LEN - 1); ! if (len > 30) ! numblanks -= (len - 30); ! if (numblanks < 0) ! numblanks = 0; blanks[numblanks] = '\0'; } else { blanks[0] = '\0'; *************** *** 2081,2133 **** } static char * ! list_cflags(CHAN *c) ! { ! static char tbuf1[BUFFER_LEN]; ! char *bp; ! ! bp = tbuf1; ! if (Channel_Disabled(c)) ! safe_chr('D', tbuf1, &bp); ! if (Channel_Player(c)) ! safe_chr('P', tbuf1, &bp); ! if (Channel_Object(c)) ! safe_chr('O', tbuf1, &bp); ! if (Channel_Admin(c)) ! safe_chr('A', tbuf1, &bp); ! if (Channel_Wizard(c)) ! safe_chr('W', tbuf1, &bp); ! if (Channel_Quiet(c)) ! safe_chr('Q', tbuf1, &bp); ! if (Channel_CanHide(c)) ! safe_chr('H', tbuf1, &bp); ! if (Channel_Open(c)) ! safe_chr('o', tbuf1, &bp); ! if (Channel_NoTitles(c)) ! safe_chr('T', tbuf1, &bp); ! if (Channel_NoNames(c)) ! safe_chr('N', tbuf1, &bp); ! if (Channel_NoCemit(c)) ! safe_chr('C', tbuf1, &bp); ! if (Channel_Interact(c)) ! safe_chr('I', tbuf1, &bp); ! *bp = '\0'; ! return tbuf1; ! } ! ! static char * ! list_cuflags(CHANUSER *u) { static char tbuf1[BUFFER_LEN]; char *bp; bp = tbuf1; ! if (Chanuser_Gag(u)) ! safe_chr('G', tbuf1, &bp); ! if (Chanuser_Quiet(u)) ! safe_chr('Q', tbuf1, &bp); ! if (Chanuser_Hide(u)) ! safe_chr('H', tbuf1, &bp); *bp = '\0'; return tbuf1; } --- 2099,2122 ---- } static char * ! list_cuflags(CHANUSER *u, int verbose) { static char tbuf1[BUFFER_LEN]; char *bp; + /* We have to handle hide separately, since it can be the player */ bp = tbuf1; ! if (verbose) { ! if (Chanuser_Hide(u)) ! safe_str("Hide ", tbuf1, &bp); ! safe_str(privs_to_string(chanuser_priv, CUtype(u) & ~CU_HIDE), tbuf1, &bp); ! if (bp > tbuf1 && *bp == ' ') ! bp--; ! } else { ! if (Chanuser_Hide(u)) ! safe_chr('H', tbuf1, &bp); ! safe_str(privs_to_letters(chanuser_priv, CUtype(u) & ~CU_HIDE), tbuf1, &bp); ! } *bp = '\0'; return tbuf1; } *************** *** 2163,2169 **** return; } if (nargs == 1) { ! safe_str(list_cflags(c), buff, bp); return; } thing = match_thing(executor, args[1]); --- 2152,2161 ---- return; } if (nargs == 1) { ! if (string_prefix(called_as, "CL")) ! safe_str(privs_to_string(priv_table, ChanType(c)), buff, bp); ! else ! safe_str(privs_to_letters(priv_table, ChanType(c)), buff, bp); return; } thing = match_thing(executor, args[1]); *************** *** 2180,2190 **** safe_str(T("#-1 NOT ON CHANNEL"), buff, bp); return; } ! safe_str(list_cuflags(u), buff, bp); break; } } /* ARGSUSED */ FUNCTION(fun_ctitle) --- 2172,2214 ---- safe_str(T("#-1 NOT ON CHANNEL"), buff, bp); return; } ! safe_str(list_cuflags(u, string_prefix(called_as, "CL") ? 1 : 0), buff, bp); break; } } + /* ARGSUSED */ + FUNCTION(fun_cinfo) + { + /* Can be called as CDESC, CBUFFER, CUSERS, CMSGS */ + CHAN *c; + if (!args[0] || !*args[0]) { + safe_str(T("#-1 NO CHANNEL GIVEN"), buff, bp); + return; + } + switch (find_channel(args[0], &c, executor)) { + case CMATCH_NONE: + safe_str(T("#-1 NO SUCH CHANNEL"), buff, bp); + return; + case CMATCH_AMBIG: + safe_str(T("#-1 AMBIGUOUS CHANNEL NAME"), buff, bp); + return; + default: + if (!Chan_Can_See(c, executor)) { + safe_str(T("#-1 NO SUCH CHANNEL"), buff, bp); + return; + } + if (string_prefix(called_as, "CD")) + safe_str(ChanTitle(c), buff, bp); + else if (string_prefix(called_as, "CB")) + safe_integer(BufferQSize(ChanBufferQ(c)), buff, bp); + else if (string_prefix(called_as, "CU")) + safe_integer(ChanNumUsers(c), buff, bp); + else if (string_prefix(called_as, "CM")) + safe_integer(ChanNumMsgs(c), buff, bp); + } + } + /* ARGSUSED */ FUNCTION(fun_ctitle) *************** *** 2244,2249 **** --- 2268,2324 ---- } } + /* ARGSUSED */ + FUNCTION(fun_cstatus) + { + /* cstatus(,) returns the object's status on that chan. + * You must pass the channel's see-lock, and + * either you must either be able to examine , or + * you must be Priv_Who or must not be hidden + */ + CHAN *c; + CHANUSER *u; + dbref thing; + + if (!args[0] || !*args[0]) { + safe_str(T("#-1 NO CHANNEL GIVEN"), buff, bp); + return; + } + switch (find_channel(args[0], &c, executor)) { + case CMATCH_NONE: + safe_str(T("#-1 NO SUCH CHANNEL"), buff, bp); + return; + case CMATCH_AMBIG: + safe_str(T("#-1 AMBIGUOUS CHANNEL NAME"), buff, bp); + return; + default: + thing = match_thing(executor, args[1]); + if (thing == NOTHING) { + safe_str(T(e_match), buff, bp); + return; + } + if (!Chan_Can_See(c, executor)) { + safe_str(T("#-1 NO SUCH CHANNEL"), buff, bp); + return; + } + u = onchannel(thing, c); + if (!u ||(!IsThing(thing) && !Connected(thing))) { + /* Easy, they're not on it or a disconnected player */ + safe_str("Off", buff, bp); + return; + } + /* They're on the channel, but maybe we can't see them? */ + if (Chanuser_Hide(u) && + !(Priv_Who(executor) || Can_Examine(executor, thing))) { + safe_str("Off", buff, bp); + return; + } + /* We can see them, so we report if they're On or Gag */ + safe_str(Chanuser_Gag(u) ? "Gag" : "On", buff, bp); + return; + } + } + FUNCTION(fun_cowner) { /* Return the dbref of the owner of a channel. */ *** 1_8_1.151/src/conf.c Sat, 20 Aug 2005 19:52:08 -0500 dunemush (pennmush/c/31_conf.c 1.41.2.3.1.3.1.2.1.15.1.1.1.1.1.1.1.41.1.1.1.1.1.2 660) --- 1_8_1.192(w)/src/conf.c Mon, 12 Dec 2005 12:26:10 -0600 dunemush (pennmush/c/31_conf.c 1.41.2.3.1.3.1.2.1.15.1.1.1.1.1.1.1.41.1.1.1.1.1.3 660) *************** *** 39,46 **** time_t mudtime; /**< game time, in seconds */ static void show_compile_options(dbref player); ! static char *config_list_helper(dbref player, CONF *cp, int lc); ! static char *config_list_helper2(dbref player, CONF *cp, int lc); OPTTAB options; /**< The table of configuration options */ HASHTAB local_options; /**< Hash table for local config options */ --- 39,46 ---- time_t mudtime; /**< game time, in seconds */ static void show_compile_options(dbref player); ! static char *config_list_helper(dbref player, PENNCONF * cp, int lc); ! static char *config_list_helper2(dbref player, PENNCONF * cp, int lc); OPTTAB options; /**< The table of configuration options */ HASHTAB local_options; /**< Hash table for local config options */ *************** *** 49,55 **** void conf_default_set(void); /** Table of all runtime configuration options. */ ! CONF conftable[] = { {"input_database", cf_str, options.input_db, sizeof options.input_db, 0, "files"} , --- 49,55 ---- void conf_default_set(void); /** Table of all runtime configuration options. */ ! PENNCONF conftable[] = { {"input_database", cf_str, options.input_db, sizeof options.input_db, 0, "files"} , *************** *** 510,519 **** const char *name; /**< name of group */ const char *desc; /**< description of group */ int viewperms; /**< who can view this group */ ! } CONFGROUP; /** The table of all configuration groups. */ ! CONFGROUP confgroups[] = { {"attribs", "Options affecting attributes", 0}, {"chat", "Chat system options", 0}, {"cmds", "Options affecting command behavior", 0}, --- 510,519 ---- const char *name; /**< name of group */ const char *desc; /**< description of group */ int viewperms; /**< who can view this group */ ! } PENNCONFGROUP; /** The table of all configuration groups. */ ! PENNCONFGROUP confgroups[] = { {"attribs", "Options affecting attributes", 0}, {"chat", "Chat system options", 0}, {"cmds", "Options affecting command behavior", 0}, *************** *** 533,545 **** {NULL, NULL, 0} }; ! /** Returns a pointer to a newly allocated CONF object. ! * \return pointer to newly allocated CONF object. */ ! CONF * new_config(void) { ! return ((CONF *) mush_malloc(sizeof(CONF), "config")); } /** Add a new local runtime configuration parameter to local_options. --- 533,545 ---- {NULL, NULL, 0} }; ! /** Returns a pointer to a newly allocated PENNCONF object. ! * \return pointer to newly allocated PENNCONF object. */ ! PENNCONF * new_config(void) { ! return ((PENNCONF *) mush_malloc(sizeof(PENNCONF), "config")); } /** Add a new local runtime configuration parameter to local_options. *************** *** 552,562 **** * \param group name of the option group the option should display with. * \return pointer to configuration structure or NULL for failure. */ ! CONF * add_config(const char *name, config_func handler, void *loc, int max, const char *group) { ! CONF *cnf; if ((cnf = get_config(name))) return cnf; if ((cnf = new_config()) == NULL) --- 552,562 ---- * \param group name of the option group the option should display with. * \return pointer to configuration structure or NULL for failure. */ ! PENNCONF * add_config(const char *name, config_func handler, void *loc, int max, const char *group) { ! PENNCONF *cnf; if ((cnf = get_config(name))) return cnf; if ((cnf = new_config()) == NULL) *************** *** 572,587 **** } /** Return a local runtime configuration parameter by name. ! * This function returns a point to a configuration structure (CONF *) * if one exists in the local runtime options that matches the given * name. Only local_options is searched. * \param name name of the configuration option. * \return pointer to configuration structure or NULL for failure. */ ! CONF * get_config(const char *name) { ! return ((CONF *) hashfind(name, &local_options)); } /** Parse a boolean configuration option. --- 572,587 ---- } /** Return a local runtime configuration parameter by name. ! * This function returns a point to a configuration structure (PENNCONF *) * if one exists in the local runtime options that matches the given * name. Only local_options is searched. * \param name name of the configuration option. * \return pointer to configuration structure or NULL for failure. */ ! PENNCONF * get_config(const char *name) { ! return ((PENNCONF *) hashfind(name, &local_options)); } /** Parse a boolean configuration option. *************** *** 826,832 **** int config_set(const char *opt, char *val, int source, int restrictions) { ! CONF *cp; char *p; if (!val) --- 826,832 ---- int config_set(const char *opt, char *val, int source, int restrictions) { ! PENNCONF *cp; char *p; if (!val) *************** *** 990,997 **** return i; } } ! for (cp = (CONF *) hash_firstentry(&local_options); cp; ! cp = (CONF *) hash_nextentry(&local_options)) { int i = 0; if ((!source || (cp->group && strcmp(cp->group, "files") != 0 && strcmp(cp->group, "messages") != 0)) --- 990,997 ---- return i; } } ! for (cp = (PENNCONF *) hash_firstentry(&local_options); cp; ! cp = (PENNCONF *) hash_nextentry(&local_options)) { int i = 0; if ((!source || (cp->group && strcmp(cp->group, "files") != 0 && strcmp(cp->group, "messages") != 0)) *************** *** 1214,1220 **** */ FILE *fp = NULL; ! CONF *cp; char tbuf1[BUFFER_LEN]; char *p, *q, *s; --- 1214,1220 ---- */ FILE *fp = NULL; ! PENNCONF *cp; char tbuf1[BUFFER_LEN]; char *p, *q, *s; *************** *** 1310,1317 **** cp->name); } } ! for (cp = (CONF *) hash_firstentry(&local_options); cp; ! cp = (CONF *) hash_nextentry(&local_options)) { if (!cp->overridden) { do_rawlog(LT_ERR, T --- 1310,1317 ---- cp->name); } } ! for (cp = (PENNCONF *) hash_firstentry(&local_options); cp; ! cp = (PENNCONF *) hash_nextentry(&local_options)) { if (!cp->overridden) { do_rawlog(LT_ERR, T *************** *** 1363,1370 **** void do_config_list(dbref player, const char *type, int lc) { ! CONFGROUP *cgp; ! CONF *cp; if (SUPPORT_PUEBLO) notify_noenter(player, tprintf("%cSAMP%c", TAG_START, TAG_END)); --- 1363,1370 ---- void do_config_list(dbref player, const char *type, int lc) { ! PENNCONFGROUP *cgp; ! PENNCONF *cp; if (SUPPORT_PUEBLO) notify_noenter(player, tprintf("%cSAMP%c", TAG_START, TAG_END)); *************** *** 1388,1395 **** } if (!found) { /* Ok, maybe a local option? */ ! for (cp = (CONF *) hash_firstentry(&local_options); cp; ! cp = (CONF *) hash_nextentry(&local_options)) { if (cp->group && !strcasecmp(cp->name, type)) { notify(player, config_list_helper(player, cp, lc)); found = 1; --- 1388,1395 ---- } if (!found) { /* Ok, maybe a local option? */ ! for (cp = (PENNCONF *) hash_firstentry(&local_options); cp; ! cp = (PENNCONF *) hash_nextentry(&local_options)) { if (cp->group && !strcasecmp(cp->name, type)) { notify(player, config_list_helper(player, cp, lc)); found = 1; *************** *** 1415,1422 **** notify(player, config_list_helper(player, cp, lc)); } } ! for (cp = (CONF *) hash_firstentry(&local_options); cp; ! cp = (CONF *) hash_nextentry(&local_options)) { if (cp->group && !strcasecmp(cp->group, cgp->name)) { notify(player, config_list_helper(player, cp, lc)); } --- 1415,1422 ---- notify(player, config_list_helper(player, cp, lc)); } } ! for (cp = (PENNCONF *) hash_firstentry(&local_options); cp; ! cp = (PENNCONF *) hash_nextentry(&local_options)) { if (cp->group && !strcasecmp(cp->group, cgp->name)) { notify(player, config_list_helper(player, cp, lc)); } *************** *** 1439,1445 **** /** Lowercase a string if we've been asked to */ #define MAYBE_LC(x) (lc ? strlower(x) : x) static char * ! config_list_helper(dbref player __attribute__ ((__unused__)), CONF *cp, int lc) { static char result[BUFFER_LEN]; char *bp = result; --- 1439,1446 ---- /** Lowercase a string if we've been asked to */ #define MAYBE_LC(x) (lc ? strlower(x) : x) static char * ! config_list_helper(dbref player ! __attribute__ ((__unused__)), PENNCONF * cp, int lc) { static char result[BUFFER_LEN]; char *bp = result; *************** *** 1479,1485 **** /* This one doesn't return the names */ static char * ! config_list_helper2(dbref player __attribute__ ((__unused__)), CONF *cp, int lc __attribute__ ((__unused__))) { static char result[BUFFER_LEN]; --- 1480,1487 ---- /* This one doesn't return the names */ static char * ! config_list_helper2(dbref player ! __attribute__ ((__unused__)), PENNCONF * cp, int lc __attribute__ ((__unused__))) { static char result[BUFFER_LEN]; *************** *** 1519,1525 **** */ FUNCTION(fun_config) { ! CONF *cp; if (args[0] && *args[0]) { for (cp = conftable; cp->name; cp++) { --- 1521,1527 ---- */ FUNCTION(fun_config) { ! PENNCONF *cp; if (args[0] && *args[0]) { for (cp = conftable; cp->name; cp++) { *************** *** 1528,1535 **** return; } } ! for (cp = (CONF *) hash_firstentry(&local_options); cp; ! cp = (CONF *) hash_nextentry(&local_options)) { if (cp->group && !strcasecmp(cp->name, args[0])) { safe_str(config_list_helper2(executor, cp, 0), buff, bp); return; --- 1530,1537 ---- return; } } ! for (cp = (PENNCONF *) hash_firstentry(&local_options); cp; ! cp = (PENNCONF *) hash_nextentry(&local_options)) { if (cp->group && !strcasecmp(cp->name, args[0])) { safe_str(config_list_helper2(executor, cp, 0), buff, bp); return; *************** *** 1542,1549 **** safe_str(cp->name, buff, bp); safe_chr(' ', buff, bp); } ! for (cp = (CONF *) hash_firstentry(&local_options); cp; ! cp = (CONF *) hash_nextentry(&local_options)) { safe_str(cp->name, buff, bp); safe_chr(' ', buff, bp); } --- 1544,1551 ---- safe_str(cp->name, buff, bp); safe_chr(' ', buff, bp); } ! for (cp = (PENNCONF *) hash_firstentry(&local_options); cp; ! cp = (PENNCONF *) hash_nextentry(&local_options)) { safe_str(cp->name, buff, bp); safe_chr(' ', buff, bp); } *************** *** 1558,1564 **** void do_enable(dbref player, const char *param, int state) { ! CONF *cp; for (cp = conftable; cp->name; cp++) { if (cp->group && !strcasecmp(cp->name, param)) { --- 1560,1566 ---- void do_enable(dbref player, const char *param, int state) { ! PENNCONF *cp; for (cp = conftable; cp->name; cp++) { if (cp->group && !strcasecmp(cp->name, param)) { *** 1_8_1.151/src/command.c Sun, 11 Sep 2005 10:23:54 -0500 dunemush (pennmush/c/36_command.c 1.56.1.1.1.1.1.1.1.2.1.1.1.1.1.5.1.2.1.1.1.1.1.2.1.3.1.10.1.1.3.74.1.6.1.3.1.1.1.1.1.1.1.2 660) --- 1_8_1.192(w)/src/command.c Mon, 12 Dec 2005 12:26:10 -0600 dunemush (pennmush/c/36_command.c 1.56.1.1.1.1.1.1.1.2.1.1.1.1.1.5.1.2.1.1.1.1.1.2.1.3.1.10.1.1.3.74.1.6.1.3.1.1.1.1.1.1.1.4 660) *************** *** 199,204 **** --- 199,206 ---- CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, "WIZARD", "CAN_NSPEMIT"}, {"@NSPEMIT", "LIST SILENT NOISY NOEVAL", cmd_pemit, CMD_T_ANY | CMD_T_EQSPLIT, "WIZARD", "CAN_NSPEMIT"}, + {"@NSPROMPT", "SILENT NOISY NOEVAL", cmd_prompt, + CMD_T_ANY | CMD_T_EQSPLIT, "WIZARD", "CAN_NSPEMIT"}, {"@NSREMIT", "LIST NOEVAL NOISY SILENT SPOOF", cmd_remit, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, "WIZARD", "CAN_NSPEMIT"}, {"@NSZEMIT", NULL, cmd_zemit, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, *************** *** 220,225 **** --- 222,229 ---- {"@POOR", NULL, cmd_poor, CMD_T_ANY, 0, 0}, {"@POWER", "ADD TYPE LETTER LIST RESTRICT DELETE ALIAS DISABLE ENABLE", cmd_power, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_RS_ARGS, "WIZARD", 0}, + {"@PROMPT", "SILENT NOISY NOEVAL SPOOF", cmd_prompt, + CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, 0, 0}, {"@PS", "ALL SUMMARY COUNT QUICK", cmd_ps, CMD_T_ANY, 0, 0}, {"@PURGE", NULL, cmd_purge, CMD_T_ANY, 0, 0}, {"@QUOTA", "ALL SET", cmd_quota, CMD_T_ANY | CMD_T_EQSPLIT, 0, 0}, *************** *** 857,862 **** --- 861,867 ---- char b; int switchnum; switch_mask sw; + char switch_err[BUFFER_LEN], *se; int noeval; int noevtoken = 0; char *retval; *************** *** 1047,1052 **** --- 1052,1058 ---- SW_ZERO(sw); swp = switches; *swp = '\0'; + se = switch_err; t = NULL; *************** *** 1065,1080 **** strcat(swp, " "); strcat(swp, swtch); } else { ! notify_format(player, T("%s doesn't know switch %s."), cmd->name, swtch); - command_parse_free_args; - return NULL; } } else { SW_SET(sw, switchnum); } } } if (!t) SW_SET(sw, SWITCH_NONE); if (noevtoken) --- 1071,1087 ---- strcat(swp, " "); strcat(swp, swtch); } else { ! if (se == switch_err) ! safe_format(switch_err, &se, T("%s doesn't know switch %s."), cmd->name, swtch); } } else { SW_SET(sw, switchnum); } } } + + *se = '\0'; if (!t) SW_SET(sw, SWITCH_NONE); if (noevtoken) *************** *** 1171,1176 **** --- 1178,1184 ---- retval = NULL; if (cmd->func == NULL) { do_rawlog(LT_ERR, T("No command vector on command %s."), cmd->name); + command_parse_free_args; return NULL; } else { char *saveregs[NUMQ]; *************** *** 1182,1187 **** --- 1190,1202 ---- !one_comm_match(cmd->hooks.override.obj, player, cmd->hooks.override.attrname, commandraw)) { /* Otherwise, we do hook/before, the command, and hook/after */ + /* But first, let's see if we had an invalid switch */ + if (*switch_err) { + notify(player, switch_err); + free_global_regs("hook.regs", saveregs); + command_parse_free_args; + return NULL; + } 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); *** 1_8_1.151/src/cmds.c Wed, 14 Sep 2005 22:36:42 -0500 dunemush (pennmush/c/37_cmds.c 1.33.1.1.1.2.1.2.2.3.1.1.1.2.1.1.1.3.1.8.1.1.2.2.2.20.1.3.1.7.1.2.1.20.1.2.1.1.1.5 660) --- 1_8_1.192(w)/src/cmds.c Mon, 12 Dec 2005 12:26:10 -0600 dunemush (pennmush/c/37_cmds.c 1.33.1.1.1.2.1.2.2.3.1.1.1.2.1.1.1.3.1.8.1.1.2.2.2.20.1.3.1.7.1.2.1.20.1.2.1.1.1.6 660) *************** *** 686,691 **** --- 686,705 ---- do_pemit(player, arg_left, arg_right, flags); } + COMMAND (cmd_prompt) { + int flags; + SPOOF(player, cause, sw); + if (SW_ISSET(sw, SWITCH_SILENT)) + flags = PEMIT_SILENT; + else if (SW_ISSET(sw, SWITCH_NOISY)) + flags = 0; + else + flags = SILENT_PEMIT ? PEMIT_SILENT : 0; + if (!strcmp(cmd->name, "@NSPEMIT")) + flags |= PEMIT_SPOOF; + do_pemit_list(player, arg_left, arg_right, flags | PEMIT_PROMPT); + } + COMMAND (cmd_poll) { do_poll(player, arg_left); } *** 1_8_1.151/src/bsd.c Sat, 01 Jan 2005 15:46:51 -0600 dunemush (pennmush/c/38_bsd.c 1.58.1.11.1.2.1.5.1.7.1.14.1.13.1.9.1.4.1.2.1.12.1.1.1.1.1.2.1.1.1.13.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.8.2.1.1.1.1.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.9.1.1.1.48.1.1.1.15.1.1 660) --- 1_8_1.192(w)/src/bsd.c Mon, 12 Dec 2005 12:26:10 -0600 dunemush (pennmush/c/38_bsd.c 1.58.1.11.1.2.1.5.1.7.1.14.1.13.1.9.1.4.1.2.1.12.1.1.1.1.1.2.1.1.1.13.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.8.2.1.1.1.1.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.9.1.1.1.48.1.1.1.15.1.9 660) *************** *** 69,77 **** #ifdef I_UNISTD #include #endif - #ifdef HAS_GETRLIMIT - #include - #endif #include #ifdef I_FLOATINGPOINT #include --- 69,74 ---- *************** *** 132,137 **** --- 129,137 ---- #define WAIT_TYPE int #endif #endif + #ifdef HAS_GETRLIMIT + void init_rlimit(void); + #endif /* BSD 4.2 and maybe some others need these defined */ *************** *** 173,192 **** char confname[BUFFER_LEN]; /**< Name of the config file */ char errlog[BUFFER_LEN]; /**< Name of the error log file */ - /** Default connection, nothing special */ - #define CONN_DEFAULT 0 - /** Using Pueblo, Smial, Mushclient, Simplemu, or some other - * pueblo-style HTML aware client */ - #define CONN_HTML 0x1 - /** Using a client that understands telnet options */ - #define CONN_TELNET 0x2 - /** Send a telnet option to test client */ - #define CONN_TELNET_QUERY 0x4 - /** Connection that should be close on load from reboot.db */ - #define CONN_CLOSE_READY 0x8 - /** Validated connection from an SSL concentrator */ - #define CONN_SSL_CONCENTRATOR 0x10 - /** Is this descriptor connected to a telnet-compatible terminal? */ #define TELNET_ABLE(d) ((d)->conn_flags & (CONN_TELNET | CONN_TELNET_QUERY)) --- 173,178 ---- *************** *** 323,331 **** sig_atomic_t signal_shutdown_flag = 0; /**< Have we caught a shutdown signal? */ sig_atomic_t signal_dump_flag = 0; /**< Have we caught a dump signal? */ - #ifdef HAS_GETRLIMIT - static void init_rlimit(void); - #endif #ifndef BOOLEXP_DEBUGGING #ifdef WIN32SERVICES void shutdown_checkpoint(void); --- 309,314 ---- *************** *** 348,354 **** static struct timeval *msec_add(struct timeval *t, int x); static void update_quotas(struct timeval *last, struct timeval *current); ! static int how_many_fds(void); static void shovechars(Port_t port, Port_t sslport); static int test_connection(int newsock); #ifndef INFO_SLAVE --- 331,337 ---- static struct timeval *msec_add(struct timeval *t, int x); static void update_quotas(struct timeval *last, struct timeval *current); ! int how_many_fds(void); static void shovechars(Port_t port, Port_t sslport); static int test_connection(int newsock); #ifndef INFO_SLAVE *************** *** 428,463 **** #endif void reopen_logs(void); void load_reboot_db(void); - #ifdef HAS_GETRLIMIT - static void - init_rlimit(void) - { - /* Unlimit file descriptors. */ - /* Ultrix 4.4 and others may have getrlimit but may not be able to - * change number of file descriptors - */ - #ifdef RLIMIT_NOFILE - struct rlimit *rlp; - - rlp = (struct rlimit *) malloc(sizeof(struct rlimit)); - if (getrlimit(RLIMIT_NOFILE, rlp)) { - perror("init_rlimit: getrlimit()"); - free(rlp); - return; - } - /* This check seems dumb, but apparently FreeBSD may return 0 for - * the max # of descriptors! - */ - if (rlp->rlim_max > rlp->rlim_cur) { - rlp->rlim_cur = rlp->rlim_max; - if (setrlimit(RLIMIT_NOFILE, rlp)) - perror("init_rlimit: setrlimit()"); - } - free(rlp); - #endif - return; - } - #endif /* HAS_GETRLIMIT */ #ifdef NT_TCP BOOL --- 411,416 ---- *************** *** 981,987 **** socklen_t addr_len; int newsock; #endif ! int input_ready, output_ready; #ifdef NT_TCP if (platform != VER_PLATFORM_WIN32_NT) --- 934,940 ---- socklen_t addr_len; int newsock; #endif ! unsigned long input_ready, output_ready; #ifdef NT_TCP if (platform != VER_PLATFORM_WIN32_NT) *************** *** 2430,2435 **** --- 2383,2392 ---- unsigned char reply[6] = "\xFF\xFB\x03\xFF\xFD\x03"; queue_newwrite(d, reply, 6); process_output(d); + /* Yeah, we still will send GA, which they should treat as a NOP, + * but we'd better send newlines, too. + */ + d->conn_flags |= CONN_PROMPT_NEWLINES; #ifdef DEBUG_TELNET fprintf(stderr, "GOT IAC DO SGA, sending IAC WILL SGA IAG DO SGA\n"); #endif *************** *** 2697,2702 **** --- 2654,2664 ---- d->width = parse_integer(command + 11); } else if (!strncmp(command, "SCREENHEIGHT", 12)) { d->height = parse_integer(command + 12); + } else if (!strncmp(command, "PROMPT_NEWLINES", 15)) { + if (parse_integer(command + 15)) + d->conn_flags |= CONN_PROMPT_NEWLINES; + else + d->conn_flags &= ~CONN_PROMPT_NEWLINES; } else if (SUPPORT_PUEBLO && !strncmp(command, PUEBLO_COMMAND, strlen(PUEBLO_COMMAND))) { parse_puebloclient(d, command); *************** *** 2821,2830 **** ModTime(player) = (time_t) 0; announce_connect(player, isnew, num); /* broadcast connect message */ check_last(player, d->addr, d->ip); /* set Last, Lastsite, give paycheck */ ! /* Check folder 0, not silently (i.e. Report lack of mail, too) */ queue_eol(d); if (command_check_byname(player, "@MAIL")) ! check_mail(player, 0, 0); set_player_folder(player, 0); do_look_around(player); if (Haven(player)) --- 2783,2792 ---- ModTime(player) = (time_t) 0; announce_connect(player, isnew, num); /* broadcast connect message */ check_last(player, d->addr, d->ip); /* set Last, Lastsite, give paycheck */ ! /* Check all mail folders. If empty, report lack of mail. */ queue_eol(d); if (command_check_byname(player, "@MAIL")) ! check_all_mail(player); set_player_folder(player, 0); do_look_around(player); if (Haven(player)) *************** *** 4474,4479 **** --- 4436,4443 ---- safe_str(" pueblo", buff, bp); if (match->conn_flags & CONN_TELNET) safe_str(" telnet", buff, bp); + if (match->conn_flags & CONN_PROMPT_NEWLINES) + safe_str(" prompt_newlines", buff, bp); #ifdef HAS_OPENSSL if (sslsock && match->ssl) safe_str(" ssl", buff, bp); *************** *** 4813,4872 **** #define fclose(x) f_close(x) #endif /* SUN_OS */ - static int - how_many_fds(void) - { - /* Determine how many open file descriptors we're allowed - * In order, we'll try: - * 1. sysconf(_SC_OPEN_MAX) - POSIX.1 - * 2. OPEN_MAX constant - POSIX.1 limits.h - * 3. getdtablesize - BSD (which Config maps to ulimit or NOFILE if needed) - */ - static int open_max = 0; - #ifdef WIN32 - int iMaxSocketsAllowed; - #endif - if (open_max) - return open_max; - #ifdef WIN32 - /* Typically, WIN32 allows many open sockets, but won't perform - * well if too many are used. The best approach is to give the - * admin a single point of control (MAX_LOGINS in MUSH.CNF) and then - * allow a few more connections than that here for clients to get access - * to an E-mail address or at least a title. 2 is an arbitrary number. - * - * If max_logins is set to 0 in mush.cnf (unlimited logins), - * we'll allocate 120 sockets for now. - * - * wsadata.iMaxSockets isn't valid for WinSock versions 2.0 - * and later, but we are requesting version 1.1, so it's valid. - */ - iMaxSocketsAllowed = options.max_logins ? (2 * options.max_logins) : 120; - if (wsadata.iMaxSockets < iMaxSocketsAllowed) - iMaxSocketsAllowed = wsadata.iMaxSockets; - return iMaxSocketsAllowed; - #else - #ifdef HAS_SYSCONF - errno = 0; - if ((open_max = sysconf(_SC_OPEN_MAX)) < 0) { - if (errno == 0) /* Value was indeterminate */ - open_max = 0; - } - if (open_max) - return open_max; - #endif - #ifdef OPEN_MAX - open_max = OPEN_MAX; - return open_max; - #endif - /* Caching getdtablesize is dangerous, since it's affected by - * getrlimit, so we don't. - */ - open_max = 0; - return getdtablesize(); - #endif /* WIN 32 */ - } - #ifdef HAS_OPENSSL /** Take down all SSL client connections and close the SSL server socket. * Typically, this is in preparation for a shutdown/reboot. --- 4777,4782 ---- *** 1_8_1.151/hdrs/version.h Thu, 15 Sep 2005 18:27:55 -0500 dunemush (pennmush/c/47_version.h 1.32.1.2.1.7.1.9.1.1.1.17.1.53 660) --- 1_8_1.192(w)/hdrs/version.h Mon, 12 Dec 2005 12:26:11 -0600 dunemush (pennmush/c/47_version.h 1.32.1.2.1.7.1.9.1.1.1.17.1.54 660) *************** *** 1,4 **** #define VERSION "1.8.1" ! #define PATCHLEVEL "3" ! #define PATCHDATE "[09/15/2005]" ! #define NUMVERSION 1008001003 --- 1,4 ---- #define VERSION "1.8.1" ! #define PATCHLEVEL "4" ! #define PATCHDATE "[12/06/2005]" ! #define NUMVERSION 1008001004 *** 1_8_1.151/hdrs/game.h Wed, 14 Sep 2005 22:37:22 -0500 dunemush (pennmush/d/12_game.h 1.28.1.2.1.1.1.1.1.1.1.7.1.22.1.3.1.2.1.4 660) --- 1_8_1.192(w)/hdrs/game.h Mon, 12 Dec 2005 12:26:11 -0600 dunemush (pennmush/d/12_game.h 1.28.1.2.1.1.1.1.1.1.1.7.1.22.1.3.1.2.1.5 660) *************** *** 136,141 **** --- 136,142 ---- #define PEMIT_SILENT 0x1 #define PEMIT_LIST 0x2 #define PEMIT_SPOOF 0x4 + #define PEMIT_PROMPT 0x8 extern void do_emit(dbref player, const char *tbuf1, int flags); extern void do_pemit (dbref player, const char *arg1, const char *arg2, int flags); *** 1_8_1.151/hdrs/extmail.h Wed, 21 Jul 2004 11:49:58 -0500 dunemush (pennmush/d/15_extmail.h 1.6.1.13 660) --- 1_8_1.192(w)/hdrs/extmail.h Mon, 12 Dec 2005 12:26:11 -0600 dunemush (pennmush/d/15_extmail.h 1.6.1.14 660) *************** *** 75,80 **** --- 75,81 ---- extern void add_folder_name(dbref player, int fld, const char *name); extern struct mail *find_exact_starting_point(dbref player); extern void check_mail(dbref player, int folder, int silent); + extern void check_all_mail(dbref player); extern int dump_mail(FILE * fp); extern int load_mail(FILE * fp); extern void mail_init(void); *** 1_8_1.151/hdrs/externs.h Sat, 27 Aug 2005 12:39:22 -0500 dunemush (pennmush/d/16_externs.h 1.1.1.53.1.2.1.8.2.1.1.2.1.1.1.1.1.2.1.6.1.3.1.4.3.1.1.1.1.18.1.8.1.1.1.32.1.1.3.1.1.5 660) --- 1_8_1.192(w)/hdrs/externs.h Mon, 12 Dec 2005 12:26:11 -0600 dunemush (pennmush/d/16_externs.h 1.1.1.53.1.2.1.8.2.1.1.2.1.1.1.1.1.2.1.6.1.3.1.4.3.1.1.1.1.18.1.8.1.1.1.32.1.1.3.1.1.9 660) *************** *** 124,129 **** --- 124,130 ---- #define NA_SPOOF 0x8000 /**< @ns* message, overrides NOSPOOF */ #define NA_INTER_LOCK 0x10000 /**< Message subject to @lock/interact even if not otherwise marked */ #define NA_INTERACTION (NA_INTER_HEAR|NA_INTER_SEE|NA_INTER_PRESENCE|NA_INTER_LOCK) /**< Message follows interaction rules */ + #define NA_PROMPT 0x20000 /**< Message is a prompt, add GOAHEAD */ /** A notify_anything lookup function type definition */ typedef dbref (*na_lookup) (dbref, void *); *************** *** 158,165 **** --- 159,170 ---- /** Basic 'notify player with message */ #define notify(p,m) notify_anything(orator, na_one, &(p), NULL, 0, m) + /** Notify player as a prompt */ + #define notify_prompt(p,m) notify_anything(orator, na_one, &(p), NULL, NA_PROMPT, m) /** Notify puppet with message, even if owner's there */ #define notify_must_puppet(p,m) notify_anything(orator, na_one, &(p), NULL, NA_MUST_PUPPET, m) + /** Notify puppet with message as prompt, even if owner's there */ + #define notify_prompt_must_puppet(p,m) notify_anything(orator, na_one, &(p), NULL, NA_MUST_PUPPET|NA_PROMPT, m) /** Notify player with message, as if from somethign specific */ #define notify_by(t,p,m) notify_anything(t, na_one, &(p), NULL, 0, m) /** Notfy player with message, but only puppet propagation */ *** 1_8_1.151/hdrs/conf.h Tue, 18 Jan 2005 13:10:33 -0600 dunemush (pennmush/d/20_conf.h 1.1.1.1.1.1.1.1.1.1.1.1.1.2.1.5.1.1.1.1.1.1.1.1.1.2.1.1.2.1.2.13.1.4.1.20.1.24.1.2 660) --- 1_8_1.192(w)/hdrs/conf.h Mon, 12 Dec 2005 12:26:11 -0600 dunemush (pennmush/d/20_conf.h 1.1.1.1.1.1.1.1.1.1.1.1.1.2.1.5.1.1.1.1.1.1.1.1.1.2.1.1.2.1.2.13.1.4.1.20.1.24.1.3 660) *************** *** 93,99 **** int max; /**< max: string length, integer value. */ int overridden; /**< Has the default been overridden? */ const char *group; /**< The option's group name */ ! } CONF; /** Runtime configuration options. * This large structure stores all of the runtime configuration options --- 93,99 ---- int max; /**< max: string length, integer value. */ int overridden; /**< Has the default been overridden? */ const char *group; /**< The option's group name */ ! } PENNCONF; /** Runtime configuration options. * This large structure stores all of the runtime configuration options *************** *** 276,285 **** extern OPTTAB options; extern HASHTAB local_options; ! extern CONF *add_config(const char *name, config_func handler, void *loc, ! int max, const char *group); ! extern CONF *new_config(void); ! extern CONF *get_config(const char *name); int cf_bool(const char *opt, const char *val, void *loc, int maxval, int source); --- 276,285 ---- extern OPTTAB options; extern HASHTAB local_options; ! extern PENNCONF *add_config(const char *name, config_func handler, void *loc, ! int max, const char *group); ! extern PENNCONF *new_config(void); ! extern PENNCONF *get_config(const char *name); int cf_bool(const char *opt, const char *val, void *loc, int maxval, int source); *** 1_8_1.151/hdrs/atr_tab.h Mon, 30 May 2005 16:17:01 -0500 dunemush (pennmush/d/26_atr_tab.h 1.15.1.18 660) --- 1_8_1.192(w)/hdrs/atr_tab.h Mon, 12 Dec 2005 12:26:11 -0600 dunemush (pennmush/d/26_atr_tab.h 1.15.1.19 660) *************** *** 104,109 **** --- 104,110 ---- NULL_CHUNK_REFERENCE, 0, NULL}, {"MAILFILTERS", AF_WIZARD | AF_NOPROG | AF_LOCKED | AF_PREFIXMATCH, NULL_CHUNK_REFERENCE, 0, NULL}, + {"MAILFILTER", AF_NOPROG | AF_PREFIXMATCH, NULL_CHUNK_REFERENCE, 0, NULL}, {"MAILFOLDERS", AF_WIZARD | AF_NOPROG | AF_LOCKED | AF_PREFIXMATCH, NULL_CHUNK_REFERENCE, 0, NULL}, {"MAILFORWARDLIST", AF_NOPROG | AF_PREFIXMATCH, NULL_CHUNK_REFERENCE, 0, *** 1_8_1.151/Makefile.SH Thu, 04 Nov 2004 13:58:00 -0600 dunemush (pennmush/d/30_Makefile.S 1.14.1.1.1.7.1.1.1.21 700) --- 1_8_1.192(w)/Makefile.SH Sun, 30 Oct 2005 16:46:24 -0600 dunemush (pennmush/d/30_Makefile.S 1.14.1.1.1.7.1.1.1.22 700) *************** *** 129,134 **** --- 129,139 ---- (cd src; make announce "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \ "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" ) + ssl_slave: + (cd src; make ssl_slave "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \ + "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" "MAKE=$(MAKE)" \ + "MAKEFLAGS=$(MAKEFLAGS)") + versions: CHANGES* -@rm -rf CHANGES*~ CHANGES*bak @utils/mkvershlp.pl game/txt/hlp CHANGES* *** 1_8_1.151/MANIFEST Sun, 16 Jan 2005 15:07:02 -0600 dunemush (pennmush/d/34_MANIFEST 1.21.1.2.1.7.1.3.1.31.1.2 600) --- 1_8_1.192(w)/MANIFEST Sat, 29 Oct 2005 19:50:37 -0500 dunemush (pennmush/d/34_MANIFEST 1.21.1.2.1.7.1.3.1.31.1.3 600) *************** *** 99,104 **** --- 99,105 ---- src/move.c src/mycrypt.c src/mymalloc.c + src/myrlimit.c src/mysocket.c src/myssl.c src/notify.c *** 1_8_1.151/win32/funs.h Sat, 27 Aug 2005 13:12:37 -0500 dunemush (pennmush/f/12_funs.h 1.11.1.9.2.8.2.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.8.1.3.1.7.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.10.1.1.1.4.1.5.1.1.1.1.1.4 640) --- 1_8_1.192(w)/win32/funs.h Tue, 06 Dec 2005 14:26:59 -0600 dunemush (pennmush/f/12_funs.h 1.11.1.9.2.8.2.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.8.1.3.1.7.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.10.1.1.1.4.1.5.1.1.1.1.1.9 640) *************** *** 42,47 **** --- 42,48 ---- FUNCTION_PROTO(fun_channels); FUNCTION_PROTO(fun_checkpass); FUNCTION_PROTO(fun_chr); + FUNCTION_PROTO(fun_cinfo); FUNCTION_PROTO(fun_clock); FUNCTION_PROTO(fun_clone); FUNCTION_PROTO(fun_cmds); *************** *** 56,61 **** --- 57,63 ---- FUNCTION_PROTO(fun_cos); FUNCTION_PROTO(fun_cowner); FUNCTION_PROTO(fun_create); + FUNCTION_PROTO(fun_cstatus); FUNCTION_PROTO(fun_ctime); FUNCTION_PROTO(fun_ctitle); FUNCTION_PROTO(fun_ctu); *************** *** 199,204 **** --- 201,208 ---- FUNCTION_PROTO(fun_mul); FUNCTION_PROTO(fun_munge); FUNCTION_PROTO(fun_name); + FUNCTION_PROTO(fun_namegrab); + FUNCTION_PROTO(fun_namegraball); FUNCTION_PROTO(fun_nand); FUNCTION_PROTO(fun_nattr); FUNCTION_PROTO(fun_nearby); *************** *** 208,213 **** --- 212,218 ---- FUNCTION_PROTO(fun_not); FUNCTION_PROTO(fun_null); FUNCTION_PROTO(fun_num); + FUNCTION_PROTO(fun_numversion); FUNCTION_PROTO(fun_nwho); FUNCTION_PROTO(fun_obj); FUNCTION_PROTO(fun_objeval); *************** *** 232,237 **** --- 237,243 ---- FUNCTION_PROTO(fun_poss); FUNCTION_PROTO(fun_power); FUNCTION_PROTO(fun_powers); + FUNCTION_PROTO(fun_prompt); FUNCTION_PROTO(fun_pueblo); FUNCTION_PROTO(fun_quota); FUNCTION_PROTO(fun_r); *************** *** 309,314 **** --- 315,321 ---- FUNCTION_PROTO(fun_tan); FUNCTION_PROTO(fun_tel); FUNCTION_PROTO(fun_terminfo); + FUNCTION_PROTO(fun_textentries); FUNCTION_PROTO(fun_textfile); FUNCTION_PROTO(fun_time); FUNCTION_PROTO(fun_timefmt); *** 1_8_1.151/win32/cmds.h Sun, 20 Mar 2005 15:07:46 -0600 dunemush (pennmush/f/15_cmds.h 1.9.1.4.1.1.1.1.1.1.1.1.2.1.1.1.2.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.9.1.7.2.4.1.2.3.1.1.1.1.1.1.1.1.13.1.1 660) --- 1_8_1.192(w)/win32/cmds.h Sun, 27 Nov 2005 15:23:43 -0600 dunemush (pennmush/f/15_cmds.h 1.9.1.4.1.1.1.1.1.1.1.1.2.1.1.1.2.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.9.1.7.2.4.1.2.3.1.1.1.1.1.1.1.1.13.1.2 660) *************** *** 92,97 **** --- 92,98 ---- COMMAND_PROTO(cmd_poor); COMMAND_PROTO(cmd_pose); COMMAND_PROTO(cmd_power); + COMMAND_PROTO(cmd_prompt); COMMAND_PROTO(cmd_ps); COMMAND_PROTO(cmd_purge); COMMAND_PROTO(cmd_quota); *** 1_8_1.151/hdrs/mushtype.h Tue, 22 Mar 2005 16:45:23 -0600 dunemush (pennmush/f/20_mushtype.h 1.2.1.1.1.23 660) --- 1_8_1.192(w)/hdrs/mushtype.h Mon, 12 Dec 2005 12:26:11 -0600 dunemush (pennmush/f/20_mushtype.h 1.2.1.1.1.25 660) *************** *** 78,83 **** --- 78,100 ---- }; /* Descriptor foo */ + /** Using Pueblo, Smial, Mushclient, Simplemu, or some other + * * pueblo-style HTML aware client */ + #define CONN_HTML 0x1 + /** Using a client that understands telnet options */ + #define CONN_TELNET 0x2 + /** Send a telnet option to test client */ + #define CONN_TELNET_QUERY 0x4 + /** Connection that should be close on load from reboot.db */ + #define CONN_CLOSE_READY 0x8 + /** Validated connection from an SSL concentrator */ + #define CONN_SSL_CONCENTRATOR 0x10 + /** Player would like to receive newlines after prompts, because + * * their client mucks up output after a GOAHEAD */ + #define CONN_PROMPT_NEWLINES 0x20 + /** Default connection, nothing special */ + #define CONN_DEFAULT (CONN_PROMPT_NEWLINES) + #define DOING_LEN 40 /** Pueblo checksum length. * Pueblo uses md5 now, but if they switch to sha1, this will still *** 1_8_1.151/game/txt/hlp/pennvOLD.hlp Thu, 15 Sep 2005 18:27:55 -0500 dunemush (pennmush/g/30_pennvOLD.h 1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.9.1.2.1.5.1.1.1.1.1.1.1.1.1.1.1.1.1.3 660) --- 1_8_1.192(w)/game/txt/hlp/pennvOLD.hlp Mon, 12 Dec 2005 12:26:11 -0600 dunemush (pennmush/g/30_pennvOLD.h 1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.9.1.2.1.5.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.3 660) *************** *** 4417,4424 **** For information on a specific patchlevel of one of the versions listed, type 'help p'. For example, 'help 1.7.2p3' ! 1.8.1: 0, 1, 2, 3 ! 1.8.0: 0, 1, 2, 3, 4, 5, 6, 7, 8 1.7.7: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 --- 4417,4424 ---- For information on a specific patchlevel of one of the versions listed, type 'help p'. For example, 'help 1.7.2p3' ! 1.8.1: 0, 1, 2, 3, 4 ! 1.8.0: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 1.7.7: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 *** 1_8_1.151/src/notify.c Tue, 18 Jan 2005 12:50:02 -0600 dunemush (pennmush/g/35_notify.c 1.41.1.10.1.2 660) --- 1_8_1.192(w)/src/notify.c Mon, 12 Dec 2005 12:26:11 -0600 dunemush (pennmush/g/35_notify.c 1.41.1.10.1.8 660) *************** *** 90,105 **** static int under_limit = 1; - /** Default connection, nothing special */ - #define CONN_DEFAULT 0 - /** Using Pueblo, Smial, Mushclient, Simplemu, or some other - * pueblo-style HTML aware client */ - #define CONN_HTML 0x1 - /** Using a client that understands telnet options */ - #define CONN_TELNET 0x2 - /** Send a telnet option to test client */ - #define CONN_TELNET_QUERY 0x4 - /* When the mush gets a new connection, it tries sending a telnet * option negotiation code for setting client-side line-editing mode --- 90,95 ---- *************** *** 123,128 **** --- 113,119 ---- /* Telnet codes */ #define IAC 255 /**< telnet: interpret as command */ + #define GOAHEAD 249 /**< telnet: go-ahead */ /** Iterate through a list of descriptors, and do something with those * that are connected. *************** *** 195,200 **** --- 186,192 ---- #define TA_BLINK 4 /**< Text attribute blinking/flashing */ #define TA_ULINE 5 /**< Text attribute underline */ + static int na_depth = 0; /** A place to store a rendered message. */ *************** *** 212,218 **** static void zero_strings(struct notify_strings messages[]); static unsigned char *notify_makestring(const char *message, struct notify_strings messages[], ! enum na_type type); static void --- 204,210 ---- static void zero_strings(struct notify_strings messages[]); static unsigned char *notify_makestring(const char *message, struct notify_strings messages[], ! enum na_type type, int flags); static void *************** *** 339,345 **** static unsigned char * notify_makestring(const char *message, struct notify_strings messages[], ! enum na_type type) { char *o; const unsigned char *p; --- 331,337 ---- static unsigned char * notify_makestring(const char *message, struct notify_strings messages[], ! enum na_type type, int flags) { char *o; const unsigned char *p; *************** *** 351,359 **** int strip = 0; int pueblo = 0; static char tbuf[BUFFER_LEN]; ! if (messages[type].made) ! return messages[type].message; messages[type].made = 1; p = (unsigned char *) message; --- 343,361 ---- int strip = 0; int pueblo = 0; static char tbuf[BUFFER_LEN]; + char *bp; ! if (messages[type].made) { ! if (flags & NA_PROMPT) { ! bp = tbuf; ! safe_str(messages[type].message, tbuf, &bp); ! safe_chr(IAC, tbuf, &bp); ! safe_chr(GOAHEAD, tbuf, &bp); ! *bp = '\0'; ! return tbuf; ! } else ! return messages[type].message; ! } messages[type].made = 1; p = (unsigned char *) message; *************** *** 384,389 **** --- 386,399 ---- *o = '\0'; messages[type].message = (unsigned char *) mush_strdup(tbuf, "string"); messages[type].len = o - tbuf; + if (flags & NA_PROMPT) { + bp = tbuf; + safe_str(messages[type].message, tbuf, &bp); + safe_chr(IAC, tbuf, &bp); + safe_chr(GOAHEAD, tbuf, &bp); + *bp = '\0'; + return tbuf; + } return messages[type].message; case NA_NPASCII: strip = 1; *************** *** 426,431 **** --- 436,449 ---- *o = '\0'; messages[type].message = (unsigned char *) mush_strdup(tbuf, "string"); messages[type].len = o - tbuf; + if (flags & NA_PROMPT) { + bp = tbuf; + safe_str(messages[type].message, tbuf, &bp); + safe_chr(IAC, tbuf, &bp); + safe_chr(GOAHEAD, tbuf, &bp); + *bp = '\0'; + return tbuf; + } return messages[type].message; case NA_PUEBLO: *************** *** 530,535 **** --- 548,561 ---- *o = '\0'; messages[type].message = (unsigned char *) mush_strdup(tbuf, "string"); messages[type].len = o - tbuf; + if (flags & NA_PROMPT) { + bp = tbuf; + safe_str(messages[type].message, tbuf, &bp); + safe_chr(IAC, tbuf, &bp); + safe_chr(GOAHEAD, tbuf, &bp); + *bp = '\0'; + return tbuf; + } return messages[type].message; } *************** *** 822,846 **** paranoid = nsfunc(speaker, func, fdata, 1); havepara = 1; } ! pstring = notify_makestring(paranoid, paranoids, poutput); ! plen = paranoids[poutput].len; } else { if (!havespoof) { nospoof = nsfunc(speaker, func, fdata, 0); havespoof = 1; } ! pstring = notify_makestring(nospoof, nospoofs, poutput); ! plen = nospoofs[poutput].len; } queue_newwrite(d, pstring, plen); } ! pstring = notify_makestring(msgbuf, messages, poutput); ! plen = messages[poutput].len; if (pstring && *pstring) queue_newwrite(d, pstring, plen); ! if (!(flags & NA_NOENTER)) { if ((poutput == NA_PUEBLO) || (poutput == NA_NPUEBLO)) { if (flags & NA_NOPENTER) queue_newwrite(d, (unsigned char *) "\n", 1); --- 848,875 ---- paranoid = nsfunc(speaker, func, fdata, 1); havepara = 1; } ! pstring = notify_makestring(paranoid, paranoids, poutput, flags); ! plen = strlen(pstring); } else { if (!havespoof) { nospoof = nsfunc(speaker, func, fdata, 0); havespoof = 1; } ! pstring = notify_makestring(nospoof, nospoofs, poutput, flags); ! plen = strlen(pstring); } queue_newwrite(d, pstring, plen); } ! pstring = notify_makestring(msgbuf, messages, poutput, flags); ! plen = strlen(pstring); if (pstring && *pstring) queue_newwrite(d, pstring, plen); ! if (!((flags & NA_NOENTER) || ((flags & NA_PROMPT) ! && !(d-> ! conn_flags & ! CONN_PROMPT_NEWLINES)))) { if ((poutput == NA_PUEBLO) || (poutput == NA_NPUEBLO)) { if (flags & NA_NOPENTER) queue_newwrite(d, (unsigned char *) "\n", 1); *************** *** 881,886 **** --- 910,916 ---- safe_str(Name(target), tbuf1, &bp); safe_str("> ", tbuf1, &bp); *bp = '\0'; + flags &= ~NA_PROMPT; /* No prompts to puppets */ notify_anything(GOD, na_one, &Owner(target), NULL, NA_NOENTER | NA_PUPPET2 | NA_NORELAY | flags, tbuf1); *************** *** 909,918 **** if (AF_Regexp(a) ? regexp_match_case(tbuf1, (char *) notify_makestring(msgbuf, messages, ! NA_ASCII), AF_Case(a)) : wild_match_case(tbuf1, (char *) notify_makestring(msgbuf, messages, ! NA_ASCII), AF_Case(a))) { if (eval_lock(speaker, target, Listen_Lock)) if (PLAYER_AHEAR || (!IsPlayer(target))) { if (speaker != target) --- 939,950 ---- if (AF_Regexp(a) ? regexp_match_case(tbuf1, (char *) notify_makestring(msgbuf, messages, ! NA_ASCII, 0), ! AF_Case(a)) : wild_match_case(tbuf1, (char *) notify_makestring(msgbuf, messages, ! NA_ASCII, 0), ! AF_Case(a))) { if (eval_lock(speaker, target, Listen_Lock)) if (PLAYER_AHEAR || (!IsPlayer(target))) { if (speaker != target) *************** *** 924,930 **** if (!(flags & NA_NORELAY) && (loc != target) && !filter_found(target, (char *) notify_makestring(msgbuf, messages, ! NA_ASCII), 1)) { passalong[0] = target; passalong[1] = target; passalong[2] = Owner(target); --- 956,962 ---- if (!(flags & NA_NORELAY) && (loc != target) && !filter_found(target, (char *) notify_makestring(msgbuf, messages, ! NA_ASCII, 0), 1)) { passalong[0] = target; passalong[1] = target; passalong[2] = Owner(target); *************** *** 965,972 **** && eval_lock(speaker, target, Listen_Lock) ) atr_comm_match(target, speaker, '^', ':', ! (char *) notify_makestring(msgbuf, messages, NA_ASCII), 0, ! NULL, NULL, NULL); /* If object is flagged AUDIBLE and has a @FORWARDLIST, send * stuff on */ --- 997,1004 ---- && eval_lock(speaker, target, Listen_Lock) ) atr_comm_match(target, speaker, '^', ':', ! (char *) notify_makestring(msgbuf, messages, NA_ASCII, 0), ! 0, NULL, NULL, NULL); /* If object is flagged AUDIBLE and has a @FORWARDLIST, send * stuff on */ *************** *** 1429,1438 **** PUSE; tag_wrap("SAMP", NULL, buff); PEND; ! s = notify_makestring(pbuff, messages, NA_PUEBLO); len = messages[NA_PUEBLO].len; } else { ! s = notify_makestring(buff, messages, notify_type(d)); len = messages[notify_type(d)].len; } queue_newwrite(d, s, len); --- 1461,1470 ---- PUSE; tag_wrap("SAMP", NULL, buff); PEND; ! s = notify_makestring(pbuff, messages, NA_PUEBLO, 0); len = messages[NA_PUEBLO].len; } else { ! s = notify_makestring(buff, messages, notify_type(d), 0); len = messages[notify_type(d)].len; } queue_newwrite(d, s, len); *************** *** 1595,1601 **** poutput = notify_type(d); ! n = notify_makestring(s, messages, poutput); ret = queue_newwrite(d, n, messages[poutput].len); free_strings(messages); return ret; --- 1627,1633 ---- poutput = notify_type(d); ! n = notify_makestring(s, messages, poutput, 0); ret = queue_newwrite(d, n, messages[poutput].len); free_strings(messages); return ret; *** 1_8_1.151/hdrs/myssl.h Sun, 10 Aug 2003 11:13:00 -0500 dunemush (pennmush/g/39_myssl.h 1.6 660) --- 1_8_1.192(w)/hdrs/myssl.h Mon, 12 Dec 2005 12:26:11 -0600 dunemush (pennmush/g/39_myssl.h 1.7 660) *************** *** 7,13 **** #ifdef HAS_OPENSSL ! SSL_CTX *ssl_init(void); SSL *ssl_setup_socket(int sock); void ssl_close_connection(SSL * ssl); SSL *ssl_listen(int sock, int *state); --- 7,13 ---- #ifdef HAS_OPENSSL ! SSL_CTX *ssl_init(char *private_key_file, char *ca_file, int req_client_cert); SSL *ssl_setup_socket(int sock); void ssl_close_connection(SSL * ssl); SSL *ssl_listen(int sock, int *state); *** 1_8_1.151/src/myssl.c Sat, 01 Jan 2005 15:46:51 -0600 dunemush (pennmush/g/40_myssl.c 1.20.1.1.1.1 660) --- 1_8_1.192(w)/src/myssl.c Mon, 12 Dec 2005 12:26:11 -0600 dunemush (pennmush/g/40_myssl.c 1.20.1.1.1.2 660) *************** *** 109,115 **** * \return pointer to SSL context object. */ SSL_CTX * ! ssl_init(void) { SSL_METHOD *meth; unsigned char context[128]; --- 109,115 ---- * \return pointer to SSL context object. */ SSL_CTX * ! ssl_init(char *private_key_file, char *ca_file, int req_client_cert) { SSL_METHOD *meth; unsigned char context[128]; *************** *** 134,157 **** ctx = SSL_CTX_new(meth); /* Load keys/certs */ ! if (*options.ssl_private_key_file) { ! if (!SSL_CTX_use_certificate_chain_file(ctx, options.ssl_private_key_file)) { ssl_errordump ("Unable to load server certificate - only anonymous ciphers supported."); } ! if (!SSL_CTX_use_PrivateKey_file ! (ctx, options.ssl_private_key_file, SSL_FILETYPE_PEM)) { ssl_errordump ("Unable to load private key - only anonymous ciphers supported."); } } /* Load trusted CAs */ ! if (*options.ssl_ca_file) { ! if (!SSL_CTX_load_verify_locations(ctx, options.ssl_ca_file, NULL)) { ssl_errordump("Unable to load CA certificates"); } else { ! if (options.ssl_require_client_cert) SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT, client_verify_callback); --- 134,156 ---- ctx = SSL_CTX_new(meth); /* Load keys/certs */ ! if (private_key_file && *private_key_file) { ! if (!SSL_CTX_use_certificate_chain_file(ctx, private_key_file)) { ssl_errordump ("Unable to load server certificate - only anonymous ciphers supported."); } ! if (!SSL_CTX_use_PrivateKey_file(ctx, private_key_file, SSL_FILETYPE_PEM)) { ssl_errordump ("Unable to load private key - only anonymous ciphers supported."); } } /* Load trusted CAs */ ! if (ca_file && *ca_file) { ! if (!SSL_CTX_load_verify_locations(ctx, ca_file, NULL)) { ssl_errordump("Unable to load CA certificates"); } else { ! if (req_client_cert) SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT, client_verify_callback); *** 1_8_1.151/game/txt/hlp/pennattr.hlp Sat, 17 Jul 2004 20:22:09 -0500 dunemush (pennmush/g/47_pennattr.h 1.6 600) --- 1_8_1.192(w)/game/txt/hlp/pennattr.hlp Thu, 20 Oct 2005 19:02:18 -0500 dunemush (pennmush/g/47_pennattr.h 1.7 600) *************** *** 1,5 **** --- 1,7 ---- & ATTRIBUTE TREES & ATTR TREES + & ATTRIB TREES + & ` Attributes can be arranged in a hierarchical tree; these are called "attribute trees", and a conceptually similar to the way that files and directories/folders are organized on computer filesystems. *************** *** 25,30 **** --- 27,35 ---- & ATTRIBUTE TREES2 & ATTR TREES2 + & ATTRIB TREES2 + & `2 + Attributes can be arranged in a hierarchical tree; these are called Attribute trees provide two immediate benefits. First, they reduce spam when examining objects. The usual * and ? wildcards for attributes do not match the ` character; the new ** wildcard does. Some *************** *** 46,51 **** --- 51,58 ---- & ATTRIBUTE TREES3 & ATTR TREES3 + & ATTRIB TREES3 + & `3 The second benefit of attributes trees is convenient access control. Attribute flags that restrict attribute access or execution (no_inherit, no_command, mortal_dark, wizard) propagate down *************** *** 70,75 **** --- 77,84 ---- See help attribute trees4 for information about @parent and attribute trees. & ATTRIBUTE TREES4 & ATTR TREES4 + & ATTRIB TREES4 + & `4 Attribute trees interact with @parent in several ways. As usual, children inherit attributes from their parent unless the *** 1_8_1.151/src/Makefile.SH Thu, 02 Sep 2004 11:04:56 -0500 dunemush (pennmush/h/7_Makefile.S 1.10 650) --- 1_8_1.192(w)/src/Makefile.SH Sun, 30 Oct 2005 17:16:01 -0600 dunemush (pennmush/h/7_Makefile.S 1.13 650) *************** *** 65,71 **** fundb.c funlist.c funlocal.c funmath.c funmisc.c funstr.c funtime.c \ funufun.c game.c help.c htab.c ident.c local.c lock.c log.c look.c \ malias.c match.c memcheck.c move.c mycrypt.c mymalloc.c mysocket.c \ ! myssl.c notify.c parse.c pcre.c player.c plyrlist.c \ predicat.c privtab.c \ ptab.c rob.c services.c set.c shs.c sig.c speech.c sql.c \ strdup.c strtree.c \ --- 65,71 ---- fundb.c funlist.c funlocal.c funmath.c funmisc.c funstr.c funtime.c \ funufun.c game.c help.c htab.c ident.c local.c lock.c log.c look.c \ malias.c match.c memcheck.c move.c mycrypt.c mymalloc.c mysocket.c \ ! myrlimit.c myssl.c notify.c parse.c pcre.c player.c plyrlist.c \ predicat.c privtab.c \ ptab.c rob.c services.c set.c shs.c sig.c speech.c sql.c \ strdup.c strtree.c \ *************** *** 93,99 **** fundb.o funlist.o funlocal.o funmath.o funmisc.o funstr.o funtime.o \ funufun.o game.o help.o htab.o ident.o local.o lock.o log.o look.o \ malias.o match.o memcheck.o move.o mycrypt.o mymalloc.o mysocket.o \ ! myssl.o notify.o parse.o pcre.o player.o plyrlist.o \ predicat.o privtab.o \ ptab.o rob.o services.o set.o shs.o sig.o speech.o sql.o \ strdup.o strtree.o \ --- 93,99 ---- fundb.o funlist.o funlocal.o funmath.o funmisc.o funstr.o funtime.o \ funufun.o game.o help.o htab.o ident.o local.o lock.o log.o look.o \ malias.o match.o memcheck.o move.o mycrypt.o mymalloc.o mysocket.o \ ! myrlimit.o myssl.o notify.o parse.o pcre.o player.o plyrlist.o \ predicat.o privtab.o \ ptab.o rob.o services.o set.o shs.o sig.o speech.o sql.o \ strdup.o strtree.o \ *************** *** 126,131 **** --- 126,138 ---- $(CC) $(LDFLAGS) $(CCFLAGS) -DINFOSLAVE -o info_slave info_slave.o \ ident.o strdup.o sig.o mymalloc.o mysocket.c $(LIBS) + SSL_SLAVE_OBJS = strdup.o sig.o mymalloc.o mysocket.o myssl.o notify.o myrlimit.o strutil.o ident.o utils.o + ssl_slave: ssl_slave.c $(SSL_SLAVE_OBJS) + @echo "Making ssl_slave." + $(CC) $(CCFLAGS) $(IDEFS) -c ssl_slave.c + $(CC) $(LDFLAGS) $(CCFLAGS) -o ssl_slave ssl_slave.o \ + $(SSL_SLAVE_OBJS) $(LIBS) + # ../hdrs/buildinf.h contains build information used by version.c: # time/date of build and CFLAGS # It should always be out of date. *************** *** 360,365 **** --- 367,373 ---- bsd.o: ../hdrs/mymalloc.h bsd.o: ../hdrs/extmail.h bsd.o: ../hdrs/game.h + bsd.o: ../hdrs/dbio.h bufferq.o: ../hdrs/copyrite.h bufferq.o: ../config.h bufferq.o: ../hdrs/conf.h *************** *** 570,575 **** --- 578,584 ---- db.o: ../options.h db.o: ../hdrs/mushtype.h db.o: ../hdrs/htab.h + db.o: ../hdrs/dbio.h db.o: ../hdrs/externs.h db.o: ../hdrs/compile.h db.o: ../hdrs/dbdefs.h *************** *** 586,591 **** --- 595,601 ---- db.o: ../hdrs/log.h db.o: ../hdrs/strtree.h db.o: ../hdrs/parse.h + db.o: ../hdrs/privtab.h db.o: ../hdrs/extmail.h destroy.o: ../config.h destroy.o: ../hdrs/copyrite.h *************** *** 639,644 **** --- 649,655 ---- extchat.o: ../hdrs/function.h extchat.o: ../hdrs/command.h extchat.o: ../hdrs/switches.h + extchat.o: ../hdrs/dbio.h extmail.o: ../config.h extmail.o: ../hdrs/copyrite.h extmail.o: ../hdrs/conf.h *************** *** 666,671 **** --- 677,683 ---- extmail.o: ../hdrs/boolexp.h extmail.o: ../hdrs/command.h extmail.o: ../hdrs/switches.h + extmail.o: ../hdrs/dbio.h filecopy.o: ../hdrs/copyrite.h filecopy.o: ../config.h filecopy.o: ../hdrs/conf.h *************** *** 723,728 **** --- 735,741 ---- flags.o: ../hdrs/lock.h flags.o: ../hdrs/boolexp.h flags.o: ../hdrs/log.h + flags.o: ../hdrs/dbio.h flags.o: ../hdrs/oldflags.h funcrypt.o: ../hdrs/copyrite.h funcrypt.o: ../config.h *************** *** 801,806 **** --- 814,820 ---- fundb.o: ../hdrs/function.h funlist.o: ../hdrs/copyrite.h funlist.o: ../config.h + funlist.o: ../hdrs/ansi.h funlist.o: ../hdrs/conf.h funlist.o: ../options.h funlist.o: ../hdrs/mushtype.h *************** *** 820,825 **** --- 834,841 ---- funlist.o: ../hdrs/mymalloc.h funlist.o: ../hdrs/pcre.h funlist.o: ../hdrs/match.h + funlist.o: ../hdrs/command.h + funlist.o: ../hdrs/switches.h funlist.o: ../hdrs/lock.h funlist.o: ../hdrs/boolexp.h funlocal.o: ../hdrs/copyrite.h *************** *** 972,977 **** --- 988,994 ---- game.o: ../hdrs/lock.h game.o: ../hdrs/function.h game.o: ../hdrs/help.h + game.o: ../hdrs/dbio.h help.o: ../config.h help.o: ../hdrs/conf.h help.o: ../hdrs/copyrite.h *************** *** 1035,1040 **** --- 1052,1058 ---- local.o: ../options.h local.o: ../hdrs/mushtype.h local.o: ../hdrs/htab.h + local.o: ../hdrs/dbio.h local.o: ../hdrs/externs.h local.o: ../hdrs/compile.h local.o: ../hdrs/dbdefs.h *************** *** 1137,1142 **** --- 1155,1161 ---- malias.o: ../hdrs/mymalloc.h malias.o: ../hdrs/pueblo.h malias.o: ../hdrs/log.h + malias.o: ../hdrs/dbio.h match.o: ../hdrs/copyrite.h match.o: ../config.h match.o: ../hdrs/conf.h *************** *** 1323,1328 **** --- 1342,1348 ---- player.o: ../hdrs/log.h player.o: ../hdrs/lock.h player.o: ../hdrs/boolexp.h + player.o: ../hdrs/parse.h player.o: ../hdrs/extmail.h plyrlist.o: ../config.h plyrlist.o: ../hdrs/copyrite.h *************** *** 1413,1418 **** --- 1433,1439 ---- rob.o: ../hdrs/lock.h rob.o: ../hdrs/boolexp.h rob.o: ../hdrs/game.h + rob.o: ../hdrs/case.h set.o: ../hdrs/copyrite.h set.o: ../config.h set.o: ../hdrs/conf.h *************** *** 1436,1441 **** --- 1457,1463 ---- set.o: ../hdrs/lock.h set.o: ../hdrs/boolexp.h set.o: ../hdrs/log.h + set.o: ../hdrs/game.h shs.o: ../hdrs/copyrite.h shs.o: ../config.h sig.o: ../config.h *** 1_8_1.151/CHANGES.180 Thu, 15 Sep 2005 18:09:51 -0500 dunemush (pennmush/h/21_CHANGES.18 1.51 600) --- 1_8_1.192(w)/CHANGES.180 Mon, 12 Dec 2005 12:25:45 -0600 dunemush (pennmush/h/21_CHANGES.18 1.53 600) *************** *** 12,17 **** --- 12,27 ---- ========================================================================== + Version 1.8.0 patchlevel 9 December 12, 2005 + + Fixes: + * On amd64 systems running FreeBSD (and possibly others), connections + could break after about 32 connections. Report by nails@M*U*S*H. + * The CONF and CONFGROUP structures are renamed PENNCONF and + PENNCONFGROUP to work around brokenness in Debian's openssl0.9.8 + package. + + Version 1.8.0 patchlevel 8 September 15, 2005 Fixes: *** 1_8_1.151/game/txt/hlp/pennv180.hlp Thu, 15 Sep 2005 18:16:50 -0500 dunemush (pennmush/h/28_pennv180.h 1.1.1.2.1.1.1.2.1.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.4.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.2.1.1.1.1.1.1.1.2.1.3 660) --- 1_8_1.192(w)/game/txt/hlp/pennv180.hlp Mon, 12 Dec 2005 12:26:11 -0600 dunemush (pennmush/h/28_pennv180.h 1.1.1.2.1.1.1.2.1.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.4.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.2.1.1.1.1.1.1.1.2.1.2.1.1.1.1 660) *************** *** 1,3 **** --- 1,14 ---- + & 1.8.0p9 + Version 1.8.0 patchlevel 9 December 12, 2005 + + Fixes: + * On amd64 systems running FreeBSD (and possibly others), connections + could break after about 32 connections. Report by nails@M*U*S*H. + * The CONF and CONFGROUP structures are renamed PENNCONF and + PENNCONFGROUP to work around brokenness in Debian's openssl0.9.8 + package. + + & 1.8.0p8 Version 1.8.0 patchlevel 8 September 15, 2005 *** 1_8_1.151/game/txt/hlp/pennv181.hlp Thu, 15 Sep 2005 18:27:55 -0500 dunemush (pennmush/h/29_pennv181.h 1.55 660) --- 1_8_1.192(w)/game/txt/hlp/pennv181.hlp Mon, 12 Dec 2005 12:26:11 -0600 dunemush (pennmush/h/29_pennv181.h 1.69 660) *************** *** 1,4 **** ! & 1.8.1p3 & changes This is a list of changes in this patchlevel which are probably of interest to players. More information about new commands and functions --- 1,4 ---- ! & 1.8.1p4 & changes This is a list of changes in this patchlevel which are probably of interest to players. More information about new commands and functions *************** *** 11,16 **** --- 11,58 ---- A list of the patchlevels associated with each release can be read in 'help patchlevels'. + Version 1.8.1 patchlevel 4 December 6, 2005 + + Major Changes: + * Errors in matching switches to commands are ignored when the + command is hook/ignored or hook/overriden, so you can override + a built-in command and provide your own switches. Suggested by + Trinsec@M*U*S*H. + Mail: + * @mailfilter attribute causes incoming mail to be be automatically + filed to a folder if it evaluates to a folder name/number. + Patch by Sketch@M*U*S*H. + Commands: + * @prompt/@nsprompt work like @pemit/list, but add a telnet GOAHEAD + at the end of the message when emitting to players; players whose + clients handle GOAHEAD (e.g. tf) will get the message displayed + as a prompt in the input window. Suggested by Trinsec@M*U*S*H. + * The PROMPT_NEWLINES socket command can be used to add a newline + after the GOAHEAD in a prompt, for clients that mix up prompt + lines with other output. + Functions: + * namegrab() and namegraball(). Patch by Walker@M*U*S*H. + * prompt() and nsprompt() (the function equivalents of @prompt/@nsprompt). + * textentries(). Suggested by Trinsec@M*U*S*H. + * cdesc(), cusers(), cmsgs(), cbuffer(), cstatus(), clflags() + functions. Suggested by d'Ark@M*U*S*H. + * numversion() returns Penn version as an integer (1008001004) + for softcode use. + Minor changes: + * @chan/list works better for people who increase CHAN_NAME_LEN. + Suggested by Trinsec@M*U*S*H. + * Help fixes by Trinsec@M*U*S*H, Chili@M*U*S*H. + * Several powers (tport_anything, tport_anywhere, no_money, no_quota, + debit, sql_ok) are now aliased to TinyMUSH/TinyMUX equivalents + as well, for better code portability. [3,MUX] + Fixes: + * center() behaves better when given a fourth argument but + not a third one. Also fixes to cases where the right fill + string is one longer than the left. Report by Ian@M*U*S*H + * Fixes from 1.8.0p9. + + + & 1.8.1p3 Version 1.8.1 patchlevel 3 September 15, 2005 Fixes *** 1_8_1.151/CHANGES.181 Thu, 15 Sep 2005 18:27:55 -0500 dunemush (pennmush/h/30_CHANGES.18 1.50 600) --- 1_8_1.192(w)/CHANGES.181 Mon, 12 Dec 2005 12:22:25 -0600 dunemush (pennmush/h/30_CHANGES.18 1.64 600) *************** *** 13,18 **** --- 13,59 ---- ========================================================================== + Version 1.8.1 patchlevel 4 December 6, 2005 + + Major Changes: + * Errors in matching switches to commands are ignored when the + command is hook/ignored or hook/overriden, so you can override + a built-in command and provide your own switches. Suggested by + Trinsec@M*U*S*H. + Mail: + * @mailfilter attribute causes incoming mail to be be automatically + filed to a folder if it evaluates to a folder name/number. + Patch by Sketch@M*U*S*H. + Commands: + * @prompt/@nsprompt work like @pemit/list, but add a telnet GOAHEAD + at the end of the message when emitting to players; players whose + clients handle GOAHEAD (e.g. tf) will get the message displayed + as a prompt in the input window. Suggested by Trinsec@M*U*S*H. + * The PROMPT_NEWLINES socket command can be used to add a newline + after the GOAHEAD in a prompt, for clients that mix up prompt + lines with other output. + Functions: + * namegrab() and namegraball(). Patch by Walker@M*U*S*H. + * prompt() and nsprompt() (the function equivalents of @prompt/@nsprompt). + * textentries(). Suggested by Trinsec@M*U*S*H. + * cdesc(), cusers(), cmsgs(), cbuffer(), cstatus(), clflags() + functions. Suggested by d'Ark@M*U*S*H. + * numversion() returns Penn version as an integer (1008001004) + for softcode use. + Minor changes: + * @chan/list works better for people who increase CHAN_NAME_LEN. + Suggested by Trinsec@M*U*S*H. + * Help fixes by Trinsec@M*U*S*H, Chili@M*U*S*H. + * Several powers (tport_anything, tport_anywhere, no_money, no_quota, + debit, sql_ok) are now aliased to TinyMUSH/TinyMUX equivalents + as well, for better code portability. [3,MUX] + Fixes: + * center() behaves better when given a fourth argument but + not a third one. Also fixes to cases where the right fill + string is one longer than the left. Report by Ian@M*U*S*H + * Fixes from 1.8.0p9. + + Version 1.8.1 patchlevel 3 September 15, 2005 Fixes *** 1_8_1.151/src/myrlimit.c Mon, 12 Dec 2005 12:26:14 -0600 dunemush () --- 1_8_1.192(w)/src/myrlimit.c Mon, 12 Dec 2005 12:26:11 -0600 dunemush (pennmush/h/41_myrlimit.c 1.2 660) *************** *** 0 **** --- 1,120 ---- + /** + * \file myrlimit.c + * + * \brief Resource limit utilities + * + * This file provides routines for modifying system resource limits + * with getrlimit/setrlimit, and similar stuff. + * + */ + + #include "copyrite.h" + #include "config.h" + + #include + #include + #ifdef I_SYS_TYPES + #include + #endif + #ifdef I_UNISTD + #include + #endif + #ifdef HAS_GETRLIMIT + #include + #endif + #include + #include + + #include "conf.h" + #include "version.h" + #include "confmagic.h" + + #ifdef HAS_GETRLIMIT + void init_rlimit(void); + #endif + int how_many_fds(void); + + #ifdef HAS_GETRLIMIT + void + init_rlimit(void) + { + /* Unlimit file descriptors. */ + /* Ultrix 4.4 and others may have getrlimit but may not be able to + * change number of file descriptors + */ + #ifdef RLIMIT_NOFILE + struct rlimit *rlp; + + rlp = (struct rlimit *) malloc(sizeof(struct rlimit)); + if (getrlimit(RLIMIT_NOFILE, rlp)) { + perror("init_rlimit: getrlimit()"); + free(rlp); + return; + } + /* This check seems dumb, but apparently FreeBSD may return 0 for + * the max # of descriptors! + */ + if (rlp->rlim_max > rlp->rlim_cur) { + rlp->rlim_cur = rlp->rlim_max; + if (setrlimit(RLIMIT_NOFILE, rlp)) + perror("init_rlimit: setrlimit()"); + } + free(rlp); + #endif + return; + } + #endif /* HAS_GETRLIMIT */ + + int + how_many_fds(void) + { + /* Determine how many open file descriptors we're allowed + * In order, we'll try: + * 1. sysconf(_SC_OPEN_MAX) - POSIX.1 + * 2. OPEN_MAX constant - POSIX.1 limits.h + * 3. getdtablesize - BSD (which Config maps to ulimit or NOFILE if needed) + */ + static int open_max = 0; + #ifdef WIN32 + int iMaxSocketsAllowed; + #endif + if (open_max) + return open_max; + #ifdef WIN32 + /* Typically, WIN32 allows many open sockets, but won't perform + * well if too many are used. The best approach is to give the + * admin a single point of control (MAX_LOGINS in MUSH.CNF) and then + * allow a few more connections than that here for clients to get access + * to an E-mail address or at least a title. 2 is an arbitrary number. + * + * If max_logins is set to 0 in mush.cnf (unlimited logins), + * we'll allocate 120 sockets for now. + * + * wsadata.iMaxSockets isn't valid for WinSock versions 2.0 + * and later, but we are requesting version 1.1, so it's valid. + */ + iMaxSocketsAllowed = options.max_logins ? (2 * options.max_logins) : 120; + if (wsadata.iMaxSockets < iMaxSocketsAllowed) + iMaxSocketsAllowed = wsadata.iMaxSockets; + return iMaxSocketsAllowed; + #else + #ifdef HAS_SYSCONF + errno = 0; + if ((open_max = sysconf(_SC_OPEN_MAX)) < 0) { + if (errno == 0) /* Value was indeterminate */ + open_max = 0; + } + if (open_max) + return open_max; + #endif + #ifdef OPEN_MAX + open_max = OPEN_MAX; + return open_max; + #endif + /* Caching getdtablesize is dangerous, since it's affected by + * getrlimit, so we don't. + */ + open_max = 0; + return getdtablesize(); + #endif /* WIN 32 */ + }