Skip to content

Commit cc42861

Browse files
committed
Adjusting the text display
1 parent 4d330ce commit cc42861

21 files changed

+93
-93
lines changed

v2rayN/ServiceLib/Enums/EConfigType.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ public enum EConfigType
55
VMess = 1,
66
Custom = 2,
77
Shadowsocks = 3,
8-
Socks = 4,
8+
SOCKS = 4,
99
VLESS = 5,
1010
Trojan = 6,
1111
Hysteria2 = 7,
12-
Tuic = 8,
13-
Wireguard = 9,
14-
Http = 10
12+
TUIC = 8,
13+
WireGuard = 9,
14+
HTTP = 10
1515
}
1616
}

v2rayN/ServiceLib/Global.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,25 +137,25 @@ public class Global
137137
{
138138
{EConfigType.VMess,"vmess://"},
139139
{EConfigType.Shadowsocks,"ss://"},
140-
{EConfigType.Socks,"socks://"},
140+
{EConfigType.SOCKS,"socks://"},
141141
{EConfigType.VLESS,"vless://"},
142142
{EConfigType.Trojan,"trojan://"},
143143
{EConfigType.Hysteria2,"hysteria2://"},
144-
{EConfigType.Tuic,"tuic://"},
145-
{EConfigType.Wireguard,"wireguard://"}
144+
{EConfigType.TUIC,"tuic://"},
145+
{EConfigType.WireGuard,"wireguard://"}
146146
};
147147

148148
public static readonly Dictionary<EConfigType, string> ProtocolTypes = new()
149149
{
150150
{EConfigType.VMess,"vmess"},
151151
{EConfigType.Shadowsocks,"shadowsocks"},
152-
{EConfigType.Socks,"socks"},
153-
{EConfigType.Http,"http"},
152+
{EConfigType.SOCKS,"socks"},
153+
{EConfigType.HTTP,"http"},
154154
{EConfigType.VLESS,"vless"},
155155
{EConfigType.Trojan,"trojan"},
156156
{EConfigType.Hysteria2,"hysteria2"},
157-
{EConfigType.Tuic,"tuic"},
158-
{EConfigType.Wireguard,"wireguard"}
157+
{EConfigType.TUIC,"tuic"},
158+
{EConfigType.WireGuard,"wireguard"}
159159
};
160160

161161
public static readonly List<string> VmessSecurities = new() { "aes-128-gcm", "chacha20-poly1305", "auto", "none", "zero" };

