1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-13 16:48:27 -05:00

migrating Stats to .Net Core 2

moved buildscripts to application
added publish profile
This commit is contained in:
RaidMax
2018-04-08 16:50:58 -05:00
parent 599027c4b6
commit d0c2a86ce8
69 changed files with 1486 additions and 720 deletions

View File

@ -0,0 +1,63 @@
using SharedLibraryCore;
using SharedLibraryCore.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace IW4MAdmin.Application
{
class ConfigurationGenerator
{
public static List<ServerConfiguration> GenerateServerConfig(List<ServerConfiguration> configList)
{
var newConfig = new ServerConfiguration();
while (string.IsNullOrEmpty(newConfig.IPAddress))
{
try
{
Console.Write("Enter server IP Address: ");
string input = Console.ReadLine();
IPAddress.Parse(input);
newConfig.IPAddress = input;
}
catch (Exception)
{
continue;
}
}
while (newConfig.Port == 0)
{
try
{
Console.Write("Enter server port: ");
newConfig.Port = Int16.Parse(Console.ReadLine());
}
catch (Exception)
{
continue;
}
}
Console.Write("Enter server RCON password: ");
newConfig.Password = Console.ReadLine();
newConfig.AutoMessages = new List<string>();
newConfig.Rules = new List<string>();
configList.Add(newConfig);
Console.Write("Configuration saved, add another? [y/n]:");
if (Console.ReadLine().ToLower().First() == 'y')
GenerateServerConfig(configList);
return configList;
}
}
}