// Token: 0x0600405E RID: 16478 RVA: 0x0012C31C File Offset: 0x0012A51C
 protected void BuyStoreItem(int storeId, FixedStoreItem storeItem, int count)
 {
     if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_BuyStoreItemInt32FixedStoreItemInt32_hotfix != null)
     {
         this.m_BuyStoreItemInt32FixedStoreItemInt32_hotfix.call(new object[]
         {
             this,
             storeId,
             storeItem,
             count
         });
         return;
     }
     BJLuaObjHelper.IsSkipLuaHotfix = false;
     if (storeItem.IsFirstBuy)
     {
         storeItem.IsFirstBuy = false;
     }
     this.m_fixedStoreDS.BuyStoreItem(storeItem, count);
     this.OnBuyStoreItem(storeItem, count);
     if (this.BuyStoreItemEvent != null)
     {
         this.BuyStoreItemEvent(storeId, storeItem.Id);
     }
 }
        // Token: 0x06004060 RID: 16480 RVA: 0x0012C478 File Offset: 0x0012A678
        private void OnAddSkin(FixedStoreItem storeItem)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_OnAddSkinFixedStoreItem_hotfix != null)
            {
                this.m_OnAddSkinFixedStoreItem_hotfix.call(new object[]
                {
                    this,
                    storeItem
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            ConfigDataFixedStoreItemInfo configDataFixedStoreItemInfo = this.m_configDataLoader.GetConfigDataFixedStoreItemInfo(storeItem.Id);
            StoreId storeID = configDataFixedStoreItemInfo.StoreID;

            if (storeID != StoreId.StoreId_SkinHero)
            {
                if (storeID == StoreId.StoreId_SkinSoldier)
                {
                    this.m_resource.AddSoldierSkin(configDataFixedStoreItemInfo.ItemId, GameFunctionType.GameFunctionType_None, null);
                }
            }
            else
            {
                this.m_resource.AddHeroSkin(configDataFixedStoreItemInfo.ItemId, GameFunctionType.GameFunctionType_None, null);
            }
        }
示例#3
0
        // Token: 0x06005141 RID: 20801 RVA: 0x001830E4 File Offset: 0x001812E4
        public static ProFixedStore FixedStoreToPBFixedStore(FixedStore store)
        {
            ProFixedStore proFixedStore = new ProFixedStore();

            proFixedStore.StoreId = store.Id;
            proFixedStore.Items.AddRange(FixedStoreItem.StoreItemsToPBStoreItems(store.Items));
            return(proFixedStore);
        }
示例#4
0
        // Token: 0x0600513F RID: 20799 RVA: 0x00183048 File Offset: 0x00181248
        public static FixedStore PBFixedStoreToFixedStore(ProFixedStore pbStore)
        {
            FixedStore fixedStore = new FixedStore();

            fixedStore.Id = pbStore.StoreId;
            fixedStore.Items.AddRange(FixedStoreItem.PBStoreItemsToStoreItems(pbStore.Items));
            return(fixedStore);
        }
        // Token: 0x0600405C RID: 16476 RVA: 0x0012BF5C File Offset: 0x0012A15C
        public FixedStore GetStore(int storeId)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_GetStoreInt32_hotfix != null)
            {
                return((FixedStore)this.m_GetStoreInt32_hotfix.call(new object[]
                {
                    this,
                    storeId
                }));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            FixedStore storeOfferingById = this.GetStoreOfferingById(storeId);

            if (storeOfferingById == null)
            {
                return(null);
            }
            FixedStore fixedStore = this.m_fixedStoreDS.FindStore(storeId);

            if (fixedStore == null)
            {
                return(storeOfferingById);
            }
            DateTime currentTime = this.m_basicInfo.GetCurrentTime();

            using (List <FixedStoreItem> .Enumerator enumerator = fixedStore.Items.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    FixedStoreItem localStoreItem = enumerator.Current;
                    FixedStoreItem fixedStoreItem = storeOfferingById.Items.Find((FixedStoreItem t) => t.Id == localStoreItem.Id);
                    if (fixedStoreItem != null)
                    {
                        ConfigDataFixedStoreItemInfo configDataFixedStoreItemInfo = this.m_configDataLoader.GetConfigDataFixedStoreItemInfo(fixedStoreItem.Id);
                        if (new DateTime(localStoreItem.NextFlushTime) == DateTime.MaxValue && configDataFixedStoreItemInfo.Count != 0 && localStoreItem.BoughtCount >= configDataFixedStoreItemInfo.Count)
                        {
                            storeOfferingById.Items.Remove(fixedStoreItem);
                        }
                        else
                        {
                            if (new DateTime(localStoreItem.NextFlushTime) > this.m_basicInfo.GetCurrentTime())
                            {
                                fixedStoreItem.BoughtCount   = localStoreItem.BoughtCount;
                                fixedStoreItem.NextFlushTime = localStoreItem.NextFlushTime;
                            }
                            else
                            {
                                fixedStoreItem.NextFlushTime = GoodsNextFlushCaculateTools.CaculateNextFlushTime(configDataFixedStoreItemInfo.BuyLimitType, configDataFixedStoreItemInfo.Param, currentTime, localStoreItem.NextFlushTime).Ticks;
                            }
                            fixedStoreItem.IsFirstBuy = localStoreItem.IsFirstBuy;
                        }
                    }
                }
            }
            return(storeOfferingById);
        }
