diff options
-rw-r--r-- | include/proto.h | 3 | ||||
-rw-r--r-- | include/pttstruct.h | 4 | ||||
-rw-r--r-- | include/uflags.h | 18 | ||||
-rw-r--r-- | mbbsd/mbbsd.c | 6 | ||||
-rw-r--r-- | mbbsd/talk.c | 27 | ||||
-rw-r--r-- | mbbsd/user.c | 30 |
6 files changed, 15 insertions, 73 deletions
diff --git a/include/proto.h b/include/proto.h index f324d338..b46b8b0d 100644 --- a/include/proto.h +++ b/include/proto.h @@ -663,9 +663,6 @@ int query_online(const char *userid); int t_changeangel(void); int t_angelmsg(void); void CallAngel(void); -void SwitchBeingAngel(void); -void SwitchAngelSex(int); -int t_switchangel(void); #endif /* tmpjack */ diff --git a/include/pttstruct.h b/include/pttstruct.h index 4e8f6983..cc766a40 100644 --- a/include/pttstruct.h +++ b/include/pttstruct.h @@ -310,14 +310,14 @@ typedef struct userinfo_t { char from[27]; /* machine name the user called in from */ int from_alias; char sex; - char nonuse[4]; + char nonuse[5]; /* unsigned char goodpost; unsigned char badpost; unsigned char goodsale; unsigned char badsale; + unsigned char angel; // deprecated: angel reject status */ - unsigned char angel; /* friends */ int friendtotal; /* 好友比較的cache 大小 */ diff --git a/include/uflags.h b/include/uflags.h index dcc4c84e..8ab31e09 100644 --- a/include/uflags.h +++ b/include/uflags.h @@ -68,15 +68,17 @@ #define REJ_OUTTAMAIL 0x00000400 /* true if don't accept outside mails */ #define REJECT_OUTTAMAIL (cuser.uflag2 & REJ_OUTTAMAIL) -/* ANGEL */ -#define REJ_QUESTION 0x00000800 /* true if don't want to be angel for a while */ -#define ANGEL_R_MAEL 0x00001000 /* true if reject male */ -#define ANGEL_R_FEMAEL 0x00002000 /* true if reject female */ -#define ANGEL_MASK 0x00003000 -#define REJECT_QUESTION (cuser.uflag2 & REJ_QUESTION) -#define ANGEL_STATUS() ((cuser.uflag2 & ANGEL_MASK) >> 12) -#define ANGEL_SET(X) (cuser.uflag2 = (cuser.uflag2 & ~ANGEL_MASK) | \ +/* ANGEL [deprecated] */ +// #define REJ_QUESTION 0x00000800 /* true if don't want to be angel for a while */ // deprecated +// #define ANGEL_R_MAEL 0x00001000 /* true if reject male */ // deprecated +// #define ANGEL_R_FEMAEL 0x00002000 /* true if reject female */ // deprecated +// #define ANGEL_MASK 0x00003000 +// #define REJECT_QUESTION (cuser.uflag2 & REJ_QUESTION) // deprecated +// #define ANGEL_STATUS() ((cuser.uflag2 & ANGEL_MASK) >> 12) +/* + #define ANGEL_SET(X) (cuser.uflag2 = (cuser.uflag2 & ~ANGEL_MASK) | \ (((X) & 3) << 12)) + */ // #define ANGEL_??? 0x00004000 // #define ANGEL_??? 0x00008000 diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index a8e6e453..0e0bc8a5 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -991,12 +991,6 @@ setup_utmp(int mode) if (enter_uflag & CLOAK_FLAG) uinfo.invisible = YEA; -#ifdef PLAY_ANGEL - if (REJECT_QUESTION) - uinfo.angel = 1; - uinfo.angel |= ANGEL_STATUS() << 1; -#endif - getnewutmpent(&uinfo); currmode = MODE_STARTED; SHM->UTMPneedsort = 1; diff --git a/mbbsd/talk.c b/mbbsd/talk.c index 1468221a..6f45650f 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -3471,8 +3471,7 @@ FindAngel(void){ nAngel = 0; j = SHM->currsorted; for (i = 0; i < SHM->UTMPnumber; ++i) - if ((SHM->uinfo[SHM->sorted[j][0][i]].userlevel & PERM_ANGEL) - && (SHM->uinfo[SHM->sorted[j][0][i]].angel & mask) == 0) + if (SHM->uinfo[SHM->sorted[j][0][i]].userlevel & PERM_ANGEL) ++nAngel; if (nAngel == 0) @@ -3481,13 +3480,11 @@ FindAngel(void){ choose = random() % nAngel + 1; j = SHM->currsorted; for (i = 0; i < SHM->UTMPnumber && choose; ++i) - if ((SHM->uinfo[SHM->sorted[j][0][i]].userlevel & PERM_ANGEL) - && (SHM->uinfo[SHM->sorted[j][0][i]].angel & mask) == 0) + if (SHM->uinfo[SHM->sorted[j][0][i]].userlevel & PERM_ANGEL) --choose; if (choose == 0 && SHM->uinfo[SHM->sorted[j][0][i - 1]].uid != currutmp->uid && (SHM->uinfo[SHM->sorted[j][0][i - 1]].userlevel & PERM_ANGEL) - && ((SHM->uinfo[SHM->sorted[j][0][i - 1]].angel & mask) == 0) && !he_reject_me(&SHM->uinfo[SHM->sorted[j][0][i - 1]]) ){ strlcpy(cuser.myangel, SHM->uinfo[SHM->sorted[j][0][i - 1]].userid, IDLEN + 1); passwd_update(usernum, &cuser); @@ -3610,7 +3607,7 @@ TalkToAngel(){ } uent = search_ulist_userid(cuser.myangel); - if (uent == 0 || (uent->angel & 1) || he_reject_me(uent)){ + if (uent == 0 || he_reject_me(uent)){ AngelNotOnline(); return; } @@ -3645,22 +3642,4 @@ CallAngel(){ entered = 0; } -void -SwitchBeingAngel(){ - cuser.uflag2 ^= REJ_QUESTION; - currutmp->angel ^= 1; -} - -void -SwitchAngelSex(int newmode){ - ANGEL_SET(newmode); - currutmp->angel = (currutmp->angel & ~0x6) | ((newmode & 3) << 1); -} - -int -t_switchangel(){ - SwitchBeingAngel(); - outs(REJECT_QUESTION ? "休息一會兒" : "開放小主人問問題"); - return XEASY; -} #endif diff --git a/mbbsd/user.c b/mbbsd/user.c index 739ab1e4..6ed90b72 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -426,22 +426,6 @@ void Customize(void) '1' + iax++, "目前的心情", mindbuf); -#ifdef PLAY_ANGEL - /* damn it, dirty stuff here */ - if( HasUserPerm(PERM_ANGEL) ) - { - const char *am[4] = - {"男女皆可", "限女生", "限男生", "暫不接受新的小主人"}; - prints("%c. %-40s%10s\n", - '1' + iax++, - "開放小主人詢問", - (REJECT_QUESTION ? "否" : "是")); - prints("%c. %-40s%10s\n", - '1' + iax++, - "接受的小主人性別", - am[ANGEL_STATUS()]); - } -#endif } /* input */ @@ -498,20 +482,6 @@ void Customize(void) } continue; } -#ifdef PLAY_ANGEL - if( HasUserPerm(PERM_ANGEL) ){ - if (key == iax-2) - { - SwitchBeingAngel(); - dirty = 1; continue; - } - else if (key == iax-1) - { - SwitchAngelSex(ANGEL_STATUS() + 1); - dirty = 1; continue; - } - } -#endif } |