From bdb45bf27b86ff63c5afdff311b4065c83faf37d Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sun, 25 Mar 2007 13:23:23 +0000 Subject: 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 --- crawl-ref/source/initfile.cc | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/initfile.cc') 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"); -- cgit v1.2.3-54-g00ecf