diff options
-rw-r--r-- | include/config.h | 4 | ||||
-rw-r--r-- | mbbsd/cal.c | 28 | ||||
-rw-r--r-- | sample/pttbbs.conf | 3 |
3 files changed, 22 insertions, 13 deletions
diff --git a/include/config.h b/include/config.h index e2d2d17d..8ed367ab 100644 --- a/include/config.h +++ b/include/config.h @@ -198,6 +198,10 @@ #define HASH_BITS 16 /* userid->uid hashing bits */ #endif +#ifndef VICE_MIN +#define VICE_MIN (1) /* �̤p�o�����B */ +#endif // VICE_MIN + /* more.c ���峹���ƤW��(lines/22), +4 for safe */ #define MAX_PAGES (MAX_EDIT_LINE / 22 + 4) diff --git a/mbbsd/cal.c b/mbbsd/cal.c index 39f55514..fb5c12e6 100644 --- a/mbbsd/cal.c +++ b/mbbsd/cal.c @@ -62,24 +62,26 @@ unlockutmpmode(void) int vice(int money, const char *item) { - char buf[128]; - unsigned int viceserial = (currutmp->lastact % 10000) * 10000 + random() % 10000; + char buf[128]; + unsigned int viceserial = (currutmp->lastact % 10000) * 10000 + + random() % 10000; + // new logic: do not send useless vice tickets demoney(-money); - if(money>=100) - { - setuserfile(buf, VICE_NEW); - log_filef(buf, LOG_CREAT, "%8.8d\n", viceserial); - } + if (money < VICE_MIN) + return 0; + + setuserfile(buf, VICE_NEW); + log_filef(buf, LOG_CREAT, "%8.8d\n", viceserial); snprintf(buf, sizeof(buf), - "%s ��F$%d �s��[%08d]", item, money, viceserial); + "%s ��F$%d �s��[%08d]", item, money, viceserial); mail_id(cuser.userid, buf, "etc/vice.txt", BBSMNAME "�g�ٳ�"); return 0; } -#define lockreturn(unmode, state) if(lockutmpmode(unmode, state)) return +#define lockreturn(unmode, state) if(lockutmpmode(unmode, state)) return #define lockreturn0(unmode, state) if(lockutmpmode(unmode, state)) return 0 -#define lockbreak(unmode, state) if(lockutmpmode(unmode, state)) break +#define lockbreak(unmode, state) if(lockutmpmode(unmode, state)) break #define SONGBOOK "etc/SONGBOOK" #define OSONGPATH "etc/SONGO" @@ -205,13 +207,13 @@ osong(void) log_filef("etc/osong.log", LOG_CREAT, "id: %-12s �� %s �I�� %s : \"%s\", ��H�� %s\n", cuser.userid, sender, receiver, say, address); - if (append_record(OSONGPATH "/.DIR", &mail, sizeof(mail)) != -1) { + if (append_record(OSONGPATH "/" FN_DIR, &mail, sizeof(mail)) != -1) { cuser.lastsong = now; /* Jaky �W�L MAX_MOVIE ���q�N�}�l�� */ - nsongs = get_num_records(OSONGPATH "/.DIR", sizeof(mail)); + nsongs = get_num_records(OSONGPATH "/" FN_DIR, sizeof(mail)); if (nsongs > MAX_MOVIE) { // XXX race condition - delete_range(OSONGPATH "/.DIR", 1, nsongs - MAX_MOVIE); + delete_range(OSONGPATH "/" FN_DIR, 1, nsongs - MAX_MOVIE); } snprintf(genbuf, sizeof(genbuf), "%s says \"%s\" to %s.", sender, say, receiver); log_usies("OSONG", genbuf); diff --git a/sample/pttbbs.conf b/sample/pttbbs.conf index 37b416a5..7dea01e6 100644 --- a/sample/pttbbs.conf +++ b/sample/pttbbs.conf @@ -246,6 +246,9 @@ /* �Y�w�q, �s�O�]�w�۰ʶ}�O���A���L USE_AUTOCPLOG �٬O�n�}�~���� */ #define DEFAULT_AUTOCPLOG +/* �Y�w�q�A�֩ƥت������N���}�o�� */ +#define VICE_MIN (100) + /* �ذe�H�c */ //#define ADD_EXMAILBOX 100 |