Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f0a77bde2 | ||
|
|
0463c1a6e7 |
@@ -66,12 +66,7 @@ namespace v2rayN.Forms
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (config.groupItem.Count <= 0)
|
||||
{
|
||||
AddGroup();
|
||||
}
|
||||
|
||||
{
|
||||
if (ConfigHandler.SaveGroupItem(ref config) == 0)
|
||||
{
|
||||
this.DialogResult = DialogResult.OK;
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace v2rayN.Forms
|
||||
RefreshRoutingsMenu();
|
||||
RestoreUI();
|
||||
|
||||
LoadV2ray();
|
||||
_ = LoadV2ray();
|
||||
|
||||
HideForm();
|
||||
|
||||
@@ -602,7 +602,7 @@ namespace v2rayN.Forms
|
||||
if (fm.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
RefreshServers();
|
||||
LoadV2ray();
|
||||
_ = LoadV2ray();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -691,7 +691,7 @@ namespace v2rayN.Forms
|
||||
ConfigHandler.RemoveServer(config, lvSelecteds);
|
||||
|
||||
RefreshServers();
|
||||
LoadV2ray();
|
||||
_ = LoadV2ray();
|
||||
}
|
||||
|
||||
private void menuRemoveDuplicateServer_Click(object sender, EventArgs e)
|
||||
@@ -700,7 +700,7 @@ namespace v2rayN.Forms
|
||||
ConfigHandler.DedupServerList(ref config, ref lstVmess);
|
||||
int newCount = lstVmess.Count;
|
||||
RefreshServers();
|
||||
LoadV2ray();
|
||||
_ = LoadV2ray();
|
||||
UI.Show(string.Format(UIRes.I18N("RemoveDuplicateServerResult"), oldCount, newCount));
|
||||
}
|
||||
|
||||
@@ -847,7 +847,7 @@ namespace v2rayN.Forms
|
||||
if (fm.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
RefreshServers();
|
||||
LoadV2ray();
|
||||
_ = LoadV2ray();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -858,7 +858,7 @@ namespace v2rayN.Forms
|
||||
{
|
||||
RefreshRoutingsMenu();
|
||||
RefreshServers();
|
||||
LoadV2ray();
|
||||
_ = LoadV2ray();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -869,7 +869,7 @@ namespace v2rayN.Forms
|
||||
{
|
||||
RefreshRoutingsMenu();
|
||||
RefreshServers();
|
||||
LoadV2ray();
|
||||
_ = LoadV2ray();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -888,7 +888,7 @@ namespace v2rayN.Forms
|
||||
private void tsbReload_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.reloadV2ray = true;
|
||||
LoadV2ray();
|
||||
_ = LoadV2ray();
|
||||
}
|
||||
|
||||
private void tsbClose_Click(object sender, EventArgs e)
|
||||
@@ -913,7 +913,7 @@ namespace v2rayN.Forms
|
||||
if (ConfigHandler.SetDefaultServer(ref config, lstVmess[index]) == 0)
|
||||
{
|
||||
RefreshServers();
|
||||
LoadV2ray();
|
||||
_ = LoadV2ray();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -1267,7 +1267,7 @@ namespace v2rayN.Forms
|
||||
if (success)
|
||||
{
|
||||
Global.reloadV2ray = true;
|
||||
LoadV2ray();
|
||||
_ = LoadV2ray();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -1396,7 +1396,7 @@ namespace v2rayN.Forms
|
||||
AppendText(false, UIRes.I18N("MsgUpdateV2rayCoreSuccessfullyMore"));
|
||||
|
||||
Global.reloadV2ray = true;
|
||||
LoadV2ray();
|
||||
_ = LoadV2ray();
|
||||
|
||||
AppendText(false, UIRes.I18N("MsgUpdateV2rayCoreSuccessfully"));
|
||||
}
|
||||
@@ -1412,7 +1412,7 @@ namespace v2rayN.Forms
|
||||
if (success)
|
||||
{
|
||||
Global.reloadV2ray = true;
|
||||
LoadV2ray();
|
||||
_ = LoadV2ray();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1425,7 +1425,7 @@ namespace v2rayN.Forms
|
||||
if (success)
|
||||
{
|
||||
Global.reloadV2ray = true;
|
||||
LoadV2ray();
|
||||
_ = LoadV2ray();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1576,7 +1576,7 @@ namespace v2rayN.Forms
|
||||
if (ConfigHandler.SetDefaultRouting(ref config, index) == 0)
|
||||
{
|
||||
RefreshRoutingsMenu();
|
||||
LoadV2ray();
|
||||
_ = LoadV2ray();
|
||||
}
|
||||
}
|
||||
catch
|
||||
|
||||
@@ -68,11 +68,6 @@ namespace v2rayN.Forms
|
||||
|
||||
private void btnOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (config.subItem.Count <= 0)
|
||||
{
|
||||
AddSub();
|
||||
}
|
||||
|
||||
if (ConfigHandler.SaveSubItem(ref config) == 0)
|
||||
{
|
||||
this.DialogResult = DialogResult.OK;
|
||||
|
||||
@@ -764,7 +764,7 @@ namespace v2rayN.Handler
|
||||
/// <returns></returns>
|
||||
public static int SaveSubItem(ref Config config)
|
||||
{
|
||||
if (config.subItem == null || config.subItem.Count <= 0)
|
||||
if (config.subItem == null)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
@@ -926,7 +926,7 @@ namespace v2rayN.Handler
|
||||
}
|
||||
if (!config.vmess.Exists(it => it.indexId == vmessItem.indexId))
|
||||
{
|
||||
var maxSort = config.vmess.Max(t => t.sort);
|
||||
var maxSort = config.vmess.Any() ? config.vmess.Max(t => t.sort) : 0;
|
||||
vmessItem.sort = maxSort++;
|
||||
|
||||
config.vmess.Add(vmessItem);
|
||||
@@ -970,7 +970,7 @@ namespace v2rayN.Handler
|
||||
/// <returns></returns>
|
||||
public static int SaveGroupItem(ref Config config)
|
||||
{
|
||||
if (config.groupItem == null || config.groupItem.Count <= 0)
|
||||
if (config.groupItem == null)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
@@ -989,12 +989,13 @@ namespace v2rayN.Handler
|
||||
|
||||
public static int RemoveGroupItem(ref Config config, string groupId)
|
||||
{
|
||||
if (Utils.IsNullOrEmpty(groupId) || config.vmess.Count <= 0)
|
||||
if (Utils.IsNullOrEmpty(groupId))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
foreach (var item in config.vmess)
|
||||
var items = config.vmess.Where(t => t.groupId == groupId).ToList();
|
||||
foreach (var item in items)
|
||||
{
|
||||
if (item.groupId.Equals(groupId))
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using v2rayN.Base;
|
||||
using v2rayN.Mode;
|
||||
|
||||
namespace v2rayN.Handler
|
||||
@@ -177,10 +178,10 @@ namespace v2rayN.Handler
|
||||
|
||||
for (int k = 1; k <= config.subItem.Count; k++)
|
||||
{
|
||||
string id = config.subItem[k - 1].id.Trim();
|
||||
string url = config.subItem[k - 1].url.Trim();
|
||||
string userAgent = config.subItem[k - 1].userAgent.Trim();
|
||||
string groupId = config.subItem[k - 1].groupId.Trim();
|
||||
string id = config.subItem[k - 1].id.TrimEx();
|
||||
string url = config.subItem[k - 1].url.TrimEx();
|
||||
string userAgent = config.subItem[k - 1].userAgent.TrimEx();
|
||||
string groupId = config.subItem[k - 1].groupId.TrimEx();
|
||||
string hashCode = $"{k}->";
|
||||
if (config.subItem[k - 1].enabled == false)
|
||||
{
|
||||
|
||||
@@ -569,7 +569,7 @@ namespace v2rayN.Mode
|
||||
public string groupId
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
} = string.Empty;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
@@ -703,7 +703,7 @@ namespace v2rayN.Mode
|
||||
public string groupId
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
} = string.Empty;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
|
||||
@@ -32,4 +32,4 @@ using System.Runtime.InteropServices;
|
||||
// 方法是按如下所示使用“*”:
|
||||
//[assembly: AssemblyVersion("1.0.*")]
|
||||
//[assembly: AssemblyVersion("1.0.0")]
|
||||
[assembly: AssemblyFileVersion("5.0")]
|
||||
[assembly: AssemblyFileVersion("5.1")]
|
||||
|
||||
Reference in New Issue
Block a user