Merge branch '2dust:master' into master

This commit is contained in:
Lemonawa 2022-07-26 20:34:41 +08:00 committed by GitHub
commit 7cb67aa49c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 37 additions and 6 deletions

View file

@ -1,4 +1,5 @@
using System; using System;
using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
@ -18,11 +19,15 @@ namespace v2rayN.Forms
private void AddServer2Form_Load(object sender, EventArgs e) private void AddServer2Form_Load(object sender, EventArgs e)
{ {
cmbCoreType.Items.AddRange(Global.coreTypes.ToArray()); List<string> coreTypes = new List<string> ();
cmbCoreType.Items.Add("clash"); foreach (ECoreType it in Enum.GetValues(typeof(ECoreType)))
cmbCoreType.Items.Add("clash_meta"); {
cmbCoreType.Items.Add("hysteria"); if (it == ECoreType.v2rayN)
cmbCoreType.Items.Add("naiveproxy"); continue;
coreTypes.Add(it.ToString());
}
cmbCoreType.Items.AddRange(coreTypes.ToArray());
cmbCoreType.Items.Add(string.Empty); cmbCoreType.Items.Add(string.Empty);
txtAddress.ReadOnly = true; txtAddress.ReadOnly = true;

View file

@ -932,7 +932,23 @@ namespace v2rayN.Forms
} }
if (ConfigHandler.SetDefaultServer(ref config, lstVmess[index]) == 0) if (ConfigHandler.SetDefaultServer(ref config, lstVmess[index]) == 0)
{ {
RefreshServers(); //RefreshServers();
for (int k = 0; k < lstVmess.Count; k++)
{
if (config.IsActiveNode(lstVmess[k]))
{
lvServers.Items[k].SubItems[0].Text = "√";
lvServers.Items[k].ForeColor = Color.DodgerBlue;
lvServers.Items[k].Font = new Font(lvServers.Font, FontStyle.Bold);
}
else
{
lvServers.Items[k].SubItems[0].Text = "";
lvServers.Items[k].ForeColor = lvServers.ForeColor;
lvServers.Items[k].Font = new Font(lvServers.Font, FontStyle.Regular);
}
}
RefreshServersMenu();
_ = LoadV2ray(); _ = LoadV2ray();
} }
return 0; return 0;

View file

@ -18,6 +18,7 @@ namespace v2rayN
public const string clashMetaCoreUrl = "https://github.com/MetaCubeX/Clash.Meta/releases"; public const string clashMetaCoreUrl = "https://github.com/MetaCubeX/Clash.Meta/releases";
public const string hysteriaCoreUrl = "https://github.com/HyNetwork/hysteria/releases"; public const string hysteriaCoreUrl = "https://github.com/HyNetwork/hysteria/releases";
public const string naiveproxyCoreUrl = "https://github.com/klzgrad/naiveproxy/releases"; public const string naiveproxyCoreUrl = "https://github.com/klzgrad/naiveproxy/releases";
public const string tuicCoreUrl = "https://github.com/EAimTY/tuic/releases";
public const string geoUrl = "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/{0}.dat"; public const string geoUrl = "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/{0}.dat";

View file

@ -138,6 +138,14 @@ namespace v2rayN.Handler
arguments = "config.json", arguments = "config.json",
coreUrl = Global.naiveproxyCoreUrl coreUrl = Global.naiveproxyCoreUrl
}); });
coreInfos.Add(new CoreInfo
{
coreType = ECoreType.tuic,
coreExes = new List<string> { "tuic-client", "tuic" },
arguments = "-c config.json",
coreUrl = Global.tuicCoreUrl
});
} }
} }

View file

@ -9,6 +9,7 @@ namespace v2rayN.Mode
clash_meta = 12, clash_meta = 12,
hysteria = 21, hysteria = 21,
naiveproxy = 22, naiveproxy = 22,
tuic = 23,
v2rayN = 99 v2rayN = 99
} }
} }