public static async Task LoadAndInitMinerPlugins()
        {
            // load dll's and create plugin containers
            var loadedPlugins = MinerPluginHost.LoadPlugins(Paths.MinerPluginsPath());
            foreach (var pluginUUID in loadedPlugins) PluginContainer.Create(MinerPluginHost.MinerPlugin[pluginUUID]);
            // init all containers
            foreach (var plugin in PluginContainer.PluginContainers)
            {
                if (!plugin.IsInitialized)
                {
                    plugin.InitPluginContainer();
                }

                if (plugin.Enabled)
                {
                    plugin.AddAlgorithmsToDevices();
                }
                else if (!plugin.IsCompatible)
                {
                    RemovePlugin(plugin.PluginUUID, false);
                }
                else
                {
                    plugin.RemoveAlgorithmsFromDevices();
                }
            }
            // cross reference local and online list
            var success = await GetOnlineMinerPlugins();
            if (success) CrossReferenceInstalledWithOnline();
            EthlargementIntegratedPlugin.Instance.ServiceEnabled = MiscSettings.Instance.UseEthlargement && Helpers.IsElevated;
            Logger.Info("MinerPluginsManager", "Finished initialization of miners.");
        }
        public static void LoadMinerPlugins()
        {
            // TODO only integrated
            InitIntegratedPlugins();
            if (IntegratedPluginsOnly)
            {
                return;
            }
            var loadedPlugins = MinerPluginHost.LoadPlugins(Paths.MinerPluginsPath());

            foreach (var pluginUUID in loadedPlugins)
            {
                var externalPlugin = MinerPluginHost.MinerPlugin[pluginUUID];
                var plugin         = PluginContainer.Create(externalPlugin);
                if (!plugin.IsInitialized)
                {
                    plugin.InitPluginContainer();
                }
                if (plugin.Enabled)
                {
                    plugin.AddAlgorithmsToDevices();
                }
                else
                {
                    plugin.RemoveAlgorithmsFromDevices();
                }
            }
            // cross reference local and online list
            CrossReferenceInstalledWithOnline();
        }
        static MinerPluginsManager()
        {
            // This is just a list of miners that are intergated in the nhm client. usefull when debuging
            _integratedPlugins = new List<IMinerPlugin>
            {
                // testing 
#if INTEGRATE_BrokenMiner_PLUGIN
                new BrokenMiner.BrokenMinerPlugin(),
#endif
#if INTEGRATE_ExamplePlugin_PLUGIN
                new Example.ExamplePlugin(),
#endif

// open source
#if INTEGRATE_CCMinerTpruvot_PLUGIN
                new CCMinerTpruvot.CCMinerTpruvotPlugin(),
#endif
#if INTEGRATE_XmrStak_PLUGIN
                new XmrStak.XmrStakPlugin(),
#endif
#if INTEGRATE_XmrStakRx_PLUGIN
                new XmrStakRx.XmrStakRxPlugin(),
#endif
#if INTEGRATE_CpuMinerOpt_PLUGIN
                new CpuMinerOpt.CPUMinerPlugin(),
#endif
//#if INTEGRATE_Ethminer_PLUGIN
//                new Ethminer.EthminerPlugin(), // abstract UUID
//#endif

// 3rd party
#if INTEGRATE_GMiner_PLUGIN
                new GMinerPlugin.GMinerPlugin(),
#endif
#if INTEGRATE_NBMiner_PLUGIN
                new NBMiner.NBMinerPlugin(),
#endif
#if INTEGRATE_Phoenix_PLUGIN
                new Phoenix.PhoenixPlugin(),
#endif
#if INTEGRATE_TeamRedMiner_PLUGIN
                new TeamRedMiner.TeamRedMinerPlugin(),
#endif
#if INTEGRATE_TRex_PLUGIN
                new TRex.TRexPlugin(),
#endif
#if INTEGRATE_TTMiner_PLUGIN
                new TTMiner.TTMinerPlugin(),
#endif
#if INTEGRATE_ClaymoreDual_PLUGIN
                new ClaymoreDual14.ClaymoreDual14Plugin(),
#endif
#if INTEGRATE_NanoMiner_PLUGIN
                new NanoMiner.NanoMinerPlugin(),
#endif
#if INTEGRATE_WildRig_PLUGIN
                new WildRig.WildRigPlugin(),
#endif
#if INTEGRATE_CryptoDredge_PLUGIN
                new CryptoDredge.CryptoDredgePlugin(),
#endif
#if INTEGRATE_ZEnemy_PLUGIN
                new ZEnemy.ZEnemyPlugin(),
#endif
#if INTEGRATE_LolMiner_PLUGIN
                new LolMiner.LolMinerPlugin(),
#endif
//#if INTEGRATE_SRBMiner_PLUGIN
//                new SRBMiner.SRBMinerPlugin(),
//#endif
#if INTEGRATE_XMRig_PLUGIN
                new XMRig.XMRigPlugin(),
#endif
#if INTEGRATE_MiniZ_PLUGIN
                new MiniZ.MiniZPlugin(),
#endif

                // leave these 2 for now

                // service plugin
                EthlargementIntegratedPlugin.Instance,

                // plugin dependencies
                VC_REDIST_x64_2015_2019_DEPENDENCY_PLUGIN.Instance
            };
            var filteredIntegratedPlugins = _integratedPlugins.Where(p => SupportedPluginsFilter.IsSupported(p.PluginUUID)).ToList();
            foreach (var integratedPlugin in filteredIntegratedPlugins)
            {
                PluginContainer.Create(integratedPlugin);
            }
        }
        static MinerPluginsManager()
        {
            var integratedPlugins = new List <IntegratedPlugin>
            {
                // testing
#if INTEGRATE_BrokenMiner_PLUGIN
                new BrokenPluginIntegratedPlugin(),
#endif
#if INTEGRATE_ExamplePlugin_PLUGIN
                new ExamplePluginIntegratedPlugin(),
#endif

// open source
#if INTEGRATE_CCMinerMTP_PLUGIN
                new CCMinerMTPIntegratedPlugin(),
#endif
#if INTEGRATE_CCMinerTpruvot_PLUGIN
                new CCMinerTpruvotIntegratedPlugin(),
#endif
#if INTEGRATE_SGminerAvemore_PLUGIN
                new SGminerAvemoreIntegratedPlugin(),
#endif
#if INTEGRATE_SGminerGM_PLUGIN
                new SGminerGMIntegratedPlugin(),
#endif
#if INTEGRATE_XmrStak_PLUGIN
                new XmrStakIntegratedPlugin(),
#endif
#if INTEGRATE_CpuMinerOpt_PLUGIN
                new CPUMinerOptIntegratedPlugin(),
#endif
#if INTEGRATE_Ethminer_PLUGIN
                new EthminerIntegratedPlugin(),
#endif

// 3rd party
#if INTEGRATE_EWBF_PLUGIN
                new EWBFIntegratedPlugin(),
#endif
#if INTEGRATE_GMiner_PLUGIN
                new GMinerIntegratedPlugin(),
#endif
#if INTEGRATE_NBMiner_PLUGIN
                new NBMinerIntegratedPlugin(),
#endif
#if INTEGRATE_Phoenix_PLUGIN
                new PhoenixIntegratedPlugin(),
#endif
#if INTEGRATE_TeamRedMiner_PLUGIN
                new TeamRedMinerIntegratedPlugin(),
#endif
#if INTEGRATE_TRex_PLUGIN
                new TRexIntegratedPlugin(),
#endif
#if INTEGRATE_TTMiner_PLUGIN
                new TTMinerIntegratedPlugin(),
#endif
#if INTEGRATE_ClaymoreDual_PLUGIN
                new ClaymoreDual14IntegratedPlugin(),
#endif
#if INTEGRATE_NanoMiner_PLUGIN
                new NanoMinerIntegratedPlugin(),
#endif
#if INTEGRATE_WildRig_PLUGIN
                new WildRigIntegratedPlugin(),
#endif
#if INTEGRATE_CryptoDredge_PLUGIN
                new CryptoDredgeIntegratedPlugin(),
#endif
#if INTEGRATE_BMiner_PLUGIN
                new BMinerIntegratedPlugin(),
#endif
#if INTEGRATE_ZEnemy_PLUGIN
                new ZEnemyIntegratedPlugin(),
#endif
#if INTEGRATE_LolMinerBeam_PLUGIN
                new LolMinerIntegratedPlugin(),
#endif
#if INTEGRATE_SRBMiner_PLUGIN
                new SRBMinerIntegratedPlugin(),
#endif
#if INTEGRATE_XMRig_PLUGIN
                new XMRigIntegratedPlugin(),
#endif
#if INTEGRATE_MiniZ_PLUGIN
                new MiniZIntegratedPlugin(),
#endif

                // service plugin
                EthlargementIntegratedPlugin.Instance,

                // plugin dependencies
                VC_REDIST_x64_2015_2019_DEPENDENCY_PLUGIN.Instance
            };
            var filteredIntegratedPlugins = integratedPlugins.Where(p => SupportedPluginsFilter.IsSupported(p.PluginUUID)).ToList();

            foreach (var integratedPlugin in filteredIntegratedPlugins)
            {
                PluginContainer.Create(integratedPlugin);
            }
        }
