2004-01-03 23:35:09 +01:00
|
|
|
--- ./include/flag.h~ 2003-12-30 00:36:39.000000000 -0800
|
|
|
|
+++ ./include/flag.h 2003-12-30 00:37:45.000000000 -0800
|
|
|
|
@@ -27,6 +27,9 @@
|
|
|
|
boolean beginner;
|
|
|
|
#ifdef MAIL
|
|
|
|
boolean biff; /* enable checking for mail */
|
|
|
|
+# ifdef SIMPLE_MAIL /* simple mail format used for dgamelaunch */
|
|
|
|
+ boolean simplemail;
|
|
|
|
+# endif
|
|
|
|
#endif
|
|
|
|
boolean botl; /* partially redo status line */
|
|
|
|
boolean botlx; /* print an entirely new bottom line */
|
|
|
|
--- ./include/decl.h~ 2003-12-30 00:47:53.000000000 -0800
|
|
|
|
+++ ./include/decl.h 2003-12-30 00:48:51.000000000 -0800
|
|
|
|
@@ -385,6 +385,10 @@
|
|
|
|
};
|
|
|
|
#endif /* AUTOPICKUP_EXCEPTIONS */
|
|
|
|
|
|
|
|
+#ifdef SIMPLE_MAIL
|
|
|
|
+E int mailckfreq;
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
#undef E
|
|
|
|
|
|
|
|
#endif /* DECL_H */
|
|
|
|
--- ./src/mail.c~ 2003-12-30 00:21:28.000000000 -0800
|
|
|
|
+++ ./src/mail.c 2003-12-30 00:52:04.000000000 -0800
|
|
|
|
@@ -36,6 +36,8 @@
|
|
|
|
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
|
|
|
|
@@ -464,11 +466,11 @@
|
|
|
|
void
|
|
|
|
ckmailstatus()
|
|
|
|
{
|
|
|
|
+ if (mailckfreq == 0)
|
|
|
|
+ mailckfreq = (flags.simplemail ? 5 : 10);
|
|
|
|
+
|
|
|
|
if(!mailbox || u.uswallow || !flags.biff
|
|
|
|
-# ifdef MAILCKFREQ
|
|
|
|
- || moves < laststattime + MAILCKFREQ
|
|
|
|
-# endif
|
|
|
|
- )
|
|
|
|
+ || moves < laststattime + mailckfreq)
|
|
|
|
return;
|
|
|
|
|
|
|
|
laststattime = moves;
|
|
|
|
@@ -501,9 +503,34 @@
|
2004-01-03 21:19:38 +01:00
|
|
|
readmail(otmp)
|
|
|
|
struct obj *otmp;
|
|
|
|
{
|
2004-01-03 23:35:09 +01:00
|
|
|
-# ifdef DEF_MAILREADER /* This implies that UNIX is defined */
|
|
|
|
+#ifdef DEF_MAILREADER
|
|
|
|
register const char *mr = 0;
|
|
|
|
+#endif /* DEF_MAILREADER */
|
|
|
|
+#ifdef SIMPLE_MAIL
|
|
|
|
+ if (flags.simplemail)
|
|
|
|
+ {
|
|
|
|
+ FILE* mb = fopen(mailbox, "r");
|
|
|
|
+ char curline[80], *tmp;
|
2004-01-03 21:19:38 +01:00
|
|
|
+
|
2004-01-03 23:35:09 +01:00
|
|
|
+ if (!mb)
|
|
|
|
+ goto bail;
|
|
|
|
+
|
|
|
|
+ while (fgets(curline, 80, mb) != NULL);
|
2004-01-03 21:19:38 +01:00
|
|
|
+
|
2004-01-03 23:35:09 +01:00
|
|
|
+ pline("This scroll is from '%s'.", strtok(curline, ":"));
|
|
|
|
+ tmp = strtok(NULL, ":");
|
2004-01-03 21:19:38 +01:00
|
|
|
+
|
2004-01-03 23:35:09 +01:00
|
|
|
+ if (!tmp)
|
|
|
|
+ goto bail;
|
|
|
|
+
|
|
|
|
+ tmp[strlen(tmp) - 1] = '\0'; /* kill newline */
|
|
|
|
+ pline("It reads: \"%s\".", tmp);
|
2004-01-03 21:19:38 +01:00
|
|
|
|
2004-01-03 23:35:09 +01:00
|
|
|
+ fclose(mb);
|
|
|
|
+ return;
|
|
|
|
+ }
|
2004-01-03 21:19:38 +01:00
|
|
|
+# endif /* SIMPLE_MAIL */
|
2004-01-03 23:35:09 +01:00
|
|
|
+# ifdef DEF_MAILREADER /* This implies that UNIX is defined */
|
|
|
|
display_nhwindow(WIN_MESSAGE, FALSE);
|
|
|
|
if(!(mr = nh_getenv("MAILREADER")))
|
|
|
|
mr = DEF_MAILREADER;
|
|
|
|
@@ -512,15 +538,19 @@
|
|
|
|
(void) execl(mr, mr, (char *)0);
|
|
|
|
terminate(EXIT_FAILURE);
|
|
|
|
}
|
|
|
|
-# else
|
|
|
|
-# ifndef AMS /* AMS mailboxes are directories */
|
|
|
|
+# else
|
|
|
|
+# ifndef AMS /* AMS mailboxes are directories */
|
|
|
|
display_file(mailbox, TRUE);
|
|
|
|
-# endif /* AMS */
|
|
|
|
-# endif /* DEF_MAILREADER */
|
|
|
|
+# endif /* AMS */
|
|
|
|
+# endif /* DEF_MAILREADER */
|
2004-01-03 21:19:38 +01:00
|
|
|
|
|
|
|
/* get new stat; not entirely correct: there is a small time
|
|
|
|
window where we do not see new mail */
|
2004-01-03 23:35:09 +01:00
|
|
|
getmailstatus();
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+bail:
|
|
|
|
+ pline("It appears to be all gibberish."); /* bail out _professionally_ */
|
|
|
|
}
|
|
|
|
|
|
|
|
# endif /* UNIX */
|
|
|
|
@@ -587,10 +617,7 @@
|
|
|
|
static int laststattime = 0;
|
|
|
|
|
|
|
|
if(u.uswallow || !flags.biff
|
|
|
|
-# ifdef MAILCKFREQ
|
|
|
|
- || moves < laststattime + MAILCKFREQ
|
|
|
|
-# endif
|
|
|
|
- )
|
|
|
|
+ || moves < laststattime + mailckfreq)
|
|
|
|
return;
|
|
|
|
|
|
|
|
laststattime = moves;
|
|
|
|
--- ./sys/unix/unixmain.c~ 2003-12-30 00:39:39.000000000 -0800
|
|
|
|
+++ ./sys/unix/unixmain.c 2003-12-30 00:42:13.000000000 -0800
|
|
|
|
@@ -54,7 +54,9 @@
|
|
|
|
register char *dir;
|
|
|
|
#endif
|
|
|
|
boolean exact_username;
|
|
|
|
-
|
|
|
|
+#ifdef SIMPLE_MAIL
|
|
|
|
+ char* e_simple = NULL;
|
|
|
|
+#endif
|
|
|
|
#if defined(__APPLE__)
|
|
|
|
/* special hack to change working directory to a resource fork when
|
|
|
|
running from finder --sam */
|
|
|
|
@@ -84,6 +86,12 @@
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
+#ifdef SIMPLE_MAIL
|
|
|
|
+ /* figure this out early */
|
|
|
|
+ e_simple = nh_getenv("SIMPLEMAIL");
|
|
|
|
+ flags.simplemail = (e_simple ? 1 : 0);
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
hname = argv[0];
|
|
|
|
hackpid = getpid();
|
|
|
|
(void) umask(0777 & ~FCMASK);
|
|
|
|
--- include/unixconf.h~ 2003-12-30 00:58:53.000000000 -0800
|
|
|
|
+++ include/unixconf.h 2003-12-30 00:59:01.000000000 -0800
|
|
|
|
@@ -193,7 +193,6 @@
|
2004-01-03 21:19:38 +01:00
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
-#define MAILCKFREQ 50
|
|
|
|
#endif /* MAIL */
|
|
|
|
|
|
|
|
|