// Token: 0x06004CBA RID: 19642 RVA: 0x00179230 File Offset: 0x00177430
        public override object SerializeToClient()
        {
            DSRandomStoreNtf dsrandomStoreNtf = new DSRandomStoreNtf();

            dsrandomStoreNtf.Version = (uint)base.Version;
            dsrandomStoreNtf.Stores.AddRange(RandomStore.StoresToPBStores(this.Stores));
            return(dsrandomStoreNtf);
        }
Example #2
0
        // Token: 0x06005132 RID: 20786 RVA: 0x00182E30 File Offset: 0x00181030
        public static List <ProRandomStore> StoresToPBStores(List <RandomStore> stores)
        {
            List <ProRandomStore> list = new List <ProRandomStore>();

            foreach (RandomStore store in stores)
            {
                list.Add(RandomStore.StoreToPBStore(store));
            }
            return(list);
        }
Example #3
0
        // Token: 0x06005134 RID: 20788 RVA: 0x00182F2C File Offset: 0x0018112C
        public static List <RandomStore> PBStoresToStores(List <ProRandomStore> pbStores)
        {
            List <RandomStore> list = new List <RandomStore>();

            foreach (ProRandomStore pbStore in pbStores)
            {
                list.Add(RandomStore.PBStoreToStore(pbStore));
            }
            return(list);
        }
 // Token: 0x06004CBF RID: 19647 RVA: 0x001792D4 File Offset: 0x001774D4
 public void SetStore(RandomStore store)
 {
     for (int i = 0; i < this.Stores.Count; i++)
     {
         if (this.Stores[i].Id == store.Id)
         {
             this.Stores[i] = store;
             base.SetDirty(true);
             return;
         }
     }
     this.AddStore(store);
 }
Example #5
0
 // Token: 0x06004761 RID: 18273 RVA: 0x001600A4 File Offset: 0x0015E2A4
 public bool CanAutoFlushStore(RandomStore store)
 {
     if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_CanAutoFlushStoreRandomStore_hotfix != null)
     {
         return(Convert.ToBoolean(this.m_CanAutoFlushStoreRandomStore_hotfix.call(new object[]
         {
             this,
             store
         })));
     }
     BJLuaObjHelper.IsSkipLuaHotfix = false;
     return(this.m_basicInfo.GetCurrentTime() >= store.NextFlushTime);
 }
Example #6
0
        // Token: 0x06005131 RID: 20785 RVA: 0x00182D94 File Offset: 0x00180F94
        public static ProRandomStore StoreToPBStore(RandomStore store)
        {
            ProRandomStore proRandomStore = new ProRandomStore
            {
                StoreId         = store.Id,
                NextFlushTime   = store.NextFlushTime.Ticks,
                ManualFlushNums = store.ManualFlushNums
            };

            foreach (RandomStoreItem storeItem in store.Items)
            {
                proRandomStore.Items.Add(RandomStoreItem.StoreItemToPBStoreItem(storeItem));
            }
            return(proRandomStore);
        }
Example #7
0
        // Token: 0x06005133 RID: 20787 RVA: 0x00182E94 File Offset: 0x00181094
        public static RandomStore PBStoreToStore(ProRandomStore pbStore)
        {
            RandomStore randomStore = new RandomStore
            {
                Id              = pbStore.StoreId,
                NextFlushTime   = new DateTime(pbStore.NextFlushTime),
                ManualFlushNums = pbStore.ManualFlushNums
            };

            foreach (ProRandomStoreItem pbStoreItem in pbStore.Items)
            {
                randomStore.Items.Add(RandomStoreItem.PBStoreItemToStoreItem(pbStoreItem));
            }
            return(randomStore);
        }
Example #8
0
 // Token: 0x06004763 RID: 18275 RVA: 0x001601C0 File Offset: 0x0015E3C0
 protected int CanManualFlushStore(RandomStore store, ConfigDataRandomStoreInfo storeInfo)
 {
     if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_CanManualFlushStoreRandomStoreConfigDataRandomStoreInfo_hotfix != null)
     {
         return(Convert.ToInt32(this.m_CanManualFlushStoreRandomStoreConfigDataRandomStoreInfo_hotfix.call(new object[]
         {
             this,
             store,
             storeInfo
         })));
     }
     BJLuaObjHelper.IsSkipLuaHotfix = false;
     if (store.ManualFlushNums >= this.m_configDataLoader.ConfigableConstId_RandomStoreManualFlushMaxNums)
     {
         return(-1105);
     }
     return(this.m_basicInfo.IsCurrencyEnough(storeInfo.CurrencyType, storeInfo.Price));
 }
 // Token: 0x06004CC2 RID: 19650 RVA: 0x0017938C File Offset: 0x0017758C
 public void SetStoreNextFlushTime(RandomStore store, DateTime flushTime)
 {
     store.NextFlushTime = flushTime;
     base.SetDirty(true);
 }