Exemplo n.º 5
0
        static MinerPluginsManager()
        {
            // This is just a list of miners that are intergated in the nhm client. usefull when debuging
            _integratedPlugins = new List <IMinerPlugin>
            {
                // __DEV__*
#if INTEGRATE_BrokenMiner_PLUGIN
                new BrokenMiner.BrokenMinerPlugin(),
#endif
#if INTEGRATE_ExamplePlugin_PLUGIN
                new Example.ExamplePlugin(),
#endif
#if INTEGRATE_FakePlugin_PLUGIN
                new FakePlugin.FakePlugin(),
#endif

// real miners
#if INTEGRATE_CCMinerTpruvot_PLUGIN
                new CCMinerTpruvot.CCMinerTpruvotPlugin(),
#endif
#if INTEGRATE_XmrStakRx_PLUGIN
                new XmrStakRx.XmrStakRxPlugin(),
#endif

#if INTEGRATE_GMiner_PLUGIN
                new GMinerPlugin.GMinerPlugin(),
#endif
#if INTEGRATE_NBMiner_PLUGIN
                new NBMiner.NBMinerPlugin(),
#endif
#if INTEGRATE_Phoenix_PLUGIN
                new Phoenix.PhoenixPlugin(),
#endif
#if INTEGRATE_TeamRedMiner_PLUGIN
                new TeamRedMiner.TeamRedMinerPlugin(),
#endif
#if INTEGRATE_TRex_PLUGIN
                new TRex.TRexPlugin(),
#endif
#if INTEGRATE_TTMiner_PLUGIN
                new TTMiner.TTMinerPlugin(),
#endif
#if INTEGRATE_ClaymoreDual_PLUGIN
                new ClaymoreDual14.ClaymoreDual14Plugin(),
#endif
#if INTEGRATE_NanoMiner_PLUGIN
                new NanoMiner.NanoMinerPlugin(),
#endif
#if INTEGRATE_WildRig_PLUGIN
                new WildRig.WildRigPlugin(),
#endif
#if INTEGRATE_CryptoDredge_PLUGIN
                new CryptoDredge.CryptoDredgePlugin(),
#endif
#if INTEGRATE_ZEnemy_PLUGIN
                new ZEnemy.ZEnemyPlugin(),
#endif
#if INTEGRATE_LolMiner_PLUGIN
                new LolMiner.LolMinerPlugin(),
#endif
#if INTEGRATE_SRBMiner_PLUGIN
                new SRBMiner.SRBMinerPlugin(),
#endif
#if INTEGRATE_XMRig_PLUGIN
                new XMRig.XMRigPlugin(),
#endif
#if INTEGRATE_MiniZ_PLUGIN
                new MiniZ.MiniZPlugin(),
#endif

#if INTEGRATE_ALL_PLUGINS
                new CCMinerTpruvot.CCMinerTpruvotPlugin(),
                new XmrStakRx.XmrStakRxPlugin(),
                new GMinerPlugin.GMinerPlugin(),
                new NBMiner.NBMinerPlugin(),
                new Phoenix.PhoenixPlugin(),
                new TeamRedMiner.TeamRedMinerPlugin(),
                new TRex.TRexPlugin(),
                new TTMiner.TTMinerPlugin(),
                new ClaymoreDual14.ClaymoreDual14Plugin(),
                new NanoMiner.NanoMinerPlugin(),
                new WildRig.WildRigPlugin(),
                new CryptoDredge.CryptoDredgePlugin(),
                new ZEnemy.ZEnemyPlugin(),
                new LolMiner.LolMinerPlugin(),
                new SRBMiner.SRBMinerPlugin(),
                new MiniZ.MiniZPlugin(),
#endif


                // service plugin
                EthlargementIntegratedPlugin.Instance,

                // plugin dependencies
                VC_REDIST_x64_2015_2019_DEPENDENCY_PLUGIN.Instance
            };
            var filteredIntegratedPlugins = _integratedPlugins.Where(p => BlacklistedPlugins.Instance.IsSupported(p.PluginUUID)).ToList();
            foreach (var integratedPlugin in filteredIntegratedPlugins)
            {
                PluginContainer.Create(integratedPlugin);
            }
        }