Moved BanProxyAfterGoodStatus from global to config-specific.

This commit is contained in:
ruri
2019-06-19 14:38:27 +02:00
parent a4fb0f3334
commit c1523ece06
5 changed files with 14 additions and 14 deletions
+4
View File
@@ -68,6 +68,10 @@ namespace RuriLib
private int maxProxyUses = 0;
/// <summary>The maximum amount of times a proxy can be used before being banned by the Runner (0 for infinite).</summary>
public int MaxProxyUses { get { return maxProxyUses; } set { maxProxyUses = value; OnPropertyChanged(); } }
private bool banProxyAfterGoodStatus = false;
/// <summary>Whether to ban the proxy after a SUCCESS, CUSTOM or NONE status (not FAIL or RETRY).</summary>
public bool BanProxyAfterGoodStatus { get { return banProxyAfterGoodStatus; } set { banProxyAfterGoodStatus = value; OnPropertyChanged(); } }
#endregion
#region Data
+3 -3
View File
@@ -793,7 +793,7 @@ namespace RuriLib.Runner
case BotStatus.SUCCESS:
validData = new ValidData(botData.Data.Data, botData.Proxy == null ? "" : botData.Proxy.Proxy, botData.Proxy == null ? ProxyType.Http : botData.Proxy.Type, botData.Status, "HIT", capturedData.ToCaptureString(), Settings.General.SaveLastSource ? botData.ResponseSource : "", BotLog);
RaiseDispatchAction(new Action(() => HitsList.Add(validData)));
if (UseProxies && !Settings.Proxies.NeverBan && Settings.Proxies.BanAfterGoodStatus)
if (UseProxies && !Settings.Proxies.NeverBan && Config.Settings.BanProxyAfterGoodStatus)
{
currentProxy.Status = Status.BANNED;
currentProxy.LastUsed = DateTime.Now;
@@ -811,7 +811,7 @@ namespace RuriLib.Runner
validData = new ValidData(botData.Data.Data, botData.Proxy == null ? "" : botData.Proxy.Proxy, botData.Proxy == null ? ProxyType.Http : botData.Proxy.Type, botData.Status, hitType, capturedData.ToCaptureString(), Settings.General.SaveLastSource ? botData.ResponseSource : "", BotLog);
RaiseDispatchAction(new Action(() => CustomList.Add(validData)));
if (UseProxies && !Settings.Proxies.NeverBan && Settings.Proxies.BanAfterGoodStatus)
if (UseProxies && !Settings.Proxies.NeverBan && Config.Settings.BanProxyAfterGoodStatus)
{
currentProxy.Status = Status.BANNED;
currentProxy.LastUsed = DateTime.Now;
@@ -843,7 +843,7 @@ namespace RuriLib.Runner
validData = new ValidData(botData.Data.Data, botData.Proxy == null ? "" : botData.Proxy.Proxy, botData.Proxy == null ? ProxyType.Http : botData.Proxy.Type, botData.Status, "TOCHK", capturedData.ToCaptureString(), Settings.General.SaveLastSource ? botData.ResponseSource : "", BotLog);
RaiseDispatchAction(new Action(() => ToCheckList.Add(validData)));
if (UseProxies && !Settings.Proxies.NeverBan && Settings.Proxies.BanAfterGoodStatus)
if (UseProxies && !Settings.Proxies.NeverBan && Config.Settings.BanProxyAfterGoodStatus)
{
currentProxy.Status = Status.BANNED;
currentProxy.LastUsed = DateTime.Now;
@@ -34,10 +34,6 @@ namespace RuriLib.ViewModels
/// <summary>Whether to never ban the proxies.</summary>
public bool NeverBan { get { return neverBan; } set { neverBan = value; OnPropertyChanged(); } }
private bool banAfterGoodStatus = false;
/// <summary>Whether to never ban the proxy after a SUCCESS, CUSTOM or NONE status (not FAIL or RETRY).</summary>
public bool BanAfterGoodStatus { get { return banAfterGoodStatus; } set { banAfterGoodStatus = value; OnPropertyChanged(); } }
private bool shuffleOnStart = false;
/// <summary>Whether proxy lists should be shuffled before being assigned to the Runner.</summary>
public bool ShuffleOnStart { get { return shuffleOnStart; } set { shuffleOnStart = value; OnPropertyChanged(); } }