summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-24 10:08:24 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-24 10:08:24 +0000
commit873dd0bfae9f9f78b3e978edb574e4793af7b03f (patch)
treef7e810bdf2ced2b13260e27418f5f94b7ceb2e84 /crawl-ref
parent89c4ddb91d7daef57c274e73747e3e3a82ea278b (diff)
downloadcrawl-ref-873dd0bfae9f9f78b3e978edb574e4793af7b03f.tar.gz
crawl-ref-873dd0bfae9f9f78b3e978edb574e4793af7b03f.zip
[1818767] Idle time clamped at 5 minutes.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2534 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/AppHdr.h5
-rw-r--r--crawl-ref/source/acr.cc11
2 files changed, 16 insertions, 0 deletions
diff --git a/crawl-ref/source/AppHdr.h b/crawl-ref/source/AppHdr.h
index 7c9fab97d6..66e1fecdd8 100644
--- a/crawl-ref/source/AppHdr.h
+++ b/crawl-ref/source/AppHdr.h
@@ -224,7 +224,9 @@
#endif
// Increase the size of the topscores file for public servers.
+ #ifndef SCORE_FILE_ENTRIES
#define SCORE_FILE_ENTRIES 1000
+ #endif
// If defined, the hiscores code dumps preformatted verbose and terse
// death message strings in the logfile for the convenience of logfile
@@ -322,6 +324,9 @@
// number of back messages saved during play (currently none saved into files)
#define NUM_STORED_MESSAGES 1000
+// clamp time between command inputs at 5 minutes when reporting play time.
+#define IDLE_TIME_CLAMP (5 * 60)
+
// Uncomment this if you find the labyrinth to be buggy and want to
// remove it from the game.
// #define SHUT_LABYRINTH
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index 16e88232ef..47a6e02eb2 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -3034,7 +3034,18 @@ static command_type get_next_cmd()
#if DEBUG_ITEM_SCAN
debug_item_scan();
#endif
+
+ const time_t before = time(NULL);
keycode_type keyin = get_next_keycode();
+
+ const time_t after = time(NULL);
+
+ // Clamp idle time so that play time is more meaningful.
+ if (after - before > IDLE_TIME_CLAMP)
+ {
+ you.real_time += (before - you.start_time) + IDLE_TIME_CLAMP;
+ you.start_time = after;
+ }
if (is_userfunction(keyin))
{