simplify initial setup by removing extra prompts

This commit is contained in:
RaidMax 2022-04-06 13:04:30 -05:00
parent 19bd47d0f4
commit a2d5e37c6f
3 changed files with 7 additions and 34 deletions

View File

@ -1,5 +1,4 @@
using SharedLibraryCore; using SharedLibraryCore.Interfaces;
using SharedLibraryCore.Interfaces;
namespace AutomessageFeed namespace AutomessageFeed
{ {
@ -11,16 +10,6 @@ namespace AutomessageFeed
public IBaseConfiguration Generate() public IBaseConfiguration Generate()
{ {
EnableFeed = Utilities.PromptBool(Utilities.CurrentLocalization.LocalizationIndex["PLUGINS_AUTOMESSAGEFEED_PROMPT_ENABLE"]);
if (EnableFeed)
{
FeedUrl = Utilities.PromptString(Utilities.CurrentLocalization.LocalizationIndex["PLUGINS_AUTOMESSAGEFEED_URL"]);
MaxFeedItems = Utilities.PromptInt(Utilities.CurrentLocalization.LocalizationIndex["PLUGINS_AUTOMESSAGEFEED_PROMPT_MAXITEMS"],
Utilities.CurrentLocalization.LocalizationIndex["PLUGINS_AUTOMESSAGEFEED_PROMPT_MAXITEMS_DESC"],
0, int.MaxValue, 0);
}
return this; return this;
} }

View File

@ -9,7 +9,6 @@ namespace IW4MAdmin.Plugins.Login
public IBaseConfiguration Generate() public IBaseConfiguration Generate()
{ {
RequirePrivilegedClientLogin = Utilities.PromptBool("Require privileged client login");
return this; return this;
} }

View File

@ -85,7 +85,7 @@ namespace SharedLibraryCore.Configuration
public bool EnableWebfrontConnectionWhitelist { get; set; } public bool EnableWebfrontConnectionWhitelist { get; set; }
[LocalizedDisplayName("WEBFRONT_CONFIGURATION_WHITELIST_LIST")] [LocalizedDisplayName("WEBFRONT_CONFIGURATION_WHITELIST_LIST")]
public string[] WebfrontConnectionWhitelist { get; set; } = new string[0]; public string[] WebfrontConnectionWhitelist { get; set; } = Array.Empty<string>();
[LocalizedDisplayName("WEBFRONT_CONFIGURATION_CUSTOM_LOCALE")] [LocalizedDisplayName("WEBFRONT_CONFIGURATION_CUSTOM_LOCALE")]
[ConfigurationLinked("CustomLocale")] [ConfigurationLinked("CustomLocale")]
@ -122,13 +122,13 @@ namespace SharedLibraryCore.Configuration
public int AutoMessagePeriod { get; set; } public int AutoMessagePeriod { get; set; }
[LocalizedDisplayName("WEBFRONT_CONFIGURATION_AUTOMESSAGES")] [LocalizedDisplayName("WEBFRONT_CONFIGURATION_AUTOMESSAGES")]
public string[] AutoMessages { get; set; } = new string[0]; public string[] AutoMessages { get; set; } = Array.Empty<string>();
[LocalizedDisplayName("WEBFRONT_CONFIGURATION_GLOBAL_RULES")] [LocalizedDisplayName("WEBFRONT_CONFIGURATION_GLOBAL_RULES")]
public string[] GlobalRules { get; set; } = new string[0]; public string[] GlobalRules { get; set; } = Array.Empty<string>();
[LocalizedDisplayName("WEBFRONT_CONFIGURATION_DISALLOWED_NAMES")] [LocalizedDisplayName("WEBFRONT_CONFIGURATION_DISALLOWED_NAMES")]
public string[] DisallowedClientNames { get; set; } = new string[0]; public string[] DisallowedClientNames { get; set; } = Array.Empty<string>();
[LocalizedDisplayName("WEBFRONT_CONFIGURATION_MAP_CHANGE_DELAY")] [LocalizedDisplayName("WEBFRONT_CONFIGURATION_MAP_CHANGE_DELAY")]
public int MapChangeDelaySeconds { get; set; } = 5; public int MapChangeDelaySeconds { get; set; } = 5;
@ -156,7 +156,7 @@ namespace SharedLibraryCore.Configuration
[ConfigurationIgnore] [ConfigurationIgnore]
[LocalizedDisplayName("WEBFRONT_CONFIGURATION_PRESET_BAN_REASONS")] [LocalizedDisplayName("WEBFRONT_CONFIGURATION_PRESET_BAN_REASONS")]
public Dictionary<string, string> PresetPenaltyReasons { get; set; } = new Dictionary<string, string> public Dictionary<string, string> PresetPenaltyReasons { get; set; } = new()
{ { "afk", "Away from keyboard" }, { "ci", "Connection interrupted. Reconnect" } }; { { "afk", "Away from keyboard" }, { "ci", "Connection interrupted. Reconnect" } };
[LocalizedDisplayName("WEBFRONT_CONFIGURATION_ENABLE_PRIVILEGED_USER_PRIVACY")] [LocalizedDisplayName("WEBFRONT_CONFIGURATION_ENABLE_PRIVILEGED_USER_PRIVACY")]
@ -198,7 +198,7 @@ namespace SharedLibraryCore.Configuration
: ManualWebfrontUrl; : ManualWebfrontUrl;
[ConfigurationIgnore] public bool IgnoreServerConnectionLost { get; set; } [ConfigurationIgnore] public bool IgnoreServerConnectionLost { get; set; }
[ConfigurationIgnore] public Uri MasterUrl { get; set; } = new Uri("http://api.raidmax.org:5000"); [ConfigurationIgnore] public Uri MasterUrl { get; set; } = new("http://api.raidmax.org:5000");
public IBaseConfiguration Generate() public IBaseConfiguration Generate()
{ {
@ -207,22 +207,7 @@ namespace SharedLibraryCore.Configuration
EnableWebFront = loc["SETUP_ENABLE_WEBFRONT"].PromptBool(); EnableWebFront = loc["SETUP_ENABLE_WEBFRONT"].PromptBool();
EnableMultipleOwners = loc["SETUP_ENABLE_MULTIOWN"].PromptBool(); EnableMultipleOwners = loc["SETUP_ENABLE_MULTIOWN"].PromptBool();
EnableSteppedHierarchy = loc["SETUP_ENABLE_STEPPEDPRIV"].PromptBool();
EnableCustomSayName = loc["SETUP_ENABLE_CUSTOMSAY"].PromptBool();
var useCustomParserEncoding = loc["SETUP_USE_CUSTOMENCODING"].PromptBool();
if (useCustomParserEncoding)
{
CustomParserEncoding = loc["SETUP_ENCODING_STRING"].PromptString();
}
WebfrontBindUrl = "http://0.0.0.0:1624"; WebfrontBindUrl = "http://0.0.0.0:1624";
if (EnableCustomSayName)
{
CustomSayName = loc["SETUP_SAY_NAME"].PromptString();
}
EnableSocialLink = loc["SETUP_DISPLAY_SOCIAL"].PromptBool(); EnableSocialLink = loc["SETUP_DISPLAY_SOCIAL"].PromptBool();
if (EnableSocialLink) if (EnableSocialLink)