Esempio n. 1
0
 // Token: 0x06004F91 RID: 20369 RVA: 0x0017F240 File Offset: 0x0017D440
 public static ProGiftStoreOperationalGoods ToPB(GiftStoreOperationalGoods goods)
 {
     return(new ProGiftStoreOperationalGoods
     {
         GoodsId = goods.GoodsId,
         SaleStartTime = goods.SaleStartTime.Ticks,
         SaleEndTime = goods.SaleEndTime.Ticks
     });
 }
        // Token: 0x060040CB RID: 16587 RVA: 0x0012EF50 File Offset: 0x0012D150
        private List <GiftStoreItem> GetOfferedStoreItemsByConfig()
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_GetOfferedStoreItemsByConfig_hotfix != null)
            {
                return((List <GiftStoreItem>) this.m_GetOfferedStoreItemsByConfig_hotfix.call(new object[]
                {
                    this
                }));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            List <GiftStoreItem> list        = new List <GiftStoreItem>();
            DateTime             currentTime = this.m_basicInfo.GetCurrentTime();

            foreach (KeyValuePair <int, ConfigDataGiftStoreItemInfo> keyValuePair in this.m_configDataLoader.GetAllConfigDataGiftStoreItemInfo())
            {
                GiftStoreItem giftStoreItem;
                if (keyValuePair.Value.IsOperateGoods)
                {
                    GiftStoreOperationalGoods giftStoreOperationalGoods = this.m_giftStoreDS.FindGiftStoreOperationalGoods(keyValuePair.Value.ID);
                    if (giftStoreOperationalGoods == null)
                    {
                        continue;
                    }
                    if (!this.IsOnSaleTime(giftStoreOperationalGoods.SaleStartTime, giftStoreOperationalGoods.SaleEndTime, currentTime))
                    {
                        continue;
                    }
                    giftStoreItem               = new GiftStoreItem();
                    giftStoreItem.GoodsId       = giftStoreOperationalGoods.GoodsId;
                    giftStoreItem.SaleStartTime = giftStoreOperationalGoods.SaleStartTime;
                    giftStoreItem.SaleEndTime   = giftStoreOperationalGoods.SaleEndTime;
                }
                else
                {
                    if (!this.IsOnSaleTime(DateTime.Parse(keyValuePair.Value.ShowStartTime), DateTime.Parse(keyValuePair.Value.ShowEndTime), currentTime))
                    {
                        continue;
                    }
                    giftStoreItem               = new GiftStoreItem();
                    giftStoreItem.GoodsId       = keyValuePair.Value.ID;
                    giftStoreItem.SaleStartTime = DateTime.Parse(keyValuePair.Value.ShowStartTime);
                    giftStoreItem.SaleEndTime   = DateTime.Parse(keyValuePair.Value.ShowEndTime);
                }
                giftStoreItem.BoughtNums    = 0;
                giftStoreItem.Config        = keyValuePair.Value;
                giftStoreItem.IsFirstBuy    = !this.HasBought(keyValuePair.Value.ID);
                giftStoreItem.NextFlushTime = GoodsNextFlushCaculateTools.CaculateNextFlushTime(keyValuePair.Value.BuyLimitType, keyValuePair.Value.Param, currentTime, 0L);
                list.Add(giftStoreItem);
            }
            return(list);
        }
        // Token: 0x060040CF RID: 16591 RVA: 0x0012F4AC File Offset: 0x0012D6AC
        public virtual int CanBuyGoods(int goodsId)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_CanBuyGoodsInt32_hotfix != null)
            {
                return(Convert.ToInt32(this.m_CanBuyGoodsInt32_hotfix.call(new object[]
                {
                    this,
                    goodsId
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            ConfigDataGiftStoreItemInfo configDataGiftStoreItemInfo = this.m_configDataLoader.GetConfigDataGiftStoreItemInfo(goodsId);

            if (configDataGiftStoreItemInfo == null)
            {
                return(-5100);
            }
            DateTime currentTime = this.m_basicInfo.GetCurrentTime();

            if (configDataGiftStoreItemInfo.IsOperateGoods)
            {
                GiftStoreOperationalGoods giftStoreOperationalGoods = this.m_giftStoreDS.FindGiftStoreOperationalGoods(goodsId);
                if (giftStoreOperationalGoods == null || !this.IsOnSaleTime(giftStoreOperationalGoods.SaleStartTime, giftStoreOperationalGoods.SaleEndTime, currentTime))
                {
                    return(-5101);
                }
            }
            else if (!this.IsOnSaleTime(DateTime.Parse(configDataGiftStoreItemInfo.ShowStartTime), DateTime.Parse(configDataGiftStoreItemInfo.ShowEndTime), currentTime))
            {
                return(-5101);
            }
            GiftStoreItem giftStoreItem = this.m_giftStoreDS.FindLocalBoughtItemById(goodsId);

            if (giftStoreItem != null && giftStoreItem.NextFlushTime > currentTime && configDataGiftStoreItemInfo.Count != 0 && configDataGiftStoreItemInfo.Count <= giftStoreItem.BoughtNums)
            {
                return(-5102);
            }
            return(0);
        }
Esempio n. 4
0
 // Token: 0x06004B2B RID: 19243 RVA: 0x00175C8C File Offset: 0x00173E8C
 public void InitOperationalGoodsList(GiftStoreOperationalGoods goods)
 {
     this.m_operationalGoodsList.Add(goods);
 }