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

Commit 0984670

Browse files
Merge pull request #107 from theLosers106/master
Upgrade to version 1.5.0.0
2 parents 5352de8 + 8b88f54 commit 0984670

13 files changed

+3216
-76
lines changed

NiceHashMiner/BitcoinAddress.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Security.Cryptography;
3+
using System.Text.RegularExpressions;
34

45
namespace NiceHashMiner
56
{
@@ -25,6 +26,20 @@ public static bool ValidateBitcoinAddress(string address)
2526
}
2627
}
2728

29+
public static bool ValidateWorkerName(string workername)
30+
{
31+
if (workername.Length > 7 || !isAlphaNumeric(workername))
32+
return false;
33+
34+
return true;
35+
}
36+
37+
public static bool isAlphaNumeric(string strToCheck)
38+
{
39+
Regex rg = new Regex(@"^[a-zA-Z0-9\s,]*$");
40+
return rg.IsMatch(strToCheck);
41+
}
42+
2843
const string Alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
2944
const int Size = 25;
3045

NiceHashMiner/Config.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public class Algo : SubConfigClass
1717
public string UsePassword;
1818
public double BenchmarkSpeed;
1919
public bool Skip;
20+
public bool[] DisabledDevices;
2021
#pragma warning restore 649
2122
}
2223

@@ -27,6 +28,7 @@ public class Group : SubConfigClass
2728
public int APIBindPort;
2829
public string ExtraLaunchParameters;
2930
public string UsePassword;
31+
public double MinimumProfit;
3032
public int[] DisabledDevices;
3133
public Algo[] Algorithms;
3234
#pragma warning restore 649
@@ -73,6 +75,9 @@ public class Config
7375
public int LogLevel;
7476
public long LogMaxFileSize; // in bytes
7577
public bool ShowDriverVersionWarning;
78+
public bool DisableWindowsErrorReporting;
79+
public bool UseNewSettingsPage;
80+
public bool NVIDIAP0State;
7681
public Group[] Groups;
7782
#pragma warning restore 649
7883

@@ -104,6 +109,9 @@ static Config()
104109
ConfigData.LogLevel = 1;
105110
ConfigData.LogMaxFileSize = 1048576;
106111
ConfigData.ShowDriverVersionWarning = true;
112+
ConfigData.DisableWindowsErrorReporting = false;
113+
ConfigData.UseNewSettingsPage = true;
114+
ConfigData.NVIDIAP0State = false;
107115

108116
try { ConfigData = JsonConvert.DeserializeObject<Config>(File.ReadAllText("config.json")); }
109117
catch { }
@@ -151,6 +159,7 @@ public static void RebuildGroups()
151159
CG[i].APIBindPort = Form1.Miners[i].APIPort;
152160
CG[i].ExtraLaunchParameters = Form1.Miners[i].ExtraLaunchParameters;
153161
CG[i].UsePassword = Form1.Miners[i].UsePassword;
162+
CG[i].MinimumProfit = Form1.Miners[i].MinimumProfit;
154163
CG[i].Algorithms = new Algo[Form1.Miners[i].SupportedAlgorithms.Length];
155164
for (int k = 0; k < Form1.Miners[i].SupportedAlgorithms.Length; k++)
156165
{
@@ -160,6 +169,12 @@ public static void RebuildGroups()
160169
CG[i].Algorithms[k].ExtraLaunchParameters = Form1.Miners[i].SupportedAlgorithms[k].ExtraLaunchParameters;
161170
CG[i].Algorithms[k].UsePassword = Form1.Miners[i].SupportedAlgorithms[k].UsePassword;
162171
CG[i].Algorithms[k].Skip = Form1.Miners[i].SupportedAlgorithms[k].Skip;
172+
173+
CG[i].Algorithms[k].DisabledDevices = new bool[Form1.Miners[i].CDevs.Count];
174+
for (int j = 0; j < Form1.Miners[i].CDevs.Count; j++)
175+
{
176+
CG[i].Algorithms[k].DisabledDevices[j] = Form1.Miners[i].SupportedAlgorithms[k].DisabledDevice[j];
177+
}
163178
}
164179
List<int> DD = new List<int>();
165180
for (int k = 0; k < Form1.Miners[i].CDevs.Count; k++)

NiceHashMiner/Form1.Designer.cs

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)