diff options
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/admin.c | 7 | ||||
-rw-r--r-- | mbbsd/read.c | 7 | ||||
-rw-r--r-- | mbbsd/user.c | 34 |
3 files changed, 23 insertions, 25 deletions
diff --git a/mbbsd/admin.c b/mbbsd/admin.c index 5379d0be..aa370b1e 100644 --- a/mbbsd/admin.c +++ b/mbbsd/admin.c @@ -231,9 +231,10 @@ setperms(unsigned int pbits, char *pstring[]) ((pbits >> (i + 16)) & 1 ? "ˇ" : "X")); } clrtobot(); - while (getdata(b_lines - 1, 0, "請按 [A-5] 切換設定,按 [Return] 結束:", - choice, sizeof(choice), LCECHO)) { - i = choice[0] - 'a'; + while ( + (i = getans("請按 [A-5] 切換設定,按 [Return] 結束:"))!='\r') + { + i = i - 'a'; if (i < 0) i = choice[0] - '0' + 26; if (i >= NUMPERMS) diff --git a/mbbsd/read.c b/mbbsd/read.c index 5fcf885c..b771ccb9 100644 --- a/mbbsd/read.c +++ b/mbbsd/read.c @@ -238,9 +238,15 @@ cursor_pos(keeploc_t * locmem, int val, int from_top, int isshow) return DONOTHING; } if (val > last_line) + { + bell(); val = last_line; + } if (val <= 0) + { + bell(); val = 1; + } if (val >= top && val < top + p_lines) { if(isshow) { @@ -550,6 +556,7 @@ i_read_key(onekey_t * rcmdlist, keeploc_t * locmem, break; case Ctrl('Q'): mode = my_query(headers[locmem->crs_ln - locmem->top_ln].owner); + break; case Ctrl('S'): if (HAS_PERM(PERM_ACCOUNTS)) { int id; diff --git a/mbbsd/user.c b/mbbsd/user.c index f6681cc2..edbe4fb1 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -217,7 +217,7 @@ violate_law(userec_t * u, int unum) static void Customize(void) { - char ans[4], done = 0, mindbuf[5]; + char done = 0, mindbuf[5]; char *wm[3] = {"一般", "進階", "未來"}; showtitle("個人化設定", "個人化設定"); @@ -236,11 +236,7 @@ static void Customize(void) prints("%-30s%10s\n", "D. 目前的心情", mindbuf); prints("%-30s%10s\n", "E. 高亮度顯示我的最愛", ((cuser.uflag2 & FAVNOHILIGHT) ? "否" : "是")); - getdata(b_lines - 1, 0, "請按 [A-E] 切換設定,按 [Return] 結束:", - ans, 3, DOECHO); - - switch( ans[0] ){ - case 'A': + switch(getans("請按 [A-E] 切換設定,按 [Return] 結束:")){ case 'a':{ int currentset = cuser.uflag2 & WATER_MASK; currentset = (currentset + 1) % 3; @@ -249,17 +245,14 @@ static void Customize(void) vmsg("修正水球模式後請正常離線再重新上線"); } break; - case 'B': case 'b': cuser.userlevel ^= PERM_NOOUTMAIL; break; - case 'C': case 'c': cuser.uflag2 ^= FAVNEW_FLAG; if (cuser.uflag2 & FAVNEW_FLAG) subscribe_newfav(); break; - case 'D': case 'd':{ getdata(b_lines - 1, 0, "現在的心情? ", mindbuf, sizeof(mindbuf), DOECHO); @@ -271,7 +264,6 @@ static void Customize(void) memcpy(currutmp->mind, mindbuf, 4); } break; - case 'E': case 'e': cuser.uflag2 ^= FAVNOHILIGHT; break; @@ -280,7 +272,7 @@ static void Customize(void) } passwd_update(usernum, &cuser); } - pressanykey(); + vmsg("設定完成"); } void @@ -288,8 +280,8 @@ uinfo_query(userec_t * u, int real, int unum) { userec_t x; register int i = 0, fail, mail_changed; - int uid; - char ans[4], buf[STRLEN], *p; + int uid, ans; + char buf[STRLEN], *p; char genbuf[200], reason[50]; int money = 0; fileheader_t fhdr; @@ -300,23 +292,22 @@ uinfo_query(userec_t * u, int real, int unum) fail = mail_changed = 0; memcpy(&x, u, sizeof(userec_t)); - getdata(b_lines - 1, 0, real ? + ans = getans(real ? "(1)改資料(2)設密碼(3)設權限(4)砍帳號(5)改ID" "(6)殺/復活寵物(7)審判 [0]結束 " : - "請選擇 (1)修改資料 (2)設定密碼 (C) 個人化設定 ==> [0]結束 ", - ans, sizeof(ans), DOECHO); + "請選擇 (1)修改資料 (2)設定密碼 (C) 個人化設定 ==> [0]結束 "); - if (ans[0] > '2' && ans[0] != 'C' && ans[0] != 'c' && !real) - ans[0] = '0'; + if (ans > '2' && ans != 'C' && ans != 'c' && !real) + ans = '0'; - if (ans[0] == '1' || ans[0] == '3') { + if (ans == '1' || ans == '3') { clear(); i = 1; move(i++, 0); outs(msg_uid); outs(x.userid); } - switch (ans[0]) { + switch (ans) { case 'C': case 'c': Customize(); @@ -588,8 +579,7 @@ uinfo_query(userec_t * u, int real, int unum) pressanykey(); return; } - getdata(b_lines - 1, 0, msg_sure_ny, ans, 3, LCECHO); - if (*ans == 'y') { + if (getans(msg_sure_ny) == 'y') { if (flag) post_change_perm(temp, i, cuser.userid, x.userid); if (strcmp(u->userid, x.userid)) { |