Fix output of add host command

This commit is contained in:
Stone_Red
2023-12-12 12:25:51 +01:00
parent 8ec9a7964a
commit a5983e427c
2 changed files with 21 additions and 6 deletions
@@ -148,9 +148,14 @@ public class HostCommands
if (recivedHosts is not null)
{
ApiManager.SendNotificationMessageNewLine($"Success! Added {recivedHosts.Count} new host(s).", NotificationMessageType.Success);
hostsManager.AddRange(recivedHosts);
hostsManager.Add(new NetworkSocket(ipAddress.ToString(), port, DateTime.Now));
int newHosts = hostsManager.AddRange(recivedHosts);
if (hostsManager.Add(new NetworkSocket(ipAddress.ToString(), port, DateTime.Now)))
{
newHosts++;
}
ApiManager.SendNotificationMessageNewLine($"Success! Added {newHosts} new host(s).", NotificationMessageType.Success);
}
else
{