diff options
author | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-05-19 03:22:19 +0800 |
---|---|---|
committer | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-05-19 03:22:19 +0800 |
commit | 628735a20221af12cab12a2a41088a50582dbe4d (patch) | |
tree | 4c4f6b3624018f0b3ca93649d33dbbbf52900dff /mbbsd | |
parent | c48ba7865921764efa49167d1817baedbd3970c0 (diff) | |
download | pttbbs-628735a20221af12cab12a2a41088a50582dbe4d.tar pttbbs-628735a20221af12cab12a2a41088a50582dbe4d.tar.gz pttbbs-628735a20221af12cab12a2a41088a50582dbe4d.tar.bz2 pttbbs-628735a20221af12cab12a2a41088a50582dbe4d.tar.lz pttbbs-628735a20221af12cab12a2a41088a50582dbe4d.tar.xz pttbbs-628735a20221af12cab12a2a41088a50582dbe4d.tar.zst pttbbs-628735a20221af12cab12a2a41088a50582dbe4d.zip |
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
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/bbs.c | 15 |
1 files changed, 10 insertions, 5 deletions
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; |