Example #10
0
 // Token: 0x0600477A RID: 18298 RVA: 0x00160A24 File Offset: 0x0015EC24
 public int CanManualFlushStore(RandomStore store, ConfigDataRandomStoreInfo storeInfo)
 {
     return(this.m_owner.CanManualFlushStore(store, storeInfo));
 }
Example #11
0
        // Token: 0x06004764 RID: 18276 RVA: 0x00160280 File Offset: 0x0015E480
        public virtual int CanBuyRandomStoreItem(int storeId, int index, int selectedIndex)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_CanBuyRandomStoreItemInt32Int32Int32_hotfix != null)
            {
                return(Convert.ToInt32(this.m_CanBuyRandomStoreItemInt32Int32Int32_hotfix.call(new object[]
                {
                    this,
                    storeId,
                    index,
                    selectedIndex
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            RandomStore randomStore = this.m_randomStoreDS.FindStore(storeId);

            if (randomStore == null)
            {
                return(-1100);
            }
            if (index < 0 || index >= randomStore.Items.Count)
            {
                return(-1101);
            }
            RandomStoreItem storeItem = this.m_randomStoreDS.GetStoreItem(randomStore, index);

            if (this.IsBoughtStoreItem(storeItem))
            {
                return(-1102);
            }
            ConfigDataRandomStoreItemInfo configDataRandomStoreItemInfo = this.m_configDataLoader.GetConfigDataRandomStoreItemInfo(storeItem.Id);
            int num = this.m_basicInfo.IsCurrencyEnough(configDataRandomStoreItemInfo.CurrencyType, configDataRandomStoreItemInfo.Price);

            if (num != 0)
            {
                return(num);
            }
            if (configDataRandomStoreItemInfo.ItemType == GoodsType.GoodsType_Item)
            {
                ConfigDataItemInfo configDataItemInfo = this.m_configDataLoader.GetConfigDataItemInfo(configDataRandomStoreItemInfo.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 (selectedIndex != -1)
            {
                return(-540);
            }
            if (this.m_bag.IsBagFullByCurrentSize())
            {
                return(-500);
            }
            return(0);
        }
 // Token: 0x06004CC4 RID: 19652 RVA: 0x001793B4 File Offset: 0x001775B4
 public void ClearStoreItems(RandomStore store)
 {
     store.Items.Clear();
     base.SetDirty(true);
 }
 // Token: 0x06004CC6 RID: 19654 RVA: 0x001793D8 File Offset: 0x001775D8
 public void SetManualFlushNums(RandomStore store, int nums)
 {
     store.ManualFlushNums = nums;
     base.SetDirty(true);
 }
        // Token: 0x06004CC1 RID: 19649 RVA: 0x00179348 File Offset: 0x00177548
        public int GetManualFlushNums(int storeId)
        {
            RandomStore randomStore = this.Stores.Find((RandomStore t) => t.Id == storeId);

            return((randomStore != null) ? randomStore.ManualFlushNums : 0);
        }
 // Token: 0x06004CBD RID: 19645 RVA: 0x00179288 File Offset: 0x00177488
 public void AddStore(RandomStore store)
 {
     this.Stores.Add(store);
     base.SetDirty(true);
 }
 // Token: 0x06004CBC RID: 19644 RVA: 0x00179278 File Offset: 0x00177478
 public void InitStore(RandomStore store)
 {
     this.Stores.Add(store);
 }
 // Token: 0x06004CC7 RID: 19655 RVA: 0x001793E8 File Offset: 0x001775E8
 public void AddManualFlushNums(RandomStore store, int addNums)
 {
     store.ManualFlushNums += addNums;
     base.SetDirty(true);
 }
 // Token: 0x06004CC3 RID: 19651 RVA: 0x0017939C File Offset: 0x0017759C
 public void AddStoreItems(RandomStore store, List <RandomStoreItem> storeItems)
 {
     store.Items.AddRange(storeItems);
     base.SetDirty(true);
 }
 // Token: 0x06004CC5 RID: 19653 RVA: 0x001793C8 File Offset: 0x001775C8
 public RandomStoreItem GetStoreItem(RandomStore store, int index)
 {
     return(store.Items[index]);
 }