예제 #1
0
 public void RunModuleCache()
 {
     try
     {
         int count = ModuleHandler.InvokeGetModuleAddonCount();
         int i     = 0;
         for (; i < count; i++)
         {
             object[] obj_temp  = ModuleHandler.InvokeGetModuleAddon(i, true);
             string   key       = (string)obj_temp[0];
             string[] split_key = key.Split(new char[1] {
                 '_'
             }, StringSplitOptions.RemoveEmptyEntries);
             if (split_key[0] == _ptype.ToString())
             {
                 obj_temp = ModuleHandler.InvokeGetModuleAddon(i, false);
                 key      = (string)obj_temp[0];
                 ModuleAddonCallback mac = (ModuleAddonCallback)obj_temp[1];
                 if (ModuleAddons.ContainsKey(key))
                 {
                     ModuleAddons.Remove(key);
                 }
                 ModuleAddons.Add(key, mac);
             }
             else
             {
             }
         }
     }
     catch (Exception e)
     {
         Console.WriteLine("ERROR: " + e.Message);
     }
 }
예제 #2
0
        public static void InvokeAddModuleAddon(PacketType p, ModuleAddonCallback m)
        {
            Assembly _Assemblies = Assembly.GetAssembly(ModuleHandler.ModuleAddons.GetType());
            Type     _Type       = ModuleHandler.ModuleAddons.GetType();

            // Get the desired method we want from the target type.
            MethodInfo _MethodInfo = null;

            try
            {
                _MethodInfo = _Type.GetMethod("Add");
            }
            catch (Exception)
            {
                return;
            }
            _MethodInfo.Invoke(ModuleHandler.ModuleAddons, new object[2] {
                (p.ToString() + "_" + count_i), (object)m
            });
            count_i++;
        }
예제 #3
0
        public void RunModuleCache()
        {
            int count = ModuleHandler.InvokeGetModuleAddonCount();
            int i     = 0;

            for (; i < count; i++)
            {
                object[] obj_temp  = ModuleHandler.InvokeGetModuleAddon(i, true);
                string   key       = (string)obj_temp[0];
                string[] split_key = key.Split(new char[1] {
                    '_'
                }, StringSplitOptions.RemoveEmptyEntries);
                if (split_key[0] == _ptype.ToString())
                {
                    obj_temp = ModuleHandler.InvokeGetModuleAddon(i, false);
                    key      = (string)obj_temp[0];
                    ModuleAddonCallback mac = (ModuleAddonCallback)obj_temp[1];
                    ModuleAddons.Add(key, mac);
                }
                else
                {
                }
            }
        }
예제 #4
0
        public static void InvokeAddModuleAddon(PacketType p, ModuleAddonCallback m)
        {
            Assembly _Assemblies = Assembly.GetAssembly(ModuleHandler.ModuleAddons.GetType());
            Type _Type = ModuleHandler.ModuleAddons.GetType();

            // Get the desired method we want from the target type.
            MethodInfo _MethodInfo = null;
            try
            {
                _MethodInfo = _Type.GetMethod("Add");
            }
            catch (Exception ex)
            {
                return;
            }
            _MethodInfo.Invoke(ModuleHandler.ModuleAddons, new object[2] { (p.ToString() + "_" + count_i), (object)m });
            count_i++;
        }