using System.Collections.Generic;
-using System.Linq;
+using System.Reflection;
+using Content.Server.Administration.Managers;
using Robust.Shared.Toolshed;
namespace Content.IntegrationTests.Tests.Toolshed;
[Test]
public async Task AllCommandsHavePermissions()
{
+ var toolMan = Server.ResolveDependency<ToolshedManager>();
+ var admin = Server.ResolveDependency<IAdminManager>();
+ var ignored = new HashSet<Assembly>()
+ {typeof(LocTest).Assembly, typeof(Robust.UnitTesting.Shared.Toolshed.LocTest).Assembly};
+
await Server.WaitAssertion(() =>
{
- Assert.That(InvokeCommand("cmd:list where { acmd:perms isnull }", out var res));
- Assert.That((IEnumerable<CommandSpec>) res, Is.Empty, "All commands must have admin permissions set up.");
+ Assert.Multiple(() =>
+ {
+ foreach (var cmd in toolMan.DefaultEnvironment.AllCommands())
+ {
+ if (ignored.Contains(cmd.Cmd.GetType().Assembly))
+ continue;
+
+ Assert.That(admin.TryGetCommandFlags(cmd, out _), $"Command does not have admin permissions set up: {cmd.FullName()}");
+ }
+ });
});
}
}
using System.Collections.Generic;
using System.Globalization;
-using Robust.Shared.IoC;
+using System.Reflection;
using Robust.Shared.Localization;
using Robust.Shared.Toolshed;
[Test]
public async Task AllCommandsHaveDescriptions()
{
+ var locMan = Server.ResolveDependency<ILocalizationManager>();
+ var toolMan = Server.ResolveDependency<ToolshedManager>();
+ var locStrings = new HashSet<string>();
+
+ var ignored = new HashSet<Assembly>()
+ {typeof(LocTest).Assembly, typeof(Robust.UnitTesting.Shared.Toolshed.LocTest).Assembly};
+
await Server.WaitAssertion(() =>
{
- Assert.That(InvokeCommand("cmd:list where { cmd:descloc loc:tryloc isnull }", out var res));
- Assert.That((IEnumerable<CommandSpec>)res!, Is.Empty, "All commands must have localized descriptions.");
+ Assert.Multiple(() =>
+ {
+ foreach (var cmd in toolMan.DefaultEnvironment.AllCommands())
+ {
+ if (ignored.Contains(cmd.Cmd.GetType().Assembly))
+ continue;
+
+ var descLoc = cmd.DescLocStr();
+ Assert.That(locStrings.Add(descLoc), $"Duplicate command description key: {descLoc}");
+ Assert.That(locMan.TryGetString(descLoc, out _), $"Failed to get command description for command {cmd.FullName()}");
+ }
+ });
});
}
}
return (T) res!;
}
- protected void ParseCommand(string command, Type? inputType = null, Type? expectedType = null, bool once = false)
+ protected void ParseCommand(string command, Type? inputType = null, Type? expectedType = null)
{
var parser = new ParserContext(command, Toolshed);
- var success = CommandRun.TryParse(false, parser, inputType, expectedType, once, out _, out _, out var error);
+ var success = CommandRun.TryParse(parser, inputType, expectedType, out _);
- if (error is not null)
- ReportError(error);
+ if (parser.Error is not null)
+ ReportError(parser.Error);
- if (error is null)
+ if (parser.Error is null)
Assert.That(success, $"Parse failed despite no error being reported. Parsed {command}");
}
return _errors;
}
+ public bool HasErrors => _errors.Count > 0;
+
public void ClearErrors()
{
_errors.Clear();
}
+ public object? ReadVar(string name)
+ {
+ return Variables.GetValueOrDefault(name);
+ }
+
+ public void WriteVar(string name, object? value)
+ {
+ Variables[name] = value;
+ }
+
+ public IEnumerable<string> GetVars()
+ {
+ return Variables.Keys;
+ }
+
public Dictionary<string, object?> Variables { get; } = new();
protected void ExpectError(Type err)
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);
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);
}
public sealed class MarkedCommand : ToolshedCommand
{
[CommandImplementation]
- public IEnumerable<EntityUid> Marked([CommandInvocationContext] IInvocationContext ctx)
+ public IEnumerable<EntityUid> Marked(IInvocationContext ctx)
{
var res = (IEnumerable<EntityUid>?)ctx.ReadVar("marked");
res ??= Array.Empty<EntityUid>();
}
[CommandImplementation]
- public void Rejuvenate([CommandInvocationContext] IInvocationContext ctx)
+ public void Rejuvenate(IInvocationContext ctx)
{
_rejuvenate ??= GetSys<RejuvenateSystem>();
if (ExecutingEntity(ctx) is not { } ent)
using Robust.Shared.Toolshed.Syntax;
using Robust.Shared.Toolshed.TypeParsers;
using System.Linq;
+using Robust.Shared.Prototypes;
namespace Content.Server.Administration.Toolshed;
private SharedSolutionContainerSystem? _solutionContainer;
[CommandImplementation("get")]
- public SolutionRef? Get(
- [CommandInvocationContext] IInvocationContext ctx,
- [PipedArgument] EntityUid input,
- [CommandArgument] ValueRef<string> name
- )
+ public SolutionRef? Get([PipedArgument] EntityUid input, string name)
{
_solutionContainer ??= GetSys<SharedSolutionContainerSystem>();
- if (_solutionContainer.TryGetSolution(input, name.Evaluate(ctx)!, out var solution))
+ if (_solutionContainer.TryGetSolution(input, name, out var solution))
return new SolutionRef(solution.Value);
return null;
}
[CommandImplementation("get")]
- public IEnumerable<SolutionRef> Get(
- [CommandInvocationContext] IInvocationContext ctx,
- [PipedArgument] IEnumerable<EntityUid> input,
- [CommandArgument] ValueRef<string> name
- )
+ public IEnumerable<SolutionRef> Get([PipedArgument] IEnumerable<EntityUid> input, string name)
{
- return input.Select(x => Get(ctx, x, name)).Where(x => x is not null).Cast<SolutionRef>();
+ return input.Select(x => Get(x, name)).Where(x => x is not null).Cast<SolutionRef>();
}
[CommandImplementation("adjreagent")]
public SolutionRef AdjReagent(
- [CommandInvocationContext] IInvocationContext ctx,
[PipedArgument] SolutionRef input,
- [CommandArgument] Prototype<ReagentPrototype> name,
- [CommandArgument] ValueRef<FixedPoint2> amountRef
+ ProtoId<ReagentPrototype> proto,
+ FixedPoint2 amount
)
{
_solutionContainer ??= GetSys<SharedSolutionContainerSystem>();
- var amount = amountRef.Evaluate(ctx);
if (amount > 0)
{
- _solutionContainer.TryAddReagent(input.Solution, name.Value.ID, amount, out _);
+ _solutionContainer.TryAddReagent(input.Solution, proto, amount, out _);
}
else if (amount < 0)
{
- _solutionContainer.RemoveReagent(input.Solution, name.Value.ID, -amount);
+ _solutionContainer.RemoveReagent(input.Solution, proto, -amount);
}
return input;
[CommandImplementation("adjreagent")]
public IEnumerable<SolutionRef> AdjReagent(
- [CommandInvocationContext] IInvocationContext ctx,
[PipedArgument] IEnumerable<SolutionRef> input,
- [CommandArgument] Prototype<ReagentPrototype> name,
- [CommandArgument] ValueRef<FixedPoint2> amountRef
+ ProtoId<ReagentPrototype> name,
+ FixedPoint2 amount
)
- => input.Select(x => AdjReagent(ctx, x, name, amountRef));
+ => input.Select(x => AdjReagent(x, name, amount));
}
public readonly record struct SolutionRef(Entity<SolutionComponent> Solution)
}
[CommandImplementation("add")]
- public EntityUid Add(
- [CommandInvocationContext] IInvocationContext ctx,
- [PipedArgument] EntityUid input,
- [CommandArgument] ValueRef<string, Prototype<TagPrototype>> @ref
- )
+ public EntityUid Add([PipedArgument] EntityUid input, ProtoId<TagPrototype> tag)
{
_tag ??= GetSys<TagSystem>();
- _tag.AddTag(input, @ref.Evaluate(ctx)!);
+ _tag.AddTag(input, tag);
return input;
}
[CommandImplementation("add")]
- public IEnumerable<EntityUid> Add(
- [CommandInvocationContext] IInvocationContext ctx,
- [PipedArgument] IEnumerable<EntityUid> input,
- [CommandArgument] ValueRef<string, Prototype<TagPrototype>> @ref
- )
- => input.Select(x => Add(ctx, x, @ref));
+ public IEnumerable<EntityUid> Add([PipedArgument] IEnumerable<EntityUid> input, ProtoId<TagPrototype> tag)
+ => input.Select(x => Add(x, tag));
[CommandImplementation("rm")]
- public EntityUid Rm(
- [CommandInvocationContext] IInvocationContext ctx,
- [PipedArgument] EntityUid input,
- [CommandArgument] ValueRef<string, Prototype<TagPrototype>> @ref
- )
+ public EntityUid Rm([PipedArgument] EntityUid input, ProtoId<TagPrototype> tag)
{
_tag ??= GetSys<TagSystem>();
- _tag.RemoveTag(input, @ref.Evaluate(ctx)!);
+ _tag.RemoveTag(input, tag);
return input;
}
[CommandImplementation("rm")]
- public IEnumerable<EntityUid> Rm(
- [CommandInvocationContext] IInvocationContext ctx,
- [PipedArgument] IEnumerable<EntityUid> input,
- [CommandArgument] ValueRef<string, Prototype<TagPrototype>> @ref
- )
- => input.Select(x => Rm(ctx, x, @ref));
+ public IEnumerable<EntityUid> Rm([PipedArgument] IEnumerable<EntityUid> input, ProtoId<TagPrototype> tag)
+ => input.Select(x => Rm(x, tag));
[CommandImplementation("addmany")]
- public EntityUid AddMany(
- [CommandInvocationContext] IInvocationContext ctx,
- [PipedArgument] EntityUid input,
- [CommandArgument] ValueRef<IEnumerable<string>, IEnumerable<string>> @ref
- )
+ public EntityUid AddMany([PipedArgument] EntityUid input, IEnumerable<ProtoId<TagPrototype>> tags)
{
_tag ??= GetSys<TagSystem>();
- _tag.AddTags(input, (IEnumerable<ProtoId<TagPrototype>>)@ref.Evaluate(ctx)!);
+ _tag.AddTags(input, tags);
return input;
}
[CommandImplementation("addmany")]
- public IEnumerable<EntityUid> AddMany(
- [CommandInvocationContext] IInvocationContext ctx,
- [PipedArgument] IEnumerable<EntityUid> input,
- [CommandArgument] ValueRef<IEnumerable<string>, IEnumerable<string>> @ref
- )
- => input.Select(x => AddMany(ctx, x, @ref));
+ public IEnumerable<EntityUid> AddMany([PipedArgument] IEnumerable<EntityUid> input, IEnumerable<ProtoId<TagPrototype>> tags)
+ => input.Select(x => AddMany(x, tags.ToArray()));
[CommandImplementation("rmmany")]
- public EntityUid RmMany(
- [CommandInvocationContext] IInvocationContext ctx,
- [PipedArgument] EntityUid input,
- [CommandArgument] ValueRef<IEnumerable<string>, IEnumerable<string>> @ref
- )
+ public EntityUid RmMany([PipedArgument] EntityUid input, IEnumerable<ProtoId<TagPrototype>> tags)
{
_tag ??= GetSys<TagSystem>();
- _tag.RemoveTags(input, (IEnumerable<ProtoId<TagPrototype>>)@ref.Evaluate(ctx)!);
+ _tag.RemoveTags(input, tags);
return input;
}
[CommandImplementation("rmmany")]
- public IEnumerable<EntityUid> RmMany(
- [CommandInvocationContext] IInvocationContext ctx,
- [PipedArgument] IEnumerable<EntityUid> input,
- [CommandArgument] ValueRef<IEnumerable<string>, IEnumerable<string>> @ref
- )
- => input.Select(x => RmMany(ctx, x, @ref));
+ public IEnumerable<EntityUid> RmMany([PipedArgument] IEnumerable<EntityUid> input, IEnumerable<ProtoId<TagPrototype>> tags)
+ => input.Select(x => RmMany(x, tags.ToArray()));
}
[Dependency] private readonly IEntitySystemManager _manager = default!;
[CommandImplementation("id")]
- public void DeleteChatMessage([CommandInvocationContext] IInvocationContext ctx, [CommandArgument] uint messageId)
+ public void DeleteChatMessage(IInvocationContext ctx, uint messageId)
{
if (!_manager.GetEntitySystem<ChatRepositorySystem>().Delete(messageId))
{
[Dependency] private readonly IEntitySystemManager _manager = default!;
[CommandImplementation("usernames")]
- public void Command([CommandInvocationContext] IInvocationContext ctx, [CommandArgument] string usernamesCsv)
+ public void Command(IInvocationContext ctx, string usernamesCsv)
{
var usernames = usernamesCsv.Split(',');
}
[CommandImplementation("control")]
- public EntityUid Control(
- [CommandInvocationContext] IInvocationContext ctx,
- [PipedArgument] EntityUid target,
- [CommandArgument] ValueRef<ICommonSession> playerRef)
+ public EntityUid Control(IInvocationContext ctx, [PipedArgument] EntityUid target, ICommonSession player)
{
_mind ??= GetSys<SharedMindSystem>();
- var player = playerRef.Evaluate(ctx);
- if (player is null)
- {
- ctx.ReportError(new NotForServerConsoleError());
- return target;
- }
if (!_mind.TryGetMind(player, out var mindId, out var mind))
{
[CommandImplementation]
public EntityUid? Polymorph(
[PipedArgument] EntityUid input,
- [CommandArgument] ProtoId<PolymorphPrototype> protoId
+ ProtoId<PolymorphPrototype> protoId
)
{
_system ??= GetSys<PolymorphSystem>();
[CommandImplementation]
public IEnumerable<EntityUid> Polymorph(
[PipedArgument] IEnumerable<EntityUid> input,
- [CommandArgument] ProtoId<PolymorphPrototype> protoId
+ ProtoId<PolymorphPrototype> protoId
)
=> input.Select(x => Polymorph(x, protoId)).Where(x => x is not null).Select(x => (EntityUid)x!);
}
=> stations.SelectMany(Jobs);
[CommandImplementation("job")]
- public JobSlotRef Job([PipedArgument] EntityUid station, [CommandArgument] Prototype<JobPrototype> job)
+ public JobSlotRef Job([PipedArgument] EntityUid station, Prototype<JobPrototype> job)
{
_jobs ??= GetSys<StationJobsSystem>();
}
[CommandImplementation("job")]
- public IEnumerable<JobSlotRef> Job([PipedArgument] IEnumerable<EntityUid> stations, [CommandArgument] Prototype<JobPrototype> job)
+ public IEnumerable<JobSlotRef> Job([PipedArgument] IEnumerable<EntityUid> stations, Prototype<JobPrototype> job)
=> stations.Select(x => Job(x, job));
[CommandImplementation("isinfinite")]
=> jobs.Select(x => IsInfinite(x, inverted));
[CommandImplementation("adjust")]
- public JobSlotRef Adjust(
- [CommandInvocationContext] IInvocationContext ctx,
- [PipedArgument] JobSlotRef @ref,
- [CommandArgument] ValueRef<int> by
- )
+ public JobSlotRef Adjust([PipedArgument] JobSlotRef @ref, int by)
{
_jobs ??= GetSys<StationJobsSystem>();
- _jobs.TryAdjustJobSlot(@ref.Station, @ref.Job, by.Evaluate(ctx), true, true);
+ _jobs.TryAdjustJobSlot(@ref.Station, @ref.Job, by, true, true);
return @ref;
}
[CommandImplementation("adjust")]
- public IEnumerable<JobSlotRef> Adjust(
- [CommandInvocationContext] IInvocationContext ctx,
- [PipedArgument] IEnumerable<JobSlotRef> @ref,
- [CommandArgument] ValueRef<int> by
- )
- => @ref.Select(x => Adjust(ctx, x, by));
+ public IEnumerable<JobSlotRef> Adjust([PipedArgument] IEnumerable<JobSlotRef> @ref, int by)
+ => @ref.Select(x => Adjust(x, by));
[CommandImplementation("set")]
- public JobSlotRef Set(
- [CommandInvocationContext] IInvocationContext ctx,
- [PipedArgument] JobSlotRef @ref,
- [CommandArgument] ValueRef<int> by
- )
+ public JobSlotRef Set([PipedArgument] JobSlotRef @ref, int by)
{
_jobs ??= GetSys<StationJobsSystem>();
- _jobs.TrySetJobSlot(@ref.Station, @ref.Job, by.Evaluate(ctx), true);
+ _jobs.TrySetJobSlot(@ref.Station, @ref.Job, by, true);
return @ref;
}
[CommandImplementation("set")]
- public IEnumerable<JobSlotRef> Set(
- [CommandInvocationContext] IInvocationContext ctx,
- [PipedArgument] IEnumerable<JobSlotRef> @ref,
- [CommandArgument] ValueRef<int> by
- )
- => @ref.Select(x => Set(ctx, x, by));
+ public IEnumerable<JobSlotRef> Set([PipedArgument] IEnumerable<JobSlotRef> @ref, int by)
+ => @ref.Select(x => Set(x, by));
[CommandImplementation("amount")]
- public int Amount(
- [CommandInvocationContext] IInvocationContext ctx,
- [PipedArgument] JobSlotRef @ref
- )
+ public int Amount([PipedArgument] JobSlotRef @ref)
{
_jobs ??= GetSys<StationJobsSystem>();
_jobs.TryGetJobSlot(@ref.Station, @ref.Job, out var slots);
- return (int)(slots ?? 0);
+ return slots ?? 0;
}
[CommandImplementation("amount")]
- public IEnumerable<int> Amount(
- [CommandInvocationContext] IInvocationContext ctx,
- [PipedArgument] IEnumerable<JobSlotRef> @ref
- )
- => @ref.Select(x => Amount(ctx, x));
+ public IEnumerable<int> Amount([PipedArgument] IEnumerable<JobSlotRef> @ref)
+ => @ref.Select(Amount);
}
// Used for Toolshed queries.
}
[CommandImplementation("get")]
- public EntityUid Get([CommandInvocationContext] IInvocationContext ctx)
+ public EntityUid Get(IInvocationContext ctx)
{
_station ??= GetSys<StationSystem>();
public EntityUid? LargestGrid([PipedArgument] EntityUid input)
{
_station ??= GetSys<StationSystem>();
-
return _station.GetLargestGrid(Comp<StationDataComponent>(input));
}
=> input.Select(Config);
[CommandImplementation("addgrid")]
- public void AddGrid(
- [CommandInvocationContext] IInvocationContext ctx,
- [PipedArgument] EntityUid input,
- [CommandArgument] ValueRef<EntityUid> grid
- )
+ public void AddGrid([PipedArgument] EntityUid input, EntityUid grid)
{
_station ??= GetSys<StationSystem>();
-
- _station.AddGridToStation(input, grid.Evaluate(ctx));
+ _station.AddGridToStation(input, grid);
}
[CommandImplementation("rmgrid")]
- public void RmGrid(
- [CommandInvocationContext] IInvocationContext ctx,
- [PipedArgument] EntityUid input,
- [CommandArgument] ValueRef<EntityUid> grid
- )
+ public void RmGrid([PipedArgument] EntityUid input, EntityUid grid)
{
_station ??= GetSys<StationSystem>();
-
- _station.RemoveGridFromStation(input, grid.Evaluate(ctx));
+ _station.RemoveGridFromStation(input, grid);
}
[CommandImplementation("rename")]
- public void Rename([CommandInvocationContext] IInvocationContext ctx,
- [PipedArgument] EntityUid input,
- [CommandArgument] ValueRef<string> name
- )
+ public void Rename([PipedArgument] EntityUid input, string name)
{
_station ??= GetSys<StationSystem>();
-
- _station.RenameStation(input, name.Evaluate(ctx)!);
+ _station.RenameStation(input, name);
}
[CommandImplementation("rerollBounties")]
- public void RerollBounties([CommandInvocationContext] IInvocationContext ctx,
- [PipedArgument] EntityUid input)
+ public void RerollBounties([PipedArgument] EntityUid input)
{
_cargo ??= GetSys<CargoSystem>();
-
_cargo.RerollBountyDatabase(input);
}
}
/// to even exist) so I think it's fine.
/// </remarks>
[CommandImplementation("simulate")]
- public IEnumerable<(string, float)> Simulate([CommandArgument] EntityPrototype eventScheduler, [CommandArgument] int rounds, [CommandArgument] int playerCount, [CommandArgument] float roundEndMean, [CommandArgument] float roundEndStdDev)
+ public IEnumerable<(string, float)> Simulate(EntityPrototype eventScheduler, int rounds, int playerCount, float roundEndMean, float roundEndStdDev)
{
_stationEvent ??= GetSys<EventManagerSystem>();
_entityTable ??= GetSys<EntityTableSystem>();
}
[CommandImplementation("lsprob")]
- public IEnumerable<(string, float)> LsProb([CommandArgument] EntityPrototype eventScheduler)
+ public IEnumerable<(string, float)> LsProb(EntityPrototype eventScheduler)
{
_compFac ??= IoCManager.Resolve<IComponentFactory>();
_stationEvent ??= GetSys<EventManagerSystem>();
}
[CommandImplementation("lsprobtime")]
- public IEnumerable<(string, float)> LsProbTime([CommandArgument] EntityPrototype eventScheduler, [CommandArgument] float time)
+ public IEnumerable<(string, float)> LsProbTime(EntityPrototype eventScheduler, float time)
{
_compFac ??= IoCManager.Resolve<IComponentFactory>();
_stationEvent ??= GetSys<EventManagerSystem>();
}
[CommandImplementation("prob")]
- public float Prob([CommandArgument] EntityPrototype eventScheduler, [CommandArgument] string eventId)
+ public float Prob(EntityPrototype eventScheduler, string eventId)
{
_compFac ??= IoCManager.Resolve<IComponentFactory>();
_stationEvent ??= GetSys<EventManagerSystem>();
}
[CommandImplementation("caninvoke")]
- public bool CanInvoke(
- [CommandInvocationContext] IInvocationContext ctx,
- [PipedArgument] CommandSpec command,
- [CommandArgument] ValueRef<ICommonSession> player
- )
+ public bool CanInvoke(IInvocationContext ctx, [PipedArgument] CommandSpec command, ICommonSession player)
{
// Deliberately discard the error.
- return ((IPermissionController) _adminManager).CheckInvokable(command, player.Evaluate(ctx), out var err);
+ return ((IPermissionController) _adminManager).CheckInvokable(command, player, out _);
}
}
[CommandImplementation]
public IEnumerable<NetEntity> RunVerbAs(
- [CommandInvocationContext] IInvocationContext ctx,
+ IInvocationContext ctx,
[PipedArgument] IEnumerable<NetEntity> input,
- [CommandArgument] ValueRef<NetEntity> runner,
- [CommandArgument] string verb
+ EntityUid runner,
+ string verb
)
{
_verb ??= GetSys<SharedVerbSystem>();
foreach (var i in input)
{
- var runnerNet = runner.Evaluate(ctx);
- var runnerEid = EntityManager.GetEntity(runnerNet);
-
- if (EntityManager.Deleted(runnerEid) && runnerEid.IsValid())
- ctx.ReportError(new DeadEntity(runnerEid));
+ if (EntityManager.Deleted(runner) && runner.IsValid())
+ ctx.ReportError(new DeadEntity(runner));
if (ctx.GetErrors().Any())
yield break;
var eId = EntityManager.GetEntity(i);
- var verbs = _verb.GetLocalVerbs(eId, runnerEid, Verb.VerbTypes, true);
+ var verbs = _verb.GetLocalVerbs(eId, runner, Verb.VerbTypes, true);
// if the "verb name" is actually a verb-type, try run any verb of that type.
var verbType = Verb.VerbTypes.FirstOrDefault(x => x.Name == verb);
var verbTy = verbs.FirstOrDefault(v => v.GetType() == verbType);
if (verbTy != null)
{
- _verb.ExecuteVerb(verbTy, runnerEid, eId, forced: true);
+ _verb.ExecuteVerb(verbTy, runner, eId, forced: true);
yield return i;
}
}
{
if (verbTy.Text.ToLowerInvariant() == verb)
{
- _verb.ExecuteVerb(verbTy, runnerEid, eId, forced: true);
+ _verb.ExecuteVerb(verbTy, runner, eId, forced: true);
yield return i;
}
}
[CommandImplementation]
public void VisualizeEntities(
- [CommandInvocationContext] IInvocationContext ctx,
+ IInvocationContext ctx,
[PipedArgument] IEnumerable<EntityUid> input
)
{
- physics
- player
- splat
- - emplace
- bin
- extremes
- reduce
- iota
- rep
- to
- - iterate
- Flags: DEBUG
Commands:
- comp
- delete
- - do
+ - with
+ - prototyped
- named
- paused
- - with
- - count
+ - emplace
+ - do
+ - iterate
- select
- where
- - prototyped
+ - count
- types
- - ecscomp
- actor
- spawn
+ - replace
- mappos
- pos
- tp
- allcomps
- - replace
- entitysystemupdateorder
- mind
-
-- Flags: HOST
- Commands:
- - methods
- - ioc
-
-- Commands:
- fuck
- - ent
- - as
- - buildinfo
- - help
- - explain
- - cmd
- - stopwatch
+ - '=>'
+ - '?'
+ - 'or?'
+ - '??'
+ - rng
- self
+ - sum
+ - take
+ - join
- search
+ - first
+ - unique
+ - any
+ - contains
- isnull
- - help
- isempty
- - any
- - unique
- cd
- ls
- - loc
- - vars
- - '=>'
- - first
- - val
+ - stopwatch
+ - append
+ - min
+ - max
+ - average
- '+'
- '-'
- '*'
- '/'
- - 'min'
- - 'max'
- - '&'
- - '|'
- - '^'
- - 'neg'
+ - '%'
+ - '%/'
+ - '&~'
+ - '|~'
+ - '^~'
+ - '~'
- '<'
- '>'
- '<='
- '>='
- '=='
- '!='
- - f
- - i
- - s
- - b
- '+/'
- '-/'
- '*/'
- '//'
- - join
- - append
- - '?'
- - 'or?'
- - '??'
- - rng
- - 'sum'
- - take
- - curtick
- - curtime
- - realtime
- - servertime
- - more
- - '%'
- - '%/'
- - '&~'
- - '|~'
- - '^~'
- - '~'
- - 'abs'
- - 'average'
- - 'bibytecount'
- - 'shortestbitlength'
- - 'countleadzeros'
- - 'counttrailingzeros'
- - 'fpi'
- - 'fe'
- - 'ftau'
- - 'fepsilon'
+ - '&'
+ - '|'
+ - '^'
+ - neg
+ - abs
+ - bibytecount
+ - shortestbitlength
+ - countleadzeros
+ - counttrailingzeros
+ - fpi
+ - fe
+ - ftau
+ - fepsilon
- dpi
- de
- dtau
- atanpi
- pick
- tee
+
+- Flags: HOST
+ Commands:
+ - methods
+ - ioc
+
+- Commands:
+ - ent
+ - f
+ - i
+ - s
+ - b
+ - as
+ - var
+ - vars
+ - val
+ - help
+ - explain
+ - cmd
+ - buildinfo
+ - loc
+ - curtick
+ - curtime
+ - realtime
+ - servertime
+ - more