Merge pull request #2 from 2dust/master

20200116更新同步
This commit is contained in:
mengzhisuoliu 2020-01-16 18:53:26 +08:00 committed by GitHub
commit 1c3fe5b5de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 49 additions and 13 deletions

View file

@ -354,6 +354,7 @@ namespace v2rayN.Handler
//Mux
outbound.mux.enabled = config.muxEnabled;
outbound.mux.concurrency = config.muxEnabled ? 8 : -1;
//远程服务器底层传输配置
StreamSettings streamSettings = outbound.streamSettings;
@ -384,6 +385,8 @@ namespace v2rayN.Handler
serversItem.level = 1;
outbound.mux.enabled = false;
outbound.mux.concurrency = -1;
outbound.protocol = "shadowsocks";
outbound.settings.vnext = null;
@ -418,6 +421,7 @@ namespace v2rayN.Handler
}
outbound.mux.enabled = false;
outbound.mux.concurrency = -1;
outbound.protocol = "socks";
outbound.settings.vnext = null;

Binary file not shown.

View file

@ -281,6 +281,11 @@ namespace v2rayN.Mode
///
/// </summary>
public bool enabled { get; set; }
/// <summary>
///
/// </summary>
public int concurrency { get; set; }
}
public class Response

View file

@ -28,20 +28,20 @@ namespace v2rayN
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
//AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
Process instance = RunningInstance();
if (instance == null)
{
{
if (!UnzipLibs())
{
UI.Show($"Error preparing the environment(准备运行环境出错)");
return;
}
Utils.SaveLog("v2rayN start up");
Utils.SaveLog("v2rayN start up " + Utils.GetVersion());
//设置语言环境
string lang = Utils.RegReadValue(Global.MyRegPath, Global.MyRegKeyLanguage, "zh-Hans");
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(lang);

View file

@ -33,4 +33,4 @@ using System.Runtime.InteropServices;
// 方法是按如下所示使用“*”:
//[assembly: AssemblyVersion("1.0.*")]
//[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyFileVersion("3.4")]
[assembly: AssemblyFileVersion("3.5")]

View file

@ -1,14 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace v2rayUpgrade
@ -16,6 +9,7 @@ namespace v2rayUpgrade
public partial class MainForm : Form
{
private string[] _args;
private string _tempFileName = "v2rayUpgradeTemp.zip";
public MainForm(string[] args)
@ -35,9 +29,37 @@ namespace v2rayUpgrade
{
return;
}
try
{
var fileName = _args[0];
Process[] existing = Process.GetProcessesByName("v2rayN");
foreach (Process p in existing)
{
var path = p.MainModule.FileName;
if (path == GetPath("v2rayN.exe"))
{
p.Kill();
p.WaitForExit(100);
}
}
}
catch (Exception ex)
{
MessageBox.Show("Failed to close v2rayN(关闭v2rayN失败)." + ex.StackTrace);
return;
}
var fileName = GetPath(_tempFileName);
try
{
File.Delete(fileName);
File.Copy(_args[0], fileName);
if (!File.Exists(fileName))
{
MessageBox.Show("Upgrade Failed, File Not Exist(升级失败,文件不存在).");
return;
}
var startKey = "v2rayN/";
using (ZipArchive archive = ZipFile.OpenRead(fileName))
@ -67,6 +89,10 @@ namespace v2rayUpgrade
MessageBox.Show("Upgrade Failed(升级失败)." + ex.StackTrace);
return;
}
finally
{
File.Delete(fileName);
}
MessageBox.Show("Upgrade successed(升级成功)");

View file

@ -23,6 +23,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>