From 5fa097b4c50f7ceb7dec5c9565bce8922d182716 Mon Sep 17 00:00:00 2001 From: piaip Date: Tue, 31 Jan 2012 04:54:54 +0000 Subject: don't allow buying extra mailbox git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5530 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- pttbbs/mbbsd/cal.c | 54 ----------------------------------------------------- pttbbs/mbbsd/menu.c | 1 - 2 files changed, 55 deletions(-) diff --git a/pttbbs/mbbsd/cal.c b/pttbbs/mbbsd/cal.c index 8cf8b302..2f5070a1 100644 --- a/pttbbs/mbbsd/cal.c +++ b/pttbbs/mbbsd/cal.c @@ -162,14 +162,6 @@ pay(int money, const char *item, ...) return do_pay(usernum, money, item, reason); } -static int -inmailbox(int m) -{ - pwcuAddExMailBox(m); - return cuser.exmailbox; -} - - int p_from(void) { @@ -188,52 +180,6 @@ p_from(void) return 0; } -int -p_exmail(void) -{ - char ans[4], buf[200]; - int n, oldm; - - if (cuser.exmailbox >= MAX_EXKEEPMAIL) { - vmsgf("容量最多增加 %d 封,不能再買了。", MAX_EXKEEPMAIL); - return 0; - } - snprintf(buf, sizeof(buf), - "您曾增購 %d 封容量,還要再買多少? ", cuser.exmailbox); - - // no need to create default prompt. - // and people usually come this this by accident... - getdata(b_lines - 2, 0, buf, ans, sizeof(ans), NUMECHO); - - oldm = cuser.exmailbox; - 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("你的" MONEYNAME "不夠。"); - return 0; - } - - if (vmsgf("你想購買 %d 封信箱 (要花 %d " MONEYNAME "), 確定嗎?[y/N] ", - n, n*1000) != 'y') - return 0; - - reload_money(); - pay(n * 1000, "購買信箱"); - inmailbox(n); - log_filef("log/exmailbox.log", LOG_CREAT, - "%-13s %d+%d->%d %s\n", cuser.userid, - oldm, n, cuser.exmailbox, Cdatelite(&now)); - - vmsgf("已購買信箱。新容量上限: %d", cuser.exmailbox); - return 0; -} - int mail_redenvelop(const char *from, const char *to, int money, char *fpath) { diff --git a/pttbbs/mbbsd/menu.c b/pttbbs/mbbsd/menu.c index 170db397..ad2bfc61 100644 --- a/pttbbs/mbbsd/menu.c +++ b/pttbbs/mbbsd/menu.c @@ -936,7 +936,6 @@ static const commands_t moneylist[] = { {save_violatelaw, 0,"11ViolateLaw 繳罰單"}, {p_from, 0, "22From 暫時修改故鄉"}, {ordersong,0, "33OSong 動態點歌機"}, - {p_exmail, 0, "44Exmail 購買信箱 $1000/封"}, {NULL, 0, NULL} }; -- cgit v1.2.3