summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pttbbs/include/proto.h1
-rw-r--r--pttbbs/include/pttstruct.h2
-rw-r--r--pttbbs/mbbsd/passwd.c8
-rw-r--r--pttbbs/mbbsd/talk.c5
4 files changed, 15 insertions, 1 deletions
diff --git a/pttbbs/include/proto.h b/pttbbs/include/proto.h
index 908fe9fd..f60e6fb4 100644
--- a/pttbbs/include/proto.h
+++ b/pttbbs/include/proto.h
@@ -787,6 +787,7 @@ int pwcuToggleOutMail (void);
int pwcuSetLoginView (unsigned int bits);
int pwcuSetLastSongTime (time4_t clk);
int pwcuSetMyAngel (const char *angel_uid);
+int pwcuPlayAngel (void);
int pwcuSetNickname (const char *nickname);
int pwcuChessResult (int sigType, ChessGameResult);
int pwcuSetChessEloRating(uint16_t elo_rating);
diff --git a/pttbbs/include/pttstruct.h b/pttbbs/include/pttstruct.h
index 83039215..c81a75d5 100644
--- a/pttbbs/include/pttstruct.h
+++ b/pttbbs/include/pttstruct.h
@@ -93,7 +93,7 @@ typedef struct userec_t {
char chkpad1[48];
time4_t lastseen; /* 最近上站時間(隱身不計) */
time4_t timesetangel; /* 上次得到天使時間 */
- time4_t _unused7; /* in case 有人忘了把 time4_t 調好... */
+ time4_t timeplayangel; /* 上次與天使互動時間 (by day) */
// 以上應為 sizeof(chicken_t) 同等大小
time4_t lastsong; /* 上次點歌時間 */
diff --git a/pttbbs/mbbsd/passwd.c b/pttbbs/mbbsd/passwd.c
index b0f5fdcd..3b33a529 100644
--- a/pttbbs/mbbsd/passwd.c
+++ b/pttbbs/mbbsd/passwd.c
@@ -200,6 +200,14 @@ int pwcuSetMyAngel (const char *angel_uid)
PWCU_END();
}
+int pwcuPlayAngel (void)
+{
+ syncnow();
+ PWCU_START();
+ u.timeplayangel = cuser.timeplayangel = now;
+ PWCU_END();
+}
+
int pwcuSetNickname (const char *nickname)
{
PWCU_START();
diff --git a/pttbbs/mbbsd/talk.c b/pttbbs/mbbsd/talk.c
index 4a495e9c..a1c133ec 100644
--- a/pttbbs/mbbsd/talk.c
+++ b/pttbbs/mbbsd/talk.c
@@ -961,6 +961,11 @@ my_write(pid_t pid, const char *prompt, const char *id, int flag, userinfo_t * p
switch (flag) {
#ifdef PLAY_ANGEL
case WATERBALL_ANGEL:
+ if ((now - cuser.timeplayangel) >= DAY_SECONDS)
+ pwcuPlayAngel();
+ uin->msgs[write_pos].msgmode = MSGMODE_TOANGEL;
+ break;
+
case WATERBALL_CONFIRM_ANGEL:
uin->msgs[write_pos].msgmode = MSGMODE_TOANGEL;
break;