Exemplo n.º 1
0
        private string GenerateRandomString(int minLength, int maxLength)
        {
            int characters = RandomStore.Next(minLength, maxLength);

            var result = new StringBuilder(characters);   // I seriously doubt this is faster.

            for (; characters > 0; characters--)
            {
                result.Append((char)RandomStore.Next(15, 125));
            }

            return(result.ToString());
        }
 // Token: 0x060075B7 RID: 30135 RVA: 0x00203C94 File Offset: 0x00201E94
 public void SetStore(RandomStore store)
 {
     if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_SetStoreRandomStore_hotfix != null)
     {
         this.m_SetStoreRandomStore_hotfix.call(new object[]
         {
             this,
             store
         });
         return;
     }
     BJLuaObjHelper.IsSkipLuaHotfix = false;
     this.m_randomStoreDS.SetStore(store);
 }
    public static int get_ManualFlushNums(IntPtr l)
    {
        int result;

        try
        {
            RandomStore randomStore = (RandomStore)LuaObject.checkSelf(l);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, randomStore.ManualFlushNums);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int constructor(IntPtr l)
    {
        int result;

        try
        {
            RandomStore o = new RandomStore();
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, o);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
 // Token: 0x060075B4 RID: 30132 RVA: 0x00203ACC File Offset: 0x00201CCC
 public void InitStores(List <ProRandomStore> pbStores)
 {
     if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_InitStoresList ` 1_hotfix != null)
     {
         this.m_InitStoresList ` 1_hotfix.call(new object[]
         {
             this,
             pbStores
         });
         return;
     }
     BJLuaObjHelper.IsSkipLuaHotfix = false;
     this.m_randomStoreDS.ClearInitedData();
     foreach (ProRandomStore pbStore in pbStores)
     {
         this.m_randomStoreDS.InitStore(RandomStore.PBStoreToStore(pbStore));
     }
 }
        // Token: 0x060075B9 RID: 30137 RVA: 0x00203D98 File Offset: 0x00201F98
        public int CanManualFlushRandomStore(RandomStore store)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_CanManualFlushRandomStoreRandomStore_hotfix != null)
            {
                return(Convert.ToInt32(this.m_CanManualFlushRandomStoreRandomStore_hotfix.call(new object[]
                {
                    this,
                    store
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            ConfigDataRandomStoreInfo configDataRandomStoreInfo = this.m_configDataLoader.GetConfigDataRandomStoreInfo(store.Id);

            if (configDataRandomStoreInfo == null)
            {
                return(-1103);
            }
            return(base.CanManualFlushStore(store, configDataRandomStoreInfo));
        }
    public static int PBStoreToStore_s(IntPtr l)
    {
        int result;

        try
        {
            ProRandomStore pbStore;
            LuaObject.checkType <ProRandomStore>(l, 1, out pbStore);
            RandomStore o = RandomStore.PBStoreToStore(pbStore);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, o);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int StoresToPBStores_s(IntPtr l)
    {
        int result;

        try
        {
            List <RandomStore> stores;
            LuaObject.checkType <List <RandomStore> >(l, 1, out stores);
            List <ProRandomStore> o = RandomStore.StoresToPBStores(stores);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, o);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int set_NextFlushTime(IntPtr l)
    {
        int result;

        try
        {
            RandomStore randomStore = (RandomStore)LuaObject.checkSelf(l);
            DateTime    nextFlushTime;
            LuaObject.checkValueType <DateTime>(l, 2, out nextFlushTime);
            randomStore.NextFlushTime = nextFlushTime;
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int set_Id(IntPtr l)
    {
        int result;

        try
        {
            RandomStore randomStore = (RandomStore)LuaObject.checkSelf(l);
            int         id;
            LuaObject.checkType(l, 2, out id);
            randomStore.Id = id;
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Exemplo n.º 11
0
        // Token: 0x060075BC RID: 30140 RVA: 0x00203F84 File Offset: 0x00202184
        public DateTime GetStoreNextFlushTime(int storeId)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_GetStoreNextFlushTimeInt32_hotfix != null)
            {
                return((DateTime)this.m_GetStoreNextFlushTimeInt32_hotfix.call(new object[]
                {
                    this,
                    storeId
                }));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            RandomStore store = this.GetStore(storeId);

            if (store == null)
            {
                return(DateTime.MinValue);
            }
            return(store.NextFlushTime);
        }
    public static int set_Items(IntPtr l)
    {
        int result;

        try
        {
            RandomStore            randomStore = (RandomStore)LuaObject.checkSelf(l);
            List <RandomStoreItem> items;
            LuaObject.checkType <List <RandomStoreItem> >(l, 2, out items);
            randomStore.Items = items;
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Exemplo n.º 13
0
        /// <summary>
        /// Designed to use reflection to work out the type of a value passed to it then alter that value to something different, aimed at
        /// changing values for unit tests.  All that can be said is that the return value will not equal the entry value for supported simple types.
        /// </summary>
        /// <remarks>If the val object is of an unsupported type it is returned unchanged.</remarks>
        /// <param name="target">The value to change</param>
        /// <returns>A new value for the object val</returns>
        public object AlterValue(object target)
        {
            if (target == null)
            {
                return(null);
            }

            Type t = target.GetType();

            if (t == typeof(long))
            {
                return((long)target + 1);
            }
            if (t == typeof(uint))
            {
                return((uint)target + 1);
            }
            if (t == typeof(double))
            {
                return((double)target + 1);
            }
            if (t == typeof(int))
            {
                return((int)target + 1);
            }

            if (t == typeof(bool))
            {
                return(!(bool)target);   // Invert it for bools
            }
            if (t == typeof(string))
            {
                string s      = GenerateFriendlyString();
                int    length = RandomStore.Next(5);
                if (s.Length < length)
                {
                    length = s.Length;
                }
                return((string)target + s.Substring(0, length));
            }
            return(target);
        }
Exemplo n.º 14
0
    public static int FindStore(IntPtr l)
    {
        int result;

        try
        {
            DataSectionRandomStore dataSectionRandomStore = (DataSectionRandomStore)LuaObject.checkSelf(l);
            int id;
            LuaObject.checkType(l, 2, out id);
            RandomStore o = dataSectionRandomStore.FindStore(id);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, o);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int GetStore(IntPtr l)
    {
        int result;

        try
        {
            RandomStoreComponent randomStoreComponent = (RandomStoreComponent)LuaObject.checkSelf(l);
            int storeId;
            LuaObject.checkType(l, 2, out storeId);
            RandomStore store = randomStoreComponent.GetStore(storeId);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, store);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Exemplo n.º 16
0
        // Token: 0x060075BA RID: 30138 RVA: 0x00203E3C File Offset: 0x0020203C
        public int ManualFlushRandomStore(RandomStore store)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_ManualFlushRandomStoreRandomStore_hotfix != null)
            {
                return(Convert.ToInt32(this.m_ManualFlushRandomStoreRandomStore_hotfix.call(new object[]
                {
                    this,
                    store
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            ConfigDataRandomStoreInfo configDataRandomStoreInfo = this.m_configDataLoader.GetConfigDataRandomStoreInfo(store.Id);

            if (configDataRandomStoreInfo == null)
            {
                return(-1103);
            }
            this.SetStore(store);
            this.m_basicInfo.AddCurrency(configDataRandomStoreInfo.CurrencyType, -configDataRandomStoreInfo.Price, GameFunctionType.GameFunctionType_None, null);
            return(0);
        }
Exemplo n.º 17
0
        // Token: 0x060075BD RID: 30141 RVA: 0x0020401C File Offset: 0x0020221C
        public int BuyStoreItem(int storeId, int index)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_BuyStoreItemInt32Int32_hotfix != null)
            {
                return(Convert.ToInt32(this.m_BuyStoreItemInt32Int32_hotfix.call(new object[]
                {
                    this,
                    storeId,
                    index
                })));
            }
            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 (base.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);
            }
            this.m_basicInfo.AddCurrency(configDataRandomStoreItemInfo.CurrencyType, -configDataRandomStoreItemInfo.Price, GameFunctionType.GameFunctionType_None, null);
            this.m_randomStoreDS.BuyStoreItem(storeItem);
            base.OnBuyStoreItem(storeId, storeItem.Id);
            return(storeItem.Id);
        }
Exemplo n.º 18
0
 // Token: 0x060075D8 RID: 30168 RVA: 0x00204544 File Offset: 0x00202744
 public int __callBase_CanManualFlushStore(RandomStore store, ConfigDataRandomStoreInfo storeInfo)
 {
     return(this.m_owner.__callBase_CanManualFlushStore(store, storeInfo));
 }
Exemplo n.º 19
0
 // Token: 0x060075D6 RID: 30166 RVA: 0x00204524 File Offset: 0x00202724
 public bool __callBase_CanAutoFlushStore(RandomStore store)
 {
     return(this.m_owner.__callBase_CanAutoFlushStore(store));
 }
Exemplo n.º 20
0
 // Token: 0x060075C9 RID: 30153 RVA: 0x002041EC File Offset: 0x002023EC
 private int __callBase_CanManualFlushStore(RandomStore store, ConfigDataRandomStoreInfo storeInfo)
 {
     return(base.CanManualFlushStore(store, storeInfo));
 }
Exemplo n.º 21
0
 // Token: 0x060075C7 RID: 30151 RVA: 0x002041D4 File Offset: 0x002023D4
 private bool __callBase_CanAutoFlushStore(RandomStore store)
 {
     return(base.CanAutoFlushStore(store));
 }