summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-07-05 15:58:09 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-07-05 15:58:09 +0800
commit85dd021ec967d2f58a531912a78ed9a956dd10dc (patch)
treee6df2e059864c3c9dd37ef29c4eba0d9d44df823
parenta2ab5ac739305ff4bd756e829f7f4e5c3b71d9a9 (diff)
downloadpttbbs-85dd021ec967d2f58a531912a78ed9a956dd10dc.tar
pttbbs-85dd021ec967d2f58a531912a78ed9a956dd10dc.tar.gz
pttbbs-85dd021ec967d2f58a531912a78ed9a956dd10dc.tar.bz2
pttbbs-85dd021ec967d2f58a531912a78ed9a956dd10dc.tar.lz
pttbbs-85dd021ec967d2f58a531912a78ed9a956dd10dc.tar.xz
pttbbs-85dd021ec967d2f58a531912a78ed9a956dd10dc.tar.zst
pttbbs-85dd021ec967d2f58a531912a78ed9a956dd10dc.zip
count #Welcomes in account to SHM instead of mbbsd.c
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@1029 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--include/pttstruct.h3
-rw-r--r--mbbsd/mbbsd.c19
-rw-r--r--util/account.c10
3 files changed, 16 insertions, 16 deletions
diff --git a/include/pttstruct.h b/include/pttstruct.h
index a85c031d..d693f985 100644
--- a/include/pttstruct.h
+++ b/include/pttstruct.h
@@ -1,4 +1,4 @@
-/* $Id: pttstruct.h,v 1.38 2003/05/26 05:23:13 in2 Exp $ */
+/* $Id: pttstruct.h,v 1.39 2003/07/05 07:58:09 in2 Exp $ */
#ifndef INCLUDE_STRUCT_H
#define INCLUDE_STRUCT_H
@@ -361,6 +361,7 @@ typedef struct {
#ifdef OUTTA_TIMER
time_t now;
#endif
+ int nWelcomes;
} e;
} GV2;
char gap3_2[128];
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index a4c3abe9..a20188a6 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -1,4 +1,4 @@
-/* $Id: mbbsd.c,v 1.87 2003/06/27 07:44:02 in2 Exp $ */
+/* $Id: mbbsd.c,v 1.88 2003/07/05 07:58:09 in2 Exp $ */
#include "bbs.h"
#define SOCKET_QLEN 4
@@ -780,19 +780,10 @@ user_login()
#ifndef MULTI_WELCOME_LOGIN
more("etc/Welcome_login", NA);
#else
- char buf[80];
- int nScreens;
-
- for (nScreens = 0; nScreens < 5; ++nScreens) {
- snprintf(buf, sizeof(buf), "etc/Welcome_login.%d", nScreens);
- if (access(buf, 0) < 0)
- break;
- }
- if (nScreens == 0) {
- //multi screen error ?
- more("etc/Welcome_login", NA);
- } else {
- snprintf(buf, sizeof(buf), "etc/Welcome_login.%d", (int)login_start_time % nScreens);
+ if( SHM->GV2.e.nWelcomes ){
+ char buf[80];
+ snprintf(buf, sizeof(buf), "etc/Welcome_login.%d",
+ (int)login_start_time % SHM->GV2.e.nWelcomes);
more(buf, NA);
}
#endif
diff --git a/util/account.c b/util/account.c
index 5220f713..bbc84244 100644
--- a/util/account.c
+++ b/util/account.c
@@ -1,4 +1,4 @@
-/* $Id: account.c,v 1.7 2002/06/16 22:21:12 ptt Exp $ */
+/* $Id: account.c,v 1.8 2003/07/05 07:58:09 in2 Exp $ */
#include "bbs.h"
#define MAX_LINE 16
@@ -399,5 +399,13 @@ int main() {
SHM->Puptime = 0;
resolve_fcache();
reset_garbage();
+
+ printf("計算進站畫面數: ");
+ for( i = 0 ; i < 5 ; ++i ){
+ sprintf(buf, "etc/Welcome_login.%d", i);
+ if( access(buf, 0) < 0 )
+ break;
+ }
+ printf("%d\n", SHM->GV2.e.nWelcomes = i);
return 0;
}