// Token: 0x060040D6 RID: 16598 RVA: 0x0012F9B4 File Offset: 0x0012DBB4
 protected void OnBuyGiftStoreGoods(ConfigDataGiftStoreItemInfo goodsInfo)
 {
     if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_OnBuyGiftStoreGoodsConfigDataGiftStoreItemInfo_hotfix != null)
     {
         this.m_OnBuyGiftStoreGoodsConfigDataGiftStoreItemInfo_hotfix.call(new object[]
         {
             this,
             goodsInfo
         });
         return;
     }
     BJLuaObjHelper.IsSkipLuaHotfix = false;
     if (this.BuyGiftStoreGoodsEvent != null)
     {
         this.BuyGiftStoreGoodsEvent(goodsInfo.ID);
     }
     if (this.BuyStoreItemEvent != null)
     {
         if (goodsInfo.ItemType == GoodsType.GoodsType_MonthCard)
         {
             this.BuyStoreItemEvent(8, goodsInfo.ID);
         }
         else
         {
             this.BuyStoreItemEvent(7, goodsInfo.ID);
         }
     }
 }
        // Token: 0x0600700B RID: 28683 RVA: 0x001F521C File Offset: 0x001F341C
        public bool IsGiftStoreItemSellOut(GiftStoreItem item)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_IsGiftStoreItemSellOutGiftStoreItem_hotfix != null)
            {
                return(Convert.ToBoolean(this.m_IsGiftStoreItemSellOutGiftStoreItem_hotfix.call(new object[]
                {
                    this,
                    item
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            ConfigDataGiftStoreItemInfo configDataGiftStoreItemInfo = this.m_configDataLoader.GetConfigDataGiftStoreItemInfo(item.GoodsId);
            DateTime currentTime = this.m_basicInfo.GetCurrentTime();

            return(item.NextFlushTime > currentTime && configDataGiftStoreItemInfo.Count != 0 && item.BoughtNums >= configDataGiftStoreItemInfo.Count);
        }
        // Token: 0x060040CC RID: 16588 RVA: 0x0012F188 File Offset: 0x0012D388
        public List <GiftStoreItem> GetOfferedStoreItems()
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_GetOfferedStoreItems_hotfix != null)
            {
                return((List <GiftStoreItem>) this.m_GetOfferedStoreItems_hotfix.call(new object[]
                {
                    this
                }));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            DateTime             currentTime = this.m_basicInfo.GetCurrentTime();
            List <GiftStoreItem> offeredStoreItemsByConfig = this.GetOfferedStoreItemsByConfig();

            using (List <GiftStoreItem> .Enumerator enumerator = this.m_giftStoreDS.GetLocalBoughtItems().GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    GiftStoreItem localItem     = enumerator.Current;
                    GiftStoreItem giftStoreItem = offeredStoreItemsByConfig.Find((GiftStoreItem t) => t.GoodsId == localItem.GoodsId);
                    if (giftStoreItem != null)
                    {
                        if (localItem.NextFlushTime == DateTime.MaxValue)
                        {
                            ConfigDataGiftStoreItemInfo configDataGiftStoreItemInfo = this.m_configDataLoader.GetConfigDataGiftStoreItemInfo(localItem.GoodsId);
                            if (configDataGiftStoreItemInfo.Count != 0 && localItem.BoughtNums >= configDataGiftStoreItemInfo.Count)
                            {
                                offeredStoreItemsByConfig.Remove(giftStoreItem);
                                continue;
                            }
                        }
                        if (localItem.NextFlushTime > currentTime)
                        {
                            giftStoreItem.BoughtNums    = localItem.BoughtNums;
                            giftStoreItem.NextFlushTime = localItem.NextFlushTime;
                        }
                        else
                        {
                            giftStoreItem.NextFlushTime = GoodsNextFlushCaculateTools.CaculateNextFlushTime(giftStoreItem.Config.BuyLimitType, giftStoreItem.Config.Param, currentTime, localItem.NextFlushTime.Ticks);
                        }
                    }
                }
            }
            return(offeredStoreItemsByConfig);
        }
        // Token: 0x060040D0 RID: 16592 RVA: 0x0012F600 File Offset: 0x0012D800
        public int CanAppleSubscribeGoods(int goodsId)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_CanAppleSubscribeGoodsInt32_hotfix != null)
            {
                return(Convert.ToInt32(this.m_CanAppleSubscribeGoodsInt32_hotfix.call(new object[]
                {
                    this,
                    goodsId
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            int num = this.CanBuyGoods(goodsId);

            if (num != 0)
            {
                return(num);
            }
            ConfigDataGiftStoreItemInfo configDataGiftStoreItemInfo = this.m_configDataLoader.GetConfigDataGiftStoreItemInfo(goodsId);

            if (!configDataGiftStoreItemInfo.IsAppleSubscribe)
            {
                return(-5105);
            }
            if (configDataGiftStoreItemInfo.ItemType != GoodsType.GoodsType_MonthCard)
            {
                return(-5106);
            }
            if (configDataGiftStoreItemInfo.Nums != 1)
            {
                return(-5111);
            }
            MonthCard monthCard = this.m_resource.FindMonthCardById(configDataGiftStoreItemInfo.ItemId);

            if (monthCard != null && monthCard.ExpiredTime > this.m_basicInfo.GetCurrentTime())
            {
                return(-5107);
            }
            return(0);
        }
        // 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);
        }
        // Token: 0x060040CA RID: 16586 RVA: 0x0012EE2C File Offset: 0x0012D02C
        private void OnFlushBoughtNums()
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_OnFlushBoughtNums_hotfix != null)
            {
                this.m_OnFlushBoughtNums_hotfix.call(new object[]
                {
                    this
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            DateTime currentTime = this.m_basicInfo.GetCurrentTime();

            foreach (GiftStoreItem giftStoreItem in this.m_giftStoreDS.GetLocalBoughtItems())
            {
                ConfigDataGiftStoreItemInfo configDataGiftStoreItemInfo = this.m_configDataLoader.GetConfigDataGiftStoreItemInfo(giftStoreItem.GoodsId);
                if (configDataGiftStoreItemInfo != null && !(giftStoreItem.NextFlushTime > currentTime))
                {
                    giftStoreItem.BoughtNums    = 0;
                    giftStoreItem.NextFlushTime = GoodsNextFlushCaculateTools.CaculateNextFlushTime(configDataGiftStoreItemInfo.BuyLimitType, configDataGiftStoreItemInfo.Param, currentTime, giftStoreItem.NextFlushTime.Ticks);
                    this.m_giftStoreDS.SetDirty(true);
                }
            }
        }
 // Token: 0x06007035 RID: 28725 RVA: 0x001F5A98 File Offset: 0x001F3C98
 public void __callBase_OnBuyGiftStoreGoods(ConfigDataGiftStoreItemInfo goodsInfo)
 {
     this.m_owner.__callBase_OnBuyGiftStoreGoods(goodsInfo);
 }
 // Token: 0x06007021 RID: 28705 RVA: 0x001F5780 File Offset: 0x001F3980
 private void __callBase_OnBuyGiftStoreGoods(ConfigDataGiftStoreItemInfo goodsInfo)
 {
     base.OnBuyGiftStoreGoods(goodsInfo);
 }
 // Token: 0x060040F5 RID: 16629 RVA: 0x00130278 File Offset: 0x0012E478
 public void OnBuyGiftStoreGoods(ConfigDataGiftStoreItemInfo goodsInfo)
 {
     this.m_owner.OnBuyGiftStoreGoods(goodsInfo);
 }