IW4M-Admin/SharedLibrary/Configuration/ApplicationConfiguration.cs

53 lines
1.9 KiB
C#
Raw Normal View History

using SharedLibrary.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
namespace SharedLibrary.Configuration
{
public class ApplicationConfiguration : IBaseConfiguration
{
public bool EnableMultipleOwners { get; set; }
public bool EnableSteppedHierarchy { get; set; }
public bool EnableClientVPNs { get; set; }
public bool EnableDiscordLink { get; set; }
public string DiscordInviteCode { get; set; }
public string IPHubAPIKey { get; set; }
public List<ServerConfiguration> Servers { get; set; }
2018-03-14 14:22:04 -04:00
public int AutoMessagePeriod { get; set; }
public List<string> AutoMessages { get; set; }
public List<string> GlobalRules { get; set; }
2018-03-14 14:22:04 -04:00
public List<MapConfiguration> Maps { get; set; }
public IBaseConfiguration Generate()
{
Console.Write("Enable multiple owners? [y/n]: ");
EnableMultipleOwners = (Console.ReadLine().ToLower().FirstOrDefault() as char?) == 'y';
Console.Write("Enable stepped privilege hierarchy? [y/n]: ");
EnableSteppedHierarchy = (Console.ReadLine().ToLower().FirstOrDefault() as char?) == 'y';
Console.Write("Enable client VPNs [y/n]: ");
EnableClientVPNs = (Console.ReadLine().ToLower().FirstOrDefault() as char?) == 'y';
if (!EnableClientVPNs)
{
Console.Write("Enter iphub.info api key: ");
IPHubAPIKey = Console.ReadLine();
}
Console.Write("Display discord link on webfront [y/n]: ");
EnableDiscordLink = (Console.ReadLine().ToLower().FirstOrDefault() as char?) == 'y';
if (EnableDiscordLink)
{
Console.Write("Enter discord invite link: ");
DiscordInviteCode = Console.ReadLine();
}
return this;
}
public string Name() => "ApplicationConfiguration";
}
}