From 50959951ae5ad3439a7f0a24b27b21cceda9297e Mon Sep 17 00:00:00 2001
From: 2dust <31833384+2dust@users.noreply.github.com>
Date: Sat, 15 Feb 2025 20:27:20 +0800
Subject: [PATCH] The number of concurrent during multi-test
---
v2rayN/ServiceLib/Handler/ConfigHandler.cs | 4 ++++
v2rayN/ServiceLib/Handler/CoreHandler.cs | 2 +-
v2rayN/ServiceLib/Models/ConfigItems.cs | 1 +
v2rayN/ServiceLib/Resx/ResUI.Designer.cs | 9 +++++++++
v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx | 5 ++++-
v2rayN/ServiceLib/Resx/ResUI.hu.resx | 5 ++++-
v2rayN/ServiceLib/Resx/ResUI.resx | 5 ++++-
v2rayN/ServiceLib/Resx/ResUI.ru.resx | 5 ++++-
v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx | 5 ++++-
v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx | 3 +++
v2rayN/ServiceLib/Services/SpeedtestService.cs | 6 +++---
.../ViewModels/OptionSettingViewModel.cs | 3 +++
.../Views/OptionSettingWindow.axaml | 15 ++++++++++++++-
.../Views/OptionSettingWindow.axaml.cs | 7 ++++++-
v2rayN/v2rayN/Views/OptionSettingWindow.xaml | 17 ++++++++++++++++-
v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs | 7 ++++++-
16 files changed, 86 insertions(+), 13 deletions(-)
diff --git a/v2rayN/ServiceLib/Handler/ConfigHandler.cs b/v2rayN/ServiceLib/Handler/ConfigHandler.cs
index 464a8222..994d4284 100644
--- a/v2rayN/ServiceLib/Handler/ConfigHandler.cs
+++ b/v2rayN/ServiceLib/Handler/ConfigHandler.cs
@@ -125,6 +125,10 @@ namespace ServiceLib.Handler
{
config.SpeedTestItem.SpeedPingTestUrl = Global.SpeedPingTestUrl;
}
+ if (config.SpeedTestItem.MixedConcurrencyCount < 1)
+ {
+ config.SpeedTestItem.MixedConcurrencyCount = 5;
+ }
config.Mux4RayItem ??= new()
{
diff --git a/v2rayN/ServiceLib/Handler/CoreHandler.cs b/v2rayN/ServiceLib/Handler/CoreHandler.cs
index 08615879..7f7a3c9a 100644
--- a/v2rayN/ServiceLib/Handler/CoreHandler.cs
+++ b/v2rayN/ServiceLib/Handler/CoreHandler.cs
@@ -141,7 +141,7 @@ namespace ServiceLib.Handler
var coreType = AppHandler.Instance.GetCoreType(node, node.ConfigType);
var coreInfo = CoreInfoHandler.Instance.GetCoreInfo(coreType);
- var proc = await CoreHandler.Instance.RunProcess(coreInfo, fileName, true, false);
+ var proc = await RunProcess(coreInfo, fileName, true, false);
if (proc is null)
{
return -1;
diff --git a/v2rayN/ServiceLib/Models/ConfigItems.cs b/v2rayN/ServiceLib/Models/ConfigItems.cs
index 0a5cf36c..b7fd31fe 100644
--- a/v2rayN/ServiceLib/Models/ConfigItems.cs
+++ b/v2rayN/ServiceLib/Models/ConfigItems.cs
@@ -156,6 +156,7 @@ namespace ServiceLib.Models
public int SpeedTestTimeout { get; set; }
public string SpeedTestUrl { get; set; }
public string SpeedPingTestUrl { get; set; }
+ public int MixedConcurrencyCount { get; set; }
}
[Serializable]
diff --git a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs
index b793d15e..9872f880 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs
+++ b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs
@@ -3220,6 +3220,15 @@ namespace ServiceLib.Resx {
}
}
+ ///
+ /// 查找类似 Number per time for auto batch during speedtest(max 1000) 的本地化字符串。
+ ///
+ public static string TbSettingsMixedConcurrencyCount {
+ get {
+ return ResourceManager.GetString("TbSettingsMixedConcurrencyCount", resourceCulture);
+ }
+ }
+
///
/// 查找类似 sing-box Mux Protocol 的本地化字符串。
///
diff --git a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx
index 459abca2..2fbc1581 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx
+++ b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx
@@ -1,4 +1,4 @@
-
+