summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2013-06-28 16:31:43 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2013-06-28 16:31:43 +0800
commit02f35199a0838b30bdb2eb54dfa675ad92936532 (patch)
tree02886f8ad31469eae98105131045392c07edf5fe
parent58ea65d223336b5b34117c5b4ac1b246b387310a (diff)
downloadpttbbs-02f35199a0838b30bdb2eb54dfa675ad92936532.tar
pttbbs-02f35199a0838b30bdb2eb54dfa675ad92936532.tar.gz
pttbbs-02f35199a0838b30bdb2eb54dfa675ad92936532.tar.bz2
pttbbs-02f35199a0838b30bdb2eb54dfa675ad92936532.tar.lz
pttbbs-02f35199a0838b30bdb2eb54dfa675ad92936532.tar.xz
pttbbs-02f35199a0838b30bdb2eb54dfa675ad92936532.tar.zst
pttbbs-02f35199a0838b30bdb2eb54dfa675ad92936532.zip
Correct playangl time
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5849 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/include/proto.h1
-rw-r--r--pttbbs/mbbsd/angel.c10
-rw-r--r--pttbbs/mbbsd/talk.c3
3 files changed, 12 insertions, 2 deletions
diff --git a/pttbbs/include/proto.h b/pttbbs/include/proto.h
index 630185f1..3b5577da 100644
--- a/pttbbs/include/proto.h
+++ b/pttbbs/include/proto.h
@@ -40,6 +40,7 @@ int angel_reject_me(userinfo_t * uin);
void angel_register_new(const char *userid);
void angel_notify_activity(const char *userid);
void angel_log_order_song(const char *angel_nick);
+void angel_log_msg_to_angel(void);
const char *angel_order_song(char *receiver, size_t sz_receiver);
void CallAngel(void);
void angel_toggle_pause();
diff --git a/pttbbs/mbbsd/angel.c b/pttbbs/mbbsd/angel.c
index d083e66a..3cd40d62 100644
--- a/pttbbs/mbbsd/angel.c
+++ b/pttbbs/mbbsd/angel.c
@@ -467,6 +467,16 @@ angel_log_order_song(const char *angel_nick) {
pwcuPlayAngel();
}
+void
+angel_log_msg_to_angel(void) {
+ if (cuser.timeplayangel > cuser.timesetangel) {
+ // Try to avoid mass logs
+ if ((now - cuser.timeplayangel) >= ANGEL_CHANGE_TIMELIMIT_MINS * 60)
+ return;
+ }
+ pwcuPlayAngel();
+}
+
int a_angelreport() {
angel_beats_report rpt = {0};
angel_beats_data req = {0};
diff --git a/pttbbs/mbbsd/talk.c b/pttbbs/mbbsd/talk.c
index 35b9a406..d83d0556 100644
--- a/pttbbs/mbbsd/talk.c
+++ b/pttbbs/mbbsd/talk.c
@@ -959,8 +959,7 @@ 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();
+ angel_log_msg_to_angel();
uin->msgs[write_pos].msgmode = MSGMODE_TOANGEL;
break;