Example #1
0
 public static void Convert(Dictionary <int, DeclareVip> data)
 {
     if (data == null)
     {
         return;
     }
     data.Clear();
     data.Add(0, DeclareVip.Create(0, 0, StringDefines.Key_56711, 0, StringDefines.Key_10474, StringDefines.Key_10474, 0, 0, StringDefines.Key_10474, 0, 0));
     data.Add(99, DeclareVip.Create(1, 1, StringDefines.Key_56712, 0, StringDefines.Key_56713, StringDefines.Key_56714, 99, 60, StringDefines.Key_15157, 300, 30));
     data.Add(999, DeclareVip.Create(1, 1, StringDefines.Key_56715, 1006, StringDefines.Key_20, StringDefines.Key_56716, 999, 60, StringDefines.Key_1723, 0, -1));
 }
Example #2
0
        public static void SetData()
        {
            if (_dataCaches == null && LuaEnv.isLoadLuaCfg)
            {
                long startTime = DateTime.Now.Ticks;
                Dictionary <int, int[]> dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataVip");
                if (dic == null)
                {
                    LuaEnv.SharedLuaEnv.DoString("DataVip = require 'Lua/Config/DataVip'");
                    dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataVip");
                }

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareVip>(3);
                    foreach (var item in dic)
                    {
                        DeclareVip tmp = new DeclareVip();
                        tmp.CanPasswordSell = item.Value[0];
                        tmp.CanSell         = item.Value[1];
                        tmp.Des             = CfgStringLua.Get(item.Value[2]);
                        tmp.Exp             = item.Value[3];
                        tmp.Gift            = CfgStringLua.Get(item.Value[4]);
                        tmp.Icon            = CfgStringLua.Get(item.Value[5]);
                        tmp.Level           = item.Value[6];
                        tmp.MaxPhysical     = item.Value[7];
                        tmp.Name            = CfgStringLua.Get(item.Value[8]);
                        tmp.NeedRecharge    = item.Value[9];
                        tmp.Time            = item.Value[10];

                        _dataCaches.Add(item.Key, tmp);
                    }
                }
                Record(startTime, DateTime.Now.Ticks, "Vip");
            }
            if (_dataCaches == null && _fillDataCallBack != null)
            {
                if (_dataCaches == null)
                {
                    long startTime = DateTime.Now.Ticks;
                    _dataCaches = new Dictionary <int, DeclareVip>(3);
                    _fillDataCallBack(_dataCaches);
                    Record(startTime, DateTime.Now.Ticks, "Vip");
                }
            }
        }
Example #3
0
        public static DeclareVip Create(int in_canPasswordSell, int in_canSell, string in_des, int in_exp, string in_gift, string in_icon, int in_level, int in_max_physical, string in_name, int in_needRecharge, int in_time)
        {
            DeclareVip tmp = new DeclareVip();

            tmp._canPasswordSell = in_canPasswordSell;
            tmp._canSell         = in_canSell;
            tmp._des             = in_des;
            tmp._exp             = in_exp;
            tmp._gift            = in_gift;
            tmp._icon            = in_icon;
            tmp._level           = in_level;
            tmp._max_physical    = in_max_physical;
            tmp._name            = in_name;
            tmp._needRecharge    = in_needRecharge;
            tmp._time            = in_time;

            return(tmp);
        }