refactor: change port type to ushort

This commit is contained in:
ChsBuffer
2020-10-16 19:29:38 +08:00
parent 86a86a94d8
commit b2ac98b21f
8 changed files with 11 additions and 11 deletions

View File

@@ -34,7 +34,7 @@ namespace Netch.Models
/// <summary>
/// 端口
/// </summary>
public int Port;
public ushort Port;
/// <summary>
/// 延迟

View File

@@ -12,7 +12,7 @@ namespace Netch.Servers.Shadowsocks.Models.SSD
/// <summary>
/// 端口
/// </summary>
public int port;
public ushort port;
/// <summary>
/// 加密方式

View File

@@ -10,7 +10,7 @@
/// <summary>
/// 端口
/// </summary>
public int port;
public ushort port;
/// <summary>
/// 加密方式

View File

@@ -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; }

View File

@@ -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;
}

View File

@@ -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"]))

View File

@@ -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};
}

View File

@@ -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; }