Replace obsolete EntityWhitelist IsValid usages part 2 (#28506)
This commit is contained in:
@@ -22,6 +22,7 @@ public sealed class TargetOutlineSystem : EntitySystem
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
private bool _enabled = false;
|
||||
|
||||
@@ -137,7 +138,7 @@ public sealed class TargetOutlineSystem : EntitySystem
|
||||
|
||||
// check the entity whitelist
|
||||
if (valid && Whitelist != null)
|
||||
valid = Whitelist.IsValid(entity);
|
||||
valid = _whitelistSystem.IsWhitelistPass(Whitelist, entity);
|
||||
|
||||
// and check the cancellable event
|
||||
if (valid && ValidationEvent != null)
|
||||
|
||||
@@ -81,6 +81,7 @@ public partial class ChatSystem
|
||||
bool ignoreActionBlocker = false
|
||||
)
|
||||
{
|
||||
|
||||
if (_whitelistSystem.IsWhitelistFail(emote.Whitelist, source) || _whitelistSystem.IsBlacklistPass(emote.Blacklist, source))
|
||||
return;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Content.Shared.Chemistry.Reaction;
|
||||
using Content.Shared.Chemistry.Reaction;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Content.Shared.Maps;
|
||||
@@ -47,7 +47,8 @@ public sealed partial class CreateEntityTileReaction : ITileReaction
|
||||
int acc = 0;
|
||||
foreach (var ent in tile.GetEntitiesInTile())
|
||||
{
|
||||
if (Whitelist.IsValid(ent))
|
||||
var whitelistSystem = entityManager.System<EntityWhitelistSystem>();
|
||||
if (whitelistSystem.IsWhitelistPass(Whitelist, ent))
|
||||
acc += 1;
|
||||
|
||||
if (acc >= MaxOnTile)
|
||||
|
||||
@@ -14,6 +14,7 @@ using Content.Shared.Hands.EntitySystems;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.Storage;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Player;
|
||||
@@ -30,6 +31,7 @@ namespace Content.Server.Construction
|
||||
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
|
||||
[Dependency] private readonly EntityLookupSystem _lookupSystem = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
// --- WARNING! LEGACY CODE AHEAD! ---
|
||||
// This entire file contains the legacy code for initial construction.
|
||||
@@ -337,7 +339,7 @@ namespace Content.Server.Construction
|
||||
return false;
|
||||
}
|
||||
|
||||
if (constructionPrototype.EntityWhitelist != null && !constructionPrototype.EntityWhitelist.IsValid(user))
|
||||
if (_whitelistSystem.IsWhitelistFail(constructionPrototype.EntityWhitelist, user))
|
||||
{
|
||||
_popup.PopupEntity(Loc.GetString("construction-system-cannot-start"), user, user);
|
||||
return false;
|
||||
@@ -422,7 +424,7 @@ namespace Content.Server.Construction
|
||||
return;
|
||||
}
|
||||
|
||||
if (constructionPrototype.EntityWhitelist != null && !constructionPrototype.EntityWhitelist.IsValid(user))
|
||||
if (_whitelistSystem.IsWhitelistFail(constructionPrototype.EntityWhitelist, user))
|
||||
{
|
||||
_popup.PopupEntity(Loc.GetString("construction-system-cannot-start"), user, user);
|
||||
return;
|
||||
|
||||
@@ -3,6 +3,7 @@ using Content.Server.GameTicking.Components;
|
||||
using Content.Server.GameTicking.Rules.Components;
|
||||
using Content.Server.GridPreloader;
|
||||
using Content.Server.Spawners.Components;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Server.Maps;
|
||||
using Robust.Shared.Map;
|
||||
@@ -19,6 +20,7 @@ public sealed class LoadMapRuleSystem : GameRuleSystem<LoadMapRuleComponent>
|
||||
[Dependency] private readonly MetaDataSystem _metaData = default!;
|
||||
[Dependency] private readonly TransformSystem _transform = default!;
|
||||
[Dependency] private readonly GridPreloaderSystem _gridPreloader = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -99,7 +101,7 @@ public sealed class LoadMapRuleSystem : GameRuleSystem<LoadMapRuleComponent>
|
||||
if (xform.GridUid == null || !ent.Comp.MapGrids.Contains(xform.GridUid.Value))
|
||||
continue;
|
||||
|
||||
if (ent.Comp.SpawnerWhitelist != null && !ent.Comp.SpawnerWhitelist.IsValid(uid, EntityManager))
|
||||
if (_whitelistSystem.IsWhitelistFail(ent.Comp.SpawnerWhitelist, uid))
|
||||
continue;
|
||||
|
||||
args.Coordinates.Add(_transform.GetMapCoordinates(xform));
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Content.Server.GameTicking.Rules.VariationPass.Components;
|
||||
using Content.Server.Wires;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Random;
|
||||
|
||||
namespace Content.Server.GameTicking.Rules.VariationPass;
|
||||
@@ -11,6 +12,8 @@ namespace Content.Server.GameTicking.Rules.VariationPass;
|
||||
/// </summary>
|
||||
public sealed class CutWireVariationPassSystem : VariationPassSystem<CutWireVariationPassComponent>
|
||||
{
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
protected override void ApplyVariation(Entity<CutWireVariationPassComponent> ent, ref StationVariationPassEvent args)
|
||||
{
|
||||
var wiresCut = 0;
|
||||
@@ -22,7 +25,7 @@ public sealed class CutWireVariationPassSystem : VariationPassSystem<CutWireVari
|
||||
continue;
|
||||
|
||||
// Check against blacklist
|
||||
if (ent.Comp.Blacklist.IsValid(uid))
|
||||
if (_whitelistSystem.IsBlacklistPass(ent.Comp.Blacklist, uid))
|
||||
continue;
|
||||
|
||||
if (Random.Prob(ent.Comp.WireCutChance))
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
using Content.Server.Administration.Logs;
|
||||
using Content.Server.Administration.Logs;
|
||||
using Content.Server.Hands.Systems;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.Item;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Server.Audio;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Map.Components;
|
||||
@@ -24,6 +25,7 @@ public sealed class RandomGiftSystem : EntitySystem
|
||||
[Dependency] private readonly IPrototypeManager _prototype = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
private readonly List<string> _possibleGiftsSafe = new();
|
||||
private readonly List<string> _possibleGiftsUnsafe = new();
|
||||
@@ -40,7 +42,7 @@ public sealed class RandomGiftSystem : EntitySystem
|
||||
|
||||
private void OnExamined(EntityUid uid, RandomGiftComponent component, ExaminedEvent args)
|
||||
{
|
||||
if (!component.ContentsViewers.IsValid(args.Examiner, EntityManager) || component.SelectedEntity is null)
|
||||
if (_whitelistSystem.IsWhitelistFail(component.ContentsViewers, args.Examiner) || component.SelectedEntity is null)
|
||||
return;
|
||||
|
||||
var name = _prototype.Index<EntityPrototype>(component.SelectedEntity).Name;
|
||||
|
||||
@@ -3,6 +3,7 @@ using Content.Shared.DoAfter;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Mech.Components;
|
||||
using Content.Shared.Mech.Equipment.Components;
|
||||
using Content.Shared.Whitelist;
|
||||
|
||||
namespace Content.Server.Mech.Systems;
|
||||
|
||||
@@ -14,6 +15,7 @@ public sealed class MechEquipmentSystem : EntitySystem
|
||||
[Dependency] private readonly MechSystem _mech = default!;
|
||||
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
|
||||
[Dependency] private readonly PopupSystem _popup = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Initialize()
|
||||
@@ -40,7 +42,7 @@ public sealed class MechEquipmentSystem : EntitySystem
|
||||
if (mechComp.EquipmentContainer.ContainedEntities.Count >= mechComp.MaxEquipmentAmount)
|
||||
return;
|
||||
|
||||
if (mechComp.EquipmentWhitelist != null && !mechComp.EquipmentWhitelist.IsValid(args.Used))
|
||||
if (_whitelistSystem.IsWhitelistFail(mechComp.EquipmentWhitelist, args.Used))
|
||||
return;
|
||||
|
||||
_popup.PopupEntity(Loc.GetString("mech-equipment-begin-install", ("item", uid)), mech);
|
||||
|
||||
@@ -22,6 +22,7 @@ using Robust.Server.Containers;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Player;
|
||||
using Content.Shared.Whitelist;
|
||||
|
||||
namespace Content.Server.Mech.Systems;
|
||||
|
||||
@@ -36,6 +37,7 @@ public sealed partial class MechSystem : SharedMechSystem
|
||||
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
|
||||
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
||||
[Dependency] private readonly UserInterfaceSystem _ui = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
[Dependency] private readonly SharedToolSystem _toolSystem = default!;
|
||||
|
||||
/// <inheritdoc/>
|
||||
@@ -224,7 +226,7 @@ public sealed partial class MechSystem : SharedMechSystem
|
||||
if (args.Cancelled || args.Handled)
|
||||
return;
|
||||
|
||||
if (component.PilotWhitelist != null && !component.PilotWhitelist.IsValid(args.User))
|
||||
if (_whitelistSystem.IsWhitelistFail(component.PilotWhitelist, args.User))
|
||||
{
|
||||
_popup.PopupEntity(Loc.GetString("mech-no-enter", ("item", uid)), args.User);
|
||||
return;
|
||||
|
||||
@@ -9,6 +9,7 @@ using Content.Shared.Stunnable;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Timing;
|
||||
using Content.Shared.Whitelist;
|
||||
|
||||
namespace Content.Server.Ninja.Systems;
|
||||
|
||||
@@ -24,6 +25,7 @@ public sealed class StunProviderSystem : SharedStunProviderSystem
|
||||
[Dependency] private readonly SharedNinjaGlovesSystem _gloves = default!;
|
||||
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
||||
[Dependency] private readonly SharedStunSystem _stun = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -42,7 +44,7 @@ public sealed class StunProviderSystem : SharedStunProviderSystem
|
||||
if (args.Handled || comp.BatteryUid == null || !_gloves.AbilityCheck(uid, args, out var target))
|
||||
return;
|
||||
|
||||
if (target == uid || !comp.Whitelist.IsValid(target, EntityManager))
|
||||
if (target == uid || _whitelistSystem.IsWhitelistFail(comp.Whitelist, target))
|
||||
return;
|
||||
|
||||
if (_timing.CurTime < comp.NextStun)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Content.Server.Administration.Logs;
|
||||
using Content.Server.Administration.Logs;
|
||||
using Content.Server.Popups;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.IdentityManagement;
|
||||
@@ -9,6 +9,7 @@ using Content.Shared.Nutrition.AnimalHusbandry;
|
||||
using Content.Shared.Nutrition.Components;
|
||||
using Content.Shared.Nutrition.EntitySystems;
|
||||
using Content.Shared.Storage;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
@@ -33,6 +34,7 @@ public sealed class AnimalHusbandrySystem : EntitySystem
|
||||
[Dependency] private readonly PopupSystem _popup = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
private readonly HashSet<EntityUid> _failedAttempts = new();
|
||||
private readonly HashSet<EntityUid> _birthQueue = new();
|
||||
@@ -174,7 +176,7 @@ public sealed class AnimalHusbandrySystem : EntitySystem
|
||||
if (!CanReproduce(partner))
|
||||
return false;
|
||||
|
||||
return component.PartnerWhitelist.IsValid(partner);
|
||||
return _whitelistSystem.IsWhitelistPass(component.PartnerWhitelist, partner);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -32,6 +32,7 @@ using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Utility;
|
||||
using System.Linq;
|
||||
using Robust.Server.GameObjects;
|
||||
using Content.Shared.Whitelist;
|
||||
|
||||
namespace Content.Server.Nutrition.EntitySystems;
|
||||
|
||||
@@ -57,6 +58,7 @@ public sealed class FoodSystem : EntitySystem
|
||||
[Dependency] private readonly StackSystem _stack = default!;
|
||||
[Dependency] private readonly StomachSystem _stomach = default!;
|
||||
[Dependency] private readonly UtensilSystem _utensil = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
public const float MaxFeedDistance = 1.0f;
|
||||
|
||||
@@ -408,7 +410,7 @@ public sealed class FoodSystem : EntitySystem
|
||||
if (comp.SpecialDigestible == null)
|
||||
continue;
|
||||
// Check if the food is in the whitelist
|
||||
if (comp.SpecialDigestible.IsValid(food, EntityManager))
|
||||
if (_whitelistSystem.IsWhitelistPass(comp.SpecialDigestible, food))
|
||||
return true;
|
||||
// They can only eat whitelist food and the food isn't in the whitelist. It's not edible.
|
||||
return false;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Content.Server.Objectives.Components;
|
||||
using Content.Shared.Objectives.Components;
|
||||
using Content.Shared.Whitelist;
|
||||
|
||||
namespace Content.Server.Objectives.Systems;
|
||||
|
||||
@@ -8,6 +9,8 @@ namespace Content.Server.Objectives.Systems;
|
||||
/// </summary>
|
||||
public sealed class ObjectiveBlacklistRequirementSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -22,7 +25,7 @@ public sealed class ObjectiveBlacklistRequirementSystem : EntitySystem
|
||||
|
||||
foreach (var objective in args.Mind.AllObjectives)
|
||||
{
|
||||
if (comp.Blacklist.IsValid(objective, EntityManager))
|
||||
if (_whitelistSystem.IsBlacklistPass(comp.Blacklist, objective))
|
||||
{
|
||||
args.Cancelled = true;
|
||||
return;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Content.Server.Objectives.Components;
|
||||
using Content.Shared.Objectives.Components;
|
||||
using Content.Shared.Whitelist;
|
||||
|
||||
namespace Content.Server.Objectives.Systems;
|
||||
|
||||
@@ -8,6 +9,7 @@ namespace Content.Server.Objectives.Systems;
|
||||
/// </summary>
|
||||
public sealed class RoleRequirementSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -22,7 +24,7 @@ public sealed class RoleRequirementSystem : EntitySystem
|
||||
|
||||
// this whitelist trick only works because roles are components on the mind and not entities
|
||||
// if that gets reworked then this will need changing
|
||||
if (!comp.Roles.IsValid(args.MindId, EntityManager))
|
||||
if (_whitelistSystem.IsWhitelistFail(comp.Roles, args.MindId))
|
||||
args.Cancelled = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Content.Server.Polymorph.Components;
|
||||
using Content.Shared.Polymorph;
|
||||
using Content.Shared.Projectiles;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Physics.Events;
|
||||
using Robust.Shared.Prototypes;
|
||||
@@ -9,6 +10,8 @@ namespace Content.Server.Polymorph.Systems;
|
||||
|
||||
public partial class PolymorphSystem
|
||||
{
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Need to do this so we don't get a collection enumeration error in physics by polymorphing
|
||||
/// an entity we're colliding with
|
||||
@@ -39,8 +42,8 @@ public partial class PolymorphSystem
|
||||
return;
|
||||
|
||||
var other = args.OtherEntity;
|
||||
if (!component.Whitelist.IsValid(other, EntityManager)
|
||||
|| component.Blacklist != null && component.Blacklist.IsValid(other, EntityManager))
|
||||
if (_whitelistSystem.IsWhitelistFail(component.Whitelist, other) ||
|
||||
_whitelistSystem.IsBlacklistPass(component.Blacklist, other))
|
||||
return;
|
||||
|
||||
_queuedPolymorphUpdates.Enqueue(new (other, component.Sound, component.Polymorph));
|
||||
|
||||
@@ -7,6 +7,7 @@ using Content.Shared.Interaction;
|
||||
using Content.Shared.Sticky;
|
||||
using Content.Shared.Sticky.Components;
|
||||
using Content.Shared.Verbs;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
@@ -20,6 +21,7 @@ public sealed class StickySystem : EntitySystem
|
||||
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
|
||||
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
private const string StickerSlotId = "stickers_container";
|
||||
|
||||
@@ -67,9 +69,8 @@ public sealed class StickySystem : EntitySystem
|
||||
return false;
|
||||
|
||||
// check whitelist and blacklist
|
||||
if (component.Whitelist != null && !component.Whitelist.IsValid(target))
|
||||
return false;
|
||||
if (component.Blacklist != null && component.Blacklist.IsValid(target))
|
||||
if (_whitelistSystem.IsWhitelistFail(component.Whitelist, target) ||
|
||||
_whitelistSystem.IsBlacklistPass(component.Blacklist, target))
|
||||
return false;
|
||||
|
||||
var attemptEv = new AttemptEntityStickEvent(target, user);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Content.Shared.Storage;
|
||||
using Content.Shared.Storage;
|
||||
using Content.Shared.Storage.Components;
|
||||
using Content.Shared.Storage.EntitySystems;
|
||||
using Content.Shared.Whitelist;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Containers;
|
||||
|
||||
@@ -9,6 +10,7 @@ namespace Content.Server.Storage.EntitySystems
|
||||
[UsedImplicitly]
|
||||
public sealed class ItemCounterSystem : SharedItemCounterSystem
|
||||
{
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
protected override int? GetCount(ContainerModifiedMessage msg, ItemCounterComponent itemCounter)
|
||||
{
|
||||
if (!EntityManager.TryGetComponent(msg.Container.Owner, out StorageComponent? component))
|
||||
@@ -19,7 +21,7 @@ namespace Content.Server.Storage.EntitySystems
|
||||
var count = 0;
|
||||
foreach (var entity in component.Container.ContainedEntities)
|
||||
{
|
||||
if (itemCounter.Count.IsValid(entity))
|
||||
if (_whitelistSystem.IsWhitelistPass(itemCounter.Count, entity))
|
||||
count++;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,18 +23,11 @@ public sealed partial class BuyerWhitelistCondition : ListingCondition
|
||||
public override bool Condition(ListingConditionArgs args)
|
||||
{
|
||||
var ent = args.EntityManager;
|
||||
var whitelistSystem = ent.System<EntityWhitelistSystem>();
|
||||
|
||||
if (Whitelist != null)
|
||||
{
|
||||
if (!Whitelist.IsValid(args.Buyer, ent))
|
||||
if (whitelistSystem.IsWhitelistFail(Whitelist, args.Buyer) ||
|
||||
whitelistSystem.IsBlacklistPass(Blacklist, args.Buyer))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Blacklist != null)
|
||||
{
|
||||
if (Blacklist.IsValid(args.Buyer, ent))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -26,18 +26,11 @@ public sealed partial class StoreWhitelistCondition : ListingCondition
|
||||
return false;
|
||||
|
||||
var ent = args.EntityManager;
|
||||
var whitelistSystem = ent.System<EntityWhitelistSystem>();
|
||||
|
||||
if (Whitelist != null)
|
||||
{
|
||||
if (!Whitelist.IsValid(args.StoreEntity.Value, ent))
|
||||
if (whitelistSystem.IsWhitelistFail(Whitelist, args.StoreEntity.Value) ||
|
||||
whitelistSystem.IsBlacklistPass(Blacklist, args.StoreEntity.Value))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Blacklist != null)
|
||||
{
|
||||
if (Blacklist.IsValid(args.StoreEntity.Value, ent))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Content.Server.Chat.Systems;
|
||||
using Content.Server.Speech;
|
||||
using Content.Server.Speech.Components;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Player;
|
||||
using static Content.Server.Chat.Systems.ChatSystem;
|
||||
|
||||
@@ -9,7 +10,7 @@ namespace Content.Server.SurveillanceCamera;
|
||||
public sealed class SurveillanceCameraMicrophoneSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedTransformSystem _xforms = default!;
|
||||
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -60,7 +61,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 (microphone.Blacklist.IsValid(args.Source))
|
||||
if (_whitelistSystem.IsBlacklistPass(microphone.Blacklist, args.Source))
|
||||
args.Cancel();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ using Content.Server.GameTicking;
|
||||
using Content.Shared.Hands.Components;
|
||||
using Content.Shared.Hands.EntitySystems;
|
||||
using Content.Shared.Traits;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.Manager;
|
||||
|
||||
@@ -12,6 +13,7 @@ public sealed class TraitSystem : EntitySystem
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly ISerializationManager _serializationManager = default!;
|
||||
[Dependency] private readonly SharedHandsSystem _sharedHandsSystem = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -31,10 +33,8 @@ public sealed class TraitSystem : EntitySystem
|
||||
return;
|
||||
}
|
||||
|
||||
if (traitPrototype.Whitelist != null && !traitPrototype.Whitelist.IsValid(args.Mob))
|
||||
continue;
|
||||
|
||||
if (traitPrototype.Blacklist != null && traitPrototype.Blacklist.IsValid(args.Mob))
|
||||
if (_whitelistSystem.IsWhitelistFail(traitPrototype.Whitelist, args.Mob) ||
|
||||
_whitelistSystem.IsBlacklistPass(traitPrototype.Blacklist, args.Mob))
|
||||
continue;
|
||||
|
||||
// Add all components required by the prototype
|
||||
|
||||
@@ -8,6 +8,7 @@ using Content.Server.Xenoarchaeology.XenoArtifacts;
|
||||
using Content.Shared.Body.Components;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Verbs;
|
||||
using Content.Shared.Whitelist;
|
||||
using Content.Shared.Xenoarchaeology.Equipment;
|
||||
using Robust.Shared.Collections;
|
||||
using Robust.Shared.Random;
|
||||
@@ -25,6 +26,7 @@ public sealed class ArtifactCrusherSystem : SharedArtifactCrusherSystem
|
||||
[Dependency] private readonly DamageableSystem _damageable = default!;
|
||||
[Dependency] private readonly StackSystem _stack = default!;
|
||||
[Dependency] private readonly PopupSystem _popup = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Initialize()
|
||||
@@ -92,7 +94,7 @@ public sealed class ArtifactCrusherSystem : SharedArtifactCrusherSystem
|
||||
var coords = Transform(ent).Coordinates;
|
||||
foreach (var contained in contents)
|
||||
{
|
||||
if (crusher.CrushingWhitelist.IsValid(contained, EntityManager))
|
||||
if (_whitelistSystem.IsWhitelistPass(crusher.CrushingWhitelist, contained))
|
||||
{
|
||||
var amount = _random.Next(crusher.MinFragments, crusher.MaxFragments);
|
||||
var stacks = _stack.SpawnMultiple(crusher.FragmentStackProtoId, amount, coords);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
|
||||
using Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
|
||||
using Content.Server.Xenoarchaeology.XenoArtifacts.Events;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Random;
|
||||
|
||||
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Systems;
|
||||
@@ -10,6 +11,7 @@ public sealed class BreakWindowArtifactSystem : EntitySystem
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly EntityLookupSystem _lookup = default!;
|
||||
[Dependency] private readonly DamageableSystem _damageable = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Initialize()
|
||||
@@ -24,7 +26,7 @@ public sealed class BreakWindowArtifactSystem : EntitySystem
|
||||
ents.Add(args.Activator.Value);
|
||||
foreach (var ent in ents)
|
||||
{
|
||||
if (component.Whitelist != null && !component.Whitelist.IsValid(ent))
|
||||
if (_whitelistSystem.IsWhitelistFail(component.Whitelist, ent))
|
||||
continue;
|
||||
|
||||
if (!_random.Prob(component.DamageChance))
|
||||
|
||||
@@ -9,6 +9,7 @@ using Content.Shared.Interaction;
|
||||
using Content.Shared.Inventory.Events;
|
||||
using Content.Shared.Mind;
|
||||
using Content.Shared.Rejuvenate;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameStates;
|
||||
@@ -29,6 +30,7 @@ public abstract class SharedActionsSystem : EntitySystem
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
|
||||
[Dependency] private readonly ActionContainerSystem _actionContainer = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -477,7 +479,7 @@ public abstract class SharedActionsSystem : EntitySystem
|
||||
if (!target.IsValid() || Deleted(target))
|
||||
return false;
|
||||
|
||||
if (action.Whitelist != null && !action.Whitelist.IsValid(target, EntityManager))
|
||||
if (_whitelistSystem.IsWhitelistFail(action.Whitelist, target))
|
||||
return false;
|
||||
|
||||
if (action.CheckCanInteract && !_actionBlockerSystem.CanInteract(user, target))
|
||||
|
||||
@@ -15,6 +15,7 @@ using Content.Shared.Storage.Components;
|
||||
using Content.Shared.Stunnable;
|
||||
using Content.Shared.Throwing;
|
||||
using Content.Shared.Verbs;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Physics.Events;
|
||||
using Robust.Shared.Utility;
|
||||
@@ -24,6 +25,8 @@ namespace Content.Shared.Buckle;
|
||||
|
||||
public abstract partial class SharedBuckleSystem
|
||||
{
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
private void InitializeBuckle()
|
||||
{
|
||||
SubscribeLocalEvent<BuckleComponent, ComponentStartup>(OnBuckleComponentStartup);
|
||||
@@ -224,8 +227,8 @@ public abstract partial class SharedBuckleSystem
|
||||
}
|
||||
|
||||
// Does it pass the Whitelist
|
||||
if (strapComp.Whitelist != null &&
|
||||
!strapComp.Whitelist.IsValid(buckleUid, EntityManager) || strapComp.Blacklist?.IsValid(buckleUid, EntityManager) == true)
|
||||
if (_whitelistSystem.IsWhitelistFail(strapComp.Whitelist, buckleUid) ||
|
||||
_whitelistSystem.IsBlacklistPass(strapComp.Blacklist, buckleUid))
|
||||
{
|
||||
if (_netManager.IsServer)
|
||||
_popup.PopupEntity(Loc.GetString("buckle-component-cannot-fit-message"), userUid, buckleUid, PopupType.Medium);
|
||||
|
||||
@@ -31,7 +31,8 @@ public sealed partial class EntityWhitelistCondition : IConstructionCondition
|
||||
|
||||
public bool Condition(EntityUid user, EntityCoordinates location, Direction direction)
|
||||
{
|
||||
return Whitelist.IsValid(user);
|
||||
var whitelistSystem = IoCManager.Resolve<IEntityManager>().System<EntityWhitelistSystem>();
|
||||
return whitelistSystem.IsWhitelistPass(Whitelist, user);
|
||||
}
|
||||
|
||||
public ConstructionGuideEntry GenerateGuideEntry()
|
||||
|
||||
@@ -11,6 +11,7 @@ using Content.Shared.Item;
|
||||
using Content.Shared.Movement.Systems;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Strip.Components;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Timing;
|
||||
@@ -30,6 +31,7 @@ public abstract partial class InventorySystem
|
||||
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
[ValidatePrototypeId<ItemSizePrototype>]
|
||||
private const string PocketableItemSize = "Small";
|
||||
@@ -267,13 +269,8 @@ public abstract partial class InventorySystem
|
||||
return false;
|
||||
}
|
||||
|
||||
if (slotDefinition.Whitelist != null && !slotDefinition.Whitelist.IsValid(itemUid))
|
||||
{
|
||||
reason = "inventory-component-can-equip-does-not-fit";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (slotDefinition.Blacklist != null && slotDefinition.Blacklist.IsValid(itemUid))
|
||||
if (_whitelistSystem.IsWhitelistFail(slotDefinition.Whitelist, itemUid) ||
|
||||
_whitelistSystem.IsBlacklistPass(slotDefinition.Blacklist, itemUid))
|
||||
{
|
||||
reason = "inventory-component-can-equip-does-not-fit";
|
||||
return false;
|
||||
|
||||
@@ -4,6 +4,7 @@ using Content.Shared.Interaction;
|
||||
using Content.Shared.Labels.Components;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Verbs;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Network;
|
||||
|
||||
@@ -16,6 +17,7 @@ public abstract class SharedHandLabelerSystem : EntitySystem
|
||||
[Dependency] private readonly SharedLabelSystem _labelSystem = default!;
|
||||
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly INetManager _netManager = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -77,7 +79,7 @@ public abstract class SharedHandLabelerSystem : EntitySystem
|
||||
|
||||
private void OnUtilityVerb(EntityUid uid, HandLabelerComponent handLabeler, GetVerbsEvent<UtilityVerb> args)
|
||||
{
|
||||
if (args.Target is not { Valid: true } target || !handLabeler.Whitelist.IsValid(target) || !args.CanAccess)
|
||||
if (args.Target is not { Valid: true } target || _whitelistSystem.IsWhitelistFail(handLabeler.Whitelist, target) || !args.CanAccess)
|
||||
return;
|
||||
|
||||
var labelerText = handLabeler.AssignedLabel == string.Empty ? Loc.GetString("hand-labeler-remove-label-text") : Loc.GetString("hand-labeler-add-label-text");
|
||||
@@ -96,7 +98,7 @@ public abstract class SharedHandLabelerSystem : EntitySystem
|
||||
|
||||
private void AfterInteractOn(EntityUid uid, HandLabelerComponent handLabeler, AfterInteractEvent args)
|
||||
{
|
||||
if (args.Target is not { Valid: true } target || !handLabeler.Whitelist.IsValid(target) || !args.CanReach)
|
||||
if (args.Target is not { Valid: true } target || _whitelistSystem.IsWhitelistFail(handLabeler.Whitelist, target) || !args.CanReach)
|
||||
return;
|
||||
|
||||
Labeling(uid, target, args.User, handLabeler);
|
||||
|
||||
@@ -9,6 +9,7 @@ using Content.Shared.Emag.Systems;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Mobs.Components;
|
||||
using Content.Shared.Stacks;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Containers;
|
||||
@@ -29,6 +30,7 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
|
||||
[Dependency] protected readonly SharedAmbientSoundSystem AmbientSound = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] protected readonly SharedContainerSystem Container = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
public const string ActiveReclaimerContainerId = "active-material-reclaimer-container";
|
||||
|
||||
@@ -91,10 +93,8 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
|
||||
if (HasComp<MobStateComponent>(item) && !CanGib(uid, item, component)) // whitelist? We be gibbing, boy!
|
||||
return false;
|
||||
|
||||
if (component.Whitelist is {} whitelist && !whitelist.IsValid(item))
|
||||
return false;
|
||||
|
||||
if (component.Blacklist is {} blacklist && blacklist.IsValid(item))
|
||||
if (_whitelistSystem.IsWhitelistFail(component.Whitelist, item) ||
|
||||
_whitelistSystem.IsBlacklistPass(component.Blacklist, item))
|
||||
return false;
|
||||
|
||||
if (Container.TryGetContainingContainer(item, out _) && !Container.TryRemoveFromContainer(item))
|
||||
|
||||
@@ -15,6 +15,7 @@ using Content.Shared.Movement.Components;
|
||||
using Content.Shared.Movement.Systems;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Weapons.Melee;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Serialization;
|
||||
@@ -37,6 +38,7 @@ public abstract class SharedMechSystem : EntitySystem
|
||||
[Dependency] private readonly SharedMoverController _mover = default!;
|
||||
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
||||
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Initialize()
|
||||
@@ -216,7 +218,7 @@ public abstract class SharedMechSystem : EntitySystem
|
||||
if (component.EquipmentContainer.ContainedEntities.Count >= component.MaxEquipmentAmount)
|
||||
return;
|
||||
|
||||
if (component.EquipmentWhitelist != null && !component.EquipmentWhitelist.IsValid(toInsert))
|
||||
if (_whitelistSystem.IsWhitelistFail(component.EquipmentWhitelist, toInsert))
|
||||
return;
|
||||
|
||||
equipmentComponent.EquipmentOwner = uid;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Content.Shared.Movement.Components;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Physics.Events;
|
||||
using Robust.Shared.Physics.Systems;
|
||||
@@ -9,6 +10,7 @@ public sealed class SpeedModifierContactsSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
|
||||
[Dependency] private readonly MovementSpeedModifierSystem _speedModifierSystem = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
// TODO full-game-save
|
||||
// Either these need to be processed before a map is saved, or slowed/slowing entities need to update on init.
|
||||
@@ -86,7 +88,7 @@ public sealed class SpeedModifierContactsSystem : EntitySystem
|
||||
if (!TryComp<SpeedModifierContactsComponent>(ent, out var slowContactsComponent))
|
||||
continue;
|
||||
|
||||
if (slowContactsComponent.IgnoreWhitelist != null && slowContactsComponent.IgnoreWhitelist.IsValid(uid))
|
||||
if (_whitelistSystem.IsWhitelistPass(slowContactsComponent.IgnoreWhitelist, uid))
|
||||
continue;
|
||||
|
||||
walkSpeed += slowContactsComponent.WalkSpeedModifier;
|
||||
|
||||
@@ -17,6 +17,7 @@ public sealed class EmagProviderSystem : EntitySystem
|
||||
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly SharedNinjaGlovesSystem _gloves = default!;
|
||||
[Dependency] private readonly TagSystem _tags = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -35,7 +36,7 @@ public sealed class EmagProviderSystem : EntitySystem
|
||||
return;
|
||||
|
||||
// only allowed to emag entities on the whitelist
|
||||
if (comp.Whitelist != null && !comp.Whitelist.IsValid(target, EntityManager))
|
||||
if (_whitelistSystem.IsWhitelistFail(comp.Whitelist, target))
|
||||
return;
|
||||
|
||||
// only allowed to emag non-immune entities
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Robust.Shared.Physics.Events;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Physics.Events;
|
||||
using Robust.Shared.Physics.Systems;
|
||||
|
||||
namespace Content.Shared.Placeable;
|
||||
@@ -11,6 +12,7 @@ public sealed class ItemPlacerSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly CollisionWakeSystem _wake = default!;
|
||||
[Dependency] private readonly PlaceableSurfaceSystem _placeableSurface = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -22,7 +24,7 @@ public sealed class ItemPlacerSystem : EntitySystem
|
||||
|
||||
private void OnStartCollide(EntityUid uid, ItemPlacerComponent comp, ref StartCollideEvent args)
|
||||
{
|
||||
if (comp.Whitelist != null && !comp.Whitelist.IsValid(args.OtherEntity))
|
||||
if (_whitelistSystem.IsWhitelistFail(comp.Whitelist, args.OtherEntity))
|
||||
return;
|
||||
|
||||
if (TryComp<CollisionWakeComponent>(args.OtherEntity, out var wakeComp))
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Numerics;
|
||||
using Content.Shared.Access.Components;
|
||||
using Content.Shared.Access.Systems;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Map.Components;
|
||||
using Robust.Shared.Physics.Components;
|
||||
@@ -14,7 +15,7 @@ public sealed class RulesSystem : EntitySystem
|
||||
[Dependency] private readonly AccessReaderSystem _reader = default!;
|
||||
[Dependency] private readonly EntityLookupSystem _lookup = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
public bool IsTrue(EntityUid uid, RulesPrototype rules)
|
||||
{
|
||||
var inRange = new HashSet<Entity<IComponent>>();
|
||||
@@ -158,7 +159,7 @@ public sealed class RulesSystem : EntitySystem
|
||||
|
||||
foreach (var ent in _lookup.GetEntitiesInRange(xform.MapID, worldPos, entity.Range))
|
||||
{
|
||||
if (!entity.Whitelist.IsValid(ent, EntityManager))
|
||||
if (_whitelistSystem.IsWhitelistFail(entity.Whitelist, ent))
|
||||
continue;
|
||||
|
||||
count++;
|
||||
|
||||
@@ -8,6 +8,7 @@ using Content.Shared.Mobs;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Sound.Components;
|
||||
using Content.Shared.Throwing;
|
||||
using Content.Shared.Whitelist;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
@@ -34,6 +35,7 @@ public abstract class SharedEmitSoundSystem : EntitySystem
|
||||
[Dependency] private readonly SharedAmbientSoundSystem _ambient = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audioSystem = default!;
|
||||
[Dependency] protected readonly SharedPopupSystem Popup = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -123,7 +125,7 @@ public abstract class SharedEmitSoundSystem : EntitySystem
|
||||
|
||||
private void OnEmitSoundOnInteractUsing(Entity<EmitSoundOnInteractUsingComponent> ent, ref InteractUsingEvent args)
|
||||
{
|
||||
if (ent.Comp.Whitelist.IsValid(args.Used, EntityManager))
|
||||
if (_whitelistSystem.IsWhitelistPass(ent.Comp.Whitelist, args.Used))
|
||||
{
|
||||
TryEmitSound(ent, ent.Comp, args.User);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Content.Shared.Gravity;
|
||||
using Content.Shared.StepTrigger.Components;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Map.Components;
|
||||
using Robust.Shared.Physics;
|
||||
using Robust.Shared.Physics.Components;
|
||||
@@ -12,6 +13,7 @@ public sealed class StepTriggerSystem : EntitySystem
|
||||
[Dependency] private readonly EntityLookupSystem _entityLookup = default!;
|
||||
[Dependency] private readonly SharedGravitySystem _gravity = default!;
|
||||
[Dependency] private readonly SharedMapSystem _map = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -67,7 +69,7 @@ public sealed class StepTriggerSystem : EntitySystem
|
||||
if (ent == uid)
|
||||
continue;
|
||||
|
||||
if (component.Blacklist.IsValid(ent.Value, EntityManager) == true)
|
||||
if (_whitelistSystem.IsBlacklistPass(component.Blacklist, ent.Value))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using Content.Shared.Administration.Logs;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.Examine;
|
||||
@@ -7,6 +7,7 @@ using Content.Shared.Interaction;
|
||||
using Content.Shared.Item;
|
||||
using Content.Shared.Storage.Components;
|
||||
using Content.Shared.Verbs;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Network;
|
||||
|
||||
@@ -21,6 +22,7 @@ public sealed class BinSystem : EntitySystem
|
||||
[Dependency] private readonly ISharedAdminLogManager _admin = default!;
|
||||
[Dependency] private readonly SharedContainerSystem _container = default!;
|
||||
[Dependency] private readonly SharedHandsSystem _hands = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
public const string BinContainerId = "bin-container";
|
||||
|
||||
@@ -130,7 +132,7 @@ public sealed class BinSystem : EntitySystem
|
||||
if (component.Items.Count >= component.MaxItems)
|
||||
return false;
|
||||
|
||||
if (component.Whitelist != null && !component.Whitelist.IsValid(toInsert))
|
||||
if (_whitelistSystem.IsWhitelistFail(component.Whitelist, toInsert))
|
||||
return false;
|
||||
|
||||
_container.Insert(toInsert, component.ItemContainer);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using Content.Shared.Storage.Components;
|
||||
using Content.Shared.Whitelist;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Containers;
|
||||
|
||||
@@ -15,6 +16,7 @@ namespace Content.Shared.Storage.EntitySystems
|
||||
{
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly SharedContainerSystem _container = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Initialize()
|
||||
@@ -93,7 +95,7 @@ namespace Content.Shared.Storage.EntitySystems
|
||||
var list = new List<string>();
|
||||
foreach (var mapLayerData in itemMapper.MapLayers.Values)
|
||||
{
|
||||
var count = containedLayers.Count(ent => mapLayerData.ServerWhitelist.IsValid(ent));
|
||||
var count = containedLayers.Count(ent => _whitelistSystem.IsWhitelistPass(mapLayerData.ServerWhitelist, ent));
|
||||
if (count >= mapLayerData.MinCount && count <= mapLayerData.MaxCount)
|
||||
{
|
||||
list.Add(mapLayerData.Layer);
|
||||
|
||||
@@ -4,6 +4,7 @@ using Content.Shared.Interaction;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Teleportation.Components;
|
||||
using Content.Shared.Verbs;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Map.Components;
|
||||
@@ -24,6 +25,7 @@ public sealed class SwapTeleporterSystem : EntitySystem
|
||||
[Dependency] private readonly SharedContainerSystem _container = default!;
|
||||
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
private EntityQuery<TransformComponent> _xformQuery;
|
||||
|
||||
@@ -51,8 +53,8 @@ public sealed class SwapTeleporterSystem : EntitySystem
|
||||
if (!TryComp<SwapTeleporterComponent>(target, out var targetComp))
|
||||
return;
|
||||
|
||||
if (!comp.TeleporterWhitelist.IsValid(target, EntityManager) ||
|
||||
!targetComp.TeleporterWhitelist.IsValid(uid, EntityManager))
|
||||
if (_whitelistSystem.IsWhitelistFail(comp.TeleporterWhitelist, target) ||
|
||||
_whitelistSystem.IsWhitelistFail(targetComp.TeleporterWhitelist, uid))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ using Content.Shared.Interaction;
|
||||
using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Verbs;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Shared.UserInterface;
|
||||
@@ -19,6 +20,7 @@ public sealed partial class ActivatableUISystem : EntitySystem
|
||||
[Dependency] private readonly SharedUserInterfaceSystem _uiSystem = default!;
|
||||
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly SharedHandsSystem _hands = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -96,7 +98,7 @@ public sealed partial class ActivatableUISystem : EntitySystem
|
||||
if (!args.CanAccess)
|
||||
return false;
|
||||
|
||||
if (!component.RequiredItems?.IsValid(args.Using ?? default, EntityManager) ?? false)
|
||||
if (_whitelistSystem.IsWhitelistFail(component.RequiredItems, args.Using ?? default))
|
||||
return false;
|
||||
|
||||
if (component.RequireHands)
|
||||
@@ -156,7 +158,7 @@ public sealed partial class ActivatableUISystem : EntitySystem
|
||||
if (component.RequiredItems == null)
|
||||
return;
|
||||
|
||||
if (!component.RequiredItems.IsValid(args.Used, EntityManager))
|
||||
if (_whitelistSystem.IsWhitelistFail(component.RequiredItems, args.Used))
|
||||
return;
|
||||
|
||||
args.Handled = InteractUI(args.User, uid, component);
|
||||
|
||||
@@ -15,6 +15,7 @@ public abstract partial class SharedGunSystem
|
||||
{
|
||||
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
|
||||
|
||||
|
||||
protected virtual void InitializeBallistic()
|
||||
{
|
||||
SubscribeLocalEvent<BallisticAmmoProviderComponent, ComponentInit>(OnBallisticInit);
|
||||
@@ -125,7 +126,7 @@ public abstract partial class SharedGunSystem
|
||||
if (ent == null)
|
||||
continue;
|
||||
|
||||
if (!target.Whitelist.IsValid(ent.Value))
|
||||
if (_whitelistSystem.IsWhitelistFail(target.Whitelist, ent.Value))
|
||||
{
|
||||
Popup(
|
||||
Loc.GetString("gun-ballistic-transfer-invalid",
|
||||
|
||||
@@ -42,7 +42,7 @@ public partial class SharedGunSystem
|
||||
|
||||
while (enumerator.NextItem(out var item))
|
||||
{
|
||||
if (component.ProviderWhitelist == null || !component.ProviderWhitelist.IsValid(item, EntityManager))
|
||||
if (_whitelistSystem.IsWhitelistFailOrNull(component.ProviderWhitelist, item))
|
||||
continue;
|
||||
|
||||
slotEntity = item;
|
||||
|
||||
Reference in New Issue
Block a user