Move Access to ECS (#4826)
* Moved access to ecs * Fixed tests * Moved test to integration * Better IoC * Moved preset ID card * Moved id card to ECS * Moved access component to ECS * Fixed pda access * Final touches Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Content.Server.Access;
|
||||
using Content.Server.Access.Components;
|
||||
using Content.Server.Access.Systems;
|
||||
using Content.Server.Atmos.Components;
|
||||
using Content.Server.Atmos.EntitySystems;
|
||||
using Content.Server.Construction.Components;
|
||||
@@ -311,12 +312,13 @@ namespace Content.Server.Doors.Components
|
||||
var doorSystem = EntitySystem.Get<DoorSystem>();
|
||||
var isAirlockExternal = HasAccessType("External");
|
||||
|
||||
var accessSystem = EntitySystem.Get<AccessReaderSystem>();
|
||||
return doorSystem.AccessType switch
|
||||
{
|
||||
DoorSystem.AccessTypes.AllowAll => true,
|
||||
DoorSystem.AccessTypes.AllowAllIdExternal => isAirlockExternal || access.IsAllowed(user),
|
||||
DoorSystem.AccessTypes.AllowAllIdExternal => isAirlockExternal || accessSystem.IsAllowed(access, user.Uid),
|
||||
DoorSystem.AccessTypes.AllowAllNoExternal => !isAirlockExternal,
|
||||
_ => access.IsAllowed(user)
|
||||
_ => accessSystem.IsAllowed(access, user.Uid)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -430,7 +432,8 @@ namespace Content.Server.Doors.Components
|
||||
return true;
|
||||
}
|
||||
|
||||
return access.IsAllowed(user);
|
||||
var accessSystem = EntitySystem.Get<AccessReaderSystem>();
|
||||
return accessSystem.IsAllowed(access, user.Uid);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user