Example #1
0
 public static bool CopyHistoryData(List <KFBoCaoHistoryData> sData, out List <KFBoCaoHistoryData> rData)
 {
     rData = new List <KFBoCaoHistoryData>();
     try
     {
         foreach (KFBoCaoHistoryData item in sData)
         {
             KFBoCaoHistoryData data = new KFBoCaoHistoryData();
             if (GlobalNew.Copy <KFBoCaoHistoryData>(item, ref data))
             {
                 rData.Add(data);
             }
         }
         return(true);
     }
     catch (Exception ex)
     {
         LogManager.WriteLog(LogTypes.Exception, string.Format("[ljl]{0}", ex.ToString()), null, true);
     }
     return(false);
 }
Example #2
0
 private void OpenLotterySetWin()
 {
     try
     {
         if (this.StageData.Stage == 5 && !this.ServerData.IsAward)
         {
             if (string.IsNullOrEmpty(this.ServerOpenData.strWinNum) || string.IsNullOrEmpty(this.ServerOpenData.WinInfo))
             {
                 this.GetOpenLotteryData(false);
             }
             if (this.FirstDataPeriods == this.ServerOpenData.DataPeriods && this.FirstDataPeriods > 0L)
             {
                 if (null != this.StartServerOpenData)
                 {
                     if (this.StartServerOpenData.DataPeriods == this.FirstDataPeriods && this.StartServerOpenData.IsAward)
                     {
                         return;
                     }
                 }
                 else if (this.StartServerStage > BoCaiStageEnum.Stage_Open)
                 {
                     return;
                 }
             }
             if (this.ServerOpenData.DataPeriods >= 1L && this.ServerOpenData.XiaoHaoDaiBi >= 1 && !string.IsNullOrEmpty(this.ServerOpenData.strWinNum) && !string.IsNullOrEmpty(this.ServerOpenData.WinInfo))
             {
                 LogManager.WriteLog(LogTypes.Info, string.Format("[ljl_caidaxiao_猜数字]猜数字 开奖 GetOpenLottery su DataPeriods={0}", this.ServerOpenData.DataPeriods), null, true);
                 List <BuyBoCai2SDB> BuyList = new List <BuyBoCai2SDB>();
                 lock (this.mutex)
                 {
                     foreach (PlayerBuyBoCaiData PlayerBuyData in this.BoCaiBaseList)
                     {
                         BuyBoCai2SDB buyItem = new BuyBoCai2SDB
                         {
                             ZoneID      = PlayerBuyData.ZoneID,
                             m_RoleID    = PlayerBuyData.RoleID,
                             ServerId    = PlayerBuyData.ServerId,
                             strUserID   = PlayerBuyData.strUserID,
                             m_RoleName  = PlayerBuyData.RoleName,
                             DataPeriods = this.ServerOpenData.DataPeriods,
                             BocaiType   = this.BoCaiType,
                             IsSend      = false,
                             IsWin       = false
                         };
                         foreach (BoCaiBuyItem item in PlayerBuyData.BuyItemList)
                         {
                             if (item.DataPeriods == this.ServerOpenData.DataPeriods)
                             {
                                 BuyBoCai2SDB temp = new BuyBoCai2SDB();
                                 GlobalNew.Copy <BuyBoCai2SDB>(buyItem, ref temp);
                                 temp.BuyNum      = item.BuyNum;
                                 temp.strBuyValue = item.strBuyValue;
                                 BuyList.Add(temp);
                             }
                         }
                     }
                 }
                 this.ServerOpenData.IsAward = true;
                 this.ServerData.IsAward     = true;
                 foreach (BuyBoCai2SDB buyItem in BuyList)
                 {
                     if (!BoCaiManager.getInstance().SendWinItem(this.ServerOpenData, buyItem))
                     {
                         this.ServerOpenData.IsAward = false;
                     }
                 }
                 if (this.ServerOpenData.IsAward)
                 {
                     Global.Send2DB <OpenLottery>(2084, this.ServerOpenData, 0);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         LogManager.WriteLog(LogTypes.Exception, string.Format("[ljl_caidaxiao_猜数字]{0}", ex.ToString()), null, true);
     }
 }