mirror of
https://github.com/2dust/v2rayN.git
synced 2025-07-01 20:42:10 +00:00
使用==替代string.Equals
This commit is contained in:
parent
ee61363c31
commit
2bd4088d40
7 changed files with 17 additions and 17 deletions
|
@ -20,9 +20,9 @@ public class PacHandler
|
||||||
|
|
||||||
public static void Start(string configPath, int httpPort, int pacPort)
|
public static void Start(string configPath, int httpPort, int pacPort)
|
||||||
{
|
{
|
||||||
if (configPath.Equals(_configPath)
|
if (configPath == _configPath
|
||||||
&& httpPort.Equals(_httpPort)
|
&& httpPort == _httpPort
|
||||||
&& pacPort.Equals(_pacPort)
|
&& pacPort == _pacPort
|
||||||
&& _isRunning)
|
&& _isRunning)
|
||||||
{
|
{
|
||||||
_needRestart = false;
|
_needRestart = false;
|
||||||
|
|
|
@ -613,12 +613,12 @@ namespace v2rayN.Handler
|
||||||
mtu = config.kcpItem.mtu,
|
mtu = config.kcpItem.mtu,
|
||||||
tti = config.kcpItem.tti
|
tti = config.kcpItem.tti
|
||||||
};
|
};
|
||||||
if (iobound.Equals("out"))
|
if (iobound == "out")
|
||||||
{
|
{
|
||||||
kcpSettings.uplinkCapacity = config.kcpItem.uplinkCapacity;
|
kcpSettings.uplinkCapacity = config.kcpItem.uplinkCapacity;
|
||||||
kcpSettings.downlinkCapacity = config.kcpItem.downlinkCapacity;
|
kcpSettings.downlinkCapacity = config.kcpItem.downlinkCapacity;
|
||||||
}
|
}
|
||||||
else if (iobound.Equals("in"))
|
else if (iobound == "in")
|
||||||
{
|
{
|
||||||
kcpSettings.uplinkCapacity = config.kcpItem.downlinkCapacity; ;
|
kcpSettings.uplinkCapacity = config.kcpItem.downlinkCapacity; ;
|
||||||
kcpSettings.downlinkCapacity = config.kcpItem.downlinkCapacity;
|
kcpSettings.downlinkCapacity = config.kcpItem.downlinkCapacity;
|
||||||
|
@ -724,7 +724,7 @@ namespace v2rayN.Handler
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
//tcp
|
//tcp
|
||||||
if (node.headerType.Equals(Global.TcpHeaderHttp))
|
if (node.headerType == Global.TcpHeaderHttp)
|
||||||
{
|
{
|
||||||
TcpSettings tcpSettings = new()
|
TcpSettings tcpSettings = new()
|
||||||
{
|
{
|
||||||
|
@ -734,7 +734,7 @@ namespace v2rayN.Handler
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (iobound.Equals("out"))
|
if (iobound == "out")
|
||||||
{
|
{
|
||||||
//request Host
|
//request Host
|
||||||
string request = Utils.GetEmbedText(Global.v2raySampleHttprequestFileName);
|
string request = Utils.GetEmbedText(Global.v2raySampleHttprequestFileName);
|
||||||
|
@ -753,7 +753,7 @@ namespace v2rayN.Handler
|
||||||
request = request.Replace("$requestPath$", $"\"{pathHttp}\"");
|
request = request.Replace("$requestPath$", $"\"{pathHttp}\"");
|
||||||
tcpSettings.header.request = Utils.FromJson<object>(request);
|
tcpSettings.header.request = Utils.FromJson<object>(request);
|
||||||
}
|
}
|
||||||
else if (iobound.Equals("in"))
|
else if (iobound == "in")
|
||||||
{
|
{
|
||||||
//string response = Utils.GetEmbedText(Global.v2raySampleHttpresponseFileName);
|
//string response = Utils.GetEmbedText(Global.v2raySampleHttpresponseFileName);
|
||||||
//tcpSettings.header.response = Utils.FromJson<object>(response);
|
//tcpSettings.header.response = Utils.FromJson<object>(response);
|
||||||
|
@ -1184,7 +1184,7 @@ namespace v2rayN.Handler
|
||||||
&& outbound.streamSettings.tcpSettings.header != null
|
&& outbound.streamSettings.tcpSettings.header != null
|
||||||
&& !Utils.IsNullOrEmpty(outbound.streamSettings.tcpSettings.header.type))
|
&& !Utils.IsNullOrEmpty(outbound.streamSettings.tcpSettings.header.type))
|
||||||
{
|
{
|
||||||
if (outbound.streamSettings.tcpSettings.header.type.Equals(Global.TcpHeaderHttp))
|
if (outbound.streamSettings.tcpSettings.header.type == Global.TcpHeaderHttp)
|
||||||
{
|
{
|
||||||
profileItem.headerType = outbound.streamSettings.tcpSettings.header.type;
|
profileItem.headerType = outbound.streamSettings.tcpSettings.header.type;
|
||||||
string request = Convert.ToString(outbound.streamSettings.tcpSettings.header.request);
|
string request = Convert.ToString(outbound.streamSettings.tcpSettings.header.request);
|
||||||
|
@ -1322,7 +1322,7 @@ namespace v2rayN.Handler
|
||||||
&& inbound.streamSettings.tcpSettings.header != null
|
&& inbound.streamSettings.tcpSettings.header != null
|
||||||
&& !Utils.IsNullOrEmpty(inbound.streamSettings.tcpSettings.header.type))
|
&& !Utils.IsNullOrEmpty(inbound.streamSettings.tcpSettings.header.type))
|
||||||
{
|
{
|
||||||
if (inbound.streamSettings.tcpSettings.header.type.Equals(Global.TcpHeaderHttp))
|
if (inbound.streamSettings.tcpSettings.header.type == Global.TcpHeaderHttp)
|
||||||
{
|
{
|
||||||
profileItem.headerType = inbound.streamSettings.tcpSettings.header.type;
|
profileItem.headerType = inbound.streamSettings.tcpSettings.header.type;
|
||||||
string request = Convert.ToString(inbound.streamSettings.tcpSettings.header.request);
|
string request = Convert.ToString(inbound.streamSettings.tcpSettings.header.request);
|
||||||
|
|
|
@ -45,7 +45,7 @@ namespace v2rayN.Base
|
||||||
{
|
{
|
||||||
var socksPort = LazyConfig.Instance.GetLocalPort(Global.InboundSocks);
|
var socksPort = LazyConfig.Instance.GetLocalPort(Global.InboundSocks);
|
||||||
|
|
||||||
if (socksPort.Equals(_socksPort)
|
if (socksPort == _socksPort
|
||||||
&& _process != null
|
&& _process != null
|
||||||
&& !_process.HasExited)
|
&& !_process.HasExited)
|
||||||
{
|
{
|
||||||
|
|
|
@ -489,7 +489,7 @@ namespace v2rayN
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (text.Equals("null"))
|
if (text == "null")
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -636,7 +636,7 @@ namespace v2rayN
|
||||||
|
|
||||||
string value = RegReadValue(Global.AutoRunRegPath, Global.AutoRunName, "");
|
string value = RegReadValue(Global.AutoRunRegPath, Global.AutoRunName, "");
|
||||||
string exePath = GetExePath();
|
string exePath = GetExePath();
|
||||||
if (value?.Equals(exePath) == true || value?.Equals($"\"{exePath}\"") == true)
|
if (value == exePath || value == $"\"{exePath}\"")
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -788,7 +788,7 @@ namespace v2rayN.ViewModels
|
||||||
|
|
||||||
var item = new ComboItem() { ID = it.indexId, Text = name };
|
var item = new ComboItem() { ID = it.indexId, Text = name };
|
||||||
_servers.Add(item);
|
_servers.Add(item);
|
||||||
if (_config.indexId.Equals(it.indexId))
|
if (_config.indexId == it.indexId)
|
||||||
{
|
{
|
||||||
SelectedServer = item;
|
SelectedServer = item;
|
||||||
}
|
}
|
||||||
|
@ -1456,7 +1456,7 @@ namespace v2rayN.ViewModels
|
||||||
foreach (var item in routings)
|
foreach (var item in routings)
|
||||||
{
|
{
|
||||||
_routingItems.Add(item);
|
_routingItems.Add(item);
|
||||||
if (item.id.Equals(_config.routingBasicItem.routingIndexId))
|
if (item.id == _config.routingBasicItem.routingIndexId)
|
||||||
{
|
{
|
||||||
SelectedRouting = item;
|
SelectedRouting = item;
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,7 +163,7 @@ namespace v2rayN.ViewModels
|
||||||
foreach (var item in routings)
|
foreach (var item in routings)
|
||||||
{
|
{
|
||||||
bool def = false;
|
bool def = false;
|
||||||
if (item.id.Equals(_config.routingBasicItem.routingIndexId))
|
if (item.id == _config.routingBasicItem.routingIndexId)
|
||||||
{
|
{
|
||||||
def = true;
|
def = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,7 @@ namespace v2rayN.Views
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var files = Directory.GetFiles(Utils.GetFontsPath(), "*.ttf");
|
var files = Directory.GetFiles(Utils.GetFontsPath(), "*.ttf");
|
||||||
var culture = _config.uiItem.currentLanguage.Equals(Global.Languages[0]) ? "zh-cn" : "en-us";
|
var culture = _config.uiItem.currentLanguage == Global.Languages[0] ? "zh-cn" : "en-us";
|
||||||
var culture2 = "en-us";
|
var culture2 = "en-us";
|
||||||
foreach (var ttf in files)
|
foreach (var ttf in files)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue