Skip to content

Commit 0e0464f

Browse files
author
goingfine
committed
no auto skip in prev result scan mode
1 parent b4da940 commit 0e0464f

File tree

3 files changed

+21
-11
lines changed

3 files changed

+21
-11
lines changed

windows/Classes/ScanEngine.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ internal class ScanEngine
4141
private int skipMinPercent;
4242
public bool isDiagnosing = false;
4343
public bool isRandomScan = false;
44+
private ScanType scanType;
4445

4546
public ScanEngine()
4647
{
@@ -51,6 +52,7 @@ public ScanEngine()
5152

5253
public bool resume(ScanType scanType = ScanType.SCAN_CLOUDFLARE_IPS)
5354
{
55+
this.scanType = scanType;
5456
if (progressInfo.scanStatus != ScanStatus.PAUSED)
5557
return false;
5658

@@ -61,6 +63,7 @@ public bool resume(ScanType scanType = ScanType.SCAN_CLOUDFLARE_IPS)
6163

6264
public bool start(ScanType scanType = ScanType.SCAN_CLOUDFLARE_IPS, int lastIndex = 0)
6365
{
66+
this.scanType = scanType;
6467
progressInfo.stopRequested = false;
6568
progressInfo.pauseRequested = false;
6669

@@ -330,6 +333,9 @@ private void monitorExceptions(CheckIPWorking checker)
330333

331334
private void checkForAutoSkips()
332335
{
336+
// no skip in prev result scan mode
337+
if (scanType == ScanType.SCAN_IN_PERV_RESULTS)
338+
return;
333339

334340
// skip after 3 minute
335341
if (skipAfterAWhileEnabled)

windows/frmMain.Designer.cs

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

windows/frmMain.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ private void updateUIControls(bool isStarting, ScanType scanType = ScanType.SCAN
380380
comboUpTargetSpeed.Enabled = false;
381381
comboDLTargetSpeed.Enabled = false;
382382
comboConfigs.Enabled = false;
383+
comboCheckType.Enabled = false;
383384
timerProgress.Enabled = true;
384385
//btnSkipCurRange.Enabled = true;
385386
comboResults.Enabled = false;
@@ -403,6 +404,7 @@ private void updateUIControls(bool isStarting, ScanType scanType = ScanType.SCAN
403404
comboDLTargetSpeed.Enabled = true;
404405
comboUpTargetSpeed.Enabled = true;
405406
comboConfigs.Enabled = true;
407+
comboCheckType.Enabled = true;
406408

407409
if (!isScanPaused())
408410
{
@@ -474,7 +476,7 @@ private void updateConrtolsProgress(bool forceUpdate = false)
474476
pInf.frontingExceptions.setControlColorStyles(btnFrontingErrors);
475477
pInf.downloadUploadExceptions.setControlColorStyles(btnDownloadErrors);
476478
btnFrontingErrors.Text = $"Fronting Errors : {pInf.frontingExceptions.getErrorRate():f1}%";
477-
btnDownloadErrors.Text = $"Download Errors : {pInf.downloadUploadExceptions.getErrorRate():f1}%";
479+
btnDownloadErrors.Text = $"DL && UP Errors : {pInf.downloadUploadExceptions.getErrorRate():f1}%";
478480
btnFrontingErrors.ToolTipText = $"Total errors: {pInf.downloadUploadExceptions.getTotalErros()}";
479481
btnDownloadErrors.ToolTipText = $"Total errors: {pInf.frontingExceptions.getTotalErros()}";
480482
}
@@ -1454,7 +1456,7 @@ private void updateClientConfigCloudflareSubnetsToolStripMenuItem_Click(object s
14541456
private void testAvgSingleIP(string IPAddress, int rounds, ScanSpeed dlSpeed, ScanSpeed upSpeed, CustomConfigInfo v2rayConfig, int downloadTimeout, CheckType checkType = CheckType.DOWNLOAD)
14551457
{
14561458

1457-
addTextLog($"Testing {IPAddress} for {rounds} rounds, Scan Type: {checkType}...");
1459+
addTextLog($"{Environment.NewLine}Testing {IPAddress} for {rounds} round(s), Scan type: {checkType}...");
14581460

14591461
int totalSuccessCount = 0, totalFailedCount = 0;
14601462
long bestDLDuration = 99999, bestUPDuration = 9999, bestFrontingDuration = 99999, totalDLDuration = 0, totalUPDuration = 0, totalFrontingDuration = 0;
@@ -1495,9 +1497,10 @@ private void testAvgSingleIP(string IPAddress, int rounds, ScanSpeed dlSpeed, Sc
14951497
averageUPDuration = totalUPDuration / totalSuccessCount;
14961498
averageFrontingDuration = totalFrontingDuration / totalSuccessCount;
14971499

1498-
string results = $"{IPAddress} => {totalSuccessCount}/{rounds} was successful." + Environment.NewLine +
1500+
// print results
1501+
string results = $"{IPAddress} => {totalSuccessCount}/{rounds} test(s) was successful." + Environment.NewLine +
14991502
(bestDLDuration > 0 ? $"\tDownload: Best {bestDLDuration:n0} ms, Average: {averageDLDuration:n0} ms" + Environment.NewLine : "") +
1500-
(bestUPDuration> 0 ? $"\tUpload : Best {bestUPDuration:n0} ms, Average: {averageUPDuration:n0} ms" + Environment.NewLine : "") +
1503+
(bestUPDuration > 0 ? $"\tUpload : Best {bestUPDuration:n0} ms, Average: {averageUPDuration:n0} ms" + Environment.NewLine : "") +
15011504
$"\tFronting: Best {bestFrontingDuration:n0} ms, Average: {averageFrontingDuration:n0} ms" + Environment.NewLine;
15021505

15031506
addTextLog(results);

0 commit comments

Comments
 (0)