Exemplo n.º 1
0
        public static DeclareDeviceMatchConfig Create(string in_deviceName, int in_deviceType, int in_id, int in_level, int in_matchCPU, int in_useFlow)
        {
            DeclareDeviceMatchConfig tmp = new DeclareDeviceMatchConfig();

            tmp._deviceName = in_deviceName;
            tmp._deviceType = in_deviceType;
            tmp._id         = in_id;
            tmp._level      = in_level;
            tmp._matchCPU   = in_matchCPU;
            tmp._useFlow    = in_useFlow;

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

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareDeviceMatchConfig>(66);
                    foreach (var item in dic)
                    {
                        DeclareDeviceMatchConfig tmp = new DeclareDeviceMatchConfig();
                        tmp.DeviceName = CfgStringLua.Get(item.Value[0]);
                        tmp.DeviceType = item.Value[1];
                        tmp.Id         = item.Value[2];
                        tmp.Level      = item.Value[3];
                        tmp.MatchCPU   = item.Value[4];
                        tmp.UseFlow    = item.Value[5];

                        _dataCaches.Add(item.Key, tmp);
                    }
                }
                Record(startTime, DateTime.Now.Ticks, "DeviceMatchConfig");
            }
            if (_dataCaches == null && _fillDataCallBack != null)
            {
                if (_dataCaches == null)
                {
                    long startTime = DateTime.Now.Ticks;
                    _dataCaches = new Dictionary <int, DeclareDeviceMatchConfig>(66);
                    _fillDataCallBack(_dataCaches);
                    Record(startTime, DateTime.Now.Ticks, "DeviceMatchConfig");
                }
            }
        }
