diff --git a/examples/Club_Cooee.cs b/examples/Club_Cooee.cs index b21fb8b..ab0b145 100644 --- a/examples/Club_Cooee.cs +++ b/examples/Club_Cooee.cs @@ -17,7 +17,7 @@ public static async Task Main() var checker = new CheckerBuilder(checkerSettings, CheckAsync) .WithCombos(File.ReadAllLines("Combos.txt")) - .WithProxies(File.ReadAllLines("Proxies.txt"), new ProxySettings(ProxyProtocol.HTTP)) + .WithProxies(File.ReadAllLines("Proxies.txt"), new ProxySettings(ProxyProtocol.Http)) .Build(); var consoleManager = new ConsoleManager(checker); diff --git a/src/Milky/Checker.cs b/src/Milky/Checker.cs index 79d3642..749ab18 100644 --- a/src/Milky/Checker.cs +++ b/src/Milky/Checker.cs @@ -183,7 +183,6 @@ private async Task StartCpmCounterAsync() } } - // It just looks better to have a separate method for this private void OutputCombo(Combo combo, CheckResult checkResult) { if (checkResult.ComboResult == ComboResult.Invalid && !_outputSettings.OutputInvalids) @@ -196,7 +195,7 @@ private void OutputCombo(Combo combo, CheckResult checkResult) if (checkResult.Captures != null && checkResult.Captures.Count != 0) { IEnumerable captures = checkResult.Captures - .Where(c => c.Value != null && !string.IsNullOrWhiteSpace(c.Value.ToString())) // If capture value is either null, empty or white-space, we don't want it to be included + .Where(c => !string.IsNullOrWhiteSpace(c.Value?.ToString())) // If capture value is either null, empty or white-space, we don't want it to be included .Select(c => $"{c.Key} = {c.Value}"); outputBuilder.Append(_outputSettings.CaptureSeparator).AppendJoin(_outputSettings.CaptureSeparator, captures); diff --git a/src/Milky/CheckerBuilder.cs b/src/Milky/CheckerBuilder.cs index 72a8931..dd5d9b3 100644 --- a/src/Milky/CheckerBuilder.cs +++ b/src/Milky/CheckerBuilder.cs @@ -34,7 +34,7 @@ public CheckerBuilder WithOutputSettings(OutputSettings outputSettings) public CheckerBuilder WithCombos(IEnumerable combos) { - foreach (var combo in combos.Where(c => c.IsValid)) + foreach (var combo in combos.Where(c => c.Valid)) { _combos.Add(combo); } diff --git a/src/Milky/Enums/ProxyProtocol.cs b/src/Milky/Enums/ProxyProtocol.cs index 1a8b27d..b97655c 100644 --- a/src/Milky/Enums/ProxyProtocol.cs +++ b/src/Milky/Enums/ProxyProtocol.cs @@ -2,9 +2,9 @@ { public enum ProxyProtocol { - HTTP, - SOCKS4, - SOCKS4a, - SOCKS5 + Http, + Socks4, + Socks4A, + Socks5 } } diff --git a/src/Milky/Models/CheckerInfo.cs b/src/Milky/Models/CheckerInfo.cs index 912e1cb..f713402 100644 --- a/src/Milky/Models/CheckerInfo.cs +++ b/src/Milky/Models/CheckerInfo.cs @@ -18,7 +18,7 @@ internal CheckerInfo(int combos) public CheckerStatus Status { get; internal set; } - public int Combos { get; } + public int Combos { get; private set; } public int Checked { get; internal set; } diff --git a/src/Milky/Models/Combo.cs b/src/Milky/Models/Combo.cs index 11a5877..a8257f3 100644 --- a/src/Milky/Models/Combo.cs +++ b/src/Milky/Models/Combo.cs @@ -20,10 +20,10 @@ public Combo(string combo, string separator = ":") Username = split[0]; Password = split[1]; - IsValid = true; + Valid = true; } - internal bool IsValid { get; } + internal bool Valid { get; } public string Username { get; } diff --git a/src/Milky/Models/Proxy.cs b/src/Milky/Models/Proxy.cs index d064e77..780a447 100644 --- a/src/Milky/Models/Proxy.cs +++ b/src/Milky/Models/Proxy.cs @@ -38,13 +38,13 @@ public Proxy(string proxy, ProxySettings settings) internal bool Valid { get; } - public string Host { get; } + internal ProxySettings Settings { get; } - public int Port { get; } + internal string Host { get; } - public NetworkCredential Credentials { get; } + internal int Port { get; } - public ProxySettings Settings { get; } + internal NetworkCredential Credentials { get; } internal HttpClient GetHttpClient() { @@ -65,7 +65,7 @@ internal HttpClient GetHttpClient() private HttpMessageHandler GetHttpMessageHandler() { - if (Settings.Protocol == ProxyProtocol.HTTP) + if (Settings.Protocol == ProxyProtocol.Http) { return new HttpClientHandler() { @@ -88,19 +88,19 @@ private HttpMessageHandler GetHttpMessageHandler() return Settings.Protocol switch { - ProxyProtocol.SOCKS4 => new ProxyClientHandler(proxySettings) + ProxyProtocol.Socks4 => new ProxyClientHandler(proxySettings) { AllowAutoRedirect = Settings.AllowAutoRedirect, UseCookies = Settings.UseCookies, CookieContainer = Settings.CookieContainer }, - ProxyProtocol.SOCKS4a => new ProxyClientHandler(proxySettings) + ProxyProtocol.Socks4A => new ProxyClientHandler(proxySettings) { AllowAutoRedirect = Settings.AllowAutoRedirect, UseCookies = Settings.UseCookies, CookieContainer = Settings.CookieContainer }, - ProxyProtocol.SOCKS5 => new ProxyClientHandler(proxySettings) + ProxyProtocol.Socks5 => new ProxyClientHandler(proxySettings) { AllowAutoRedirect = Settings.AllowAutoRedirect, UseCookies = Settings.UseCookies,