Added ability to send the Proxy Type to the debugger as well.

This commit is contained in:
ruri
2019-05-03 19:42:29 +02:00
parent 07eaa8854c
commit d467682fac
3 changed files with 22 additions and 10 deletions
+8 -2
View File
@@ -1,4 +1,5 @@
using RuriLib.ViewModels;
using Extreme.Net;
using RuriLib.ViewModels;
using System;
using System.Collections.Generic;
@@ -17,6 +18,10 @@ namespace RuriLib.Models
/// <summary>The proxy that was used for the check.</summary>
public string Proxy { get { return proxy; } set { proxy = value; OnPropertyChanged(); } }
private ProxyType proxyType;
/// <summary>The proxy type.</summary>
public ProxyType ProxyType { get { return proxyType; } set { proxyType = value; OnPropertyChanged(); } }
private BotStatus result;
/// <summary>The result of the check.</summary>
public BotStatus Result { get { return result; } set { result = value; OnPropertyChanged(); } }
@@ -48,11 +53,12 @@ namespace RuriLib.Models
/// </summary>
/// <param name="data">The data line that was used in the check</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="result">The result of 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="log">The detailed log of the check</param>
public ValidData(string data, string proxy, BotStatus result, string capturedData, string source, List<LogEntry> log)
public ValidData(string data, string proxy, ProxyType proxyType, BotStatus result, string capturedData, string source, List<LogEntry> log)
{
Data = data;
Proxy = proxy;
+5 -5
View File
@@ -421,7 +421,7 @@ namespace RuriLib.Runner
// Check if it's valid
if (!c.IsValid || !c.RespectsRules(Config.Settings.DataRules.ToList()))
{
FailedList.Add(new ValidData(data, "", BotStatus.FAIL, "", "", null));
FailedList.Add(new ValidData(data, "", ProxyType.Http, BotStatus.FAIL, "", "", null));
continue;
}
@@ -755,7 +755,7 @@ namespace RuriLib.Runner
switch (botData.Status)
{
case BotStatus.SUCCESS:
validData = new ValidData(botData.Data.Data, botData.Proxy == null ? "" : botData.Proxy.Proxy, 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, capturedData.ToCaptureString(), Settings.General.SaveLastSource ? botData.ResponseSource : "", BotLog);
RaiseDispatchAction(new Action(() => HitsList.Add(validData)));
if (UseProxies && !Settings.Proxies.NeverBan && Settings.Proxies.BanAfterGoodStatus)
{
@@ -767,12 +767,12 @@ namespace RuriLib.Runner
break;
case BotStatus.FAIL:
FailedList.Add(new ValidData("", botData.Proxy == null ? "" : botData.Proxy.Proxy, botData.Status, "", "", null));
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;
case BotStatus.CUSTOM:
hitType = botData.CustomStatus;
validData = new ValidData(botData.Data.Data, botData.Proxy == null ? "" : botData.Proxy.Proxy, 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, capturedData.ToCaptureString(), Settings.General.SaveLastSource ? botData.ResponseSource : "", BotLog);
RaiseDispatchAction(new Action(() => CustomList.Add(validData)));
if (UseProxies && !Settings.Proxies.NeverBan && Settings.Proxies.BanAfterGoodStatus)
@@ -804,7 +804,7 @@ namespace RuriLib.Runner
goto GETPROXY;
case BotStatus.NONE:
validData = new ValidData(botData.Data.Data, botData.Proxy == null ? "" : botData.Proxy.Proxy, 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, capturedData.ToCaptureString(), Settings.General.SaveLastSource ? botData.ResponseSource : "", BotLog);
RaiseDispatchAction(new Action(() => ToCheckList.Add(validData)));
if (UseProxies && !Settings.Proxies.NeverBan && Settings.Proxies.BanAfterGoodStatus)