1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

support hostnames for server config

This commit is contained in:
RaidMax
2021-07-11 17:26:30 -05:00
parent da6da0edca
commit 19b5c456a5
12 changed files with 59 additions and 52 deletions

View File

@ -87,12 +87,8 @@ namespace SharedLibraryCore.Configuration
while (string.IsNullOrEmpty(IPAddress))
{
string input = Utilities.PromptString(loc["SETUP_SERVER_IP"]);
if (System.Net.IPAddress.TryParse(input, out System.Net.IPAddress ip))
{
IPAddress = input;
}
var input = Utilities.PromptString(loc["SETUP_SERVER_IP"]);
IPAddress = input;
}
Port = Utilities.PromptInt(loc["SETUP_SERVER_PORT"], null, 1, ushort.MaxValue);

View File

@ -10,10 +10,6 @@ namespace SharedLibraryCore.Configuration.Validation
{
public ServerConfigurationValidator()
{
RuleFor(_server => _server.IPAddress)
.NotEmpty()
.Must(_address => IPAddress.TryParse(_address, out _));
RuleFor(_server => _server.Port)
.InclusiveBetween(1, ushort.MaxValue);