From 88eaeba222b5149c9c755d77f03027483a013e91 Mon Sep 17 00:00:00 2001 From: Milon Date: Fri, 22 Nov 2024 10:45:39 +0100 Subject: [PATCH] add debug logging to entitywhitelist (#2263) * everything is on fire but whatever * cd trolling * kill * 4 commits to add 14 lines is crazy --- Content.Shared/Whitelist/EntityWhitelistSystem.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Content.Shared/Whitelist/EntityWhitelistSystem.cs b/Content.Shared/Whitelist/EntityWhitelistSystem.cs index 7c78b410a18..df29a94aa63 100644 --- a/Content.Shared/Whitelist/EntityWhitelistSystem.cs +++ b/Content.Shared/Whitelist/EntityWhitelistSystem.cs @@ -1,4 +1,5 @@ using System.Diagnostics.CodeAnalysis; +using System.Linq; // DeltaV using Content.Shared.Item; using Content.Shared.Roles; using Content.Shared.Tag; @@ -113,6 +114,19 @@ public bool IsWhitelistPass(EntityWhitelist? whitelist, EntityUid uid) if (whitelist == null) return false; + // Begin DeltaV + var isValid = IsValid(whitelist, uid); + Log.Debug($"Whitelist validation result for entity {ToPrettyString(uid)}: {isValid}"); + + if (whitelist.RequireAll) + { + Log.Debug($"Whitelist requires all conditions - Components: {string.Join(", ", whitelist.Components ?? Array.Empty())}, " + + $"Tags: {(whitelist.Tags != null ? string.Join(", ", whitelist.Tags.Select(t => t.ToString())) : "none")}"); + } + + return isValid; + // EndDeltaV + return IsValid(whitelist, uid); }