2018-04-08 02:44:42 -04:00
|
|
|
|
using SharedLibraryCore.Interfaces;
|
2018-03-18 22:25:11 -04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
2018-03-14 01:36:25 -04:00
|
|
|
|
|
2018-04-08 02:44:42 -04:00
|
|
|
|
namespace SharedLibraryCore.Configuration
|
2018-03-14 01:36:25 -04:00
|
|
|
|
{
|
2018-03-18 22:25:11 -04:00
|
|
|
|
public class ApplicationConfiguration : IBaseConfiguration
|
2018-03-14 01:36:25 -04:00
|
|
|
|
{
|
2018-04-16 16:31:14 -04:00
|
|
|
|
public bool EnableWebFront { get; set; }
|
2018-03-14 01:36:25 -04:00
|
|
|
|
public bool EnableMultipleOwners { get; set; }
|
2018-03-24 17:35:54 -04:00
|
|
|
|
public bool EnableSteppedHierarchy { get; set; }
|
2018-05-08 00:58:46 -04:00
|
|
|
|
public bool EnableSocialLink { get; set; }
|
2018-03-30 00:13:40 -04:00
|
|
|
|
public bool EnableCustomSayName { get; set; }
|
|
|
|
|
public string CustomSayName { get; set; }
|
2018-05-08 00:58:46 -04:00
|
|
|
|
public string SocialLinkAddress { get; set; }
|
2018-05-05 18:52:04 -04:00
|
|
|
|
public string SocialLinkTitle { get; set; }
|
2018-04-19 01:48:14 -04:00
|
|
|
|
public string WebfrontBindUrl { get; set; }
|
2018-04-21 18:18:20 -04:00
|
|
|
|
public string CustomParserEncoding { get; set; }
|
2018-04-24 18:01:27 -04:00
|
|
|
|
public string CustomLocale { get; set; }
|
2018-09-23 20:45:54 -04:00
|
|
|
|
public string DatabaseProvider { get; set; } = "sqlite";
|
2018-04-25 02:38:59 -04:00
|
|
|
|
public string ConnectionString { get; set; }
|
2018-06-07 22:19:12 -04:00
|
|
|
|
public int RConPollRate { get; set; } = 5000;
|
2018-10-13 19:49:08 -04:00
|
|
|
|
public bool IgnoreBots { get; set; }
|
2018-10-15 20:51:04 -04:00
|
|
|
|
public TimeSpan MaximumTempBanTime { get; set; } = new TimeSpan(24 * 30, 0, 0);
|
2018-04-18 16:46:53 -04:00
|
|
|
|
public string Id { get; set; }
|
2018-03-14 01:36:25 -04:00
|
|
|
|
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()
|
|
|
|
|
{
|
2018-05-05 16:36:26 -04:00
|
|
|
|
var loc = Utilities.CurrentLocalization.LocalizationIndex;
|
2018-04-18 16:46:53 -04:00
|
|
|
|
Id = Guid.NewGuid().ToString();
|
2018-08-22 21:25:34 -04:00
|
|
|
|
|
2018-04-22 16:04:18 -04:00
|
|
|
|
EnableWebFront = Utilities.PromptBool(loc["SETUP_ENABLE_WEBFRONT"]);
|
|
|
|
|
EnableMultipleOwners = Utilities.PromptBool(loc["SETUP_ENABLE_MULTIOWN"]);
|
|
|
|
|
EnableSteppedHierarchy = Utilities.PromptBool(loc["SETUP_ENABLE_STEPPEDPRIV"]);
|
|
|
|
|
EnableCustomSayName = Utilities.PromptBool(loc["SETUP_ENABLE_CUSTOMSAY"]);
|
2018-03-18 22:25:11 -04:00
|
|
|
|
|
2018-04-22 16:04:18 -04:00
|
|
|
|
bool useCustomParserEncoding = Utilities.PromptBool(loc["SETUP_USE_CUSTOMENCODING"]);
|
|
|
|
|
CustomParserEncoding = useCustomParserEncoding ? Utilities.PromptString(loc["SETUP_ENCODING_STRING"]) : "windows-1252";
|
2018-04-21 18:18:20 -04:00
|
|
|
|
|
2018-09-04 13:40:29 -04:00
|
|
|
|
WebfrontBindUrl = "http://0.0.0.0:1624";
|
2018-04-19 01:48:14 -04:00
|
|
|
|
|
2018-03-30 00:13:40 -04:00
|
|
|
|
if (EnableCustomSayName)
|
2018-04-22 16:04:18 -04:00
|
|
|
|
CustomSayName = Utilities.PromptString(loc["SETUP_SAY_NAME"]);
|
2018-03-18 22:25:11 -04:00
|
|
|
|
|
2018-05-08 00:58:46 -04:00
|
|
|
|
EnableSocialLink = Utilities.PromptBool(loc["SETUP_DISPLAY_SOCIAL"]);
|
2018-03-18 22:25:11 -04:00
|
|
|
|
|
2018-05-08 00:58:46 -04:00
|
|
|
|
if (EnableSocialLink)
|
2018-05-05 18:52:04 -04:00
|
|
|
|
{
|
|
|
|
|
SocialLinkTitle = Utilities.PromptString(loc["SETUP_SOCIAL_TITLE"]);
|
2018-05-08 00:58:46 -04:00
|
|
|
|
SocialLinkAddress = Utilities.PromptString(loc["SETUP_SOCIAL_LINK"]);
|
2018-05-05 18:52:04 -04:00
|
|
|
|
}
|
2018-09-04 13:40:29 -04:00
|
|
|
|
|
2018-06-07 22:19:12 -04:00
|
|
|
|
RConPollRate = 5000;
|
|
|
|
|
|
2018-03-18 22:25:11 -04:00
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string Name() => "ApplicationConfiguration";
|
2018-03-14 01:36:25 -04:00
|
|
|
|
}
|
2018-03-18 22:25:11 -04:00
|
|
|
|
}
|