Toolshed refactor (#33598)
* Content changes for engine toolshed PR * add contains command * more permissive commands
This commit is contained in:
@@ -10,11 +10,7 @@ namespace Content.Server.Access;
|
||||
public sealed class AddAccessLogCommand : ToolshedCommand
|
||||
{
|
||||
[CommandImplementation]
|
||||
public void AddAccessLog(
|
||||
[CommandInvocationContext] IInvocationContext ctx,
|
||||
[CommandArgument] EntityUid input,
|
||||
[CommandArgument] float seconds,
|
||||
[CommandArgument] ValueRef<string> accessor)
|
||||
public void AddAccessLog(IInvocationContext ctx, EntityUid input, float seconds, string accessor)
|
||||
{
|
||||
var accessReader = EnsureComp<AccessReaderComponent>(input);
|
||||
|
||||
@@ -23,19 +19,14 @@ public sealed class AddAccessLogCommand : ToolshedCommand
|
||||
ctx.WriteLine($"WARNING: Surpassing the limit of the log by {accessLogCount - accessReader.AccessLogLimit+1} entries!");
|
||||
|
||||
var accessTime = TimeSpan.FromSeconds(seconds);
|
||||
var accessName = accessor.Evaluate(ctx)!;
|
||||
accessReader.AccessLog.Enqueue(new AccessRecord(accessTime, accessName));
|
||||
accessReader.AccessLog.Enqueue(new AccessRecord(accessTime, accessor));
|
||||
ctx.WriteLine($"Successfully added access log to {input} with this information inside:\n " +
|
||||
$"Time of access: {accessTime}\n " +
|
||||
$"Accessed by: {accessName}");
|
||||
$"Accessed by: {accessor}");
|
||||
}
|
||||
|
||||
[CommandImplementation]
|
||||
public void AddAccessLogPiped(
|
||||
[CommandInvocationContext] IInvocationContext ctx,
|
||||
[PipedArgument] EntityUid input,
|
||||
[CommandArgument] float seconds,
|
||||
[CommandArgument] ValueRef<string> accessor)
|
||||
public void AddAccessLogPiped(IInvocationContext ctx, [PipedArgument] EntityUid input, float seconds, string accessor)
|
||||
{
|
||||
AddAccessLog(ctx, input, seconds, accessor);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user