diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2006-09-17 02:41:39 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2006-09-17 02:41:39 +0800 |
commit | 5f36f8a8fb4424a5b75f6c2e478a4a398ec1492a (patch) | |
tree | d4e02e80d6827491f2c38cb5d427bb3d0787de68 | |
parent | 3f5d885e592f443ce831c5b1c124f54976207733 (diff) | |
download | pttbbs-5f36f8a8fb4424a5b75f6c2e478a4a398ec1492a.tar pttbbs-5f36f8a8fb4424a5b75f6c2e478a4a398ec1492a.tar.gz pttbbs-5f36f8a8fb4424a5b75f6c2e478a4a398ec1492a.tar.bz2 pttbbs-5f36f8a8fb4424a5b75f6c2e478a4a398ec1492a.tar.lz pttbbs-5f36f8a8fb4424a5b75f6c2e478a4a398ec1492a.tar.xz pttbbs-5f36f8a8fb4424a5b75f6c2e478a4a398ec1492a.tar.zst pttbbs-5f36f8a8fb4424a5b75f6c2e478a4a398ec1492a.zip |
deny abuse of recommendation, don't recommend too frequently.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3413 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/bbs.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 1775b03d..9e4f7e5b 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -2230,6 +2230,20 @@ recommend(int ent, fileheader_t * fhdr, const char *direct) return FULLUPDATE; } } + { + static unsigned char lastrecommend_minute = 0; + static unsigned short recommend_in_minute = 0; + unsigned char now_in_minute = (unsigned char)(now / 60); + if(now_in_minute != lastrecommend_minute) { + recommend_in_minute = 0; + lastrecommend_minute = now_in_minute; + } + recommend_in_minute++; + if(recommend_in_minute>60) { + vmsg("系統禁止短時間內大量推文"); + return FULLUPDATE; + } + } #ifdef USE_COOLDOWN if(check_cooldown(bp)) |