diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-03-06 22:31:41 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-03-06 22:31:41 +0800 |
commit | b35ae20a364942ab97ff2d53226f613518fc07eb (patch) | |
tree | ed7a3e8ee3df81d3e7c8d5c432f8a14706ad10f6 | |
parent | e2edcb13a0eb21598f99ecc7a4e2627aa1c79bae (diff) | |
download | pttbbs-b35ae20a364942ab97ff2d53226f613518fc07eb.tar pttbbs-b35ae20a364942ab97ff2d53226f613518fc07eb.tar.gz pttbbs-b35ae20a364942ab97ff2d53226f613518fc07eb.tar.bz2 pttbbs-b35ae20a364942ab97ff2d53226f613518fc07eb.tar.lz pttbbs-b35ae20a364942ab97ff2d53226f613518fc07eb.tar.xz pttbbs-b35ae20a364942ab97ff2d53226f613518fc07eb.tar.zst pttbbs-b35ae20a364942ab97ff2d53226f613518fc07eb.zip |
- user/chicken: enable sysop toggle chicken-death
- mail: UI message finetune, prevent 'mail-folder' for non-authorized users
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3970 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | include/common.h | 11 | ||||
-rw-r--r-- | include/proto.h | 4 | ||||
-rw-r--r-- | mbbsd/chicken.c | 30 | ||||
-rw-r--r-- | mbbsd/mail.c | 17 | ||||
-rw-r--r-- | mbbsd/user.c | 5 |
5 files changed, 51 insertions, 16 deletions
diff --git a/include/common.h b/include/common.h index 24193642..825f4852 100644 --- a/include/common.h +++ b/include/common.h @@ -112,12 +112,11 @@ #define MSG_MAILER_LEN (78) #define MSG_MAILER \ ANSI_COLOR(34;46) " 鴻雁往返 " \ - ANSI_COLOR(31;47) " (R)" ANSI_COLOR(30) "回信" \ - ANSI_COLOR(31) "(x)" ANSI_COLOR(30) "轉寄" \ - ANSI_COLOR(31) "(y)" ANSI_COLOR(30) "回群組信 " \ - ANSI_COLOR(31) "(D)" ANSI_COLOR(30) "刪除 " \ - ANSI_COLOR(31) "(c)" ANSI_COLOR(30) "收入信件夾" \ - ANSI_COLOR(31) "(z)" ANSI_COLOR(30) "信件夾 " \ + ANSI_COLOR(31;47) " (R)" ANSI_COLOR(30) "回信 " \ + ANSI_COLOR(31) "(x)" ANSI_COLOR(30) "站內轉寄 " \ + ANSI_COLOR(31) "(y)" ANSI_COLOR(30) "回群組信 " \ + ANSI_COLOR(31) "(d/D)" ANSI_COLOR(30) "刪信 " \ + ANSI_COLOR(31) "(m)" ANSI_COLOR(30) "避免誤刪 " \ ANSI_COLOR(31) "←[q]" ANSI_COLOR(30) "離開 " \ "" diff --git a/include/proto.h b/include/proto.h index 705992cd..84c2ae5a 100644 --- a/include/proto.h +++ b/include/proto.h @@ -210,11 +210,11 @@ ChessInfo* chc_replay(FILE* fp); /* chicken */ int chicken_main(void); int chickenpk(int fd); -int reload_chicken(void); +int load_chicken(const char *uid, chicken_t *mychicken); void chicken_query(const char *userid); void ch_buyitem(int money, const char *picture, int *item, int haveticket); void show_chicken_data(chicken_t *thechicken, chicken_t *pkchicken); -int load_chicken(const char *uid, chicken_t *mychicken); +void chicken_toggle_death(const char *uid); /* dark */ int main_dark(int fd,userinfo_t *uin); diff --git a/mbbsd/chicken.c b/mbbsd/chicken.c index 2e4354bb..d2d10d4e 100644 --- a/mbbsd/chicken.c +++ b/mbbsd/chicken.c @@ -798,6 +798,7 @@ recover_chicken(chicken_t * thechicken) { char buf[200]; int price = egg_price[(int)thechicken->type], money = price + (random() % price); + price *= 2; if (now - thechicken->lastvisit > (60 * 60 * 24 * 7)) return 0; @@ -809,14 +810,14 @@ recover_chicken(chicken_t * thechicken) bell(); igetch(); snprintf(buf, sizeof(buf), ANSI_COLOR(33;44) "★靈界守衛" ANSI_COLOR(37;45) " " - "你有一個剛走不久的%s要招換回來嗎? 只要%d元唷 " ANSI_RESET, - chicken_type[(int)thechicken->type], price * 2); + "你有一個剛走不久的%s要招換回來嗎? 只要 %d 元唷 " ANSI_RESET, + chicken_type[(int)thechicken->type], price); outmsg(buf); bell(); getdata_str(21, 0, " 選擇:(N:坑人嘛/y:請幫幫我)", buf, 3, LCECHO, "N"); if (buf[0] == 'y' || buf[0] == 'Y') { reload_money(); - if (cuser.money < price * 2) { + if (cuser.money < price) { outmsg(ANSI_COLOR(33;44) "★靈界守衛" ANSI_COLOR(37;45) " 什麼 錢沒帶夠 " "沒錢的小鬼 快去籌錢吧 " ANSI_RESET); bell(); @@ -846,6 +847,29 @@ recover_chicken(chicken_t * thechicken) return 0; } +void +chicken_toggle_death(const char *uid) +{ + chicken_t *mychicken = load_live_chicken(uid); + if (!uid) + return; + if (!mychicken) + { + vmsgf("%s 沒養寵物。", uid); + } + else if (mychicken->name[0]) + { + mychicken->name[0] = 0; + vmsgf("%s 的寵物被殺死了", uid); + } + else + { + strlcpy(mychicken->name, "[死]", sizeof(mychicken->name)); + vmsgf("%s 的寵物復活了", uid); + } + free_live_chicken(mychicken); +} + #define lockreturn0(unmode, state) if(lockutmpmode(unmode, state)) return 0 int diff --git a/mbbsd/mail.c b/mbbsd/mail.c index 2fdfd491..530d23aa 100644 --- a/mbbsd/mail.c +++ b/mbbsd/mail.c @@ -942,8 +942,8 @@ mailtitle(void) int msglen = 0; showtitle("郵件選單", BBSName); - prints("[←]離開[↑↓]選擇[→]閱\讀信件 [R]回信 [x]轉達 " - "[y]群組回信 [O]站外信:%s [h]求助\n" + prints("[←]離開[↑↓]選擇[→]閱\讀信件 [X]轉錄看板[F]轉寄站外 " + " [O]站外信:%s [h]求助\n" ANSI_COLOR(7) " 編號 %s 作 者 信 件 標 題" "", REJECT_OUTTAMAIL ? ANSI_COLOR(31) "關" ANSI_RESET : "開", @@ -1507,6 +1507,11 @@ mail_man(void) int mode0 = currutmp->mode; int stat0 = currstat; + // TODO if someday we put things in user man...? + + if (!HasUserPerm(PERM_MAILLIMIT)) + return DONOTHING; + sethomeman(buf, cuser.userid); snprintf(buf1, sizeof(buf1), "%s 的信件夾", cuser.userid); a_menu(buf1, buf, HasUserPerm(PERM_MAILLIMIT) ? 1 : 0, 0, NULL); @@ -1522,7 +1527,7 @@ mail_cite(int ent, fileheader_t * fhdr, const char *direct) { char fpath[PATHLEN]; char title[TTLEN + 1]; - static char xboard[20]; + static char xboard[20] = ""; char buf[20]; int bid; @@ -1538,7 +1543,11 @@ mail_cite(int ent, fileheader_t * fhdr, const char *direct) clrtoeol(); move(1, 0); - CompleteBoard("輸入看板名稱 (直接Enter進入私人信件夾):", buf); + CompleteBoard( + HasUserPerm(PERM_MAILLIMIT) ? + "輸入看板名稱 (直接Enter進入私人信件夾):" : + "輸入看板名稱:", + buf); if (*buf) strlcpy(xboard, buf, sizeof(xboard)); if (*xboard && ((bid = getbnum(xboard)) > 0)){ /* XXXbid */ diff --git a/mbbsd/user.c b/mbbsd/user.c index 9c686b24..c077280a 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -554,7 +554,7 @@ uinfo_query(userec_t *u, int adminmode, int unum) memcpy(&x, u, sizeof(userec_t)); ans = getans(adminmode ? - "(1)改資料(2)密碼(3)權限(4)砍帳號(5)改ID(7)審判(M)信箱 [0]結束 " : + "(1)改資料(2)密碼(3)權限(4)砍帳號(5)改ID(6)寵物(7)審判(M)信箱 [0]結束 " : "請選擇 (1)修改資料 (2)設定密碼 (M)修改信箱 (C) 個人化設定 ==> [0]結束 "); if (ans > '2' && ans != 'm' && ans != 'c' && !adminmode) @@ -948,6 +948,9 @@ uinfo_query(userec_t *u, int adminmode, int unum) strlcpy(x.userid, genbuf, sizeof(x.userid)); } break; + case '6': + chicken_toggle_death(x.userid); + break; default: return; } |