Added hit type column to the Runner's hit table.

This commit is contained in:
ruri
2019-05-29 11:20:28 +02:00
parent 586c8a3947
commit 49663a0c67
3 changed files with 14 additions and 7 deletions
+2 -1
View File
@@ -226,7 +226,8 @@
<GridViewColumn Header="Time" DisplayMemberBinding="{Binding Path=Time}" /> <GridViewColumn Header="Time" DisplayMemberBinding="{Binding Path=Time}" />
<GridViewColumn Header="Data" DisplayMemberBinding="{Binding Path=Data}" /> <GridViewColumn Header="Data" DisplayMemberBinding="{Binding Path=Data}" />
<GridViewColumn Header="Proxy" DisplayMemberBinding="{Binding Path=Proxy}" /> <GridViewColumn Header="Proxy" DisplayMemberBinding="{Binding Path=Proxy}" />
<GridViewColumn Width="2000" Header="Captured Data" DisplayMemberBinding="{Binding Path=CapturedData}" /> <GridViewColumn Header="Type" DisplayMemberBinding="{Binding Path=Type}"/>
<GridViewColumn Width="2000" Header="Capture" DisplayMemberBinding="{Binding Path=CapturedData}" />
</GridView> </GridView>
</ListView.View> </ListView.View>
</ListView> </ListView>
+7 -1
View File
@@ -26,6 +26,10 @@ namespace RuriLib.Models
/// <summary>The result of the check.</summary> /// <summary>The result of the check.</summary>
public BotStatus Result { get { return result; } set { result = value; OnPropertyChanged(); } } public BotStatus Result { get { return result; } set { result = value; OnPropertyChanged(); } }
private string type;
/// <summary>The type of the result.</summary>
public string Type { get { return type; } set { type = value; OnPropertyChanged(); } }
private string capturedData; private string capturedData;
/// <summary>The data captured during the check.</summary> /// <summary>The data captured during the check.</summary>
public string CapturedData { get { return capturedData; } set { capturedData = value; OnPropertyChanged(); } } public string CapturedData { get { return capturedData; } set { capturedData = value; OnPropertyChanged(); } }
@@ -55,14 +59,16 @@ namespace RuriLib.Models
/// <param name="proxy">The proxy that was used for the check (empty string if none)</param> /// <param name="proxy">The proxy that was used for the check (empty string if none)</param>
/// <param name="proxyType">The proxy type</param> /// <param name="proxyType">The proxy type</param>
/// <param name="result">The result of the check</param> /// <param name="result">The result of the check</param>
/// <param name="type">The result type</param>
/// <param name="capturedData">The data captured during the check</param> /// <param name="capturedData">The data captured during the check</param>
/// <param name="source">The last page source code of the check</param> /// <param name="source">The last page source code of the check</param>
/// <param name="log">The detailed log of the check</param> /// <param name="log">The detailed log of the check</param>
public ValidData(string data, string proxy, ProxyType proxyType, BotStatus result, string capturedData, string source, List<LogEntry> log) public ValidData(string data, string proxy, ProxyType proxyType, BotStatus result, string type, string capturedData, string source, List<LogEntry> log)
{ {
Data = data; Data = data;
Proxy = proxy; Proxy = proxy;
Result = result; Result = result;
Type = type;
CapturedData = capturedData; CapturedData = capturedData;
UnixDate = (int)Math.Round((DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0)).TotalSeconds); UnixDate = (int)Math.Round((DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0)).TotalSeconds);
Source = source; Source = source;
+5 -5
View File
@@ -447,7 +447,7 @@ namespace RuriLib.Runner
// Check if it's valid // Check if it's valid
if (!c.IsValid || !c.RespectsRules(Config.Settings.DataRules.ToList())) if (!c.IsValid || !c.RespectsRules(Config.Settings.DataRules.ToList()))
{ {
FailedList.Add(new ValidData(data, "", ProxyType.Http, BotStatus.FAIL, "", "", null)); FailedList.Add(new ValidData(data, "", ProxyType.Http, BotStatus.FAIL, "", "", "", null));
continue; continue;
} }
@@ -791,7 +791,7 @@ namespace RuriLib.Runner
switch (botData.Status) switch (botData.Status)
{ {
case BotStatus.SUCCESS: 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, capturedData.ToCaptureString(), Settings.General.SaveLastSource ? botData.ResponseSource : "", BotLog); 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))); RaiseDispatchAction(new Action(() => HitsList.Add(validData)));
if (UseProxies && !Settings.Proxies.NeverBan && Settings.Proxies.BanAfterGoodStatus) if (UseProxies && !Settings.Proxies.NeverBan && Settings.Proxies.BanAfterGoodStatus)
{ {
@@ -803,12 +803,12 @@ namespace RuriLib.Runner
break; break;
case BotStatus.FAIL: case BotStatus.FAIL:
FailedList.Add(new ValidData("", "", ProxyType.Http, botData.Status, "", "", null)); // Only needed for CPM calculation so we can set blank data to avoid filling RAM FailedList.Add(new ValidData("", "", ProxyType.Http, botData.Status, "", "", "", null)); // Only needed for CPM calculation so we can set blank data to avoid filling RAM
break; break;
case BotStatus.CUSTOM: case BotStatus.CUSTOM:
hitType = botData.CustomStatus; hitType = botData.CustomStatus;
validData = new ValidData(botData.Data.Data, botData.Proxy == null ? "" : botData.Proxy.Proxy, botData.Proxy == null ? ProxyType.Http : botData.Proxy.Type, botData.Status, capturedData.ToCaptureString(), Settings.General.SaveLastSource ? botData.ResponseSource : "", BotLog); 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))); RaiseDispatchAction(new Action(() => CustomList.Add(validData)));
if (UseProxies && !Settings.Proxies.NeverBan && Settings.Proxies.BanAfterGoodStatus) if (UseProxies && !Settings.Proxies.NeverBan && Settings.Proxies.BanAfterGoodStatus)
@@ -840,7 +840,7 @@ namespace RuriLib.Runner
goto GETPROXY; goto GETPROXY;
case BotStatus.NONE: case BotStatus.NONE:
validData = new ValidData(botData.Data.Data, botData.Proxy == null ? "" : botData.Proxy.Proxy, botData.Proxy == null ? ProxyType.Http : botData.Proxy.Type, botData.Status, capturedData.ToCaptureString(), Settings.General.SaveLastSource ? botData.ResponseSource : "", BotLog); 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))); RaiseDispatchAction(new Action(() => ToCheckList.Add(validData)));
if (UseProxies && !Settings.Proxies.NeverBan && Settings.Proxies.BanAfterGoodStatus) if (UseProxies && !Settings.Proxies.NeverBan && Settings.Proxies.BanAfterGoodStatus)