Пример #1
0
 /// <summary>
 /// CustomFormattedClass Constructor.
 /// </summary>
 public CSGOProcess()
 {
     moduleManager = new ModuleManager();
     Logger = Log.GetLogger(this.GetType().Name.ToString());
     Modules = new List<IModule<object>>();
     moduleList = new Modules();
     ConfigurationManager = new ConfigurationManager();
     ConfigurationManager.SaveDefault(AppDomain.CurrentDomain.BaseDirectory + "\\" + modulesCfg, moduleList);
     ConfigurationManager.SaveDefault(AppDomain.CurrentDomain.BaseDirectory + "\\" + settingsCfg, new Options());
     // Construct.
 }
Пример #2
0
        public void Load()
        {
            Logger.Info(AppDomain.CurrentDomain.BaseDirectory);
            Logger.Info("Getting startup modules! " + modulesCfg);
            moduleList = ConfigurationManager.Read<Modules>(AppDomain.CurrentDomain.BaseDirectory +"\\"+ modulesCfg);
            CSGOData.Config = ConfigurationManager.Read<Options>(AppDomain.CurrentDomain.BaseDirectory +"\\"+ settingsCfg);
            Logger.Info("Loading modules!");
            //Load IMemory
            var memoryModuleAssembly = moduleManager.GetInstance(moduleList.Path,"AgaHackTools.Memory.dll", "ISmartMemory");
            _memory = moduleManager.ActivateInstance<ISmartMemory>(memoryModuleAssembly, "");

            Logger.Info("Loaded: Memory implementation lib");
            //Load ModuleResponsable for memoryUpdates
            foreach (var item in moduleList.ModuleNames)
            {
                // for
                var newModuleType = moduleManager.GetInstance(moduleList.Path, item, "IModule`1");
                var newModule = moduleManager.ActivateInstance<IModule<object>>(newModuleType, new object[] {_memory, new object(),60});
                Modules.Add(newModule);
                Logger.Info("Loaded: "+ newModule.Name);
            }
        }