Revert "Add an IP lookup to the WebSocketBot"

This reverts commit 0a149647b6.
This commit is contained in:
zorua162 2023-11-19 12:57:09 +00:00
parent 0a149647b6
commit fd1009b43f

View file

@ -291,17 +291,7 @@ public class WebSocketBot : ChatBot
public WebSocketBot() public WebSocketBot()
{ {
// Lookup the given address var match = Regex.Match(Config.Ip!, @"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}");
try
{
_ip = Dns.GetHostAddresses(Config.Ip!).First().ToString();
}
catch (Exception e)
{
// Set Ip to a non-acceptable value to fail the Ip check
_ip = "not found";
}
var match = Regex.Match(_ip, @"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}");
if (!match.Success) if (!match.Success)
{ {
@ -315,6 +305,7 @@ public class WebSocketBot : ChatBot
return; return;
} }
_ip = Config.Ip;
_port = Config.Port; _port = Config.Port;
_password = Config.Password; _password = Config.Password;
_authenticatedSessions = new(); _authenticatedSessions = new();