Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
732da0c330 | ||
|
|
012bb5654b | ||
|
|
068fe3113b | ||
|
|
4a74102eb7 | ||
|
|
b310cfeda2 | ||
|
|
07cd855446 |
@@ -18,7 +18,7 @@ namespace v2rayN.Forms
|
|||||||
{
|
{
|
||||||
public partial class MainForm : BaseForm
|
public partial class MainForm : BaseForm
|
||||||
{
|
{
|
||||||
private V2rayHandler v2rayHandler;
|
private V2rayHandler v2rayHandler;
|
||||||
private List<int> lvSelecteds = new List<int>();
|
private List<int> lvSelecteds = new List<int>();
|
||||||
private StatisticsHandler statistics = null;
|
private StatisticsHandler statistics = null;
|
||||||
|
|
||||||
@@ -966,9 +966,9 @@ namespace v2rayN.Forms
|
|||||||
}
|
}
|
||||||
private void ClearTestResult()
|
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)
|
private void UpdateSpeedtestHandler(int index, string msg)
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
AbsoluteCompleted(this, new ResultEventArgs(false, "Already the latest version"));
|
AbsoluteCompleted(this, new ResultEventArgs(false, "Already the latest version"));
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
string url = string.Format(nUrl, version);
|
string url = string.Format(nUrl, version);
|
||||||
|
|||||||
@@ -182,6 +182,7 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void RunSpeedTest()
|
private void RunSpeedTest()
|
||||||
{
|
{
|
||||||
if (_config.vmess.Count <= 0)
|
if (_config.vmess.Count <= 0)
|
||||||
@@ -244,7 +245,7 @@ namespace v2rayN.Handler
|
|||||||
|
|
||||||
testCounter++;
|
testCounter++;
|
||||||
var webProxy = new WebProxy(Global.Loopback, httpPort + index);
|
var webProxy = new WebProxy(Global.Loopback, httpPort + index);
|
||||||
downloadHandle2.DownloadFileAsync(_config, url, webProxy, 30);
|
downloadHandle2.DownloadFileAsync(_config, url, webProxy, 20);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1398,6 +1398,8 @@ namespace v2rayN.Handler
|
|||||||
|
|
||||||
msg = UIRes.I18N("InitialConfiguration");
|
msg = UIRes.I18N("InitialConfiguration");
|
||||||
|
|
||||||
|
Config configCopy = Utils.DeepCopy<Config>(config);
|
||||||
|
|
||||||
string result = Utils.GetEmbedText(SampleClient);
|
string result = Utils.GetEmbedText(SampleClient);
|
||||||
if (Utils.IsNullOrEmpty(result))
|
if (Utils.IsNullOrEmpty(result))
|
||||||
{
|
{
|
||||||
@@ -1412,21 +1414,21 @@ namespace v2rayN.Handler
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
log(config, ref v2rayConfig, false);
|
log(configCopy, ref v2rayConfig, false);
|
||||||
//routing(config, ref v2rayConfig);
|
//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++)
|
for (int k = 0; k < selecteds.Count; k++)
|
||||||
{
|
{
|
||||||
int index = selecteds[k];
|
int index = selecteds[k];
|
||||||
if (config.vmess[index].configType == (int)EConfigType.Custom)
|
if (configCopy.vmess[index].configType == (int)EConfigType.Custom)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
config.index = index;
|
configCopy.index = index;
|
||||||
|
|
||||||
var inbound = new Inbounds();
|
var inbound = new Inbounds();
|
||||||
inbound.listen = Global.Loopback;
|
inbound.listen = Global.Loopback;
|
||||||
@@ -1437,7 +1439,7 @@ namespace v2rayN.Handler
|
|||||||
|
|
||||||
|
|
||||||
var v2rayConfigCopy = Utils.FromJson<V2rayConfig>(result);
|
var v2rayConfigCopy = Utils.FromJson<V2rayConfig>(result);
|
||||||
outbound(config, ref v2rayConfigCopy);
|
outbound(configCopy, ref v2rayConfigCopy);
|
||||||
v2rayConfigCopy.outbounds[0].tag = Global.agentTag + inbound.port.ToString();
|
v2rayConfigCopy.outbounds[0].tag = Global.agentTag + inbound.port.ToString();
|
||||||
v2rayConfig.outbounds.Add(v2rayConfigCopy.outbounds[0]);
|
v2rayConfig.outbounds.Add(v2rayConfigCopy.outbounds[0]);
|
||||||
|
|
||||||
@@ -1450,7 +1452,7 @@ namespace v2rayN.Handler
|
|||||||
|
|
||||||
Utils.ToJsonFile(v2rayConfig, fileName);
|
Utils.ToJsonFile(v2rayConfig, fileName);
|
||||||
|
|
||||||
msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), config.getSummary());
|
msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), configCopy.getSummary());
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -70,14 +70,22 @@ namespace v2rayN.HttpProxyHandler
|
|||||||
// copy the array over into that spot in memory ...
|
// copy the array over into that spot in memory ...
|
||||||
for (int i = 0; i < options.Length; ++i)
|
for (int i = 0; i < options.Length; ++i)
|
||||||
{
|
{
|
||||||
IntPtr opt = new IntPtr(optionsPtr.ToInt32() + (i * optSize));
|
if (Environment.Is64BitOperatingSystem)
|
||||||
Marshal.StructureToPtr(options[i], opt, false);
|
{
|
||||||
|
IntPtr opt = new IntPtr(optionsPtr.ToInt64() + (i * optSize));
|
||||||
|
Marshal.StructureToPtr(options[i], opt, false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
IntPtr opt = new IntPtr(optionsPtr.ToInt32() + (i * optSize));
|
||||||
|
Marshal.StructureToPtr(options[i], opt, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
list.options = optionsPtr;
|
list.options = optionsPtr;
|
||||||
|
|
||||||
// and then make a pointer out of the whole list
|
// and then make a pointer out of the whole list
|
||||||
IntPtr ipcoListPtr = Marshal.AllocCoTaskMem((Int32)list.dwSize);
|
IntPtr ipcoListPtr = Marshal.AllocCoTaskMem((int)list.dwSize);
|
||||||
Marshal.StructureToPtr(list, ipcoListPtr, false);
|
Marshal.StructureToPtr(list, ipcoListPtr, false);
|
||||||
|
|
||||||
// and finally, call the API method!
|
// and finally, call the API method!
|
||||||
|
|||||||
Binary file not shown.
@@ -33,4 +33,4 @@ using System.Runtime.InteropServices;
|
|||||||
// 方法是按如下所示使用“*”:
|
// 方法是按如下所示使用“*”:
|
||||||
//[assembly: AssemblyVersion("1.0.*")]
|
//[assembly: AssemblyVersion("1.0.*")]
|
||||||
//[assembly: AssemblyVersion("1.0.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)
|
foreach (ZipArchiveEntry entry in archive.Entries)
|
||||||
{
|
{
|
||||||
if (entry.Length == 0)
|
if (entry.Length == 0)
|
||||||
|
{
|
||||||
continue;
|
continue;
|
||||||
entry.ExtractToFile(Utils.GetPath(entry.Name), true);
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
entry.ExtractToFile(Utils.GetPath(entry.Name), true);
|
||||||
|
}
|
||||||
|
catch (IOException ex)
|
||||||
|
{
|
||||||
|
Utils.SaveLog(ex.Message, ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,9 +62,9 @@ namespace v2rayUpgrade
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
MessageBox.Show("Upgrade Failed(升级失败)");
|
MessageBox.Show("Upgrade Failed(升级失败)." + ex.StackTrace);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user