Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
added tos 3rdparty miners, bins checker update
Browse files Browse the repository at this point in the history
  • Loading branch information
S74nk0 committed Nov 23, 2016
1 parent 7a18fe0 commit c027309
Show file tree
Hide file tree
Showing 10 changed files with 126 additions and 243 deletions.
5 changes: 4 additions & 1 deletion NiceHashMiner/Configs/GeneralConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ public int ApiBindPortPoolStart {

public bool DownloadInit { get; set; }

Use3rdPartyMiners Use3rdPartyMiners { get; set; }
public Use3rdPartyMiners Use3rdPartyMiners { get; set; }
public bool DownloadInit3rdParty { get; set; }


[JsonIgnore]
Expand Down Expand Up @@ -176,6 +177,7 @@ public void SetDefaults() {
DownloadInit = false;
ContinueMiningIfNoInternetAccess = false;
Use3rdPartyMiners = Use3rdPartyMiners.NOT_SET;
DownloadInit3rdParty = false;
}

public GeneralConfig(bool initDefaults = false) {
Expand Down Expand Up @@ -258,6 +260,7 @@ protected override void InitializeObject() {
DownloadInit = _file.DownloadInit;
}
Use3rdPartyMiners = _file.Use3rdPartyMiners;
DownloadInit3rdParty = _file.DownloadInit3rdParty;

hwidLoadFromFile = true;
hwidOK = this.hwid == _file.hwid;
Expand Down
64 changes: 37 additions & 27 deletions NiceHashMiner/Forms/Form_Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -327,35 +327,45 @@ private void StartupTimer_Tick(object sender, EventArgs e) {
}
// 3rdparty miners check scope
{
//
// check if setting set
if (ConfigManager.Instance.GeneralConfig.Use3rdPartyMiners == Use3rdPartyMiners.NOT_SET) {
// TODO
var result = MessageBox.Show(International.GetText("Form_Main_3rdParty_Text"),
International.GetText("Form_Main_3rdParty_Title"),
MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == System.Windows.Forms.DialogResult.Yes) {
ConfigManager.Instance.GeneralConfig.Use3rdPartyMiners = Use3rdPartyMiners.YES;
} else {
ConfigManager.Instance.GeneralConfig.Use3rdPartyMiners = Use3rdPartyMiners.NO;
}
}
// check if download needed
if (
//!MinersExistanceChecker.IsMinersBinsInit() && !ConfigManager.Instance.GeneralConfig.DownloadInit
true
) {
Form_Loading download3rdPartyUnzipForm = new Form_Loading(new MinersDownloader(MinersDownloadManager.ThirdPartyDlSetup));
SetChildFormCenter(download3rdPartyUnzipForm);
download3rdPartyUnzipForm.ShowDialog();
if (ConfigManager.Instance.GeneralConfig.Use3rdPartyMiners == Use3rdPartyMiners.YES) {
if (!MinersExistanceChecker.IsMiners3rdPartyBinsInit() && !ConfigManager.Instance.GeneralConfig.DownloadInit3rdParty) {
Form_Loading download3rdPartyUnzipForm = new Form_Loading(new MinersDownloader(MinersDownloadManager.ThirdPartyDlSetup));
SetChildFormCenter(download3rdPartyUnzipForm);
download3rdPartyUnzipForm.ShowDialog();
}
// check if files are mising
if (!MinersExistanceChecker.IsMiners3rdPartyBinsInit()) {
var result = MessageBox.Show(International.GetText("Form_Main_bins_folder_files_missing"),
International.GetText("Warning_with_Exclamation"),
MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (result == DialogResult.Yes) {
ConfigManager.Instance.GeneralConfig.DownloadInit = false;
ConfigManager.Instance.GeneralConfig.Commit();
Process PHandle = new Process();
PHandle.StartInfo.FileName = Application.ExecutablePath;
PHandle.Start();
Close();
return;
}
} else {
// all good
ConfigManager.Instance.GeneralConfig.DownloadInit3rdParty = true;
ConfigManager.Instance.GeneralConfig.Commit();
}
}
// check if files are mising
//if (!MinersExistanceChecker.IsMinersBinsInit()) {
// var result = MessageBox.Show(International.GetText("Form_Main_bins_folder_files_missing"),
// International.GetText("Warning_with_Exclamation"),
// MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
// if (result == DialogResult.Yes) {
// ConfigManager.Instance.GeneralConfig.DownloadInit = false;
// ConfigManager.Instance.GeneralConfig.Commit();
// Process PHandle = new Process();
// PHandle.StartInfo.FileName = Application.ExecutablePath;
// PHandle.Start();
// Close();
// return;
// }
//} else {
// // all good
// ConfigManager.Instance.GeneralConfig.DownloadInit = true;
// ConfigManager.Instance.GeneralConfig.Commit();
//}
}

// no bots please
Expand Down
4 changes: 3 additions & 1 deletion NiceHashMiner/Miners/MinersManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ public static Miner CreateMiner(DeviceType deviceType, string minerPath) {
return new eqm();
} else if (minerPath == MinerPaths.nheqminer) {
return new nheqminer();
} else if (minerPath == MinerPaths.ClaymoreZcashMiner && DeviceType.AMD == deviceType) {
} else if (
ConfigManager.Instance.GeneralConfig.Use3rdPartyMiners == Use3rdPartyMiners.YES
&& minerPath == MinerPaths.ClaymoreZcashMiner && DeviceType.AMD == deviceType) {
return new ClaymoreZcashMiner();
} else if (minerPath.Contains("ethminer") && DeviceType.CPU != deviceType) {
if (DeviceType.AMD == deviceType) {
Expand Down
1 change: 1 addition & 0 deletions NiceHashMiner/NiceHashMiner.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@
<Compile Include="Miners\sgminer.cs" />
<Compile Include="TextBoxKeyPressEvents.cs" />
<Compile Include="Utils\BINS_CODEGEN.cs" />
<Compile Include="Utils\BINS_CODEGEN_3rd.cs" />
<Compile Include="Utils\CommandLineParser.cs" />
<Compile Include="Utils\DownloadSetup.cs" />
<Compile Include="Utils\MinersDownloader.cs" />
Expand Down
Loading

0 comments on commit c027309

Please sign in to comment.