From 628735a20221af12cab12a2a41088a50582dbe4d Mon Sep 17 00:00:00 2001 From: ptt Date: Wed, 18 May 2005 19:22:19 +0000 Subject: dynamically change the limitation of waterpost according to the number of users. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2728 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/bbs.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index a71ba432..6a7a87ce 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -2513,6 +2513,7 @@ change_restrictedpost(int ent, fileheader_t * fhdr, char *direct){ int check_cooldown(boardheader_t *bp) { int diff = cooldowntimeof(usernum) - now; + int i, limit[8] = {4000,1,2000,2,1000,3,30,10}; if(diff<0) SHM->cooldowntime[usernum - 1] &= 0xFFFFFFF0; @@ -2529,12 +2530,16 @@ int check_cooldown(boardheader_t *bp) return 1; } #ifdef NO_WATER_POST - else if(bp->nuser>30 && posttimesof(usernum)>=10) - { - vmsg("對不起,您的文章太水囉!用'X'推薦文章 (限制 %d 分 %d 秒)", + else + { + for(i=0; i<4; i++) + if(bp->nuser>limit[i*2] && posttimesof(usernum)>=limit[i*2+1]) + { + vmsg("對不起,您的文章太水囉!用'X'推薦文章 (限制 %d 分 %d 秒)", diff/60, diff%60); - return 1; - } + return 1; + } + } #endif // NO_WATER_POST } return 0; -- cgit v1.2.3