diff --git a/HyperbolicDownloader/HyperbolicDownloaderCli.csproj b/HyperbolicDownloader/HyperbolicDownloaderCli.csproj index 1a90c33..101fc76 100644 --- a/HyperbolicDownloader/HyperbolicDownloaderCli.csproj +++ b/HyperbolicDownloader/HyperbolicDownloaderCli.csproj @@ -1,4 +1,4 @@ - + Exe diff --git a/HyperbolicDownloaderApi/Commands/FileCommands.cs b/HyperbolicDownloaderApi/Commands/FileCommands.cs index 8586f7a..0d94ddb 100644 --- a/HyperbolicDownloaderApi/Commands/FileCommands.cs +++ b/HyperbolicDownloaderApi/Commands/FileCommands.cs @@ -28,7 +28,7 @@ public class FileCommands } else { - ApiManager.SendMessageNewLine(message, NotificationMessageType.Error); + ApiManager.SendMessageNewLine(message!, NotificationMessageType.Error); } } diff --git a/HyperbolicDownloaderApi/Commands/HostCommands.cs b/HyperbolicDownloaderApi/Commands/HostCommands.cs index 796acba..1f20919 100644 --- a/HyperbolicDownloaderApi/Commands/HostCommands.cs +++ b/HyperbolicDownloaderApi/Commands/HostCommands.cs @@ -108,9 +108,10 @@ public class HostCommands string ipAddressInput = parts[0]; string portInput = parts[1]; - IPAddress? ipAddress = null; + IPAddress? ipAddress; _ = int.TryParse(portInput, out int port); + if (port < 1000 || port >= 6000) { ApiManager.SendMessageNewLine("Invalid port number!", NotificationMessageType.Error); diff --git a/HyperbolicDownloaderApi/Networking/HostsManager.cs b/HyperbolicDownloaderApi/Networking/HostsManager.cs index 60f18c4..763d764 100644 --- a/HyperbolicDownloaderApi/Networking/HostsManager.cs +++ b/HyperbolicDownloaderApi/Networking/HostsManager.cs @@ -58,7 +58,7 @@ public class HostsManager try { - tcpClient.ConnectAsync(host.IPAddress, host.Port).Wait(1000); + tcpClient.ConnectAsync(host.IPAddress, host.Port).Wait(500); Console.CursorLeft = 0; if (tcpClient.Connected) {