v2rayN/ServiceLib/Handler/ConfigHandler.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -401,13 +401,13 @@ public static int AddServer(Config config, ProfileItem profileItem)
401401
{
402402
EConfigType.VMess => AddVMessServer(config, item),
403403
EConfigType.Shadowsocks => AddShadowsocksServer(config, item),
404-
EConfigType.Socks => AddSocksServer(config, item),
405-
EConfigType.Http => AddHttpServer(config, item),
404+
EConfigType.SOCKS => AddSocksServer(config, item),
405+
EConfigType.HTTP => AddHttpServer(config, item),
406406
EConfigType.Trojan => AddTrojanServer(config, item),
407407
EConfigType.VLESS => AddVlessServer(config, item),
408408
EConfigType.Hysteria2 => AddHysteria2Server(config, item),
409-
EConfigType.Tuic => AddTuicServer(config, item),
410-
EConfigType.Wireguard => AddWireguardServer(config, item),
409+
EConfigType.TUIC => AddTuicServer(config, item),
410+
EConfigType.WireGuard => AddWireguardServer(config, item),
411411
_ => -1,
412412
};
413413
return ret;
@@ -739,7 +739,7 @@ public static int AddShadowsocksServer(Config config, ProfileItem profileItem, b
739739
/// <returns></returns>
740740
public static int AddSocksServer(Config config, ProfileItem profileItem, bool toFile = true)
741741
{
742-
profileItem.configType = EConfigType.Socks;
742+
profileItem.configType = EConfigType.SOCKS;
743743

744744
profileItem.address = profileItem.address.TrimEx();
745745

@@ -756,7 +756,7 @@ public static int AddSocksServer(Config config, ProfileItem profileItem, bool to
756756
/// <returns></returns>
757757
public static int AddHttpServer(Config config, ProfileItem profileItem, bool toFile = true)
758758
{
759-
profileItem.configType = EConfigType.Http;
759+
profileItem.configType = EConfigType.HTTP;
760760

761761
profileItem.address = profileItem.address.TrimEx();
762762

@@ -829,7 +829,7 @@ public static int AddHysteria2Server(Config config, ProfileItem profileItem, boo
829829
/// <returns></returns>
830830
public static int AddTuicServer(Config config, ProfileItem profileItem, bool toFile = true)
831831
{
832-
profileItem.configType = EConfigType.Tuic;
832+
profileItem.configType = EConfigType.TUIC;
833833
profileItem.coreType = ECoreType.sing_box;
834834

835835
profileItem.address = profileItem.address.TrimEx();
@@ -868,7 +868,7 @@ public static int AddTuicServer(Config config, ProfileItem profileItem, bool toF
868868
/// <returns></returns>
869869
public static int AddWireguardServer(Config config, ProfileItem profileItem, bool toFile = true)
870870
{
871-
profileItem.configType = EConfigType.Wireguard;
871+
profileItem.configType = EConfigType.WireGuard;
872872
profileItem.coreType = ECoreType.sing_box;
873873

874874
profileItem.address = profileItem.address.TrimEx();
@@ -1263,12 +1263,12 @@ private static int AddBatchServers(Config config, string strData, string subid,
12631263
{
12641264
EConfigType.VMess => AddVMessServer(config, profileItem, false),
12651265
EConfigType.Shadowsocks => AddShadowsocksServer(config, profileItem, false),
1266-
EConfigType.Socks => AddSocksServer(config, profileItem, false),
1266+
EConfigType.SOCKS => AddSocksServer(config, profileItem, false),
12671267
EConfigType.Trojan => AddTrojanServer(config, profileItem, false),
12681268
EConfigType.VLESS => AddVlessServer(config, profileItem, false),
12691269
EConfigType.Hysteria2 => AddHysteria2Server(config, profileItem, false),
1270-
EConfigType.Tuic => AddTuicServer(config, profileItem, false),
1271-
EConfigType.Wireguard => AddWireguardServer(config, profileItem, false),
1270+
EConfigType.TUIC => AddTuicServer(config, profileItem, false),
1271+
EConfigType.WireGuard => AddWireguardServer(config, profileItem, false),
12721272
_ => -1,
12731273
};
12741274

v2rayN/ServiceLib/Handler/CoreConfig/CoreConfigSingbox.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ private int GenOutbound(ProfileItem node, Outbound4Sbox outbound)
606606
GenOutboundMux(node, outbound);
607607
break;
608608
}
609-
case EConfigType.Socks:
609+
case EConfigType.SOCKS:
610610
{
611611
outbound.version = "5";
612612
if (Utils.IsNotEmpty(node.security)
@@ -617,7 +617,7 @@ private int GenOutbound(ProfileItem node, Outbound4Sbox outbound)
617617
}
618618
break;
619619
}
620-
case EConfigType.Http:
620+
case EConfigType.HTTP:
621621
{
622622
if (Utils.IsNotEmpty(node.security)
623623
&& Utils.IsNotEmpty(node.id))
@@ -667,14 +667,14 @@ private int GenOutbound(ProfileItem node, Outbound4Sbox outbound)
667667
outbound.down_mbps = _config.hysteriaItem.down_mbps > 0 ? _config.hysteriaItem.down_mbps : null;
668668
break;
669669
}
670-
case EConfigType.Tuic:
670+
case EConfigType.TUIC:
671671
{
672672
outbound.uuid = node.id;
673673
outbound.password = node.security;
674674
outbound.congestion_control = node.headerType;
675675
break;
676676
}
677-
case EConfigType.Wireguard:
677+
case EConfigType.WireGuard:
678678
{
679679
outbound.private_key = node.id;
680680
outbound.peer_public_key = node.publicKey;
@@ -1240,7 +1240,7 @@ private int GenDnsDomains(ProfileItem? node, SingboxConfig singboxConfig, DNSIte
12401240
}
12411241

12421242
//Tun2SocksAddress
1243-
if (_config.tunModeItem.enableTun && node?.configType == EConfigType.Socks && Utils.IsDomain(node?.sni))
1243+
if (_config.tunModeItem.enableTun && node?.configType == EConfigType.SOCKS && Utils.IsDomain(node?.sni))
12441244
{
12451245
dns4Sbox.rules.Insert(0, new()
12461246
{

v2rayN/ServiceLib/Handler/CoreConfig/CoreConfigV2ray.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public int GenerateClientMultipleLoadConfig(List<ProfileItem> selecteds, out V2r
110110
{
111111
continue;
112112
}
113-
if (it.configType is EConfigType.Hysteria2 or EConfigType.Tuic or EConfigType.Wireguard)
113+
if (it.configType is EConfigType.Hysteria2 or EConfigType.TUIC or EConfigType.WireGuard)
114114
{
115115
continue;
116116
}
@@ -647,8 +647,8 @@ private int GenOutbound(ProfileItem node, Outbounds4Ray outbound)
647647
outbound.settings.vnext = null;
648648
break;
649649
}
650-
case EConfigType.Socks:
651-
case EConfigType.Http:
650+
case EConfigType.SOCKS:
651+
case EConfigType.HTTP:
652652
{
653653
ServersItem4Ray serversItem;
654654
if (outbound.settings.servers.Count <= 0)
@@ -1208,8 +1208,8 @@ private int GenMoreOutbounds(ProfileItem node, V2rayConfig v2rayConfig)
12081208
if (prevNode is not null
12091209
&& prevNode.configType != EConfigType.Custom
12101210
&& prevNode.configType != EConfigType.Hysteria2
1211-
&& prevNode.configType != EConfigType.Tuic
1212-
&& prevNode.configType != EConfigType.Wireguard)
1211+
&& prevNode.configType != EConfigType.TUIC
1212+
&& prevNode.configType != EConfigType.WireGuard)
12131213
{
12141214
var prevOutbound = JsonUtils.Deserialize<Outbounds4Ray>(txtOutbound);
12151215
GenOutbound(prevNode, prevOutbound);
@@ -1227,8 +1227,8 @@ private int GenMoreOutbounds(ProfileItem node, V2rayConfig v2rayConfig)
12271227
if (nextNode is not null
12281228
&& nextNode.configType != EConfigType.Custom
12291229
&& nextNode.configType != EConfigType.Hysteria2
1230-
&& nextNode.configType != EConfigType.Tuic
1231-
&& nextNode.configType != EConfigType.Wireguard)
1230+
&& nextNode.configType != EConfigType.TUIC
1231+
&& nextNode.configType != EConfigType.WireGuard)
12321232
{
12331233
var nextOutbound = JsonUtils.Deserialize<Outbounds4Ray>(txtOutbound);
12341234
GenOutbound(nextNode, nextOutbound);

v2rayN/ServiceLib/Handler/CoreHandler.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void LoadCore(ProfileItem? node)
6666
public int LoadCoreConfigSpeedtest(List<ServerTestItem> selecteds)
6767
{
6868
int pid = -1;
69-
var coreType = selecteds.Exists(t => t.configType == EConfigType.Hysteria2 || t.configType == EConfigType.Tuic || t.configType == EConfigType.Wireguard) ? ECoreType.sing_box : ECoreType.Xray;
69+
var coreType = selecteds.Exists(t => t.configType == EConfigType.Hysteria2 || t.configType == EConfigType.TUIC || t.configType == EConfigType.WireGuard) ? ECoreType.sing_box : ECoreType.Xray;
7070
string configPath = Utils.GetConfigPath(Global.CoreSpeedtestConfigFileName);
7171
if (CoreConfigHandler.GenerateClientSpeedtestConfig(_config, configPath, selecteds, coreType, out string msg) != 0)
7272
{
@@ -204,7 +204,7 @@ private void CoreStart(ProfileItem node)
204204
itemSocks = new ProfileItem()
205205
{
206206
coreType = preCoreType,
207-
configType = EConfigType.Socks,
207+
configType = EConfigType.SOCKS,
208208
address = Global.Loopback,
209209
sni = node.address, //Tun2SocksAddress
210210
port = LazyConfig.Instance.GetLocalPort(EInboundProtocol.socks)
@@ -216,7 +216,7 @@ private void CoreStart(ProfileItem node)
216216
itemSocks = new ProfileItem()
217217
{
218218
coreType = preCoreType,
219-
configType = EConfigType.Socks,
219+
configType = EConfigType.SOCKS,
220220
address = Global.Loopback,
221221
port = node.preSocksPort.Value,
222222
};

v2rayN/ServiceLib/Handler/Fmt/FmtHandler.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ public class FmtHandler
1010
{
1111
EConfigType.VMess => VmessFmt.ToUri(item),
1212
EConfigType.Shadowsocks => ShadowsocksFmt.ToUri(item),
13-
EConfigType.Socks => SocksFmt.ToUri(item),
13+
EConfigType.SOCKS => SocksFmt.ToUri(item),
1414
EConfigType.Trojan => TrojanFmt.ToUri(item),
1515
EConfigType.VLESS => VLESSFmt.ToUri(item),
1616
EConfigType.Hysteria2 => Hysteria2Fmt.ToUri(item),
17-
EConfigType.Tuic => TuicFmt.ToUri(item),
18-
EConfigType.Wireguard => WireguardFmt.ToUri(item),
17+
EConfigType.TUIC => TuicFmt.ToUri(item),
18+
EConfigType.WireGuard => WireguardFmt.ToUri(item),
1919
_ => null,
2020
};
2121

@@ -49,7 +49,7 @@ public class FmtHandler
4949
{
5050
return ShadowsocksFmt.Resolve(str, out msg);
5151
}
52-
else if (str.StartsWith(Global.ProtocolShares[EConfigType.Socks]))
52+
else if (str.StartsWith(Global.ProtocolShares[EConfigType.SOCKS]))
5353
{
5454
return SocksFmt.Resolve(str, out msg);
5555
}
@@ -65,11 +65,11 @@ public class FmtHandler
6565
{
6666
return Hysteria2Fmt.Resolve(str, out msg);
6767
}
68-
else if (str.StartsWith(Global.ProtocolShares[EConfigType.Tuic]))
68+
else if (str.StartsWith(Global.ProtocolShares[EConfigType.TUIC]))
6969
{
7070
return TuicFmt.Resolve(str, out msg);
7171
}
72-
else if (str.StartsWith(Global.ProtocolShares[EConfigType.Wireguard]))
72+
else if (str.StartsWith(Global.ProtocolShares[EConfigType.WireGuard]))
7373
{
7474
return WireguardFmt.Resolve(str, out msg);
7575
}

v2rayN/ServiceLib/Handler/Fmt/SocksFmt.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class SocksFmt : BaseFmt
1717
return null;
1818
}
1919

20-
item.configType = EConfigType.Socks;
20+
item.configType = EConfigType.SOCKS;
2121

2222
return item;
2323
}
@@ -41,17 +41,17 @@ public class SocksFmt : BaseFmt
4141
//new
4242
var pw = Utils.Base64Encode($"{item.security}:{item.id}");
4343
url = $"{pw}@{GetIpv6(item.address)}:{item.port}";
44-
url = $"{Global.ProtocolShares[EConfigType.Socks]}{url}{remark}";
44+
url = $"{Global.ProtocolShares[EConfigType.SOCKS]}{url}{remark}";
4545
return url;
4646
}
4747

4848
private static ProfileItem? ResolveSocks(string result)
4949
{
5050
ProfileItem item = new()
5151
{
52-
configType = EConfigType.Socks
52+
configType = EConfigType.SOCKS
5353
};
54-
result = result[Global.ProtocolShares[EConfigType.Socks].Length..];
54+
result = result[Global.ProtocolShares[EConfigType.SOCKS].Length..];
5555
//remark
5656
int indexRemark = result.IndexOf("#");
5757
if (indexRemark > 0)

v2rayN/ServiceLib/Handler/Fmt/TuicFmt.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public class TuicFmt : BaseFmt
88

99
ProfileItem item = new()
1010
{
11-
configType = EConfigType.Tuic
11+
configType = EConfigType.TUIC
1212
};
1313

1414
Uri url = new(str);
@@ -57,7 +57,7 @@ public class TuicFmt : BaseFmt
5757
$"{item.id}:{item.security}",
5858
GetIpv6(item.address),
5959
item.port);
60-
url = $"{Global.ProtocolShares[EConfigType.Tuic]}{url}{query}{remark}";
60+
url = $"{Global.ProtocolShares[EConfigType.TUIC]}{url}{query}{remark}";
6161
return url;
6262
}
6363
}

v2rayN/ServiceLib/Handler/Fmt/WireguardFmt.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public class WireguardFmt : BaseFmt
88

99
ProfileItem item = new()
1010
{
11-
configType = EConfigType.Wireguard
11+
configType = EConfigType.WireGuard
1212
};
1313

1414
Uri url = new(str);
@@ -62,7 +62,7 @@ public class WireguardFmt : BaseFmt
6262
Utils.UrlEncode(item.id),
6363
GetIpv6(item.address),
6464
item.port);
65-
url = $"{Global.ProtocolShares[EConfigType.Wireguard]}{url}/{query}{remark}";
65+
url = $"{Global.ProtocolShares[EConfigType.WireGuard]}{url}/{query}{remark}";
6666
return url;
6767
}
6868
}

v2rayN/ServiceLib/Resx/ResUI.Designer.cs

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)