From d0449b8292eb5fe8afd965fd83f23a59eccdd09d Mon Sep 17 00:00:00 2001 From: Milon Date: Fri, 22 Nov 2024 06:18:33 +0100 Subject: [PATCH 1/4] everything is on fire but whatever --- .../Whitelist/EntityWhitelistSystem.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Content.Shared/Whitelist/EntityWhitelistSystem.cs b/Content.Shared/Whitelist/EntityWhitelistSystem.cs index 7c78b410a18..3196ced16ae 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; @@ -11,12 +12,14 @@ public sealed class EntityWhitelistSystem : EntitySystem [Dependency] private readonly SharedRoleSystem _roles = default!; [Dependency] private readonly TagSystem _tag = default!; + private ISawmill _sawmill = default!; // DeltaV private EntityQuery _itemQuery; public override void Initialize() { base.Initialize(); _itemQuery = GetEntityQuery(); + _sawmill = Logger.GetSawmill("whitelist"); // DeltaV } /// @@ -113,6 +116,21 @@ public bool IsWhitelistPass(EntityWhitelist? whitelist, EntityUid uid) if (whitelist == null) return false; + // Begin DeltaV + _sawmill.Debug($"Checking whitelist pass for entity {ToPrettyString(uid)}"); + var isValid = IsValid(whitelist, uid); + _sawmill.Debug($"Whitelist validation result for entity {ToPrettyString(uid)}: {isValid}"); + + if (whitelist.RequireAll) + { + _sawmill.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")}, " + + $"MaxSize: {whitelist.MaxSize}"); + } + + return isValid; + // EndDeltaV + return IsValid(whitelist, uid); } From a7c3e3f9c922bd7e2066713fc1ed0eab28baac73 Mon Sep 17 00:00:00 2001 From: Milon Date: Fri, 22 Nov 2024 06:27:36 +0100 Subject: [PATCH 2/4] cd trolling --- Content.Shared/Whitelist/EntityWhitelistSystem.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Content.Shared/Whitelist/EntityWhitelistSystem.cs b/Content.Shared/Whitelist/EntityWhitelistSystem.cs index 3196ced16ae..63828c10361 100644 --- a/Content.Shared/Whitelist/EntityWhitelistSystem.cs +++ b/Content.Shared/Whitelist/EntityWhitelistSystem.cs @@ -124,8 +124,7 @@ public bool IsWhitelistPass(EntityWhitelist? whitelist, EntityUid uid) if (whitelist.RequireAll) { _sawmill.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")}, " + - $"MaxSize: {whitelist.MaxSize}"); + $"Tags: {(whitelist.Tags != null ? string.Join(", ", whitelist.Tags.Select(t => t.ToString())) : "none")}"); } return isValid; From 8c41f452f82c86597c272db07fce69df7febefde Mon Sep 17 00:00:00 2001 From: Milon Date: Fri, 22 Nov 2024 10:09:03 +0100 Subject: [PATCH 3/4] kill --- Content.Shared/Whitelist/EntityWhitelistSystem.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Content.Shared/Whitelist/EntityWhitelistSystem.cs b/Content.Shared/Whitelist/EntityWhitelistSystem.cs index 63828c10361..0454c697a4a 100644 --- a/Content.Shared/Whitelist/EntityWhitelistSystem.cs +++ b/Content.Shared/Whitelist/EntityWhitelistSystem.cs @@ -12,14 +12,12 @@ public sealed class EntityWhitelistSystem : EntitySystem [Dependency] private readonly SharedRoleSystem _roles = default!; [Dependency] private readonly TagSystem _tag = default!; - private ISawmill _sawmill = default!; // DeltaV private EntityQuery _itemQuery; public override void Initialize() { base.Initialize(); _itemQuery = GetEntityQuery(); - _sawmill = Logger.GetSawmill("whitelist"); // DeltaV } /// @@ -117,13 +115,13 @@ public bool IsWhitelistPass(EntityWhitelist? whitelist, EntityUid uid) return false; // Begin DeltaV - _sawmill.Debug($"Checking whitelist pass for entity {ToPrettyString(uid)}"); + Log.Debug($"Checking whitelist pass for entity {ToPrettyString(uid)}"); var isValid = IsValid(whitelist, uid); - _sawmill.Debug($"Whitelist validation result for entity {ToPrettyString(uid)}: {isValid}"); + Log.Debug($"Whitelist validation result for entity {ToPrettyString(uid)}: {isValid}"); if (whitelist.RequireAll) { - _sawmill.Debug($"Whitelist requires all conditions - Components: {string.Join(", ", whitelist.Components ?? Array.Empty())}, " + + 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")}"); } From 6613b2e95cadece63bf997c6be8664e2d28eba0a Mon Sep 17 00:00:00 2001 From: Milon Date: Fri, 22 Nov 2024 10:19:22 +0100 Subject: [PATCH 4/4] 4 commits to add 14 lines is crazy --- Content.Shared/Whitelist/EntityWhitelistSystem.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Content.Shared/Whitelist/EntityWhitelistSystem.cs b/Content.Shared/Whitelist/EntityWhitelistSystem.cs index 0454c697a4a..df29a94aa63 100644 --- a/Content.Shared/Whitelist/EntityWhitelistSystem.cs +++ b/Content.Shared/Whitelist/EntityWhitelistSystem.cs @@ -115,7 +115,6 @@ public bool IsWhitelistPass(EntityWhitelist? whitelist, EntityUid uid) return false; // Begin DeltaV - Log.Debug($"Checking whitelist pass for entity {ToPrettyString(uid)}"); var isValid = IsValid(whitelist, uid); Log.Debug($"Whitelist validation result for entity {ToPrettyString(uid)}: {isValid}");