diff --git a/Projects/Scripts/Accounting/Account.cs b/Projects/Scripts/Accounting/Account.cs index 39473a93d..9fc558432 100644 --- a/Projects/Scripts/Accounting/Account.cs +++ b/Projects/Scripts/Accounting/Account.cs @@ -315,7 +315,7 @@ namespace Server.Accounting public void SetPassword(string plainPassword) { Password = AccountSecurity.CurrentPasswordProtection.EncryptPassword(plainPassword); - m_PasswordAlgorithm = AccountSecurity.AlgorithmName; + m_PasswordAlgorithm = AccountSecurity.CurrentAlgorithm; } public bool CheckPassword(string plainPassword) @@ -327,7 +327,7 @@ namespace Server.Accounting return false; // Upgrade the password protection in case we change the algorithm - if (m_PasswordAlgorithm != AccountSecurity.AlgorithmName) + if (m_PasswordAlgorithm != AccountSecurity.CurrentAlgorithm) SetPassword(plainPassword); return true; diff --git a/Projects/Scripts/Accounting/AccountAttackLimiter.cs b/Projects/Scripts/Accounting/AccountAttackLimiter.cs index 23bb338b3..9d304777b 100644 --- a/Projects/Scripts/Accounting/AccountAttackLimiter.cs +++ b/Projects/Scripts/Accounting/AccountAttackLimiter.cs @@ -11,7 +11,7 @@ namespace Server.Accounting public static bool Enabled; public static void Configure() { - Enabled = ServerConfiguration.GetOrUpdateSetting("accountAttackLimiter.enabled", true); + Enabled = ServerConfiguration.GetOrUpdateSetting("accountAttackLimiter.enable", true); } private static readonly List m_List = new List(); diff --git a/Projects/Scripts/Accounting/AccountHandler.cs b/Projects/Scripts/Accounting/AccountHandler.cs index f13b6f7c5..67fb62770 100644 --- a/Projects/Scripts/Accounting/AccountHandler.cs +++ b/Projects/Scripts/Accounting/AccountHandler.cs @@ -20,7 +20,7 @@ namespace Server.Misc public static void Configure() { MaxAccountsPerIP = ServerConfiguration.GetOrUpdateSetting("accountHandler.maxAccountsPerIP", 1); - AutoAccountCreation = ServerConfiguration.GetOrUpdateSetting("accountHandler.autoAccountCreation", true); + AutoAccountCreation = ServerConfiguration.GetOrUpdateSetting("accountHandler.enableAutoAccountCreation", true); PasswordCommandEnabled = ServerConfiguration.GetOrUpdateSetting("accountHandler.enablePlayerPasswordCommand", false); } diff --git a/Projects/Scripts/Accounting/IPLimiter.cs b/Projects/Scripts/Accounting/IPLimiter.cs index e20bcfe4b..eb148583b 100644 --- a/Projects/Scripts/Accounting/IPLimiter.cs +++ b/Projects/Scripts/Accounting/IPLimiter.cs @@ -13,8 +13,8 @@ namespace Server.Misc public static void Configure() { - Enabled = ServerConfiguration.GetOrUpdateSetting("ipLImiter.enabled", true); - SocketBlock = ServerConfiguration.GetOrUpdateSetting("ipLImiter.blockAtConnection", true); + Enabled = ServerConfiguration.GetOrUpdateSetting("ipLimiter.enable", true); + SocketBlock = ServerConfiguration.GetOrUpdateSetting("ipLimiter.blockAtConnection", true); MaxAddresses = ServerConfiguration.GetOrUpdateSetting("ipLimiter.maxConnectionsPerIP", 10); } diff --git a/Projects/Scripts/Accounting/Security/AccountSecurity.cs b/Projects/Scripts/Accounting/Security/AccountSecurity.cs index 1f02e07aa..d63fc01d6 100644 --- a/Projects/Scripts/Accounting/Security/AccountSecurity.cs +++ b/Projects/Scripts/Accounting/Security/AccountSecurity.cs @@ -40,14 +40,17 @@ namespace Server.Accounting.Security public static class AccountSecurity { // TODO: Put it in a configuration - public const PasswordProtectionAlgorithm AlgorithmName = PasswordProtectionAlgorithm.Argon2; + public static PasswordProtectionAlgorithm CurrentAlgorithm { get; set; } - public static readonly IPasswordProtection CurrentPasswordProtection = GetPasswordProtection(AlgorithmName); + public static readonly IPasswordProtection CurrentPasswordProtection = GetPasswordProtection(CurrentAlgorithm); public static void Configure() { - if (AlgorithmName < PasswordProtectionAlgorithm.SHA2) - throw new Exception($"Security: {AlgorithmName} is obselete and not secure. Do not use it."); + CurrentAlgorithm = + ServerConfiguration.GetOrUpdateSetting("accountSecurity.encryptionAlgorithm", PasswordProtectionAlgorithm.Argon2); + + if (CurrentAlgorithm < PasswordProtectionAlgorithm.SHA2) + throw new Exception($"Security: {CurrentAlgorithm} is obselete and not secure. Do not use it."); } public static IPasswordProtection GetPasswordProtection(PasswordProtectionAlgorithm algorithm) diff --git a/Projects/Scripts/Configuration/ExpansionConfiguration.cs b/Projects/Scripts/Configuration/ExpansionConfiguration.cs index aaf7d3615..b56d9786f 100644 --- a/Projects/Scripts/Configuration/ExpansionConfiguration.cs +++ b/Projects/Scripts/Configuration/ExpansionConfiguration.cs @@ -11,13 +11,13 @@ namespace Server { Core.Expansion = ServerConfiguration.GetOrUpdateSetting("currentExpansion", Expansion.TOL); - AccountGold.Enabled = ServerConfiguration.GetSetting("accountGold.enabled", Core.TOL); + AccountGold.Enabled = ServerConfiguration.GetSetting("accountGold.enable", Core.TOL); AccountGold.ConvertOnBank = ServerConfiguration.GetSetting("accountGold.convertOnBank", true); AccountGold.ConvertOnTrade = ServerConfiguration.GetSetting("accountGold.convertOnTrade", false); VirtualCheck.UseEditGump = ServerConfiguration.GetSetting("virtualChecks.useEditGump", true); - Mobile.InsuranceEnabled = ServerConfiguration.GetSetting("insurance.enabled", Core.AOS); - ObjectPropertyList.Enabled = ServerConfiguration.GetSetting("opl.enabled", Core.AOS); + Mobile.InsuranceEnabled = ServerConfiguration.GetSetting("insurance.enable", Core.AOS); + ObjectPropertyList.Enabled = ServerConfiguration.GetSetting("opl.enable", Core.AOS); bool visibleDamage = ServerConfiguration.GetSetting("visibleDamage", Core.AOS); Mobile.VisibleDamageType = visibleDamage ? VisibleDamageType.Related : VisibleDamageType.None; Mobile.GuildClickMessage = ServerConfiguration.GetSetting("guildClickMessage", !Core.AOS); diff --git a/Projects/Scripts/Engines/Ethics/Core/Ethic.cs b/Projects/Scripts/Engines/Ethics/Core/Ethic.cs index b114c3b8f..50b0b5b4c 100644 --- a/Projects/Scripts/Engines/Ethics/Core/Ethic.cs +++ b/Projects/Scripts/Engines/Ethics/Core/Ethic.cs @@ -98,7 +98,7 @@ namespace Server.Ethics public static void Initialize() { - Enabled = ServerConfiguration.GetOrUpdateSetting("ethics.enabled", false); + Enabled = ServerConfiguration.GetOrUpdateSetting("ethics.enable", false); if (Enabled) EventSink.Speech += EventSink_Speech; diff --git a/Projects/Scripts/Engines/Pathing/PathFollower.cs b/Projects/Scripts/Engines/Pathing/PathFollower.cs index 4cba5f5d6..84f8b572d 100644 --- a/Projects/Scripts/Engines/Pathing/PathFollower.cs +++ b/Projects/Scripts/Engines/Pathing/PathFollower.cs @@ -16,7 +16,7 @@ namespace Server public static void Initialize() { - Enabled = ServerConfiguration.GetOrUpdateSetting("pathfinding.enabled", true); + Enabled = ServerConfiguration.GetOrUpdateSetting("pathfinding.enable", true); } public PathFollower(Mobile from, IPoint3D goal) diff --git a/Projects/Scripts/Engines/VeteranRewards/RewardSystem.cs b/Projects/Scripts/Engines/VeteranRewards/RewardSystem.cs index 35aa0e6f2..e9058408a 100644 --- a/Projects/Scripts/Engines/VeteranRewards/RewardSystem.cs +++ b/Projects/Scripts/Engines/VeteranRewards/RewardSystem.cs @@ -16,7 +16,7 @@ namespace Server.Engines.VeteranRewards // assuming vet rewards are enabled, should total skill cap bonuses be awarded? (720 skills total at 4th level) public static bool SkillCapRewards { get; private set; } - public static TimeSpan RewardInterval = TimeSpan.FromDays(30.0); + public static TimeSpan RewardInterval { get; private set; } public static RewardCategory[] Categories { @@ -455,8 +455,9 @@ namespace Server.Engines.VeteranRewards public static void Initialize() { - Enabled = ServerConfiguration.GetOrUpdateSetting("vetRewards.enabled", true); - SkillCapRewards = ServerConfiguration.GetOrUpdateSetting("vetReards.skillCapRewards", true); + Enabled = ServerConfiguration.GetOrUpdateSetting("vetRewards.enable", true); + SkillCapRewards = ServerConfiguration.GetOrUpdateSetting("vetRewards.skillCapRewards", true); + RewardInterval = ServerConfiguration.GetOrUpdateSetting("vetRewards.rewardInterval", TimeSpan.FromDays(30.0)); if (Enabled) EventSink.Login += EventSink_Login; diff --git a/Projects/Scripts/Misc/BuffIcons.cs b/Projects/Scripts/Misc/BuffIcons.cs index f6dda432c..2acf4d066 100644 --- a/Projects/Scripts/Misc/BuffIcons.cs +++ b/Projects/Scripts/Misc/BuffIcons.cs @@ -10,7 +10,7 @@ namespace Server public static void Initialize() { - Enabled = ServerConfiguration.GetOrUpdateSetting("buffIcons.enabled", Core.ML); + Enabled = ServerConfiguration.GetOrUpdateSetting("buffIcons.enable", Core.ML); if (Enabled) EventSink.ClientVersionReceived += ResendBuffsOnClientVersionReceived; diff --git a/Projects/Scripts/Misc/ClientVerification.cs b/Projects/Scripts/Misc/ClientVerification.cs index c2cd9e974..62afe1e74 100644 --- a/Projects/Scripts/Misc/ClientVerification.cs +++ b/Projects/Scripts/Misc/ClientVerification.cs @@ -27,7 +27,7 @@ namespace Server.Misc public static void Initialize() { - m_DetectClientRequirement = ServerConfiguration.GetOrUpdateSetting("clientVerification.enabled", true); + m_DetectClientRequirement = ServerConfiguration.GetOrUpdateSetting("clientVerification.enable", true); m_OldClientResponse = ServerConfiguration.GetOrUpdateSetting("clientVerification.oldClientResponse", OldClientResponse.Kick); m_AgeLeniency = ServerConfiguration.GetOrUpdateSetting("clientVerification.ageLeniency", TimeSpan.FromDays(10)); diff --git a/Projects/Scripts/SpecialSystems/Engines/TestCenter.cs b/Projects/Scripts/SpecialSystems/Engines/TestCenter.cs index fa673b32a..faf2cc4f8 100644 --- a/Projects/Scripts/SpecialSystems/Engines/TestCenter.cs +++ b/Projects/Scripts/SpecialSystems/Engines/TestCenter.cs @@ -12,7 +12,7 @@ namespace Server.Misc public static void Configure() { - Enabled = ServerConfiguration.GetOrUpdateSetting("testCenter.enabled", false); + Enabled = ServerConfiguration.GetOrUpdateSetting("testCenter.enable", false); } public static void Initialize()