2018-03-18 22:25:11 -04:00
|
|
|
|
using SharedLibrary.Interfaces;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
2018-03-14 01:36:25 -04:00
|
|
|
|
|
|
|
|
|
namespace SharedLibrary.Configuration
|
|
|
|
|
{
|
2018-03-18 22:25:11 -04:00
|
|
|
|
public class ApplicationConfiguration : IBaseConfiguration
|
2018-03-14 01:36:25 -04:00
|
|
|
|
{
|
|
|
|
|
public bool EnableMultipleOwners { get; set; }
|
|
|
|
|
public bool EnableTrustedRank { 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; }
|
2018-03-18 22:25:11 -04:00
|
|
|
|
public List<string> GlobalRules { get; set; }
|
2018-03-14 14:22:04 -04:00
|
|
|
|
public List<MapConfiguration> Maps { get; set; }
|
2018-03-18 22:25:11 -04:00
|
|
|
|
|
|
|
|
|
public IBaseConfiguration Generate()
|
|
|
|
|
{
|
|
|
|
|
Console.Write("Enable multiple owners? [y/n]: ");
|
|
|
|
|
EnableMultipleOwners = (Console.ReadLine().ToLower().FirstOrDefault() as char?) == 'y';
|
|
|
|
|
|
|
|
|
|
Console.Write("Enable trusted rank? [y/n]: ");
|
|
|
|
|
EnableTrustedRank = (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";
|
2018-03-14 01:36:25 -04:00
|
|
|
|
}
|
2018-03-18 22:25:11 -04:00
|
|
|
|
}
|