From 6039fbdb36de01be6defe4e20688024ce69c0962 Mon Sep 17 00:00:00 2001 From: "@Someone" <45270312+Someone-193@users.noreply.github.com> Date: Fri, 29 May 2026 18:24:06 -0400 Subject: [PATCH] changes --- EXILED/Exiled.Loader/Config.cs | 6 ------ EXILED/Exiled.Loader/ConfigManager.cs | 16 ++++++++-------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/EXILED/Exiled.Loader/Config.cs b/EXILED/Exiled.Loader/Config.cs index 4e720d7bb7..6e07979ef2 100644 --- a/EXILED/Exiled.Loader/Config.cs +++ b/EXILED/Exiled.Loader/Config.cs @@ -88,11 +88,5 @@ public sealed class Config : IConfig /// [Description("Indicates whether Exiled should auto-update itself as soon as a new release is available.")] public bool EnableAutoUpdates { get; set; } = true; - - /// - /// Gets or sets a value indicating whether config validator should check all properties inside config values' types. - /// - [Description("Indicating whether config validator should check all properties inside config values' types.")] - public bool EnableDeepValidation { get; set; } = false; } } \ No newline at end of file diff --git a/EXILED/Exiled.Loader/ConfigManager.cs b/EXILED/Exiled.Loader/ConfigManager.cs index ac52381049..84399b0b7b 100644 --- a/EXILED/Exiled.Loader/ConfigManager.cs +++ b/EXILED/Exiled.Loader/ConfigManager.cs @@ -147,16 +147,16 @@ public static void ValidateType(object instance, object defaultInstance, Propert return; } - if (hasValidateChildrenAttribute || (!LoaderPlugin.Config.EnableDeepValidation && !(propertyInfo.PropertyType.Namespace?.Contains("System") ?? false))) + if (!hasValidateChildrenAttribute) + return; + + foreach (PropertyInfo property in propertyInfo.PropertyType.GetProperties().Where(x => x.GetMethod != null && x.SetMethod != null)) { - foreach (PropertyInfo property in propertyInfo.PropertyType.GetProperties().Where(x => x.GetMethod != null && x.SetMethod != null)) - { - ConstructorInfo ctor = property.PropertyType.GetConstructor(Type.EmptyTypes); - if (ctor is null) - continue; + ConstructorInfo ctor = property.PropertyType.GetConstructor(Type.EmptyTypes); + if (ctor is null) + continue; - ValidateType(value, ctor.Invoke(null, null), property, ref validated); - } + ValidateType(value, ctor.Invoke(null, null), property, ref validated); } }