Exemplo n.º 1
0
        private void DoInit(Action callback)
        {
            this.ReporterDataProvider = new ReportDataProvider();
            this.CalcConfigSet        = new CalcConfigSet(this);
            this.ServerContext        = new ServerContext();
            this.GpuProfileSet        = new GpuProfileSet(this);
            this.KernelProfileSet     = new KernelProfileSet();
            this.GpusSpeed            = new GpusSpeed(this);
            this.CoinShareSet         = new CoinShareSet(this);
            this.OverClockDataSet     = new OverClockDataSet(this);
            this.ServerMessageSet     = new ServerMessageSet(HomePath.LocalDbFileFullName, isServer: false);
            this._minerProfile        = new MinerProfile(this);
            var cpuPackage = new CpuPackage(_minerProfile);

            this.CpuPackage = cpuPackage;

            // 这几个注册表内部区分挖矿端和群控客户端
            NTMinerRegistry.SetLocation(ClientAppType.AppType, VirtualRoot.AppFileFullName);
            NTMinerRegistry.SetArguments(ClientAppType.AppType, string.Join(" ", CommandLineArgs.Args));
            NTMinerRegistry.SetCurrentVersion(ClientAppType.AppType, EntryAssemblyInfo.CurrentVersionStr);
            NTMinerRegistry.SetCurrentVersionTag(ClientAppType.AppType, EntryAssemblyInfo.CurrentVersionTag);

            if (ClientAppType.IsMinerClient)
            {
                Link();
                // 当显卡温度变更时守卫温度防线
                TempGruarder.Instance.Init(this);
            }

            callback?.Invoke();
            cpuPackage.Init();
        }
Exemplo n.º 2
0
        private void DoInit(bool isWork, Action callback)
        {
            IsJsonServer = !DevMode.IsDevMode || VirtualRoot.IsMinerStudio || isWork;
            this.ReporterDataProvider = new ReportDataProvider();
            this.ServerAppSettingSet  = new ServerAppSettingSet();
            this.CalcConfigSet        = new CalcConfigSet(this);
            this.ServerContext        = new ServerContext();
            this.GpuProfileSet        = new GpuProfileSet(this);
            this.UserSet          = new UserSet();
            this.KernelProfileSet = new KernelProfileSet(this);
            this.GpusSpeed        = new GpusSpeed(this);
            this.CoinShareSet     = new CoinShareSet(this);
            this.MineWorkSet      = new MineWorkSet();
            this.MinerGroupSet    = new MinerGroupSet();
            this.NTMinerWalletSet = new NTMinerWalletSet();
            this.OverClockDataSet = new OverClockDataSet(this);
            this.ColumnsShowSet   = new ColumnsShowSet();
            this.ServerMessageSet = new ServerMessageSet(EntryAssemblyInfo.LocalDbFileFullName, isServer: false);
            // 作业和在群控客户端管理作业时
            IsJsonLocal        = isWork || VirtualRoot.IsMinerStudio;
            this._minerProfile = new MinerProfile(this);
            var cpuPackage = new CpuPackage(_minerProfile);

            this.CpuPackage = cpuPackage;

            // 这几个注册表内部区分挖矿端和群控客户端
            NTMinerRegistry.SetLocation(VirtualRoot.AppFileFullName);
            NTMinerRegistry.SetArguments(string.Join(" ", CommandLineArgs.Args));
            NTMinerRegistry.SetCurrentVersion(EntryAssemblyInfo.CurrentVersion.ToString());
            NTMinerRegistry.SetCurrentVersionTag(EntryAssemblyInfo.CurrentVersionTag);

            if (VirtualRoot.IsMinerClient)
            {
                VirtualRoot.LocalIpSet.InitOnece();
                Link();
                // 当显卡温度变更时守卫温度防线
                TempGruarder.Instance.Init(this);
                // 因为这里耗时500毫秒左右
                Task.Factory.StartNew(() => {
                    Windows.Error.DisableWindowsErrorUI();
                    Windows.UAC.DisableUAC();
                    Windows.WAU.DisableWAUAsync();
                    Windows.Defender.DisableAntiSpyware();
                    Windows.Power.PowerCfgOff();
                    Windows.BcdEdit.IgnoreAllFailures();
                });
            }

            callback?.Invoke();
            cpuPackage.Init();
        }
Exemplo n.º 3
0
        private void DoInit(bool isWork, Action callback)
        {
            IsJsonServer = !DevMode.IsDevMode || ClientAppType.IsMinerStudio || isWork;
            this.ReporterDataProvider = new ReportDataProvider();

            this.CalcConfigSet    = new CalcConfigSet(this);
            this.ServerContext    = new ServerContext();
            this.GpuProfileSet    = new GpuProfileSet(this);
            this.KernelProfileSet = new KernelProfileSet();
            this.GpusSpeed        = new GpusSpeed(this);
            this.CoinShareSet     = new CoinShareSet(this);
            this.OverClockDataSet = new OverClockDataSet(this);
            this.ServerMessageSet = new ServerMessageSet(HomePath.LocalDbFileFullName, isServer: false);
            // 作业和在群控客户端管理作业时
            IsJsonLocal        = isWork || ClientAppType.IsMinerStudio;
            this._minerProfile = new MinerProfile(this);
            var cpuPackage = new CpuPackage(_minerProfile);

            this.CpuPackage = cpuPackage;

            // 这几个注册表内部区分挖矿端和群控客户端
            NTMinerRegistry.SetLocation(ClientAppType.AppType, VirtualRoot.AppFileFullName);
            NTMinerRegistry.SetArguments(ClientAppType.AppType, string.Join(" ", CommandLineArgs.Args));
            NTMinerRegistry.SetCurrentVersion(ClientAppType.AppType, EntryAssemblyInfo.CurrentVersionStr);
            NTMinerRegistry.SetCurrentVersionTag(ClientAppType.AppType, EntryAssemblyInfo.CurrentVersionTag);

            if (ClientAppType.IsMinerClient)
            {
                VirtualRoot.LocalIpSet.InitOnece();
                Link();
                // 当显卡温度变更时守卫温度防线
                TempGruarder.Instance.Init(this);
                // 因为这里耗时500毫秒左右
                Task.Factory.StartNew(() => {
                    Error.DisableWindowsErrorUI();
                    Power.PowerCfgOff();
                    BcdEdit.IgnoreAllFailures();
                });
            }

            callback?.Invoke();
            cpuPackage.Init();
        }