diff options
-rw-r--r-- | mbbsd/bbs.c | 4 | ||||
-rw-r--r-- | mbbsd/gamble.c | 29 |
2 files changed, 16 insertions, 17 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 6b08d1db..f6877570 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -1,4 +1,4 @@ -/* $Id: bbs.c,v 1.49 2002/06/06 21:34:11 in2 Exp $ */ +/* $Id: bbs.c,v 1.50 2002/06/07 18:54:52 ptt Exp $ */ #include "bbs.h" static void mail_by_link(char* owner, char* title, char* path) { @@ -974,7 +974,7 @@ static int hold_gamble(int ent, fileheader_t *fhdr, char *direct) { if(dashf(fn_ticket_end)) { getdata(b_lines - 1, 0, "已經有舉辦賭盤, " - "是否要 [開獎]?(N/y):", yn, 3, LCECHO); + "是否要 [開獎/取消]?(N/y):", yn, 3, LCECHO); if(yn[0]!='y') return FULLUPDATE; openticket(currbid); return FULLUPDATE; diff --git a/mbbsd/gamble.c b/mbbsd/gamble.c index 253c6682..a73460f9 100644 --- a/mbbsd/gamble.c +++ b/mbbsd/gamble.c @@ -1,4 +1,4 @@ -/* $Id: gamble.c,v 1.10 2002/06/07 18:47:40 ptt Exp $ */ +/* $Id: gamble.c,v 1.11 2002/06/07 18:54:52 ptt Exp $ */ #include "bbs.h" #ifndef _BBS_UTIL_C_ @@ -248,15 +248,24 @@ int openticket(int bid) { getdata(21, 0, "\033[1m再次確認輸入號碼\033[m:", buf, 3, LCECHO); }while(bet!=atoi(buf)); + if(fork()) + { // Ptt 用fork防止不正常斷線洗錢 + move(22,0); + prints("系統將於稍後自動把中獎結果公佈於看板 若參加者多會需要幾分鐘時間.."); + pressanykey(); + unlockutmpmode(); + return 0; + } + close(0); + close(1); + bet -= 1; //轉成矩陣的index total=load_ticket_record(path, ticket); setbfile(buf,bh->brdname,FN_TICKET_END); if(!(fp1 = fopen(buf,"r"))) - { - unlockutmpmode(); - return 0; - } + exit(1); + // 還沒開完獎不能賭博 只要mv一項就好 if(bet!=98) { @@ -311,16 +320,6 @@ int openticket(int bid) { setbfile(buf, bh->brdname, FN_TICKET_END); unlink(buf); - if(fork()) - { // Ptt 用fork防止不正常斷線洗錢 - move(22,0); - prints("系統將於稍後自動把中獎結果公佈於看板 若參加者多會需要幾分鐘時間.."); - pressanykey(); - unlockutmpmode(); - return 0; - } - close(0); - close(1); /* 以下是給錢動作 */ |