mirror of
https://github.com/netchx/netch.git
synced 2026-03-18 18:13:21 +08:00
refactor: change port type to ushort
This commit is contained in:
@@ -34,7 +34,7 @@ namespace Netch.Models
|
||||
/// <summary>
|
||||
/// 端口
|
||||
/// </summary>
|
||||
public int Port;
|
||||
public ushort Port;
|
||||
|
||||
/// <summary>
|
||||
/// 延迟
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Netch.Servers.Shadowsocks.Models.SSD
|
||||
/// <summary>
|
||||
/// 端口
|
||||
/// </summary>
|
||||
public int port;
|
||||
public ushort port;
|
||||
|
||||
/// <summary>
|
||||
/// 加密方式
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
/// <summary>
|
||||
/// 端口
|
||||
/// </summary>
|
||||
public int port;
|
||||
public ushort port;
|
||||
|
||||
/// <summary>
|
||||
/// 加密方式
|
||||
|
||||
@@ -3,7 +3,7 @@ namespace Netch.Servers.Shadowsocks.Models
|
||||
public class ShadowsocksConfig
|
||||
{
|
||||
public string server { get; set; }
|
||||
public int server_port { get; set; }
|
||||
public ushort server_port { get; set; }
|
||||
public string password { get; set; }
|
||||
public string method { get; set; }
|
||||
public string remarks { get; set; }
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace Netch.Servers.Shadowsocks
|
||||
if (!match.Success) throw new FormatException();
|
||||
|
||||
data.Hostname = match.Groups["server"].Value;
|
||||
data.Port = int.Parse(match.Groups["port"].Value);
|
||||
data.Port = ushort.Parse(match.Groups["port"].Value);
|
||||
|
||||
var base64 = ShareLink.URLSafeBase64Decode(match.Groups["base64"].Value);
|
||||
match = parser.Match(base64);
|
||||
@@ -156,7 +156,7 @@ namespace Netch.Servers.Shadowsocks
|
||||
if (!match.Success) throw new FormatException();
|
||||
|
||||
data.Hostname = match.Groups["server"].Value;
|
||||
data.Port = int.Parse(match.Groups["port"].Value);
|
||||
data.Port = ushort.Parse(match.Groups["port"].Value);
|
||||
data.EncryptMethod = match.Groups["method"].Value;
|
||||
data.Password = match.Groups["password"].Value;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace Netch.Servers.Socks5
|
||||
var data = new Socks5
|
||||
{
|
||||
Hostname = dict["server"],
|
||||
Port = int.Parse(dict["port"])
|
||||
Port = ushort.Parse(dict["port"])
|
||||
};
|
||||
|
||||
if (dict.ContainsKey("user") && !string.IsNullOrWhiteSpace(dict["user"]))
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace Netch.Servers.Trojan
|
||||
|
||||
data.Password = match.Groups["psk"].Value;
|
||||
data.Hostname = match.Groups["server"].Value;
|
||||
data.Port = int.Parse(match.Groups["port"].Value);
|
||||
data.Port = ushort.Parse(match.Groups["port"].Value);
|
||||
|
||||
return new[] {data};
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Netch.Servers.VMess.Models
|
||||
{
|
||||
public string tag { get; set; }
|
||||
|
||||
public int port { get; set; }
|
||||
public ushort port { get; set; }
|
||||
|
||||
public string listen { get; set; }
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace Netch.Servers.VMess.Models
|
||||
{
|
||||
public string address { get; set; }
|
||||
|
||||
public int port { get; set; }
|
||||
public ushort port { get; set; }
|
||||
|
||||
public List<UsersItem> users { get; set; }
|
||||
}
|
||||
@@ -109,7 +109,7 @@ namespace Netch.Servers.VMess.Models
|
||||
|
||||
public string password { get; set; }
|
||||
|
||||
public int port { get; set; }
|
||||
public ushort port { get; set; }
|
||||
|
||||
public int level { get; set; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user