migrating to .NET Core 2.0
This commit is contained in:
48
SharedLibraryCore/Configuration/ApplicationConfiguration.cs
Normal file
48
SharedLibraryCore/Configuration/ApplicationConfiguration.cs
Normal file
@ -0,0 +1,48 @@
|
||||
using SharedLibraryCore.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace SharedLibraryCore.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 bool EnableCustomSayName { get; set; }
|
||||
public string CustomSayName { get; set; }
|
||||
public string DiscordInviteCode { get; set; }
|
||||
public string IPHubAPIKey { get; set; }
|
||||
public List<ServerConfiguration> Servers { get; set; }
|
||||
public int AutoMessagePeriod { get; set; }
|
||||
public List<string> AutoMessages { get; set; }
|
||||
public List<string> GlobalRules { get; set; }
|
||||
public List<MapConfiguration> Maps { get; set; }
|
||||
|
||||
public IBaseConfiguration Generate()
|
||||
{
|
||||
EnableMultipleOwners = Utilities.PromptBool("Enable multiple owners");
|
||||
EnableSteppedHierarchy = Utilities.PromptBool("Enable stepped privilege hierarchy");
|
||||
EnableCustomSayName = Utilities.PromptBool("Enable custom say name");
|
||||
|
||||
if (EnableCustomSayName)
|
||||
CustomSayName = Utilities.PromptString("Enter custom say name");
|
||||
|
||||
EnableClientVPNs = Utilities.PromptBool("Enable client VPNS");
|
||||
|
||||
if (!EnableClientVPNs)
|
||||
IPHubAPIKey = Utilities.PromptString("Enter iphub.info api key");
|
||||
|
||||
EnableDiscordLink = Utilities.PromptBool("Display discord link on webfront");
|
||||
|
||||
if (EnableDiscordLink)
|
||||
DiscordInviteCode = Utilities.PromptString("Enter discord invite link");
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public string Name() => "ApplicationConfiguration";
|
||||
}
|
||||
}
|
16
SharedLibraryCore/Configuration/MapConfiguration.cs
Normal file
16
SharedLibraryCore/Configuration/MapConfiguration.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using static SharedLibraryCore.Server;
|
||||
|
||||
namespace SharedLibraryCore.Configuration
|
||||
{
|
||||
public class MapConfiguration
|
||||
{
|
||||
public Game Game { get; set; }
|
||||
public List<Map> Maps { get; set; }
|
||||
}
|
||||
}
|
13
SharedLibraryCore/Configuration/ServerConfiguration.cs
Normal file
13
SharedLibraryCore/Configuration/ServerConfiguration.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SharedLibraryCore.Configuration
|
||||
{
|
||||
public class ServerConfiguration
|
||||
{
|
||||
public string IPAddress { get; set; }
|
||||
public short Port { get; set; }
|
||||
public string Password { get; set; }
|
||||
public List<string> Rules { get; set; }
|
||||
public List<string> AutoMessages { get; set; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user