summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mbbsd/bbs.c10
-rw-r--r--mbbsd/gamble.c9
2 files changed, 15 insertions, 4 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index ed27b214..4a09f955 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -1,4 +1,4 @@
-/* $Id: bbs.c,v 1.54 2002/06/19 13:40:50 lwms Exp $ */
+/* $Id: bbs.c,v 1.55 2002/06/22 07:23:22 ptt Exp $ */
#include "bbs.h"
static void mail_by_link(char* owner, char* title, char* path) {
@@ -966,6 +966,7 @@ static int hold_gamble(int ent, fileheader_t *fhdr, char *direct) {
if(!(currmode & MODE_BOARD)) return 0;
setbfile(fn_ticket, currboard, FN_TICKET);
setbfile(fn_ticket_end, currboard, FN_TICKET_END);
+ setbfile(genbuf, currboard, FN_TICKET_LOCK);
if(dashf(fn_ticket))
{
getdata(b_lines - 1, 0, "已經有舉辦賭盤, "
@@ -983,6 +984,13 @@ static int hold_gamble(int ent, fileheader_t *fhdr, char *direct) {
openticket(currbid);
return FULLUPDATE;
}
+ else if(dashf(genbuf))
+ {
+ move(20,20);
+ prints(" 目前本版系統正在處理開獎事宜, 請稍後再舉辦 ");
+ pressanykey();
+ return FULLUPDATE;
+ }
getdata(b_lines - 2, 0, "要舉辦賭盤 (N/y):", yn, 3, LCECHO);
if(yn[0]!='y') return FULLUPDATE;
getdata(b_lines - 1, 0, "賭什麼? 請輸入主題 (輸入後編輯內容):",
diff --git a/mbbsd/gamble.c b/mbbsd/gamble.c
index ff1c39d6..917d71b6 100644
--- a/mbbsd/gamble.c
+++ b/mbbsd/gamble.c
@@ -1,4 +1,4 @@
-/* $Id: gamble.c,v 1.16 2002/06/19 13:28:16 lwms Exp $ */
+/* $Id: gamble.c,v 1.17 2002/06/22 07:23:22 ptt Exp $ */
#include "bbs.h"
#ifndef _BBS_UTIL_C_
@@ -320,7 +320,8 @@ int openticket(int bid) {
fclose(fp1);
setbfile(buf, bh->brdname, FN_TICKET_END);
- unlink(buf);
+ setbfile(path, bh->brdname, FN_TICKET_LOCK);
+ rename(buf, path);
/*
以下是給錢動作
*/
@@ -346,7 +347,7 @@ int openticket(int bid) {
}
else
continue;
- if((uid=getuser(userid))==0) continue;
+ if((uid=searchuser(userid))==0) continue;
deumoney(uid, money * i);
mail_id(userid, buf, "etc/ticket.win", "Ptt賭場");
}
@@ -366,6 +367,8 @@ int openticket(int bid) {
unlink(buf);
setbfile(buf, bh->brdname, FN_TICKET_USER);
unlink(buf);
+ setbfile(buf, bh->brdname, FN_TICKET_LOCK);
+ unlink(buf);
exit(1);
return 0;
}