diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2010-10-31 20:06:16 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2010-10-31 20:06:16 +0800 |
commit | 7318511b631832a4356c29153aedcc8007d9502d (patch) | |
tree | 3337e3861c9b183d56beb56082778f81cbb374ec | |
parent | 51b3d0004d77040c367ad843a40ceaea1721913f (diff) | |
download | pttbbs-7318511b631832a4356c29153aedcc8007d9502d.tar pttbbs-7318511b631832a4356c29153aedcc8007d9502d.tar.gz pttbbs-7318511b631832a4356c29153aedcc8007d9502d.tar.bz2 pttbbs-7318511b631832a4356c29153aedcc8007d9502d.tar.lz pttbbs-7318511b631832a4356c29153aedcc8007d9502d.tar.xz pttbbs-7318511b631832a4356c29153aedcc8007d9502d.tar.zst pttbbs-7318511b631832a4356c29153aedcc8007d9502d.zip |
add alerts to global gamble (openticket)
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5192 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/util/openticket.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/pttbbs/util/openticket.c b/pttbbs/util/openticket.c index d8161551..8ab89c2b 100644 --- a/pttbbs/util/openticket.c +++ b/pttbbs/util/openticket.c @@ -8,6 +8,19 @@ static char *betname[8] = {"Ptt", "Jaky", "Action", "Heat", #define MAX_DES 7 /* 最大保留獎數 */ +int +sendalert_uid(int uid, int alert){ + userinfo_t *uentp = NULL; + int n, i; + + n = count_logins(uid, 0); + for (i = 1; i <= n; i++) + if ((uentp = (userinfo_t *) search_ulistn(uid, i))) + uentp->alerts |= alert; + + return 0; +} + int main(int argc, char **argv) { int money, bet, n, total = 0, ticket[8] = @@ -119,6 +132,7 @@ int main(int argc, char **argv) Link(BBSHOME "/etc/ticket", genbuf); sprintf(genbuf, BBSHOME "/home/%c/%s/.DIR", userid[0], userid); append_record(genbuf, &mymail, sizeof(mymail)); + sendalert_uid(uid, ALERT_NEW_MAIL); } else { printf(" %-15s買了%9d 張 %s\n" ,userid, num, betname[mybet]); } |