示例#6
0
        // Token: 0x0600514F RID: 20815 RVA: 0x001832CC File Offset: 0x001814CC
        public static List <FixedStoreItem> PBStoreItemsToStoreItems(List <ProFixedStoreItem> pbStoreItems)
        {
            List <FixedStoreItem> list = new List <FixedStoreItem>();

            foreach (ProFixedStoreItem pbStoreItem in pbStoreItems)
            {
                list.Add(FixedStoreItem.PBStoreItemToStoreItem(pbStoreItem));
            }
            return(list);
        }
示例#7
0
        // Token: 0x0600514D RID: 20813 RVA: 0x00183220 File Offset: 0x00181420
        public static List <ProFixedStoreItem> StoreItemsToPBStoreItems(List <FixedStoreItem> storeItems)
        {
            List <ProFixedStoreItem> list = new List <ProFixedStoreItem>();

            foreach (FixedStoreItem storeItem in storeItems)
            {
                list.Add(FixedStoreItem.StoreItemToPBStoreItem(storeItem));
            }
            return(list);
        }
示例#8
0
 // Token: 0x0600514C RID: 20812 RVA: 0x001831D8 File Offset: 0x001813D8
 public static ProFixedStoreItem StoreItemToPBStoreItem(FixedStoreItem storeItem)
 {
     return(new ProFixedStoreItem
     {
         Id = storeItem.Id,
         BoughtCount = storeItem.BoughtCount,
         IsFirstBuy = storeItem.IsFirstBuy,
         NextFlushTime = storeItem.NextFlushTime
     });
 }
 // Token: 0x06004056 RID: 16470 RVA: 0x0012B980 File Offset: 0x00129B80
 public bool IsSoldOut(ConfigDataFixedStoreItemInfo itemConfig, FixedStoreItem item)
 {
     if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_IsSoldOutConfigDataFixedStoreItemInfoFixedStoreItem_hotfix != null)
     {
         return(Convert.ToBoolean(this.m_IsSoldOutConfigDataFixedStoreItemInfoFixedStoreItem_hotfix.call(new object[]
         {
             this,
             itemConfig,
             item
         })));
     }
     BJLuaObjHelper.IsSkipLuaHotfix = false;
     return(itemConfig.Count != 0 && item.BoughtCount >= itemConfig.Count);
 }
 // Token: 0x0600405F RID: 16479 RVA: 0x0012C3F0 File Offset: 0x0012A5F0
 private void OnBuyStoreItem(FixedStoreItem storeItem, int count)
 {
     if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_OnBuyStoreItemFixedStoreItemInt32_hotfix != null)
     {
         this.m_OnBuyStoreItemFixedStoreItemInt32_hotfix.call(new object[]
         {
             this,
             storeItem,
             count
         });
         return;
     }
     BJLuaObjHelper.IsSkipLuaHotfix = false;
     this.OnAddSkin(storeItem);
 }
        // Token: 0x06004059 RID: 16473 RVA: 0x0012BCBC File Offset: 0x00129EBC
        protected int CanBuyFixedStoreItem(ConfigDataFixedStoreItemInfo itemConfig, FixedStoreItem item)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_CanBuyFixedStoreItemConfigDataFixedStoreItemInfoFixedStoreItem_hotfix != null)
            {
                return(Convert.ToInt32(this.m_CanBuyFixedStoreItemConfigDataFixedStoreItemInfoFixedStoreItem_hotfix.call(new object[]
                {
                    this,
                    itemConfig,
                    item
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            if (!this.IsInSaleTime(itemConfig))
            {
                return(-1303);
            }
            bool isFirstBuy;

            if (item == null)
            {
                isFirstBuy = true;
            }
            else
            {
                isFirstBuy = this.m_fixedStoreDS.IsFirstBuy(item);
                if (new DateTime(item.NextFlushTime) > this.m_basicInfo.GetCurrentTime() && this.IsSoldOut(itemConfig, item))
                {
                    return(-1302);
                }
            }
            int consumeNums = this.CaculateCurrencyCount(itemConfig, isFirstBuy);
            int num         = this.m_basicInfo.IsCurrencyEnough(itemConfig.CurrencyType, consumeNums);

            if (num != 0)
            {
                return(num);
            }
            if (BagItemBase.IsBagItem(itemConfig.ItemType) && this.m_bag.IsBagFullByCurrentSize())
            {
                return(-500);
            }
            return(0);
        }
        // Token: 0x0600405D RID: 16477 RVA: 0x0012C18C File Offset: 0x0012A38C
        private FixedStore GetStoreOfferingById(int storeId)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_GetStoreOfferingByIdInt32_hotfix != null)
            {
                return((FixedStore)this.m_GetStoreOfferingByIdInt32_hotfix.call(new object[]
                {
                    this,
                    storeId
                }));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            DateTime       maxValue = DateTime.MaxValue;
            FixedStoreInfo fixedStoreInfo;

            if (!this.m_configDataLoader.FixedStoreData.Stores.TryGetValue(storeId, out fixedStoreInfo))
            {
                return(null);
            }
            DateTime   currentTime = this.m_basicInfo.GetCurrentTime();
            FixedStore fixedStore  = new FixedStore();

            fixedStore.Id = storeId;
            foreach (ConfigDataFixedStoreItemInfo configDataFixedStoreItemInfo in fixedStoreInfo.StoreItems.Values)
            {
                if (DateTime.Parse(configDataFixedStoreItemInfo.ShowStartTime) <= currentTime && currentTime < DateTime.Parse(configDataFixedStoreItemInfo.ShowEndTime))
                {
                    FixedStoreItem fixedStoreItem = new FixedStoreItem();
                    fixedStoreItem.Id            = configDataFixedStoreItemInfo.ID;
                    fixedStoreItem.BoughtCount   = 0;
                    fixedStoreItem.IsFirstBuy    = true;
                    fixedStoreItem.NextFlushTime = GoodsNextFlushCaculateTools.CaculateNextFlushTime(configDataFixedStoreItemInfo.BuyLimitType, configDataFixedStoreItemInfo.Param, currentTime, 0L).Ticks;
                    fixedStore.Items.Add(fixedStoreItem);
                }
            }
            return(fixedStore);
        }
 // Token: 0x06004AF4 RID: 19188 RVA: 0x00175510 File Offset: 0x00173710
 public bool IsFirstBuy(FixedStoreItem storeItem)
 {
     return(storeItem.IsFirstBuy);
 }
 // Token: 0x0600407A RID: 16506 RVA: 0x0012CB74 File Offset: 0x0012AD74
 public void OnBuyStoreItem(FixedStoreItem storeItem, int count)
 {
     this.m_owner.OnBuyStoreItem(storeItem, count);
 }
 // Token: 0x06004077 RID: 16503 RVA: 0x0012CB44 File Offset: 0x0012AD44
 public int CanBuyFixedStoreItem(ConfigDataFixedStoreItemInfo itemConfig, FixedStoreItem item)
 {
     return(this.m_owner.CanBuyFixedStoreItem(itemConfig, item));
 }
 // Token: 0x06004079 RID: 16505 RVA: 0x0012CB64 File Offset: 0x0012AD64
 public void BuyStoreItem(int storeId, FixedStoreItem storeItem, int count)
 {
     this.m_owner.BuyStoreItem(storeId, storeItem, count);
 }
        // Token: 0x06004058 RID: 16472 RVA: 0x0012BAEC File Offset: 0x00129CEC
        public virtual int CanBuyGoods(int storeId, int goodsId, int selectedIndex)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_CanBuyGoodsInt32Int32Int32_hotfix != null)
            {
                return(Convert.ToInt32(this.m_CanBuyGoodsInt32Int32Int32_hotfix.call(new object[]
                {
                    this,
                    storeId,
                    goodsId2,
                    selectedIndex
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            int            goodsId = goodsId2;
            FixedStoreInfo fixedStoreInfo;

            if (!this.m_configDataLoader.FixedStoreData.Stores.TryGetValue(storeId, out fixedStoreInfo))
            {
                return(-1300);
            }
            ConfigDataFixedStoreItemInfo configDataFixedStoreItemInfo;

            if (!fixedStoreInfo.StoreItems.TryGetValue(goodsId, out configDataFixedStoreItemInfo))
            {
                return(-1301);
            }
            if (configDataFixedStoreItemInfo.ItemType == GoodsType.GoodsType_Item)
            {
                ConfigDataItemInfo configDataItemInfo = this.m_configDataLoader.GetConfigDataItemInfo(configDataFixedStoreItemInfo.ItemId);
                if (configDataItemInfo.FuncType == ItemFuncType.ItemFuncType_SelfSelectedBox)
                {
                    ConfigDataSelfSelectedBoxInfo configDataSelfSelectedBoxInfo = this.m_configDataLoader.GetConfigDataSelfSelectedBoxInfo(configDataItemInfo.FuncTypeParam1);
                    if (configDataSelfSelectedBoxInfo.Reward.Count <= selectedIndex || selectedIndex < 0)
                    {
                        return(-539);
                    }
                }
                else if (selectedIndex != -1)
                {
                    return(-540);
                }
            }
            else
            {
                if (configDataFixedStoreItemInfo.ItemType == GoodsType.GoodsType_Gold && this.m_basicInfo.IsGoldOverFlow(configDataFixedStoreItemInfo.Nums))
                {
                    return(-422);
                }
                if (selectedIndex != -1)
                {
                    return(-540);
                }
            }
            FixedStoreItem item       = null;
            FixedStore     fixedStore = this.m_fixedStoreDS.FindStore(storeId);

            if (fixedStore != null)
            {
                item = fixedStore.Items.Find((FixedStoreItem t) => t.Id == goodsId);
            }
            return(this.CanBuyFixedStoreItem(configDataFixedStoreItemInfo, item));
        }
 // Token: 0x0600407B RID: 16507 RVA: 0x0012CB84 File Offset: 0x0012AD84
 public void OnAddSkin(FixedStoreItem storeItem)
 {
     this.m_owner.OnAddSkin(storeItem);
 }
 // Token: 0x06004AF3 RID: 19187 RVA: 0x001754F8 File Offset: 0x001736F8
 public void BuyStoreItem(FixedStoreItem storeItem, int count)
 {
     storeItem.BoughtCount += count;
     base.SetDirty(true);
 }