// Token: 0x06004AF2 RID: 19186 RVA: 0x001754D8 File Offset: 0x001736D8
        public FixedStore FindStore(int id)
        {
            FixedStore result = null;

            this.Stores.TryGetValue(id, out result);
            return(result);
        }
Example #2
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);
        }
Example #3
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: 0x06004AEB RID: 19179 RVA: 0x00175398 File Offset: 0x00173598
        public override object SerializeToClient()
        {
            DSFixedStoreNtf dsfixedStoreNtf = new DSFixedStoreNtf();

            dsfixedStoreNtf.Version = (uint)base.Version;
            dsfixedStoreNtf.Stores.AddRange(FixedStore.FixedStoresToPBFixedStores(this.Stores.Values.ToList <FixedStore>()));
            return(dsfixedStoreNtf);
        }
        // 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);
        }
Example #6
0
        // Token: 0x06005142 RID: 20802 RVA: 0x0018311C File Offset: 0x0018131C
        public static List <ProFixedStore> FixedStoresToPBFixedStores(List <FixedStore> stores)
        {
            List <ProFixedStore> list = new List <ProFixedStore>();

            foreach (FixedStore store in stores)
            {
                list.Add(FixedStore.FixedStoreToPBFixedStore(store));
            }
            return(list);
        }
Example #7
0
        // Token: 0x06005140 RID: 20800 RVA: 0x00183080 File Offset: 0x00181280
        public static List <FixedStore> PBFixedStoresToFixedStores(List <ProFixedStore> pbStores)
        {
            List <FixedStore> list = new List <FixedStore>();

            foreach (ProFixedStore pbStore in pbStores)
            {
                list.Add(FixedStore.PBFixedStoreToFixedStore(pbStore));
            }
            return(list);
        }
        // Token: 0x06004AF1 RID: 19185 RVA: 0x00175498 File Offset: 0x00173698
        public void ResetStore(FixedStore newStore)
        {
            FixedStore fixedStore;

            if (this.Stores.TryGetValue(newStore.Id, out fixedStore))
            {
                this.Stores[newStore.Id] = newStore;
                base.SetDirty(true);
            }
        }
        // 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: 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: 0x06004AF5 RID: 19189 RVA: 0x0017551C File Offset: 0x0017371C
 public FixedStoreItem GetStoreItem(FixedStore store, int goodsId)
 {
     return(store.Items.Find((FixedStoreItem t) => t.Id == goodsId));
 }
 // Token: 0x06004AF0 RID: 19184 RVA: 0x0017547C File Offset: 0x0017367C
 public void AddStore(FixedStore store)
 {
     this.Stores.Add(store.Id, store);
     base.SetDirty(true);
 }
 // Token: 0x06004AEF RID: 19183 RVA: 0x00175468 File Offset: 0x00173668
 public void InitStore(FixedStore store)
 {
     this.Stores.Add(store.Id, store);
 }