This is patch37 to PennMUSH 1.7.7. After applying this patch, you will have version 1.7.7p37 To apply this patch, save it to a file in your top-level MUSH directory, and do the following: patch -p1 < 1.7.7-patch37 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: * @adisconnect is triggered on every disconnection, partial or full. This mirrors the behavior of @aconnect. Use %1 (the number of remaining connections) to distinguish between partial and full disconnects in @adisconnect code. Minor changes (user-visible): * When a player disconnects, their recv(), sent(), and cmds() values are passed to triggered @adisconnects as %2, %3, and %4. The number of remaining connections is passed as %1. Suggested by Jessica Hawthorne and Wayne@PDX. * No_Pay players now have their money reported as unlimited by examine and score (but money() still returns a useful integer value). ex/debug can be used to see the object's Pennies field. Suggested by Wayne@PDX. Fixes: * ex obj/*1 and similar was matching like ex obj/*1*. Reported by Math@HavenMUSH. * inc() and dec() with out-of-range integers now return a more useful error instead of odd behavior. Suggested by Jessica Hawthorne. * Win32 bug with renamed temporary database files resolved. Reported by AndromedaMU. * Help fixes by Mike Griffiths. * @mail commands with no message list were not using current folder. Report by Jessica Hawthorne. Prereq: 1.7.7p36 *** 1_7_7.1170/Patchlevel Mon, 09 Aug 2004 14:06:52 -0500 dunemush (pennmush/5_Patchlevel 1.17.1.11.1.38 600) --- 1_7_7.1191(w)/Patchlevel Mon, 23 Aug 2004 15:26:53 -0500 dunemush (pennmush/5_Patchlevel 1.17.1.11.1.39 600) *************** *** 1,2 **** Do not edit this file. It is maintained by the official PennMUSH patches. ! This is PennMUSH 1.7.7p36 --- 1,2 ---- Do not edit this file. It is maintained by the official PennMUSH patches. ! This is PennMUSH 1.7.7p37 *** 1_7_7.1170/CHANGES.177 Thu, 12 Aug 2004 12:25:12 -0500 dunemush (pennmush/g/23_CHANGES 1.48.1.258.1.14.1.174 600) --- 1_7_7.1191(w)/CHANGES.177 Mon, 23 Aug 2004 15:27:37 -0500 dunemush (pennmush/g/23_CHANGES 1.48.1.258.1.14.1.187 600) *************** *** 18,23 **** --- 18,50 ---- ========================================================================== + Version 1.7.7 patchlevel 37 August 23, 2004 + + Major changes: + * @adisconnect is triggered on every disconnection, partial or full. + This mirrors the behavior of @aconnect. Use %1 (the number of + remaining connections) to distinguish between partial and full + disconnects in @adisconnect code. + Minor changes (user-visible): + * When a player disconnects, their recv(), sent(), and cmds() + values are passed to triggered @adisconnects as %2, %3, and %4. + The number of remaining connections is passed as %1. + Suggested by Jessica Hawthorne and Wayne@PDX. + * No_Pay players now have their money reported as unlimited by + examine and score (but money() still returns a useful integer value). + ex/debug can be used to see the object's Pennies field. + Suggested by Wayne@PDX. + Fixes: + * ex obj/*1 and similar was matching like ex obj/*1*. Reported by + Math@HavenMUSH. + * inc() and dec() with out-of-range integers now return a more + useful error instead of odd behavior. Suggested by Jessica Hawthorne. + * Win32 bug with renamed temporary database files resolved. + Reported by AndromedaMU. + * Help fixes by Mike Griffiths. + * @mail commands with no message list were not using current folder. + Report by Jessica Hawthorne. + Version 1.7.7 patchlevel 36 August 9, 2004 Functions: *** 1_7_7.1170/game/txt/hlp/penntop.hlp Mon, 07 Jun 2004 15:48:54 -0500 dunemush (pennmush/13_penntop.hl 1.2.1.27.1.3.1.2.1.2.1.1.1.1.1.1.1.1.1.12.1.1.1.1.1.8.1.11 600) --- 1_7_7.1191(w)/game/txt/hlp/penntop.hlp Mon, 23 Aug 2004 15:39:44 -0500 dunemush (pennmush/13_penntop.hl 1.2.1.27.1.3.1.2.1.2.1.1.1.1.1.1.1.1.1.12.1.1.1.1.1.8.1.11.1.1.1.1 600) *************** *** 744,750 **** LAST and LASTLOGOUT These attributes show the last times you connected and disconnected from ! the MUSH. & LASTSITE & LASTIP LASTSITE and LASTIP --- 744,750 ---- LAST and LASTLOGOUT These attributes show the last times you connected and disconnected from ! the MUSH. & LASTSITE & LASTIP LASTSITE and LASTIP *** 1_7_7.1170/game/txt/hlp/penncmd.hlp Thu, 12 Aug 2004 12:07:04 -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.41 600) --- 1_7_7.1191(w)/game/txt/hlp/penncmd.hlp Fri, 20 Aug 2004 21:01:20 -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.43 600) *************** *** 188,194 **** when a player disconnects in that location or zone (or, in the case of the master room, anywhere). ! See also: @aconnect, ACTION LISTS & @adrop @adrop = --- 188,200 ---- when a player disconnects in that location or zone (or, in the case of the master room, anywhere). ! Several descriptor variables are passed to @adisconnect: ! %1 = number of remaining connections (0 if a full disconnect) ! %2 = bytes received by the disconnecting descriptor ! %3 = bytes sent by the disconnecting descriptor ! %4 = commands issued by the disconnecting descriptor ! ! See also: @aconnect, ACTION LISTS, recv(), sent(), cmds() & @adrop @adrop = *************** *** 3287,3293 **** See also: use, @ouse, @ause, @charges, @runout & @uunlock ! @uunlock = Un-use-locks the object. See also: @lock, @ulock & @version --- 3293,3299 ---- See also: use, @ouse, @ause, @charges, @runout & @uunlock ! @uunlock Un-use-locks the object. See also: @lock, @ulock & @version *** 1_7_7.1170/game/txt/hlp/pennchat.hlp Wed, 30 Jun 2004 21:05:30 -0500 dunemush (pennmush/19_pennchat.h 1.2.1.4.1.8 600) --- 1_7_7.1191(w)/game/txt/hlp/pennchat.hlp Thu, 19 Aug 2004 13:50:15 -0500 dunemush (pennmush/19_pennchat.h 1.2.1.4.1.9 600) *************** *** 152,159 **** @channel/decompile[/brief] @channel/chown = ! The "priv" switch changes the channel's access privileges. Use ! ! to reset a privilege. The "wipe" switch clears a channel of players without deleting it. The "buffer" switch sets the maximum number of full-length lines that the channel will buffer for @chan/recall. Many more shorter lines may --- 152,158 ---- @channel/decompile[/brief] @channel/chown = ! The "priv" switch sets the channel's access privileges to those specified. The "wipe" switch clears a channel of players without deleting it. The "buffer" switch sets the maximum number of full-length lines that the channel will buffer for @chan/recall. Many more shorter lines may *** 1_7_7.1170/src/wiz.c Mon, 09 Aug 2004 14:06:52 -0500 dunemush (pennmush/b/23_wiz.c 1.44.1.1.1.1.1.2.1.7.1.1.1.1.1.1.1.1.1.1.1.8.1.2.2.2.1.2.1.1.1.1.1.1.1.2.1.1.1.2.2.17.1.9.1.30.1.2 660) --- 1_7_7.1191(w)/src/wiz.c Mon, 23 Aug 2004 18:33:03 -0500 dunemush (pennmush/b/23_wiz.c 1.44.1.1.1.1.1.2.1.7.1.1.1.1.1.1.1.1.1.1.1.8.1.2.2.2.1.2.1.1.1.1.1.1.1.2.1.1.1.2.2.17.1.9.1.30.1.3 660) *************** *** 999,1004 **** --- 999,1005 ---- notify_format(player, "Next: %d", Next(thing)); notify_format(player, "Contents: %d", Contents(thing)); + notify_format(player, "Pennies: %d", Pennies(thing)); switch (Typeof(thing)) { case TYPE_PLAYER: *** 1_7_7.1170/src/wild.c Wed, 30 Jun 2004 15:00:16 -0500 dunemush (pennmush/b/24_wild.c 1.11.1.1.1.8.1.1.1.4.1.2.1.8 660) --- 1_7_7.1191(w)/src/wild.c Mon, 23 Aug 2004 18:33:03 -0500 dunemush (pennmush/b/24_wild.c 1.11.1.1.1.8.1.1.1.4.1.2.1.9 660) *************** *** 246,253 **** /* Scan for possible matches. */ while (*dstr) { ! if (EQUAL(0, *dstr, *tstr) && atr_wild(tstr + 1, dstr + 1)) ! return 1; if (starcount < 2 && *dstr == '`') return 0; dstr++; --- 246,257 ---- /* Scan for possible matches. */ while (*dstr) { ! if (EQUAL(0, *dstr, *tstr)) { ! if (!*(tstr + 1) && *(dstr + 1)) ! return 0; /* No more in pattern string, but more in target */ ! if (atr_wild(tstr + 1, dstr + 1)) ! return 1; ! } if (starcount < 2 && *dstr == '`') return 0; dstr++; *** 1_7_7.1170/src/look.c Sat, 17 Jul 2004 20:49:33 -0500 dunemush (pennmush/c/4_look.c 1.21.1.2.1.9.1.1.1.1.1.38 660) --- 1_7_7.1191(w)/src/look.c Mon, 23 Aug 2004 18:33:03 -0500 dunemush (pennmush/c/4_look.c 1.21.1.2.1.9.1.1.1.1.1.41 660) *************** *** 804,813 **** if (ok) { char tbuf1[BUFFER_LEN]; strcpy(tbuf1, object_header(player, Zone(thing))); ! notify_format(player, ! T("Owner: %s Zone: %s %s: %d"), ! object_header(player, Owner(thing)), ! tbuf1, MONIES, Pennies(thing)); notify_format(player, T("Parent: %s"), parent_chain(player, thing)); { struct lock_list *ll; --- 804,818 ---- if (ok) { char tbuf1[BUFFER_LEN]; strcpy(tbuf1, object_header(player, Zone(thing))); ! if (Moneybags(player)) ! notify_format(player, ! T("Owner: %s Zone: %s %s: Unlimited"), ! object_header(player, Owner(thing)), tbuf1, MONIES); ! else ! notify_format(player, ! T("Owner: %s Zone: %s %s: %d"), ! object_header(player, Owner(thing)), ! tbuf1, MONIES, Pennies(thing)); notify_format(player, T("Parent: %s"), parent_chain(player, thing)); { struct lock_list *ll; *************** *** 947,956 **** void do_score(dbref player) { ! ! notify_format(player, ! T("You have %d %s."), ! Pennies(player), Pennies(player) == 1 ? MONEY : MONIES); } /** The inventory command. --- 952,963 ---- void do_score(dbref player) { ! if (Moneybags(player)) ! notify_format(player, T("You have unlimited %s."), MONIES); ! else ! notify_format(player, ! T("You have %d %s."), ! Pennies(player), Pennies(player) == 1 ? MONEY : MONIES); } /** The inventory command. *** 1_7_7.1170/src/funmath.c Wed, 09 Jun 2004 20:58:57 -0500 dunemush (pennmush/c/15_funmath.c 1.39.1.1.1.1.1.1.1.10.1.11 660) --- 1_7_7.1191(w)/src/funmath.c Mon, 23 Aug 2004 18:33:02 -0500 dunemush (pennmush/c/15_funmath.c 1.39.1.1.1.1.1.1.1.10.1.12 660) *************** *** 259,267 **** } p--; } ! /* p now points to the last non-numeric character in the string ! * Move it to the first numeric character ! */ p++; num = parse_integer(p) + 1; *p = '\0'; --- 259,272 ---- } p--; } ! /* p now points to the last non-numeric character in the string */ ! if (p == args[0] && (isdigit((unsigned char) *p) || (*p == '-'))) { ! /* Special case - it's all digits, but out of range. */ ! safe_str(T(e_range), buff, bp); ! return; ! } ! ! /* Move it to the first numeric character */ p++; num = parse_integer(p) + 1; *p = '\0'; *************** *** 301,309 **** } p--; } ! /* p now points to the last non-numeric character in the string ! * Move it to the first numeric character ! */ p++; num = parse_integer(p) - 1; *p = '\0'; --- 306,318 ---- } p--; } ! /* p now points to the last non-numeric character in the string */ ! if (p == args[0] && (isdigit((unsigned char) *p) || (*p == '-'))) { ! /* Special case - it's all digits, but out of range. */ ! safe_str(T(e_range), buff, bp); ! return; ! } ! /* Move it to the first numeric character */ p++; num = parse_integer(p) - 1; *p = '\0'; *** 1_7_7.1170/src/filecopy.c Sun, 25 Jul 2004 06:48:24 -0500 dunemush (pennmush/c/21_filecopy.c 1.85 660) --- 1_7_7.1191(w)/src/filecopy.c Mon, 23 Aug 2004 18:33:02 -0500 dunemush (pennmush/c/21_filecopy.c 1.86 660) *************** *** 291,298 **** { /* Windows can't rename over an existing file */ #ifdef WIN32 ! if (unlink(newname) < 0) ! return -1; #endif return rename(origname, newname); } --- 291,297 ---- { /* Windows can't rename over an existing file */ #ifdef WIN32 ! unlink(newname); #endif return rename(origname, newname); } *** 1_7_7.1170/src/extmail.c Thu, 12 Aug 2004 12:57:29 -0500 dunemush (pennmush/c/22_extmail.c 1.44.1.7.1.5.1.9.1.1.1.1.1.22 660) --- 1_7_7.1191(w)/src/extmail.c Mon, 23 Aug 2004 18:33:02 -0500 dunemush (pennmush/c/22_extmail.c 1.44.1.7.1.5.1.9.1.1.1.1.1.27 660) *************** *** 385,391 **** } FA_Init(i, j); j = 0; ! folder = MSFolder(ms); for (mp = find_exact_starting_point(player); mp && (mp->to == player); mp = mp->next) { if ((mp->to == player) && (All(ms) || (Folder(mp) == folder))) { --- 385,391 ---- } FA_Init(i, j); j = 0; ! folder = AllInFolder(ms) ? player_folder(player) : MSFolder(ms); for (mp = find_exact_starting_point(player); mp && (mp->to == player); mp = mp->next) { if ((mp->to == player) && (All(ms) || (Folder(mp) == folder))) { *************** *** 471,477 **** } FA_Init(i, j); j = 0; ! origfold = MSFolder(ms); for (mp = find_exact_starting_point(player); mp && (mp->to == player); mp = mp->next) { if ((mp->to == player) && (All(ms) || (Folder(mp) == origfold))) { --- 471,477 ---- } FA_Init(i, j); j = 0; ! origfold = AllInFolder(ms) ? player_folder(player) : MSFolder(ms); for (mp = find_exact_starting_point(player); mp && (mp->to == player); mp = mp->next) { if ((mp->to == player) && (All(ms) || (Folder(mp) == origfold))) { *************** *** 521,527 **** if (!parse_msglist(msglist, &ms, player)) { return; } ! folder = MSFolder(ms); FA_Init(i, j); j = 0; for (mp = find_exact_starting_point(player); --- 521,527 ---- if (!parse_msglist(msglist, &ms, player)) { return; } ! folder = AllInFolder(ms) ? player_folder(player) : MSFolder(ms); FA_Init(i, j); j = 0; for (mp = find_exact_starting_point(player); *************** *** 594,600 **** } FA_Init(i, j); j = 0; ! folder = MSFolder(ms); if (SUPPORT_PUEBLO) notify_noenter(player, tprintf("%cSAMP%c", TAG_START, TAG_END)); notify_format(player, --- 594,600 ---- } FA_Init(i, j); j = 0; ! folder = AllInFolder(ms) ? player_folder(player) : MSFolder(ms); if (SUPPORT_PUEBLO) notify_noenter(player, tprintf("%cSAMP%c", TAG_START, TAG_END)); notify_format(player, *************** *** 743,749 **** notify(player, T("MAIL: To whom should I forward?")); return; } ! folder = MSFolder(ms); /* Mark the player's last message. This prevents a loop if * the forwarding command happens to forward a message back * to the player itself --- 743,749 ---- notify(player, T("MAIL: To whom should I forward?")); return; } ! folder = AllInFolder(ms) ? player_folder(player) : MSFolder(ms); /* Mark the player's last message. This prevents a loop if * the forwarding command happens to forward a message back * to the player itself *************** *** 2307,2317 **** return 0; if (ms.player && !was_sender(ms.player, mp)) return 0; - if (AllInFolder(ms) && (Folder(mp) == player_folder(player))) - return 1; mpflag = Read(mp) ? mp->read : (mp->read | M_MSUNREAD); if (!All(ms) && !(ms.flags & mpflag)) return 0; if (ms.days != -1) { /* Get the time now, subtract mp->time, and compare the results with * ms.days (in manner of ms.day_comp) */ --- 2307,2317 ---- return 0; if (ms.player && !was_sender(ms.player, mp)) return 0; mpflag = Read(mp) ? mp->read : (mp->read | M_MSUNREAD); if (!All(ms) && !(ms.flags & mpflag)) return 0; + if (AllInFolder(ms) && (Folder(mp) == player_folder(player))) + return 1; if (ms.days != -1) { /* Get the time now, subtract mp->time, and compare the results with * ms.days (in manner of ms.day_comp) */ *************** *** 2343,2349 **** ms->day_comp = 0; /* Now, parse the message list */ if (!msglist || !*msglist) { ! /* All messages */ return 1; } /* Don't mess with msglist itself */ --- 2343,2350 ---- ms->day_comp = 0; /* Now, parse the message list */ if (!msglist || !*msglist) { ! /* All messages in current folder */ ! ms->flags |= M_FOLDER; return 1; } /* Don't mess with msglist itself */ *************** *** 2440,2452 **** } else if (!strcasecmp(p, "folder")) { ms->flags = M_FOLDER; } else if (!strcasecmp(p, "urgent")) { ! ms->flags = M_URGENT; } else if (!strcasecmp(p, "unread")) { ! ms->flags = M_MSUNREAD; } else if (!strcasecmp(p, "read")) { ! ms->flags = M_MSGREAD; } else if (!strcasecmp(p, "clear") || !strcasecmp(p, "cleared")) { ! ms->flags = M_CLEARED; } else if (!strcasecmp(p, "tag") || !strcasecmp(p, "tagged")) { ms->flags = M_TAG; } else if (!strcasecmp(p, "mass")) { --- 2441,2453 ---- } else if (!strcasecmp(p, "folder")) { ms->flags = M_FOLDER; } else if (!strcasecmp(p, "urgent")) { ! ms->flags = M_URGENT | M_FOLDER; } else if (!strcasecmp(p, "unread")) { ! ms->flags = M_MSUNREAD | M_FOLDER; } else if (!strcasecmp(p, "read")) { ! ms->flags = M_MSGREAD | M_FOLDER; } else if (!strcasecmp(p, "clear") || !strcasecmp(p, "cleared")) { ! ms->flags = M_CLEARED | M_FOLDER; } else if (!strcasecmp(p, "tag") || !strcasecmp(p, "tagged")) { ms->flags = M_TAG; } else if (!strcasecmp(p, "mass")) { *** 1_7_7.1170/src/bsd.c Tue, 06 Jul 2004 22:10:33 -0500 dunemush (pennmush/c/38_bsd.c 1.58.1.11.1.2.1.5.1.7.1.14.1.13.1.9.1.4.1.2.1.12.1.1.1.1.1.2.1.1.1.13.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.8.2.1.1.1.1.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.9.1.1.1.48 660) --- 1_7_7.1191(w)/src/bsd.c Mon, 23 Aug 2004 18:33:02 -0500 dunemush (pennmush/c/38_bsd.c 1.58.1.11.1.2.1.5.1.7.1.14.1.13.1.9.1.4.1.2.1.12.1.1.1.1.1.2.1.1.1.13.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.8.2.1.1.1.1.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.9.1.1.1.48.1.1.1.7 660) *************** *** 417,423 **** static const char *time_format_1(long int dt); static const char *time_format_2(long int dt); static void announce_connect(dbref player, int isnew, int num); ! static void announce_disconnect(dbref player); void inactivity_check(void); #ifdef INFO_SLAVE static void make_info_slave(void); --- 417,423 ---- static const char *time_format_1(long int dt); static const char *time_format_2(long int dt); static void announce_connect(dbref player, int isnew, int num); ! static void announce_disconnect(DESC *saved); void inactivity_check(void); #ifdef INFO_SLAVE static void make_info_slave(void); *************** *** 1492,1498 **** do_log(LT_CONN, 0, 0, T("[%d/%s/%s] Logout by %s(#%d) "), d->descriptor, d->addr, d->ip, Name(d->player), d->player); ! announce_disconnect(d->player); do_mail_purge(d->player); login_number--; if (MAX_LOGINS) { --- 1492,1498 ---- do_log(LT_CONN, 0, 0, T("[%d/%s/%s] Logout by %s(#%d) "), d->descriptor, d->addr, d->ip, Name(d->player), d->player); ! announce_disconnect(d); do_mail_purge(d->player); login_number--; if (MAX_LOGINS) { *************** *** 1554,1560 **** if (d->connected != 2) { fcache_dump(d, fcache.quit_fcache, NULL); /* Player was not allowed to log in from the connect screen */ ! announce_disconnect(d->player); do_mail_purge(d->player); } login_number--; --- 1554,1560 ---- if (d->connected != 2) { fcache_dump(d, fcache.quit_fcache, NULL); /* Player was not allowed to log in from the connect screen */ ! announce_disconnect(d); do_mail_purge(d->player); } login_number--; *************** *** 3720,3726 **** } static void ! announce_disconnect(dbref player) { dbref loc; int num; --- 3720,3726 ---- } static void ! announce_disconnect(DESC *saved) { dbref loc; int num; *************** *** 3728,3734 **** --- 3728,3737 ---- char tbuf1[BUFFER_LEN]; dbref zone, obj; int j; + char *myenv[5]; + dbref player; + player = saved->player; loc = Location(player); if (!GoodObject(loc)) return; *************** *** 3738,3804 **** for (num = 0, d = descriptor_list; d; d = d->next) if (d->connected && (d->player == player)) num++; - if (num < 2) { - sprintf(tbuf1, T("%s has disconnected."), Name(player)); - if (ANNOUNCE_CONNECTS) { - if (!Dark(player)) - notify_except(Contents(loc), player, tbuf1, NA_INTER_PRESENCE); - /* notify contents */ - notify_except(Contents(player), player, tbuf1, 0); - } - - /* clear the environment for possible actions */ - for (j = 0; j < 10; j++) - global_eval_context.wnxt[j] = NULL; - for (j = 0; j < NUMQ; j++) - global_eval_context.rnxt[j] = NULL; - - (void) queue_attribute(player, "ADISCONNECT", player); - if (ROOM_CONNECTS) - if (IsRoom(loc) || IsThing(loc)) { - (void) queue_attribute(loc, "ADISCONNECT", player); - } - /* do the zone of the player's location's possible adisconnect */ - if ((zone = Zone(loc)) != NOTHING) { - switch (Typeof(zone)) { - case TYPE_THING: - (void) queue_attribute(zone, "ADISCONNECT", player); - break; - case TYPE_ROOM: - /* check every object in the room for a connect action */ - DOLIST(obj, Contents(zone)) { - (void) queue_attribute(obj, "ADISCONNECT", player); - } - break; - default: - do_log(LT_ERR, 0, 0, - T("Invalid zone #%d for %s(#%d) has bad type %d"), zone, - Name(player), player, Typeof(zone)); - } - } - /* now try the master room */ - DOLIST(obj, Contents(MASTER_ROOM)) { - (void) queue_attribute(obj, "ADISCONNECT", player); - } - clear_flag_internal(player, "CONNECTED"); - (void) atr_add(player, "LASTLOGOUT", show_time(mudtime, 0), GOD, NOTHING); - } else { - /* note: when you partially disconnect, ADISCONNECTS are not executed */ - sprintf(tbuf1, T("%s has partially disconnected."), Name(player)); ! if (ANNOUNCE_CONNECTS) { ! if (!Dark(player)) ! notify_except(Contents(loc), player, tbuf1, NA_INTER_PRESENCE); ! /* notify contents */ ! notify_except(Contents(player), player, tbuf1, 0); } } ! if (ANNOUNCE_CONNECTS) ! chat_player_announce(player, tbuf1, 0); - /* Monitor broadcasts */ /* Redundant, but better for translators */ if (Dark(player)) { sprintf(tbuf1, (num < 2) ? T("%s has DARK-disconnected.") : --- 3741,3814 ---- for (num = 0, d = descriptor_list; d; d = d->next) if (d->connected && (d->player == player)) num++; ! /* clear the environment for possible actions */ ! for (j = 0; j < 10; j++) ! global_eval_context.wnxt[j] = NULL; ! for (j = 0; j < NUMQ; j++) ! global_eval_context.rnxt[j] = NULL; ! /* And then load it up, as follows: ! * %0 (unused, reserved for "reason for disconnect") ! * %1 (number of connections remaining after disconnect) ! * %2 (bytes received) ! * %3 (bytes sent) ! * %4 (commands queued) ! */ ! myenv[0] = NULL; ! myenv[1] = mush_strdup(unparse_integer(num - 1), "myenv"); ! myenv[2] = mush_strdup(unparse_integer(saved->input_chars), "myenv"); ! myenv[3] = mush_strdup(unparse_integer(saved->output_chars), "myenv"); ! myenv[4] = mush_strdup(unparse_integer(saved->cmds), "myenv"); ! for (j = 0; j < 5; j++) ! global_eval_context.wnxt[j] = myenv[j]; ! ! (void) queue_attribute(player, "ADISCONNECT", player); ! if (ROOM_CONNECTS) ! if (IsRoom(loc) || IsThing(loc)) { ! if (!Priv_Who(loc) && !Can_Examine(loc, player)) ! global_eval_context.wnxt[1] = NULL; ! (void) queue_attribute(loc, "ADISCONNECT", player); ! global_eval_context.wnxt[1] = myenv[1]; ! } ! /* do the zone of the player's location's possible adisconnect */ ! if ((zone = Zone(loc)) != NOTHING) { ! switch (Typeof(zone)) { ! case TYPE_THING: ! if (!Priv_Who(zone) && !Can_Examine(zone, player)) ! global_eval_context.wnxt[1] = NULL; ! (void) queue_attribute(zone, "ADISCONNECT", player); ! global_eval_context.wnxt[1] = myenv[1]; ! break; ! case TYPE_ROOM: ! /* check every object in the room for a connect action */ ! DOLIST(obj, Contents(zone)) { ! if (!Priv_Who(obj) && !Can_Examine(obj, player)) ! global_eval_context.wnxt[1] = NULL; ! (void) queue_attribute(obj, "ADISCONNECT", player); ! global_eval_context.wnxt[1] = myenv[1]; ! } ! break; ! default: ! do_log(LT_ERR, 0, 0, ! T("Invalid zone #%d for %s(#%d) has bad type %d"), zone, ! Name(player), player, Typeof(zone)); } } + /* now try the master room */ + DOLIST(obj, Contents(MASTER_ROOM)) { + if (!Priv_Who(obj) && !Can_Examine(obj, player)) + global_eval_context.wnxt[1] = NULL; + (void) queue_attribute(obj, "ADISCONNECT", player); + global_eval_context.wnxt[1] = myenv[1]; + } ! for (j = 0; j < 5; j++) ! if (myenv[j]) ! mush_free(myenv[j], "myenv"); ! for (j = 0; j < 10; j++) ! global_eval_context.wnxt[j] = NULL; /* Redundant, but better for translators */ if (Dark(player)) { sprintf(tbuf1, (num < 2) ? T("%s has DARK-disconnected.") : *************** *** 3810,3821 **** --- 3820,3847 ---- sprintf(tbuf1, (num < 2) ? T("%s has disconnected.") : T("%s has partially disconnected."), Name(player)); } + + if (ANNOUNCE_CONNECTS) { + if (!Dark(player)) + notify_except(Contents(loc), player, tbuf1, NA_INTER_PRESENCE); + /* notify contents */ + notify_except(Contents(player), player, tbuf1, 0); + /* notify channels */ + chat_player_announce(player, tbuf1, 0); + } + + /* Monitor broadcasts */ if (Suspect(player)) flag_broadcast("WIZARD", 0, T("GAME: Suspect %s"), tbuf1); if (Dark(player)) { flag_broadcast("ROYALTY WIZARD", "MONITOR", "%s %s", T("GAME:"), tbuf1); } else flag_broadcast(0, "MONITOR", "%s %s", T("GAME:"), tbuf1); + + if (num < 2) { + clear_flag_internal(player, "CONNECTED"); + (void) atr_add(player, "LASTLOGOUT", show_time(mudtime, 0), GOD, NOTHING); + } local_disconnect(player, num); } *************** *** 4979,4985 **** /* Now announce disconnects of everyone who's not really here */ while (closed) { nextclosed = closed->next; ! announce_disconnect(closed->player); mush_free(closed, "descriptor"); closed = nextclosed; } --- 5005,5011 ---- /* Now announce disconnects of everyone who's not really here */ while (closed) { nextclosed = closed->next; ! announce_disconnect(closed); mush_free(closed, "descriptor"); closed = nextclosed; } *** 1_7_7.1170/hdrs/version.h Mon, 09 Aug 2004 14:06:52 -0500 dunemush (pennmush/c/47_version.h 1.32.1.2.1.7.1.9.1.1.1.17.1.40 660) --- 1_7_7.1191(w)/hdrs/version.h Mon, 23 Aug 2004 18:33:03 -0500 dunemush (pennmush/c/47_version.h 1.32.1.2.1.7.1.9.1.1.1.17.1.41 660) *************** *** 1,4 **** #define VERSION "1.7.7" ! #define PATCHLEVEL "36" ! #define PATCHDATE "[08/09/2004]" ! #define NUMVERSION 001007007036 --- 1,4 ---- #define VERSION "1.7.7" ! #define PATCHLEVEL "37" ! #define PATCHDATE "[08/23/2004]" ! #define NUMVERSION 001007007037 *** 1_7_7.1170/game/txt/hlp/pennvOLD.hlp Wed, 04 Aug 2004 19:43:51 -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.1 660) --- 1_7_7.1191(w)/game/txt/hlp/pennvOLD.hlp Mon, 23 Aug 2004 18:33:03 -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 660) *************** *** 4419,4425 **** 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 1.7.6: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 1.7.5: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 1.7.4: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, --- 4419,4425 ---- 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 1.7.6: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 1.7.5: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 1.7.4: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, *** 1_7_7.1170/game/txt/hlp/pennv177.hlp Thu, 12 Aug 2004 12:25:12 -0500 dunemush (pennmush/g/34_pennv177.h 1.226.1.14.1.174 660) --- 1_7_7.1191(w)/game/txt/hlp/pennv177.hlp Mon, 23 Aug 2004 18:33:03 -0500 dunemush (pennmush/g/34_pennv177.h 1.226.1.14.1.187 660) *************** *** 1,4 **** ! & 1.7.7p36 & changes This is a list of changes in this patchlevel which are probably of interest to players. More information about new commands and functions --- 1,4 ---- ! & 1.7.7p37 & 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,44 ---- A list of the patchlevels associated with each release can be read in 'help patchlevels'. + Version 1.7.7 patchlevel 37 August 23, 2004 + + Major changes: + * @adisconnect is triggered on every disconnection, partial or full. + This mirrors the behavior of @aconnect. Use %1 (the number of + remaining connections) to distinguish between partial and full + disconnects in @adisconnect code. + Minor changes (user-visible): + * When a player disconnects, their recv(), sent(), and cmds() + values are passed to triggered @adisconnects as %2, %3, and %4. + The number of remaining connections is passed as %1. + Suggested by Jessica Hawthorne and Wayne@PDX. + * No_Pay players now have their money reported as unlimited by + examine and score (but money() still returns a useful integer value). + ex/debug can be used to see the object's Pennies field. + Suggested by Wayne@PDX. + Fixes: + * ex obj/*1 and similar was matching like ex obj/*1*. Reported by + Math@HavenMUSH. + * inc() and dec() with out-of-range integers now return a more + useful error instead of odd behavior. Suggested by Jessica Hawthorne. + * Win32 bug with renamed temporary database files resolved. + Reported by AndromedaMU. + * Help fixes by Mike Griffiths. + * @mail commands with no message list were not using current folder. + Report by Jessica Hawthorne. + + & 1.7.7p36 Version 1.7.7 patchlevel 36 August 9, 2004 Functions: