// Token: 0x06004055 RID: 16469 RVA: 0x0012B80C File Offset: 0x00129A0C 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 (KeyValuePair <int, FixedStore> keyValuePair in this.m_fixedStoreDS.Stores) { foreach (FixedStoreItem fixedStoreItem in keyValuePair.Value.Items) { ConfigDataFixedStoreItemInfo configDataFixedStoreItemInfo = this.m_configDataLoader.GetConfigDataFixedStoreItemInfo(fixedStoreItem.Id); if (configDataFixedStoreItemInfo != null && fixedStoreItem.NextFlushTime <= currentTime.Ticks) { fixedStoreItem.BoughtCount = 0; fixedStoreItem.NextFlushTime = GoodsNextFlushCaculateTools.CaculateNextFlushTime(configDataFixedStoreItemInfo.BuyLimitType, configDataFixedStoreItemInfo.Param, currentTime, fixedStoreItem.NextFlushTime).Ticks; this.m_fixedStoreDS.SetDirty(true); } } } }
// 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); }
// 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: 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: 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: 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); }