From ba6ab8e0ba499442e2964661620647d544aa2583 Mon Sep 17 00:00:00 2001 From: in2 Date: Mon, 7 Apr 2003 08:08:47 +0000 Subject: dymaxactive, toomanyusers git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk@778 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- pttbbs/include/pttstruct.h | 5 +++-- pttbbs/mbbsd/mbbsd.c | 7 ++++--- pttbbs/util/shmctl.c | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pttbbs/include/pttstruct.h b/pttbbs/include/pttstruct.h index 5ea7e799..2e3e5492 100644 --- a/pttbbs/include/pttstruct.h +++ b/pttbbs/include/pttstruct.h @@ -1,4 +1,4 @@ -/* $Id: pttstruct.h,v 1.32 2003/04/07 03:55:17 in2 Exp $ */ +/* $Id: pttstruct.h,v 1.33 2003/04/07 08:08:47 in2 Exp $ */ #ifndef INCLUDE_STRUCT_H #define INCLUDE_STRUCT_H @@ -353,7 +353,8 @@ typedef struct { union { int v[192]; struct { - int dyactive; + int dymaxactive; + int toomanyusers; } e; } GV2; char gap3_2[128]; diff --git a/pttbbs/mbbsd/mbbsd.c b/pttbbs/mbbsd/mbbsd.c index 97ba847a..6eade791 100644 --- a/pttbbs/mbbsd/mbbsd.c +++ b/pttbbs/mbbsd/mbbsd.c @@ -1,4 +1,4 @@ -/* $Id: mbbsd.c,v 1.69 2003/03/28 14:15:20 in2 Exp $ */ +/* $Id: mbbsd.c,v 1.70 2003/04/07 08:08:47 in2 Exp $ */ #include "bbs.h" #define SOCKET_QLEN 4 @@ -1342,10 +1342,11 @@ check_ban_and_load(int fd) } if (SHM->UTMPnumber >= MAX_ACTIVE #ifdef DYMAX_ACTIVE - || (GLOBALVAR[9] > 500 && SHM->UTMPnumber >= GLOBALVAR[9] ) + || (SHM->GV2.e.dymaxactive > 2000 && + SHM->UTMPnumber >= SHM->GV2.e.dymaxactive) #endif ) { - ++GLOBALVAR[8]; + ++SHM->GV2.e.toomanyusers; snprintf(buf, sizeof(buf), "由於人數過多,請您稍後再來。"); write(fd, buf, strlen(buf)); overload = 1; diff --git a/pttbbs/util/shmctl.c b/pttbbs/util/shmctl.c index 1417c2b0..2232c42d 100644 --- a/pttbbs/util/shmctl.c +++ b/pttbbs/util/shmctl.c @@ -1,4 +1,4 @@ -/* $Id: shmctl.c,v 1.36 2003/04/07 03:55:30 in2 Exp $ */ +/* $Id: shmctl.c,v 1.37 2003/04/07 08:08:47 in2 Exp $ */ #include "bbs.h" #include @@ -337,7 +337,7 @@ int utmpnum(int argc, char **argv) return 0; } -char *GV2str[] = {"dyactive", NULL}; +char *GV2str[] = {"dymaxactive", "toomanyusers", NULL}; int showglobal(int argc, char **argv) { int i; -- cgit v1.2.3