Exemplo n.º 3
0
 public static void Convert(Dictionary <int, DeclareDeviceMatchConfig> data)
 {
     if (data == null)
     {
         return;
     }
     data.Clear();
     data.Add(0, DeclareDeviceMatchConfig.Create(StringDefines.Key_31150, 0, 0, 0, 0, 0));
     data.Add(1, DeclareDeviceMatchConfig.Create(StringDefines.Key_31151, 0, 1, 0, 0, 1));
     data.Add(2, DeclareDeviceMatchConfig.Create(StringDefines.Key_31152, 0, 2, 0, 0, 1));
     data.Add(3, DeclareDeviceMatchConfig.Create(StringDefines.Key_31153, 0, 3, 0, 0, 1));
     data.Add(4, DeclareDeviceMatchConfig.Create(StringDefines.Key_31154, 0, 4, 0, 0, 1));
     data.Add(5, DeclareDeviceMatchConfig.Create(StringDefines.Key_31155, 0, 5, 1, 0, 1));
     data.Add(6, DeclareDeviceMatchConfig.Create(StringDefines.Key_31156, 0, 6, 2, 0, 1));
     data.Add(7, DeclareDeviceMatchConfig.Create(StringDefines.Key_31157, 0, 7, 0, 0, 1));
     data.Add(8, DeclareDeviceMatchConfig.Create(StringDefines.Key_31158, 0, 8, 1, 0, 1));
     data.Add(9, DeclareDeviceMatchConfig.Create(StringDefines.Key_31159, 0, 9, 2, 0, 1));
     data.Add(10, DeclareDeviceMatchConfig.Create(StringDefines.Key_31160, 0, 10, 2, 0, 1));
     data.Add(11, DeclareDeviceMatchConfig.Create(StringDefines.Key_31161, 0, 11, 2, 0, 1));
     data.Add(1000, DeclareDeviceMatchConfig.Create(StringDefines.Key_31162, 1, 1000, 1, 1, 0));
     data.Add(1001, DeclareDeviceMatchConfig.Create(StringDefines.Key_31163, 1, 1001, 0, 0, 0));
     data.Add(1002, DeclareDeviceMatchConfig.Create(StringDefines.Key_31164, 1, 1002, 1, 1, 0));
     data.Add(1003, DeclareDeviceMatchConfig.Create(StringDefines.Key_31165, 1, 1003, 0, 0, 0));
     data.Add(1004, DeclareDeviceMatchConfig.Create(StringDefines.Key_31166, 1, 1004, 1, 0, 0));
     data.Add(1005, DeclareDeviceMatchConfig.Create(StringDefines.Key_31167, 1, 1005, 1, 0, 0));
     data.Add(1006, DeclareDeviceMatchConfig.Create(StringDefines.Key_31168, 1, 1006, 1, 0, 0));
     data.Add(1007, DeclareDeviceMatchConfig.Create(StringDefines.Key_31169, 1, 1007, 1, 0, 0));
     data.Add(1008, DeclareDeviceMatchConfig.Create(StringDefines.Key_31170, 1, 1008, 1, 0, 0));
     data.Add(1009, DeclareDeviceMatchConfig.Create(StringDefines.Key_31171, 1, 1009, 1, 0, 0));
     data.Add(1010, DeclareDeviceMatchConfig.Create(StringDefines.Key_31172, 1, 1010, 2, 0, 1));
     data.Add(1011, DeclareDeviceMatchConfig.Create(StringDefines.Key_31173, 1, 1011, 1, 0, 1));
     data.Add(1012, DeclareDeviceMatchConfig.Create(StringDefines.Key_31174, 1, 1012, 2, 0, 1));
     data.Add(1013, DeclareDeviceMatchConfig.Create(StringDefines.Key_31175, 1, 1013, 0, 0, 1));
     data.Add(1014, DeclareDeviceMatchConfig.Create(StringDefines.Key_31176, 1, 1014, 0, 0, 1));
     data.Add(1015, DeclareDeviceMatchConfig.Create(StringDefines.Key_31177, 1, 1015, 0, 0, 1));
     data.Add(1016, DeclareDeviceMatchConfig.Create(StringDefines.Key_31178, 1, 1016, 1, 0, 1));
     data.Add(1017, DeclareDeviceMatchConfig.Create(StringDefines.Key_31179, 1, 1017, 1, 0, 1));
     data.Add(1018, DeclareDeviceMatchConfig.Create(StringDefines.Key_31180, 1, 1018, 1, 1, 1));
     data.Add(1019, DeclareDeviceMatchConfig.Create(StringDefines.Key_31181, 1, 1019, 1, 0, 1));
     data.Add(1020, DeclareDeviceMatchConfig.Create(StringDefines.Key_31182, 1, 1020, 1, 0, 1));
     data.Add(1021, DeclareDeviceMatchConfig.Create(StringDefines.Key_31183, 1, 1021, 1, 0, 1));
     data.Add(1022, DeclareDeviceMatchConfig.Create(StringDefines.Key_31184, 1, 1022, 1, 1, 1));
     data.Add(1023, DeclareDeviceMatchConfig.Create(StringDefines.Key_31185, 1, 1023, 1, 0, 1));
     data.Add(1024, DeclareDeviceMatchConfig.Create(StringDefines.Key_31186, 1, 1024, 1, 0, 1));
     data.Add(1025, DeclareDeviceMatchConfig.Create(StringDefines.Key_31187, 1, 1025, 2, 0, 1));
     data.Add(1026, DeclareDeviceMatchConfig.Create(StringDefines.Key_31188, 1, 1026, 0, 0, 1));
     data.Add(1027, DeclareDeviceMatchConfig.Create(StringDefines.Key_31189, 1, 1027, 0, 0, 1));
     data.Add(1028, DeclareDeviceMatchConfig.Create(StringDefines.Key_31190, 1, 1028, 0, 0, 1));
     data.Add(1029, DeclareDeviceMatchConfig.Create(StringDefines.Key_31191, 1, 1029, 0, 0, 1));
     data.Add(1030, DeclareDeviceMatchConfig.Create(StringDefines.Key_31192, 1, 1030, 0, 0, 1));
     data.Add(1031, DeclareDeviceMatchConfig.Create(StringDefines.Key_31193, 1, 1031, 0, 0, 1));
     data.Add(1032, DeclareDeviceMatchConfig.Create(StringDefines.Key_31194, 1, 1032, 0, 0, 1));
     data.Add(1033, DeclareDeviceMatchConfig.Create(StringDefines.Key_31195, 1, 1033, 1, 0, 1));
     data.Add(1034, DeclareDeviceMatchConfig.Create(StringDefines.Key_31196, 1, 1034, 1, 0, 1));
     data.Add(1035, DeclareDeviceMatchConfig.Create(StringDefines.Key_31197, 1, 1035, 1, 0, 1));
     data.Add(1036, DeclareDeviceMatchConfig.Create(StringDefines.Key_31198, 1, 1036, 1, 0, 1));
     data.Add(1037, DeclareDeviceMatchConfig.Create(StringDefines.Key_31199, 1, 1037, 1, 0, 1));
     data.Add(1038, DeclareDeviceMatchConfig.Create(StringDefines.Key_31200, 1, 1038, 1, 0, 1));
     data.Add(1039, DeclareDeviceMatchConfig.Create(StringDefines.Key_31201, 1, 1039, 1, 0, 1));
     data.Add(1040, DeclareDeviceMatchConfig.Create(StringDefines.Key_31202, 1, 1040, 1, 0, 1));
     data.Add(1041, DeclareDeviceMatchConfig.Create(StringDefines.Key_31203, 1, 1041, 2, 0, 1));
     data.Add(1042, DeclareDeviceMatchConfig.Create(StringDefines.Key_31204, 1, 1042, 2, 0, 1));
     data.Add(1043, DeclareDeviceMatchConfig.Create(StringDefines.Key_31205, 1, 1043, 0, 0, 1));
     data.Add(1044, DeclareDeviceMatchConfig.Create(StringDefines.Key_31206, 1, 1044, 1, 0, 1));
     data.Add(1045, DeclareDeviceMatchConfig.Create(StringDefines.Key_31207, 1, 1045, 1, 0, 1));
     data.Add(1046, DeclareDeviceMatchConfig.Create(StringDefines.Key_31208, 1, 1046, 1, 0, 1));
     data.Add(1047, DeclareDeviceMatchConfig.Create(StringDefines.Key_31209, 1, 1047, 2, 0, 1));
     data.Add(1048, DeclareDeviceMatchConfig.Create(StringDefines.Key_31210, 1, 1048, 0, 0, 1));
     data.Add(1049, DeclareDeviceMatchConfig.Create(StringDefines.Key_31211, 1, 1049, 0, 0, 1));
     data.Add(1050, DeclareDeviceMatchConfig.Create(StringDefines.Key_31212, 1, 1050, 0, 0, 1));
     data.Add(1051, DeclareDeviceMatchConfig.Create(StringDefines.Key_31213, 1, 1051, 0, 0, 1));
     data.Add(1052, DeclareDeviceMatchConfig.Create(StringDefines.Key_31214, 1, 1052, 0, 0, 1));
     data.Add(1053, DeclareDeviceMatchConfig.Create(StringDefines.Key_31215, 1, 1053, 0, 0, 1));
 }