Exemple #1
0
 public void CopyBuyHistoryList(ref List <BoCaiBuyItem> itemList, int roleID)
 {
     try
     {
         lock (this.mutex)
         {
             foreach (List <RoleBuyHistory> item in this.BuyItemHistoryDict.Values)
             {
                 RoleBuyHistory hostory = item.Find((RoleBuyHistory x) => x.RoleID == roleID);
                 if (null != hostory)
                 {
                     foreach (BoCaiBuyItem buyitem in hostory.BuyItemList)
                     {
                         itemList.Add(new BoCaiBuyItem
                         {
                             BuyNum      = buyitem.BuyNum,
                             strBuyValue = buyitem.strBuyValue,
                             DataPeriods = buyitem.DataPeriods
                         });
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         LogManager.WriteLog(LogTypes.Exception, string.Format("[ljl_caidaxiao_猜数字]{0}", ex.ToString()), null, true);
     }
 }
Exemple #2
0
 private void GetRank()
 {
     try
     {
         List <OpenLottery> openHistory = BoCaiManager.getInstance().GetNewOpenLottery10(this.BoCaiType);
         if (null != openHistory)
         {
             ReturnValue <List <KFBoCaoHistoryData> > msgData = TcpCall.KFBoCaiManager.GetWinHistory(this.BoCaiType);
             if (!msgData.IsReturn)
             {
                 LogManager.WriteLog(LogTypes.Error, "[ljl_caidaxiao_猜数字]猜数字获取排行 失败", null, true);
             }
             else
             {
                 List <KFBoCaoHistoryData> History = msgData.Value;
                 lock (this.mutex)
                 {
                     this.RankResult  = true;
                     this.OpenHistory = openHistory;
                     this.WinHistory.Clear();
                     if (null != History)
                     {
                         using (List <KFBoCaoHistoryData> .Enumerator enumerator = History.GetEnumerator())
                         {
                             while (enumerator.MoveNext())
                             {
                                 KFBoCaoHistoryData item = enumerator.Current;
                                 OpenLottery        data = this.OpenHistory.Find((OpenLottery x) => x.DataPeriods == item.DataPeriods);
                                 if (data != null && !string.IsNullOrEmpty(data.strWinNum))
                                 {
                                     item.OpenData = data.strWinNum;
                                     this.WinHistory.Add(item);
                                 }
                             }
                         }
                         List <long> DataPeriodsList  = new List <long>();
                         List <long> DataPeriodsList2 = new List <long>();
                         foreach (OpenLottery open in this.OpenHistory)
                         {
                             DataPeriodsList.Add(open.DataPeriods);
                         }
                         DataPeriodsList2 = this.BuyItemHistoryDict.Keys.ToList <long>();
                         using (List <long> .Enumerator enumerator3 = DataPeriodsList2.GetEnumerator())
                         {
                             while (enumerator3.MoveNext())
                             {
                                 long Periods = enumerator3.Current;
                                 if (DataPeriodsList.Find((long x) => x == Periods) < 1L)
                                 {
                                     this.BuyItemHistoryDict.Remove(Periods);
                                 }
                             }
                         }
                         foreach (long Periods2 in DataPeriodsList)
                         {
                             if (!this.BuyItemHistoryDict.ContainsKey(Periods2))
                             {
                                 List <BuyBoCai2SDB> ItemList;
                                 if (BoCaiManager.getInstance().GetBuyList2DB(this.BoCaiType, Periods2, out ItemList, 1))
                                 {
                                     List <RoleBuyHistory> roleBuyList = new List <RoleBuyHistory>();
                                     using (List <BuyBoCai2SDB> .Enumerator enumerator4 = ItemList.GetEnumerator())
                                     {
                                         while (enumerator4.MoveNext())
                                         {
                                             BuyBoCai2SDB   dbdata   = enumerator4.Current;
                                             RoleBuyHistory roledata = roleBuyList.Find((RoleBuyHistory x) => x.RoleID == dbdata.m_RoleID);
                                             if (null == roledata)
                                             {
                                                 roledata             = new RoleBuyHistory();
                                                 roledata.RoleID      = dbdata.m_RoleID;
                                                 roledata.BuyItemList = new List <BoCaiBuyItem>();
                                                 roleBuyList.Add(roledata);
                                             }
                                             roledata.BuyItemList.Add(new BoCaiBuyItem
                                             {
                                                 BuyNum      = dbdata.BuyNum,
                                                 strBuyValue = dbdata.strBuyValue,
                                                 DataPeriods = Periods2
                                             });
                                         }
                                     }
                                     this.BuyItemHistoryDict.Add(Periods2, roleBuyList);
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         LogManager.WriteLog(LogTypes.Exception, string.Format("[ljl_caidaxiao_猜数字]{0}", ex.ToString()), null, true);
     }
 }