From: slarticodefast <161409025+slarticodefast@users.noreply.github.com> Date: Mon, 24 Nov 2025 00:38:08 +0000 (+0100) Subject: Remove blacklist methods in EntityWhitelistSystem (#40932) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=a428130d452720734163cd2f14161cf876b84e9b;p=space-station-14.git Remove blacklist methods in EntityWhitelistSystem (#40932) * replace blacklist methods * VS is trolling me --- diff --git a/Content.Client/UserInterface/Systems/Emotes/EmotesUIController.cs b/Content.Client/UserInterface/Systems/Emotes/EmotesUIController.cs index fdcc3c45a2..193db2a486 100644 --- a/Content.Client/UserInterface/Systems/Emotes/EmotesUIController.cs +++ b/Content.Client/UserInterface/Systems/Emotes/EmotesUIController.cs @@ -147,7 +147,7 @@ public sealed class EmotesUIController : UIController, IOnStateChanged(objective, out var kill) && kill.Target == mind.Owner) { // remove the mind if this objective is blacklisted - if (whitelistSys.IsBlacklistPassOrNull(Blacklist, objective)) + if (whitelistSys.IsWhitelistPassOrNull(Blacklist, objective)) return true; } } diff --git a/Content.Server/Objectives/Systems/NinjaConditionsSystem.cs b/Content.Server/Objectives/Systems/NinjaConditionsSystem.cs index 4c19a64ab1..9004e245ee 100644 --- a/Content.Server/Objectives/Systems/NinjaConditionsSystem.cs +++ b/Content.Server/Objectives/Systems/NinjaConditionsSystem.cs @@ -59,7 +59,7 @@ public sealed class NinjaConditionsSystem : EntitySystem while (allEnts.MoveNext(out var warpUid, out var warp)) { - if (_whitelist.IsBlacklistFail(bombingBlacklist, warpUid) + if (_whitelist.IsWhitelistFail(bombingBlacklist, warpUid) && !string.IsNullOrWhiteSpace(warp.Location)) { warps.Add(warpUid); diff --git a/Content.Server/Objectives/Systems/ObjectiveBlacklistRequirementSystem.cs b/Content.Server/Objectives/Systems/ObjectiveBlacklistRequirementSystem.cs index 0671c6b67e..e92943a65e 100644 --- a/Content.Server/Objectives/Systems/ObjectiveBlacklistRequirementSystem.cs +++ b/Content.Server/Objectives/Systems/ObjectiveBlacklistRequirementSystem.cs @@ -25,7 +25,7 @@ public sealed class ObjectiveBlacklistRequirementSystem : EntitySystem foreach (var objective in args.Mind.Objectives) { - if (_whitelistSystem.IsBlacklistPass(comp.Blacklist, objective)) + if (_whitelistSystem.IsWhitelistPass(comp.Blacklist, objective)) { args.Cancelled = true; return; diff --git a/Content.Server/Power/EntitySystems/CableSystem.Placer.cs b/Content.Server/Power/EntitySystems/CableSystem.Placer.cs index d6fe1a8f85..ffe2998c74 100644 --- a/Content.Server/Power/EntitySystems/CableSystem.Placer.cs +++ b/Content.Server/Power/EntitySystems/CableSystem.Placer.cs @@ -42,7 +42,7 @@ public sealed partial class CableSystem foreach (var anchored in _map.GetAnchoredEntities((gridUid, grid), snapPos)) { - if (_whitelistSystem.IsBlacklistPass(component.Blacklist, anchored)) + if (_whitelistSystem.IsWhitelistPass(component.Blacklist, anchored)) return; if (TryComp(anchored, out var wire) && wire.CableType == component.BlockingCableType) diff --git a/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs b/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs index 8089cba61b..82e6f026e6 100644 --- a/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs +++ b/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs @@ -344,7 +344,7 @@ public sealed partial class RevenantSystem foreach (var ent in _lookup.GetEntitiesInRange(uid, component.MalfunctionRadius)) { if (_whitelistSystem.IsWhitelistFail(component.MalfunctionWhitelist, ent) || - _whitelistSystem.IsBlacklistPass(component.MalfunctionBlacklist, ent)) + _whitelistSystem.IsWhitelistPass(component.MalfunctionBlacklist, ent)) continue; _emagSystem.TryEmagEffect(uid, uid, ent); diff --git a/Content.Server/Store/Conditions/BuyerWhitelistCondition.cs b/Content.Server/Store/Conditions/BuyerWhitelistCondition.cs index ff4a9a19cd..28b2787840 100644 --- a/Content.Server/Store/Conditions/BuyerWhitelistCondition.cs +++ b/Content.Server/Store/Conditions/BuyerWhitelistCondition.cs @@ -26,7 +26,7 @@ public sealed partial class BuyerWhitelistCondition : ListingCondition var whitelistSystem = ent.System(); if (whitelistSystem.IsWhitelistFail(Whitelist, args.Buyer) || - whitelistSystem.IsBlacklistPass(Blacklist, args.Buyer)) + whitelistSystem.IsWhitelistPass(Blacklist, args.Buyer)) return false; return true; diff --git a/Content.Server/Store/Conditions/StoreWhitelistCondition.cs b/Content.Server/Store/Conditions/StoreWhitelistCondition.cs index ced4dfa9c0..e27d79af75 100644 --- a/Content.Server/Store/Conditions/StoreWhitelistCondition.cs +++ b/Content.Server/Store/Conditions/StoreWhitelistCondition.cs @@ -29,7 +29,7 @@ public sealed partial class StoreWhitelistCondition : ListingCondition var whitelistSystem = ent.System(); if (whitelistSystem.IsWhitelistFail(Whitelist, args.StoreEntity.Value) || - whitelistSystem.IsBlacklistPass(Blacklist, args.StoreEntity.Value)) + whitelistSystem.IsWhitelistPass(Blacklist, args.StoreEntity.Value)) return false; return true; diff --git a/Content.Server/SurveillanceCamera/Systems/SurveillanceCameraMicrophoneSystem.cs b/Content.Server/SurveillanceCamera/Systems/SurveillanceCameraMicrophoneSystem.cs index 1f298f32a4..e8c53de9eb 100644 --- a/Content.Server/SurveillanceCamera/Systems/SurveillanceCameraMicrophoneSystem.cs +++ b/Content.Server/SurveillanceCamera/Systems/SurveillanceCameraMicrophoneSystem.cs @@ -62,7 +62,7 @@ public sealed class SurveillanceCameraMicrophoneSystem : EntitySystem public void CanListen(EntityUid uid, SurveillanceCameraMicrophoneComponent microphone, ListenAttemptEvent args) { // TODO maybe just make this a part of ActiveListenerComponent? - if (_whitelistSystem.IsBlacklistPass(microphone.Blacklist, args.Source)) + if (_whitelistSystem.IsWhitelistPass(microphone.Blacklist, args.Source)) args.Cancel(); } diff --git a/Content.Server/Teleportation/TeleportLocationsSystem.cs b/Content.Server/Teleportation/TeleportLocationsSystem.cs index edda0859ee..4409b14111 100644 --- a/Content.Server/Teleportation/TeleportLocationsSystem.cs +++ b/Content.Server/Teleportation/TeleportLocationsSystem.cs @@ -61,7 +61,7 @@ public sealed partial class TeleportLocationsSystem : SharedTeleportLocationsSys while (allEnts.MoveNext(out var warpEnt, out var warpPointComp)) { - if (_whitelist.IsBlacklistPass(warpPointComp.Blacklist, warpEnt) || string.IsNullOrWhiteSpace(warpPointComp.Location)) + if (_whitelist.IsWhitelistPass(warpPointComp.Blacklist, warpEnt) || string.IsNullOrWhiteSpace(warpPointComp.Location)) continue; ent.Comp.AvailableWarps.Add(new TeleportPoint(warpPointComp.Location, GetNetEntity(warpEnt))); diff --git a/Content.Server/Traits/TraitSystem.cs b/Content.Server/Traits/TraitSystem.cs index d6035f887b..9a634f8942 100644 --- a/Content.Server/Traits/TraitSystem.cs +++ b/Content.Server/Traits/TraitSystem.cs @@ -41,7 +41,7 @@ public sealed class TraitSystem : EntitySystem } if (_whitelistSystem.IsWhitelistFail(traitPrototype.Whitelist, args.Mob) || - _whitelistSystem.IsBlacklistPass(traitPrototype.Blacklist, args.Mob)) + _whitelistSystem.IsWhitelistPass(traitPrototype.Blacklist, args.Mob)) continue; // Add all components required by the prototype diff --git a/Content.Shared/Actions/SharedActionsSystem.cs b/Content.Shared/Actions/SharedActionsSystem.cs index a2a1782553..642d942fb6 100644 --- a/Content.Shared/Actions/SharedActionsSystem.cs +++ b/Content.Shared/Actions/SharedActionsSystem.cs @@ -426,7 +426,7 @@ public abstract partial class SharedActionsSystem : EntitySystem if (_whitelist.IsWhitelistFail(comp.Whitelist, target)) return false; - if (_whitelist.IsBlacklistPass(comp.Blacklist, target)) + if (_whitelist.IsWhitelistPass(comp.Blacklist, target)) return false; if (_actionQuery.Comp(uid).CheckCanInteract && !_actionBlocker.CanInteract(user, target)) diff --git a/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs b/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs index 75680089fb..0c4d7a0988 100644 --- a/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs +++ b/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs @@ -235,7 +235,7 @@ public abstract partial class SharedBuckleSystem // Does it pass the Whitelist if (_whitelistSystem.IsWhitelistFail(strapComp.Whitelist, buckleUid) || - _whitelistSystem.IsBlacklistPass(strapComp.Blacklist, buckleUid)) + _whitelistSystem.IsWhitelistPass(strapComp.Blacklist, buckleUid)) { if (popup) _popup.PopupClient(Loc.GetString("buckle-component-cannot-fit-message"), user, PopupType.Medium); diff --git a/Content.Shared/Chat/SharedChatSystem.Emote.cs b/Content.Shared/Chat/SharedChatSystem.Emote.cs index d92a02a9de..c7b47a4321 100644 --- a/Content.Shared/Chat/SharedChatSystem.Emote.cs +++ b/Content.Shared/Chat/SharedChatSystem.Emote.cs @@ -193,7 +193,7 @@ public abstract partial class SharedChatSystem // Check the whitelist and blacklist if (_whitelist.IsWhitelistFail(emote.Whitelist, source) || - _whitelist.IsBlacklistPass(emote.Blacklist, source)) + _whitelist.IsWhitelistPass(emote.Blacklist, source)) { return false; } diff --git a/Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs b/Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs index 718d2a0524..73caec52e8 100644 --- a/Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs +++ b/Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs @@ -339,7 +339,7 @@ namespace Content.Shared.Containers.ItemSlots private bool CanInsertWhitelist(EntityUid usedUid, ItemSlot slot) { if (_whitelistSystem.IsWhitelistFail(slot.Whitelist, usedUid) - || _whitelistSystem.IsBlacklistPass(slot.Blacklist, usedUid)) + || _whitelistSystem.IsWhitelistPass(slot.Blacklist, usedUid)) return false; return true; } diff --git a/Content.Shared/Disposal/Unit/SharedDisposalUnitSystem.cs b/Content.Shared/Disposal/Unit/SharedDisposalUnitSystem.cs index 292cfd2b3c..d4031b7d00 100644 --- a/Content.Shared/Disposal/Unit/SharedDisposalUnitSystem.cs +++ b/Content.Shared/Disposal/Unit/SharedDisposalUnitSystem.cs @@ -453,7 +453,7 @@ public abstract class SharedDisposalUnitSystem : EntitySystem if (!storable && !HasComp(entity)) return false; - if (_whitelistSystem.IsBlacklistPass(component.Blacklist, entity) || + if (_whitelistSystem.IsWhitelistPass(component.Blacklist, entity) || _whitelistSystem.IsWhitelistFail(component.Whitelist, entity)) return false; diff --git a/Content.Shared/Implants/SharedImplanterSystem.cs b/Content.Shared/Implants/SharedImplanterSystem.cs index 6431b3d42e..82cc4924fb 100644 --- a/Content.Shared/Implants/SharedImplanterSystem.cs +++ b/Content.Shared/Implants/SharedImplanterSystem.cs @@ -177,7 +177,7 @@ public abstract class SharedImplanterSystem : EntitySystem protected bool CheckTarget(EntityUid target, EntityWhitelist? whitelist, EntityWhitelist? blacklist) { return _whitelistSystem.IsWhitelistPassOrNull(whitelist, target) && - _whitelistSystem.IsBlacklistFailOrNull(blacklist, target); + _whitelistSystem.IsWhitelistFailOrNull(blacklist, target); } //Draw the implant out of the target diff --git a/Content.Shared/Inventory/InventorySystem.Equip.cs b/Content.Shared/Inventory/InventorySystem.Equip.cs index cb5ef864b9..23f658b50d 100644 --- a/Content.Shared/Inventory/InventorySystem.Equip.cs +++ b/Content.Shared/Inventory/InventorySystem.Equip.cs @@ -275,7 +275,7 @@ public abstract partial class InventorySystem } if (_whitelistSystem.IsWhitelistFail(slotDefinition.Whitelist, itemUid) || - _whitelistSystem.IsBlacklistPass(slotDefinition.Blacklist, itemUid)) + _whitelistSystem.IsWhitelistPass(slotDefinition.Blacklist, itemUid)) { reason = "inventory-component-can-equip-does-not-fit"; return false; diff --git a/Content.Shared/Materials/SharedMaterialReclaimerSystem.cs b/Content.Shared/Materials/SharedMaterialReclaimerSystem.cs index 8eb541ee59..7c2a3532fd 100644 --- a/Content.Shared/Materials/SharedMaterialReclaimerSystem.cs +++ b/Content.Shared/Materials/SharedMaterialReclaimerSystem.cs @@ -99,7 +99,7 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem return false; if (_whitelistSystem.IsWhitelistFail(component.Whitelist, item) || - _whitelistSystem.IsBlacklistPass(component.Blacklist, item)) + _whitelistSystem.IsWhitelistPass(component.Blacklist, item)) return false; if (Container.TryGetContainingContainer((item, null, null), out _) && !Container.TryRemoveFromContainer(item)) diff --git a/Content.Shared/Mind/Filters/ObjectiveMindFilter.cs b/Content.Shared/Mind/Filters/ObjectiveMindFilter.cs index 2d3cf6a263..5b64fc36c6 100644 --- a/Content.Shared/Mind/Filters/ObjectiveMindFilter.cs +++ b/Content.Shared/Mind/Filters/ObjectiveMindFilter.cs @@ -16,7 +16,7 @@ public sealed partial class ObjectiveMindFilter : MindFilter foreach (var obj in mind.Comp.Objectives) { // mind has a blacklisted objective, remove it from the pool - if (whitelistSys.IsBlacklistPass(Blacklist, obj)) + if (whitelistSys.IsWhitelistPass(Blacklist, obj)) return true; } diff --git a/Content.Shared/Polymorph/Systems/SharedChameleonProjectorSystem.cs b/Content.Shared/Polymorph/Systems/SharedChameleonProjectorSystem.cs index 3fd9ed07bd..6c686ff555 100644 --- a/Content.Shared/Polymorph/Systems/SharedChameleonProjectorSystem.cs +++ b/Content.Shared/Polymorph/Systems/SharedChameleonProjectorSystem.cs @@ -191,7 +191,7 @@ public abstract class SharedChameleonProjectorSystem : EntitySystem public bool IsInvalid(ChameleonProjectorComponent comp, EntityUid target) { return _whitelist.IsWhitelistFail(comp.Whitelist, target) - || _whitelist.IsBlacklistPass(comp.Blacklist, target); + || _whitelist.IsWhitelistPass(comp.Blacklist, target); } /// diff --git a/Content.Shared/Sound/SharedEmitSoundSystem.cs b/Content.Shared/Sound/SharedEmitSoundSystem.cs index 0e758ba0f1..ed1837e3f4 100644 --- a/Content.Shared/Sound/SharedEmitSoundSystem.cs +++ b/Content.Shared/Sound/SharedEmitSoundSystem.cs @@ -59,7 +59,7 @@ public abstract class SharedEmitSoundSystem : EntitySystem private void HandleEmitSoundOnUIOpen(EntityUid uid, EmitSoundOnUIOpenComponent component, AfterActivatableUIOpenEvent args) { - if (_whitelistSystem.IsBlacklistFail(component.Blacklist, args.User)) + if (_whitelistSystem.IsWhitelistFail(component.Blacklist, args.User)) { TryEmitSound(uid, component, args.User); } diff --git a/Content.Shared/StepTrigger/Systems/StepTriggerSystem.cs b/Content.Shared/StepTrigger/Systems/StepTriggerSystem.cs index d1443e5da2..f1d6a9c7dd 100644 --- a/Content.Shared/StepTrigger/Systems/StepTriggerSystem.cs +++ b/Content.Shared/StepTrigger/Systems/StepTriggerSystem.cs @@ -69,7 +69,7 @@ public sealed class StepTriggerSystem : EntitySystem if (ent == uid) continue; - if (_whitelistSystem.IsBlacklistPass(component.Blacklist, ent.Value)) + if (_whitelistSystem.IsWhitelistPass(component.Blacklist, ent.Value)) { return false; } diff --git a/Content.Shared/Sticky/Systems/StickySystem.cs b/Content.Shared/Sticky/Systems/StickySystem.cs index ea768fea93..bc04c81f55 100644 --- a/Content.Shared/Sticky/Systems/StickySystem.cs +++ b/Content.Shared/Sticky/Systems/StickySystem.cs @@ -68,7 +68,7 @@ public sealed class StickySystem : EntitySystem // check whitelist and blacklist if (_whitelist.IsWhitelistFail(comp.Whitelist, target) || - _whitelist.IsBlacklistPass(comp.Blacklist, target)) + _whitelist.IsWhitelistPass(comp.Blacklist, target)) return false; var attemptEv = new AttemptEntityStickEvent(target, user); diff --git a/Content.Shared/Storage/EntitySystems/SecretStashSystem.cs b/Content.Shared/Storage/EntitySystems/SecretStashSystem.cs index 273359e4d3..5118c6ae0b 100644 --- a/Content.Shared/Storage/EntitySystems/SecretStashSystem.cs +++ b/Content.Shared/Storage/EntitySystems/SecretStashSystem.cs @@ -107,7 +107,7 @@ public sealed class SecretStashSystem : EntitySystem // check if item is too big to fit into secret stash or is in the blacklist if (_item.GetSizePrototype(itemComp.Size) > _item.GetSizePrototype(entity.Comp.MaxItemSize) || - _whitelistSystem.IsBlacklistPass(entity.Comp.Blacklist, itemToHideUid)) + _whitelistSystem.IsWhitelistPass(entity.Comp.Blacklist, itemToHideUid)) { var msg = Loc.GetString("comp-secret-stash-action-hide-item-too-big", ("item", itemToHideUid), ("stashname", GetStashName(entity))); diff --git a/Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs b/Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs index cda5eb5263..6ede24e8b7 100644 --- a/Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs +++ b/Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs @@ -1058,7 +1058,7 @@ public abstract class SharedStorageSystem : EntitySystem } if (_whitelistSystem.IsWhitelistFail(storageComp.Whitelist, insertEnt) || - _whitelistSystem.IsBlacklistPass(storageComp.Blacklist, insertEnt)) + _whitelistSystem.IsWhitelistPass(storageComp.Blacklist, insertEnt)) { reason = "comp-storage-invalid-container"; return false; diff --git a/Content.Shared/Stunnable/SharedStunSystem.cs b/Content.Shared/Stunnable/SharedStunSystem.cs index 8bb5949c23..60d42ede62 100644 --- a/Content.Shared/Stunnable/SharedStunSystem.cs +++ b/Content.Shared/Stunnable/SharedStunSystem.cs @@ -119,7 +119,7 @@ public abstract partial class SharedStunSystem : EntitySystem if (args.OurFixtureId != ent.Comp.FixtureId) return; - if (_entityWhitelist.IsBlacklistPass(ent.Comp.Blacklist, args.OtherEntity)) + if (_entityWhitelist.IsWhitelistPass(ent.Comp.Blacklist, args.OtherEntity)) return; TryUpdateStunDuration(args.OtherEntity, ent.Comp.Duration); diff --git a/Content.Shared/Whitelist/EntityWhitelistSystem.cs b/Content.Shared/Whitelist/EntityWhitelistSystem.cs index b29adb8e35..bb4abe3197 100644 --- a/Content.Shared/Whitelist/EntityWhitelistSystem.cs +++ b/Content.Shared/Whitelist/EntityWhitelistSystem.cs @@ -125,42 +125,6 @@ public sealed class EntityWhitelistSystem : EntitySystem return !IsValid(whitelist, uid); } - /// - /// Helper function to determine if Blacklist is not null and entity is on list - /// Duplicate of equivalent Whitelist function - /// - public bool IsBlacklistPass(EntityWhitelist? blacklist, EntityUid uid) - { - return IsWhitelistPass(blacklist, uid); - } - - /// - /// Helper function to determine if Blacklist is not null and entity is not on the list - /// Duplicate of equivalent Whitelist function - /// - public bool IsBlacklistFail(EntityWhitelist? blacklist, EntityUid uid) - { - return IsWhitelistFail(blacklist, uid); - } - - /// - /// Helper function to determine if Blacklist is either null or the entity is on the list - /// Duplicate of equivalent Whitelist function - /// - public bool IsBlacklistPassOrNull(EntityWhitelist? blacklist, EntityUid uid) - { - return IsWhitelistPassOrNull(blacklist, uid); - } - - /// - /// Helper function to determine if Blacklist is either null or the entity is not on the list - /// Duplicate of equivalent Whitelist function - /// - public bool IsBlacklistFailOrNull(EntityWhitelist? blacklist, EntityUid uid) - { - return IsWhitelistFailOrNull(blacklist, uid); - } - private List? StringsToRegs(string[]? input) { if (input == null || input.Length == 0)