Beispiel #1
0
        public static DeclareOffstring Create(string in_forbiddenStr, int in_id)
        {
            DeclareOffstring tmp = new DeclareOffstring();

            tmp._forbiddenStr = in_forbiddenStr;
            tmp._id           = in_id;

            return(tmp);
        }
Beispiel #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[]> >("DataOffstring");
                if (dic == null)
                {
                    LuaEnv.SharedLuaEnv.DoString("DataOffstring = require 'Lua/Config/DataOffstring'");
                    dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataOffstring");
                }

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareOffstring>(11656);
                    foreach (var item in dic)
                    {
                        DeclareOffstring tmp = new DeclareOffstring();
                        tmp.ForbiddenStr = CfgStringLua.Get(item.Value[0]);
                        tmp.Id           = item.Value[1];

                        _dataCaches.Add(item.Key, tmp);
                    }
                }
                Record(startTime, DateTime.Now.Ticks, "Offstring");
            }
            if (_dataCaches == null && _fillDataCallBack != null)
            {
                if (_dataCaches == null)
                {
                    long startTime = DateTime.Now.Ticks;
                    _dataCaches = new Dictionary <int, DeclareOffstring>(11656);
                    _fillDataCallBack(_dataCaches);
                    Record(startTime, DateTime.Now.Ticks, "Offstring");
                }
            }
        }