summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/initfile.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-03-25 13:23:23 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-03-25 13:23:23 +0000
commitbdb45bf27b86ff63c5afdff311b4065c83faf37d (patch)
treecf3a914532ecc372932b8d897e8c9abf57fbe2a4 /crawl-ref/source/initfile.cc
parentc500c6b3582877a10bd362722bde81eb9b94b917 (diff)
downloadcrawl-ref-bdb45bf27b86ff63c5afdff311b4065c83faf37d.tar.gz
crawl-ref-bdb45bf27b86ff63c5afdff311b4065c83faf37d.zip
Merged in crawl.akrasiac.org patches (simple messaging, milestones). These take
effect only if compiled with -DDGAMELAUNCH. Simple messaging: interacts with dgamelaunch's messaging facility allowing viewers to send messages to the player. Milestones: Writes a milestones.txt file (in xlogfile format) for things like the player killing uniques, reaching the end of a dungeon branch, etc. (similar to notes). milestones.txt is used for game announcements by an IRC bot. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1095 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/initfile.cc')
-rw-r--r--crawl-ref/source/initfile.cc22
1 files changed, 21 insertions, 1 deletions
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index 6e4cde4035..b2605acc73 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -550,6 +550,10 @@ void game_options::reset_options()
player_name.clear();
+#ifdef SIMPLE_MESSAGING
+ messaging = true;
+#endif
+
autopickup_on = true;
autoprayer_on = false;
@@ -1824,7 +1828,13 @@ void game_options::read_option_line(const std::string &str, bool runscript)
else if (key == "autopickup_no_burden")
{
autopickup_no_burden = read_bool( field, autopickup_no_burden );
- }
+ }
+#ifdef SIMPLE_MESSAGING
+ else if (key == "messaging")
+ {
+ messaging = read_bool(field, messaging);
+ }
+#endif
else if (key == "use_notes")
{
use_notes = read_bool( field, use_notes );
@@ -2362,6 +2372,16 @@ void get_system_environment(void)
// This should end with the appropriate path delimiter.
SysEnv.crawl_dir = getenv("CRAWL_DIR");
+#ifdef SIMPLE_MESSAGING
+ // Enable SIMPLE_MESSAGING only if SIMPLEMAIL and MAIL are set.
+ const char *simplemail = getenv("SIMPLEMAIL");
+ if (simplemail && strcmp(simplemail, "0"))
+ {
+ const char *mail = getenv("MAIL");
+ SysEnv.messagefile = mail? mail : "";
+ }
+#endif
+
// The full path to the init file -- this over-rides CRAWL_DIR
SysEnv.crawl_rc = getenv("CRAWL_RC");