summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-01-25 21:47:09 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-01-25 21:47:09 +0800
commitf265780b3421cc2ffeb7c1a813c120c7d19b17dc (patch)
tree180d78398386c8d5d86b4aaa91d07309257ffb86
parenta1476dc84787241743986af4084bec42a9ffd1a5 (diff)
downloadpttbbs-f265780b3421cc2ffeb7c1a813c120c7d19b17dc.tar
pttbbs-f265780b3421cc2ffeb7c1a813c120c7d19b17dc.tar.gz
pttbbs-f265780b3421cc2ffeb7c1a813c120c7d19b17dc.tar.bz2
pttbbs-f265780b3421cc2ffeb7c1a813c120c7d19b17dc.tar.lz
pttbbs-f265780b3421cc2ffeb7c1a813c120c7d19b17dc.tar.xz
pttbbs-f265780b3421cc2ffeb7c1a813c120c7d19b17dc.tar.zst
pttbbs-f265780b3421cc2ffeb7c1a813c120c7d19b17dc.zip
- buy-mail-box: prevent user accidentally enter the option.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3866 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/cal.c43
1 files changed, 41 insertions, 2 deletions
diff --git a/mbbsd/cal.c b/mbbsd/cal.c
index 6b881795..a98dd001 100644
--- a/mbbsd/cal.c
+++ b/mbbsd/cal.c
@@ -310,20 +310,32 @@ p_exmail(void)
return 0;
}
snprintf(buf, sizeof(buf),
- "您曾增購 %d 封容量,還要再買多少?", cuser.exmailbox);
+ "您曾增購 %d 封容量,還要再買多少? ", cuser.exmailbox);
- getdata_str(b_lines - 2, 0, buf, ans, sizeof(ans), LCECHO, "1");
+ // no need to create default prompt.
+ // and people usually come this this by accident...
+ getdata(b_lines - 2, 0, buf, ans, sizeof(ans), LCECHO);
n = atoi(ans);
if (!ans[0] || n<=0)
return 0;
+
if (n + cuser.exmailbox > MAX_EXKEEPMAIL)
n = MAX_EXKEEPMAIL - cuser.exmailbox;
reload_money();
if (cuser.money < n * 1000)
+ {
+ vmsg("你的錢不夠。");
+ return 0;
+ }
+
+ if (vmsgf("你想購買 %d 封信箱 (要花 %d 元), 確定嗎?[y/N] ",
+ n, n*1000) != 'y')
return 0;
+
vice(n * 1000, "購買信箱");
inmailbox(n);
+ vmsgf("已購買信箱。新容量上限: %d", cuser.exmailbox);
return 0;
}
@@ -449,6 +461,33 @@ p_sysinfo(void)
client_code,
#endif
compile_time, ctime4(&start_time));
+
+#ifdef REPORT_PIAIP_MODULES
+ outs("\n" ANSI_COLOR(1;30)
+ "Modules powered by piaip:\n"
+ "\ttelnet protocol, ALOHA fixer, BRC v3\n"
+#if defined(USE_PIAIP_MORE) || defined(USE_PMORE)
+ "\tpmore (piaip's more) 2007 w/Movie\n"
+#endif
+#ifdef HAVE_GRAYOUT
+ "\tGrayout Advanced Control 淡入淡出特效系統\n"
+#endif
+#ifdef EDITPOST_SMARTMERGE
+ "\tSmart Merge 修文自動合併\n"
+#endif
+#ifdef EXP_EDIT_UPLOAD
+ "\t(EXP) Editor Uploader 長文上傳\n"
+#endif
+#if defined(USE_PFTERM)
+ "\t(EXP) pfterm (piaip's flat terminal, Perfect Term)\n"
+#endif
+#if defined(USE_BBSLUA)
+ "\t(EXP) BBS-Lua\n"
+#endif
+ ANSI_RESET
+ );
+#endif // REPORT_PIAIP_MODULES
+
if (HasUserPerm(PERM_SYSOP)) {
struct rusage ru;
#ifdef __linux__