summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-05-14 23:08:48 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-05-14 23:08:48 +0800
commit1ef6abcf621d5476a76aaef98b5f9282104fd9f2 (patch)
tree20c7703724aab19d46d6c0258b96300da4cb328d
parentadb168b6c309a29331d0f9e8c5156d3c73b24392 (diff)
downloadpttbbs-1ef6abcf621d5476a76aaef98b5f9282104fd9f2.tar
pttbbs-1ef6abcf621d5476a76aaef98b5f9282104fd9f2.tar.gz
pttbbs-1ef6abcf621d5476a76aaef98b5f9282104fd9f2.tar.bz2
pttbbs-1ef6abcf621d5476a76aaef98b5f9282104fd9f2.tar.lz
pttbbs-1ef6abcf621d5476a76aaef98b5f9282104fd9f2.tar.xz
pttbbs-1ef6abcf621d5476a76aaef98b5f9282104fd9f2.tar.zst
pttbbs-1ef6abcf621d5476a76aaef98b5f9282104fd9f2.zip
idle timeout improvement
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@168 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/io.c3
-rw-r--r--mbbsd/mbbsd.c7
-rw-r--r--mbbsd/talk.c11
-rw-r--r--mbbsd/var.c3
-rw-r--r--mbbsd/xyz.c3
5 files changed, 10 insertions, 17 deletions
diff --git a/mbbsd/io.c b/mbbsd/io.c
index b6c67825..a52b7835 100644
--- a/mbbsd/io.c
+++ b/mbbsd/io.c
@@ -1,4 +1,4 @@
-/* $Id: io.c,v 1.12 2002/05/14 14:48:01 ptt Exp $ */
+/* $Id: io.c,v 1.13 2002/05/14 15:08:47 ptt Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -33,7 +33,6 @@ extern pid_t currpid;
extern int errno;
extern screenline_t *big_picture;
extern int t_lines, t_columns; /* Screen size / width */
-extern int curr_idle_timeout;
extern water_t water[6], *swater[5], *water_which;
extern char water_usies;
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index 07f1b955..8ea6f8d1 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -1,4 +1,4 @@
-/* $Id: mbbsd.c,v 1.26 2002/05/13 10:00:17 ptt Exp $ */
+/* $Id: mbbsd.c,v 1.27 2002/05/14 15:08:48 ptt Exp $ */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -38,7 +38,6 @@
extern int t_lines, t_columns; /* Screen size / width */
extern int b_lines; /* Screen bottom line number: t_lines-1 */
extern userinfo_t *currutmp;
-extern int curr_idle_timeout;
extern time_t now;
static void do_aloha (char *hello);
@@ -149,10 +148,6 @@ chkload (char *buf)
#endif
if (i > MAX_CPULOAD)
return 1;
- else if (i > MAX_CPULOAD / 2)
- curr_idle_timeout = 10 * 60;
- else
- curr_idle_timeout = 30 * 60;
return 0;
}
diff --git a/mbbsd/talk.c b/mbbsd/talk.c
index 8937df3d..70fb4fd8 100644
--- a/mbbsd/talk.c
+++ b/mbbsd/talk.c
@@ -1,4 +1,4 @@
-/* $Id: talk.c,v 1.33 2002/05/13 03:20:04 ptt Exp $ */
+/* $Id: talk.c,v 1.34 2002/05/14 15:08:48 ptt Exp $ */
#include <stdio.h>
#include <string.h>
#include <errno.h>
@@ -44,7 +44,6 @@ extern int talkrequest;
extern char *msg_shortulist;
extern char *msg_nobody;
extern boardheader_t *bcache;
-extern int curr_idle_timeout;
extern userec_t cuser;
extern userec_t xuser;
extern time_t now;
@@ -1708,9 +1707,11 @@ static void pickup_user(void)
#ifdef SHOW_IDLE_TIME
diff = freshtime - pklist[ch].ui->lastact;
//diff = pklist[ch].idle;
- if (diff > 1800) diff = 1800; /* Doma: 以免一大串的發呆時間 */
- /* in2: max 30'00 :P */
- if (diff > 0)
+ // if (diff > 1800) diff = 1800; /* Doma: 以免一大串的發呆時間 */
+ // in2: max 30'00 :P Ptt:真實沒關係
+ if (diff > 3600 )
+ sprintf(buf,"%3ldH%02ld", diff / 3600, (diff/60) % 60);
+ else if (diff > 0)
sprintf(buf, "%3ld'%02ld", diff / 60, diff % 60);
else
buf[0] = '\0';
diff --git a/mbbsd/var.c b/mbbsd/var.c
index 6f531c21..866ce063 100644
--- a/mbbsd/var.c
+++ b/mbbsd/var.c
@@ -1,4 +1,4 @@
-/* $Id: var.c,v 1.2 2002/04/29 07:05:45 in2 Exp $ */
+/* $Id: var.c,v 1.3 2002/05/14 15:08:48 ptt Exp $ */
#include <stdio.h>
#include <sys/types.h>
#include "config.h"
@@ -81,7 +81,6 @@ unsigned int currstat;
int currmode = 0;
int curredit = 0;
int showansi = 1;
-int curr_idle_timeout = IDLE_TIMEOUT;
time_t login_start_time;
userec_t cuser; /* current user structure */
userec_t xuser; /* lookup user structure */
diff --git a/mbbsd/xyz.c b/mbbsd/xyz.c
index daa0116e..d880a178 100644
--- a/mbbsd/xyz.c
+++ b/mbbsd/xyz.c
@@ -1,4 +1,4 @@
-/* $Id: xyz.c,v 1.5 2002/05/13 03:20:04 ptt Exp $ */
+/* $Id: xyz.c,v 1.6 2002/05/14 15:08:48 ptt Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -20,7 +20,6 @@ extern int b_lines; /* Screen bottom line number: t_lines-1 */
extern char *BBSName;
extern char fromhost[];
extern userinfo_t *currutmp;
-extern int curr_idle_timeout;
extern userec_t cuser;
extern time_t now;
/* 各種統計及相關資訊列表 */