diff options
author | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-06-08 01:38:31 +0800 |
---|---|---|
committer | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-06-08 01:38:31 +0800 |
commit | 48e482af368f894298bd35cb0eb8d41f77ea68af (patch) | |
tree | f900e399063a22dbf1288a382b0b550ae7afc2ae /mbbsd | |
parent | af701fbefaca5c71904190f96d59284fff4cfb3d (diff) | |
download | pttbbs-48e482af368f894298bd35cb0eb8d41f77ea68af.tar pttbbs-48e482af368f894298bd35cb0eb8d41f77ea68af.tar.gz pttbbs-48e482af368f894298bd35cb0eb8d41f77ea68af.tar.bz2 pttbbs-48e482af368f894298bd35cb0eb8d41f77ea68af.tar.lz pttbbs-48e482af368f894298bd35cb0eb8d41f77ea68af.tar.xz pttbbs-48e482af368f894298bd35cb0eb8d41f77ea68af.tar.zst pttbbs-48e482af368f894298bd35cb0eb8d41f77ea68af.zip |
add log
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@305 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/gamble.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/mbbsd/gamble.c b/mbbsd/gamble.c index 5409330d..4b7b25a4 100644 --- a/mbbsd/gamble.c +++ b/mbbsd/gamble.c @@ -1,4 +1,4 @@ -/* $Id: gamble.c,v 1.5 2002/06/07 17:19:47 ptt Exp $ */ +/* $Id: gamble.c,v 1.6 2002/06/07 17:38:31 ptt Exp $ */ #include "bbs.h" #ifndef _BBS_UTIL_C_ @@ -292,37 +292,36 @@ int openticket(int bid) { Cdatelite(&now), betname[bet], total*price, money, total? (float)ticket[bet] / total:0); - fclose(fp); } fclose(fp1); setbfile(buf, bh->brdname, FN_TICKET_END); unlink(buf); if(fork()) - { + { // Ptt ��fork������`�_�u�~�� + fclose(fp); more(outcome,YEA); + move(22,0); + prints("�t�αN��y��۰ʧ⤤�����G���G��ݪO �Y�ѥ[�̦h�|�ݭn�X�����ɶ�.."); unlockutmpmode(); return 0; } close(0); close(1); - sprintf(buf, "[���i] %s ��L�}��", bh->brdname); - post_file(bh->brdname, buf, outcome, "[�䯫]"); - post_file("Record", buf+7, outcome, "[�������l]"); /* �H�U�O�����ʧ@ */ setbfile(buf, bh->brdname, FN_TICKET_USER); - if (ticket[bet] && (fp = fopen(buf, "r"))) + if (ticket[bet] && (fp1 = fopen(buf, "r"))) { int mybet, uid; char userid[IDLEN]; - while (fscanf(fp, "%s %d %d\n", userid, &mybet, &i) != EOF) + while (fscanf(fp1, "%s %d %d\n", userid, &mybet, &i) != EOF) { if (mybet == bet) { - printf("���� %-15s�R�F%9d �i %s, ��o %d �T��\n" + fprintf(fp,"���� %-15s�R�F%9d �i %s, ��o %d �T��\n" ,userid, i, betname[mybet], money * i); if((uid=getuser(userid))==0) continue; deumoney(uid, money * i); @@ -330,7 +329,14 @@ int openticket(int bid) { mail_id(userid, buf, outcome, "Ptt���"); } } + fclose(fp1); } + fclose(fp); + + sprintf(buf, "[���i] %s ��L�}��", bh->brdname); + post_file(bh->brdname, buf, outcome, "[�䯫]"); + post_file("Record", buf+7, outcome, "[�������l]"); + setbfile(buf, bh->brdname, FN_TICKET_RECORD); unlink(buf); setbfile(buf, bh->brdname, FN_TICKET_USER); |