summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-06-23 22:35:18 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-06-23 22:35:18 +0800
commitdbe4efa5777ce48d99018eff680fc279e8ccee06 (patch)
tree39afedca65a06c60dc6774e47088c11eaa14a9c2
parent810217595d84a37ab442dc498d1ca8828ad20f21 (diff)
downloadpttbbs-dbe4efa5777ce48d99018eff680fc279e8ccee06.tar
pttbbs-dbe4efa5777ce48d99018eff680fc279e8ccee06.tar.gz
pttbbs-dbe4efa5777ce48d99018eff680fc279e8ccee06.tar.bz2
pttbbs-dbe4efa5777ce48d99018eff680fc279e8ccee06.tar.lz
pttbbs-dbe4efa5777ce48d99018eff680fc279e8ccee06.tar.xz
pttbbs-dbe4efa5777ce48d99018eff680fc279e8ccee06.tar.zst
pttbbs-dbe4efa5777ce48d99018eff680fc279e8ccee06.zip
* move money calibration from bbs.c to edit.c
* fix: previous entropy limitation would half max post money git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4695 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/bbs.c4
-rw-r--r--mbbsd/edit.c14
2 files changed, 12 insertions, 6 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 04b73def..3b1a4eb9 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -1108,11 +1108,9 @@ do_general(int isbid)
// money verification
#ifdef MAX_POST_MONEY
- if (money > MAX_POST_MONEY * 2)
+ if (money > MAX_POST_MONEY)
money = MAX_POST_MONEY;
- else
#endif
- money /= 2;
// drop money & numposts for free boards
// including: special boards (e.g. TEST, ALLPOST), bad boards, no BM boards
diff --git a/mbbsd/edit.c b/mbbsd/edit.c
index db80fbad..c34a992e 100644
--- a/mbbsd/edit.c
+++ b/mbbsd/edit.c
@@ -44,6 +44,10 @@
#define EDIT_SIZE_LIMIT (32768*1024)
#define EDIT_LINE_LIMIT (65530) // (1048576)
+#ifndef POST_MONEY_RATIO
+#define POST_MONEY_RATIO (0.5f)
+#endif
+
#define ENTROPY_RATIO (0.25f)
#define ENTROPY_MAX (MAX_POST_MONEY/ENTROPY_RATIO)
@@ -3644,14 +3648,18 @@ vedit2(const char *fpath, int saveheader, int *islocal, char title[STRLEN], int
(flags & EDITFLAG_UPLOAD) ? 1 : 0,
(flags & EDITFLAG_ALLOWTITLE) ? 1 : 0,
&entropy);
- // money or entropy?
- if (money > (entropy * ENTROPY_RATIO) && entropy >= 0)
- money = (entropy * ENTROPY_RATIO) + 1;
if (tmp != KEEP_EDITING) {
currutmp->mode = mode0;
currutmp->destuid = destuid0;
exit_edit_buffer();
+
+ // adjust final money
+ money *= POST_MONEY_RATIO;
+ // money or entropy?
+ if (money > (entropy * ENTROPY_RATIO) && entropy >= 0)
+ money = (entropy * ENTROPY_RATIO) + 1;
+
if (!tmp)
return money;
else