diff options
author | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-06-08 02:54:52 +0800 |
---|---|---|
committer | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-06-08 02:54:52 +0800 |
commit | cdba92eb91393b1a87f9332f57a076e5c8557d2f (patch) | |
tree | 9a8c2a41db730a791c74e071d37395d7aff54c67 /mbbsd | |
parent | 61a9c3dfb82d33f741133573e2b3471073f78306 (diff) | |
download | pttbbs-cdba92eb91393b1a87f9332f57a076e5c8557d2f.tar pttbbs-cdba92eb91393b1a87f9332f57a076e5c8557d2f.tar.gz pttbbs-cdba92eb91393b1a87f9332f57a076e5c8557d2f.tar.bz2 pttbbs-cdba92eb91393b1a87f9332f57a076e5c8557d2f.tar.lz pttbbs-cdba92eb91393b1a87f9332f57a076e5c8557d2f.tar.xz pttbbs-cdba92eb91393b1a87f9332f57a076e5c8557d2f.tar.zst pttbbs-cdba92eb91393b1a87f9332f57a076e5c8557d2f.zip |
*** empty log message ***
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@310 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-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); /* 以下是給錢動作 */ |