From b9b08dc09359d17ea223c984d21978c996960577 Mon Sep 17 00:00:00 2001
From: ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>
Date: Sat, 22 Jun 2002 07:23:22 +0000
Subject: o    fix openticket tick;

git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@332 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
---
 mbbsd/bbs.c    | 10 +++++++++-
 mbbsd/gamble.c |  9 ++++++---
 2 files changed, 15 insertions(+), 4 deletions(-)

(limited to 'mbbsd')

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, "�w�g���|���L, "
@@ -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(" �ثe�����t�Υ��b�B�z�}���Ʃy, �еy��A�|��  "); 
+      pressanykey();
+      return FULLUPDATE; 
+    }
    getdata(b_lines - 2, 0, "�n�|���L (N/y):", yn, 3, LCECHO);
    if(yn[0]!='y') return FULLUPDATE;
    getdata(b_lines - 1, 0, "�䤰��? �п�J�D�D (��J��s�褺�e):",
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);	
     /*
       �H�U�O�����ʧ@
     */
@@ -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;
 }
-- 
cgit v1.2.3