mirror of https://github.com/2dust/v2rayN
up test
parent
4a74102eb7
commit
068fe3113b
|
@ -18,7 +18,7 @@ namespace v2rayN.Forms
|
|||
{
|
||||
public partial class MainForm : BaseForm
|
||||
{
|
||||
private V2rayHandler v2rayHandler;
|
||||
private V2rayHandler v2rayHandler;
|
||||
private List<int> lvSelecteds = new List<int>();
|
||||
private StatisticsHandler statistics = null;
|
||||
|
||||
|
@ -966,9 +966,9 @@ namespace v2rayN.Forms
|
|||
}
|
||||
private void ClearTestResult()
|
||||
{
|
||||
for (int k = 0; k < config.vmess.Count; k++)
|
||||
for (int k = 0; k < lvSelecteds.Count; k++)
|
||||
{
|
||||
SetTestResult(k, "");
|
||||
SetTestResult(lvSelecteds[k], "");
|
||||
}
|
||||
}
|
||||
private void UpdateSpeedtestHandler(int index, string msg)
|
||||
|
|
|
@ -182,6 +182,7 @@ namespace v2rayN.Handler
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private void RunSpeedTest()
|
||||
{
|
||||
if (_config.vmess.Count <= 0)
|
||||
|
@ -244,7 +245,7 @@ namespace v2rayN.Handler
|
|||
|
||||
testCounter++;
|
||||
var webProxy = new WebProxy(Global.Loopback, httpPort + index);
|
||||
downloadHandle2.DownloadFileAsync(_config, url, webProxy, 30);
|
||||
downloadHandle2.DownloadFileAsync(_config, url, webProxy, 20);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1398,6 +1398,8 @@ namespace v2rayN.Handler
|
|||
|
||||
msg = UIRes.I18N("InitialConfiguration");
|
||||
|
||||
Config configCopy = Utils.DeepCopy<Config>(config);
|
||||
|
||||
string result = Utils.GetEmbedText(SampleClient);
|
||||
if (Utils.IsNullOrEmpty(result))
|
||||
{
|
||||
|
@ -1412,21 +1414,21 @@ namespace v2rayN.Handler
|
|||
return -1;
|
||||
}
|
||||
|
||||
log(config, ref v2rayConfig, false);
|
||||
log(configCopy, ref v2rayConfig, false);
|
||||
//routing(config, ref v2rayConfig);
|
||||
dns(config, ref v2rayConfig);
|
||||
dns(configCopy, ref v2rayConfig);
|
||||
|
||||
|
||||
var httpPort = config.GetLocalPort("speedtest");
|
||||
var httpPort = configCopy.GetLocalPort("speedtest");
|
||||
for (int k = 0; k < selecteds.Count; k++)
|
||||
{
|
||||
int index = selecteds[k];
|
||||
if (config.vmess[index].configType == (int)EConfigType.Custom)
|
||||
if (configCopy.vmess[index].configType == (int)EConfigType.Custom)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
config.index = index;
|
||||
configCopy.index = index;
|
||||
|
||||
var inbound = new Inbounds();
|
||||
inbound.listen = Global.Loopback;
|
||||
|
@ -1437,7 +1439,7 @@ namespace v2rayN.Handler
|
|||
|
||||
|
||||
var v2rayConfigCopy = Utils.FromJson<V2rayConfig>(result);
|
||||
outbound(config, ref v2rayConfigCopy);
|
||||
outbound(configCopy, ref v2rayConfigCopy);
|
||||
v2rayConfigCopy.outbounds[0].tag = Global.agentTag + inbound.port.ToString();
|
||||
v2rayConfig.outbounds.Add(v2rayConfigCopy.outbounds[0]);
|
||||
|
||||
|
@ -1450,7 +1452,7 @@ namespace v2rayN.Handler
|
|||
|
||||
Utils.ToJsonFile(v2rayConfig, fileName);
|
||||
|
||||
msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), config.getSummary());
|
||||
msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), configCopy.getSummary());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
@ -33,4 +33,4 @@ using System.Runtime.InteropServices;
|
|||
// 方法是按如下所示使用“*”:
|
||||
//[assembly: AssemblyVersion("1.0.*")]
|
||||
//[assembly: AssemblyVersion("1.0.0")]
|
||||
[assembly: AssemblyFileVersion("3.0")]
|
||||
[assembly: AssemblyFileVersion("3.2")]
|
||||
|
|
|
@ -77,8 +77,17 @@ namespace v2rayN.Tool
|
|||
foreach (ZipArchiveEntry entry in archive.Entries)
|
||||
{
|
||||
if (entry.Length == 0)
|
||||
{
|
||||
continue;
|
||||
entry.ExtractToFile(Utils.GetPath(entry.Name), true);
|
||||
}
|
||||
try
|
||||
{
|
||||
entry.ExtractToFile(Utils.GetPath(entry.Name), true);
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
Utils.SaveLog(ex.Message, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue