diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.cs b/Content.Server/Administration/Systems/AdminVerbSystem.cs index 0640537f57ecd9..43b60075837837 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.cs @@ -105,7 +105,7 @@ private void AddAdminVerbs(GetVerbsEvent args) mark.Text = Loc.GetString("toolshed-verb-mark"); mark.Message = Loc.GetString("toolshed-verb-mark-description"); mark.Category = VerbCategory.Admin; - mark.Act = () => _toolshed.InvokeCommand(player, "=> $marked", Enumerable.Repeat(args.Target, 1), out _); + mark.Act = () => _toolshed.InvokeCommand(player, "=> $marked", new List {args.Target}, out _); mark.Impact = LogImpact.Low; args.Verbs.Add(mark); diff --git a/Content.Server/Administration/Toolshed/MarkedCommand.cs b/Content.Server/Administration/Toolshed/MarkedCommand.cs index 54d45a352de781..c2b9ecf79a0dac 100644 --- a/Content.Server/Administration/Toolshed/MarkedCommand.cs +++ b/Content.Server/Administration/Toolshed/MarkedCommand.cs @@ -9,8 +9,7 @@ public sealed class MarkedCommand : ToolshedCommand [CommandImplementation] public IEnumerable Marked(IInvocationContext ctx) { - var res = (IEnumerable?)ctx.ReadVar("marked"); - res ??= Array.Empty(); - return res; + var marked = ctx.ReadVar("marked") as IEnumerable; + return marked ?? Array.Empty(); } } diff --git a/Content.Server/Commands/CommandUtils.cs b/Content.Server/Commands/CommandUtils.cs index 30ea41b7c9faa3..502c3ae0241e57 100644 --- a/Content.Server/Commands/CommandUtils.cs +++ b/Content.Server/Commands/CommandUtils.cs @@ -4,6 +4,7 @@ using Robust.Shared.Console; using Robust.Shared.Network; using Robust.Shared.Player; +using Robust.Shared.Toolshed.Commands.Generic; namespace Content.Server.Commands { @@ -50,45 +51,5 @@ public static bool TryGetAttachedEntityByUsernameOrId(IConsoleShell shell, attachedEntity = session.AttachedEntity.Value; return true; } - - public static string SubstituteEntityDetails(IConsoleShell shell, EntityUid ent, string ruleString) - { - var entMan = IoCManager.Resolve(); - var transform = entMan.GetComponent(ent); - var transformSystem = entMan.System(); - var worldPosition = transformSystem.GetWorldPosition(transform); - - // gross, is there a better way to do this? - ruleString = ruleString.Replace("$ID", ent.ToString()); - ruleString = ruleString.Replace("$WX", - worldPosition.X.ToString(CultureInfo.InvariantCulture)); - ruleString = ruleString.Replace("$WY", - worldPosition.Y.ToString(CultureInfo.InvariantCulture)); - ruleString = ruleString.Replace("$LX", - transform.LocalPosition.X.ToString(CultureInfo.InvariantCulture)); - ruleString = ruleString.Replace("$LY", - transform.LocalPosition.Y.ToString(CultureInfo.InvariantCulture)); - ruleString = ruleString.Replace("$NAME", entMan.GetComponent(ent).EntityName); - - if (shell.Player is { } player) - { - if (player.AttachedEntity is {Valid: true} p) - { - var pTransform = entMan.GetComponent(p); - var pWorldPosition = transformSystem.GetWorldPosition(pTransform); - - ruleString = ruleString.Replace("$PID", ent.ToString()); - ruleString = ruleString.Replace("$PWX", - pWorldPosition.X.ToString(CultureInfo.InvariantCulture)); - ruleString = ruleString.Replace("$PWY", - pWorldPosition.Y.ToString(CultureInfo.InvariantCulture)); - ruleString = ruleString.Replace("$PLX", - pTransform.LocalPosition.X.ToString(CultureInfo.InvariantCulture)); - ruleString = ruleString.Replace("$PLY", - pTransform.LocalPosition.Y.ToString(CultureInfo.InvariantCulture)); - } - } - return ruleString; - } } } diff --git a/Resources/toolshedEngineCommandPerms.yml b/Resources/toolshedEngineCommandPerms.yml index b9911e9468db1d..ae02339c1a2430 100644 --- a/Resources/toolshedEngineCommandPerms.yml +++ b/Resources/toolshedEngineCommandPerms.yml @@ -74,7 +74,7 @@ - '%' - '%/' - '&~' - - '|~' + - bitornot - '^~' - '~' - '<' @@ -88,7 +88,7 @@ - '*/' - '//' - '&' - - '|' + - bitor - '^' - neg - abs