diff -pruN slashem-0.0.7E7/include/config.h slashem/include/config.h --- slashem-0.0.7E7/include/config.h 2005-02-19 11:13:50.000000000 +0100 +++ slashem/include/config.h 2005-04-13 11:04:21.000000000 +0200 @@ -199,10 +199,10 @@ #ifndef WIZARD /* allow for compile-time or Makefile changes */ # ifndef KR1ED -# define WIZARD "wizard" /* the person allowed to use the -D option */ +# define WIZARD "blindcoder" /* the person allowed to use the -D option */ # else # define WIZARD -# define WIZARD_NAME "wizard" +# define WIZARD_NAME "blindcoder" # endif #endif @@ -227,8 +227,8 @@ #ifdef UNIX /* path and file name extension for compression program */ -# define COMPRESS "/usr/bin/compress" /* Lempel-Ziv compression */ -# define COMPRESS_EXTENSION ".Z" /* compress's extension */ +//# define COMPRESS "/usr/bin/compress" /* Lempel-Ziv compression */ +//# define COMPRESS_EXTENSION ".Z" /* compress's extension */ /* An example of one alternative you might want to use: */ /* # define COMPRESS "/usr/local/bin/gzip" */ /* FSF gzip compression */ @@ -246,7 +246,7 @@ * a tar-like file, thus making a neater installation. See *conf.h * for detailed configuration. */ -/* #define DLB */ /* not supported on all platforms */ +#define DLB /* not supported on all platforms */ /* * Defining INSURANCE slows down level changes, but allows games that @@ -367,7 +367,7 @@ typedef unsigned char uchar; * functions that have been macroized. */ /* WAC Can be defined under DJGPP, even though it's DOS*/ -/*#define VISION_TABLES */ /* use vision tables generated at compile time */ +#define VISION_TABLES /* use vision tables generated at compile time */ #ifndef VISION_TABLES # ifndef NO_MACRO_CPATH # define MACRO_CPATH /* use clear_path macros instead of functions */ @@ -388,7 +388,7 @@ typedef unsigned char uchar; /* dungeon levels */ #define WALLIFIED_MAZE /* Fancy mazes - Jean-Christophe Collet */ -/* #define REINCARNATION */ /* Special Rogue-like levels */ +#define REINCARNATION /* Special Rogue-like levels */ #define BLACKMARKET /* Massimo Campostrini (campo@sunthpi3.difi.unipi.it) */ /* monsters & objects */ @@ -410,7 +410,7 @@ typedef unsigned char uchar; #define DWARF /* Dwarf Patch, Osku Salerma (osku@iki.fi) */ #define TOURIST /* Tourist players with cameras and Hawaiian shirts */ #define YEOMAN /* KMH -- Yeoman class */ -/* #define ZOUTHERN */ /* KMH -- Zoutherner class and its animals */ +#define ZOUTHERN /* KMH -- Zoutherner class and its animals */ /* I/O */ #define REDO /* support for redoing last command - DGK */ @@ -460,7 +460,7 @@ typedef unsigned char uchar; #endif #define EXP_ON_BOTL /* Show experience on bottom line */ -/* #define SCORE_ON_BOTL */ /* added by Gary Erickson (erickson@ucivax) */ +#define SCORE_ON_BOTL /* added by Gary Erickson (erickson@ucivax) */ /* #define BORG */ /* Works only under DOS */ /* #define KEEP_SAVE */ /* Keep savefiles after Restore (wac@intergate.bc.ca)*/ /* #define CHARON */ /* Charon's boat, enables Cerebus - not implemented */ @@ -484,7 +484,11 @@ typedef unsigned char uchar; */ /*#define GOLDOBJ */ /* Gold is kept on obj chains - Helge Hafting */ -/*#define AUTOPICKUP_EXCEPTIONS */ /* exceptions to autopickup */ +#define AUTOPICKUP_EXCEPTIONS /* exceptions to autopickup */ +#define HPMON +#define DUMP_LOG +#define DUMP_FN "/usr/games/lib/dgamelaunch/dump/%%n/%%n.%%t.txt" +#define SIMPLE_MAIL /* End of Section 5 */ diff -pruN slashem-0.0.7E7/include/decl.h slashem/include/decl.h --- slashem-0.0.7E7/include/decl.h 2005-04-18 10:12:00.555721880 +0200 +++ slashem/include/decl.h 2005-04-13 10:44:22.000000000 +0200 @@ -484,6 +484,10 @@ struct autopickup_exception { }; #endif /* AUTOPICKUP_EXCEPTIONS */ +#ifdef SIMPLE_MAIL +E int mailckfreq; +#endif + #undef E #endif /* DECL_H */ diff -pruN slashem-0.0.7E7/include/flag.h slashem/include/flag.h --- slashem-0.0.7E7/include/flag.h 2005-02-19 11:13:50.000000000 +0100 +++ slashem/include/flag.h 2005-04-13 10:44:22.000000000 +0200 @@ -193,6 +193,9 @@ struct instance_flags { uchar bouldersym; /* symbol for boulder display */ boolean travel1; /* first travel step */ coord travelcc; /* coordinates for travel_cache */ +#ifdef SIMPLE_MAIL + boolean simplemail; /* simple mail format $NAME:$MESSAGE */ +#endif #ifdef WIZARD boolean sanity_check; /* run sanity checks */ boolean mon_polycontrol; /* debug: control monster polymorphs */ diff -pruN slashem-0.0.7E7/src/mail.c slashem/src/mail.c --- slashem-0.0.7E7/src/mail.c 2005-02-19 11:13:50.000000000 +0100 +++ slashem/src/mail.c 2005-04-13 10:46:22.000000000 +0200 @@ -5,6 +5,8 @@ #include "hack.h" #ifdef MAIL +#include +#include #include "mail.h" /* @@ -36,6 +38,8 @@ STATIC_DCL boolean FDECL(md_stop,(coord STATIC_DCL boolean FDECL(md_rush,(struct monst *,int,int)); STATIC_DCL void FDECL(newmail, (struct mail_info *)); +int mailckfreq = 0; + extern char *viz_rmin, *viz_rmax; /* line-of-sight limits (vision.c) */ #ifdef OVL0 @@ -460,11 +464,15 @@ struct obj *otmp; void ckmailstatus() { +#ifdef SIMPLE_MAIL + if (mailckfreq == 0) + mailckfreq = (iflags.simplemail ? 5 : 10); +#else + mailckfreq = 10; +#endif + if(!mailbox || u.uswallow || !flags.biff -# ifdef MAILCKFREQ - || moves < laststattime + MAILCKFREQ -# endif - ) + || moves < laststattime + mailckfreq) return; laststattime = moves; @@ -497,9 +505,68 @@ void readmail(otmp) struct obj *otmp; { -# ifdef DEF_MAILREADER /* This implies that UNIX is defined */ +#ifdef DEF_MAILREADER register const char *mr = 0; +#endif /* DEF_MAILREADER */ +#ifdef SIMPLE_MAIL + if (iflags.simplemail) + { + FILE* mb = fopen(mailbox, "r"); + char curline[102], *msg; + boolean seen_one_already = FALSE; + struct flock fl = { 0 }; + + fl.l_type = F_RDLCK; + fl.l_whence = SEEK_SET; + fl.l_start = 0; + fl.l_len = 0; + + if (!mb) + goto bail; + + /* Allow this call to block. */ + if (fcntl (fileno (mb), F_SETLKW, &fl) == -1) + goto bail; + + errno = 0; + + while (fgets(curline, 102, mb) != NULL) + { + fl.l_type = F_UNLCK; + fcntl (fileno(mb), F_UNLCK, &fl); + + pline("There is a%s message on this scroll.", + seen_one_already ? "nother" : ""); + + msg = strchr(curline, ':'); + + if (!msg) + goto bail; + + *msg = '\0'; + msg++; + + pline ("This message is from '%s'.", curline); + + msg[strlen(msg) - 1] = '\0'; /* kill newline */ + pline ("It reads: \"%s\".", msg); + + seen_one_already = TRUE; + errno = 0; + fl.l_type = F_RDLCK; + fcntl(fileno(mb), F_SETLKW, &fl); + } + + fl.l_type = F_UNLCK; + fcntl(fileno(mb), F_UNLCK, &fl); + + fclose(mb); + unlink(mailbox); + return; + } +# endif /* SIMPLE_MAIL */ +# ifdef DEF_MAILREADER /* This implies that UNIX is defined */ display_nhwindow(WIN_MESSAGE, FALSE); if(!(mr = nh_getenv("MAILREADER"))) mr = DEF_MAILREADER; @@ -517,6 +584,12 @@ struct obj *otmp; /* get new stat; not entirely correct: there is a small time window where we do not see new mail */ getmailstatus(); + return; + +#ifdef SIMPLE_MAIL +bail: + pline("It appears to be all gibberish."); /* bail out _professionally_ */ +#endif } # endif /* UNIX */ @@ -583,10 +656,7 @@ ckmailstatus() static int laststattime = 0; if(u.uswallow || !flags.biff -# ifdef MAILCKFREQ - || moves < laststattime + MAILCKFREQ -# endif - ) + || moves < laststattime + mailckfreq) return; laststattime = moves; diff -pruN slashem-0.0.7E7/sys/unix/unixmain.c slashem/sys/unix/unixmain.c --- slashem-0.0.7E7/sys/unix/unixmain.c 2005-02-19 11:13:52.000000000 +0100 +++ slashem/sys/unix/unixmain.c 2005-04-13 10:45:20.000000000 +0200 @@ -59,6 +59,15 @@ char *argv[]; register char *dir; #endif boolean exact_username; +#ifdef SIMPLE_MAIL + char* e_simple = NULL; +#endif + +#ifdef SIMPLE_MAIL + /* figure this out early */ + e_simple = nh_getenv("SIMPLEMAIL"); + iflags.simplemail = (e_simple ? 1 : 0); +#endif hname = argv[0]; hackpid = getpid();