diff --git a/Content.Client/Administration/Managers/ClientAdminManager.cs b/Content.Client/Administration/Managers/ClientAdminManager.cs index f34487932e..d2c3aff9ce 100644 --- a/Content.Client/Administration/Managers/ClientAdminManager.cs +++ b/Content.Client/Administration/Managers/ClientAdminManager.cs @@ -1,10 +1,13 @@ using System; using System.Collections.Generic; +using System.Reflection; using Content.Shared.Administration; using Robust.Client.Console; +using Robust.Shared.Console; using Robust.Shared.IoC; using Robust.Shared.Log; using Robust.Shared.Network; +using Robust.Shared.Reflection; namespace Content.Client.Administration.Managers { @@ -61,6 +64,15 @@ namespace Content.Client.Administration.Managers private void UpdateMessageRx(MsgUpdateAdminStatus message) { _availableCommands.Clear(); + var host = IoCManager.Resolve(); + + // Anything marked as Any we'll just add even if the server doesn't know about it. + foreach (var (command, instance) in host.RegisteredCommands) + { + if (Attribute.GetCustomAttribute(instance.GetType(), typeof(AnyCommandAttribute)) == null) continue; + _availableCommands.Add(command); + } + _availableCommands.UnionWith(message.AvailableCommands); Logger.DebugS("admin", $"Have {message.AvailableCommands.Length} commands available"); diff --git a/Content.Client/Commands/OpenAHelpCommand.cs b/Content.Client/Commands/OpenAHelpCommand.cs index dee8b2f4ea..cbe61a3b9a 100644 --- a/Content.Client/Commands/OpenAHelpCommand.cs +++ b/Content.Client/Commands/OpenAHelpCommand.cs @@ -1,5 +1,6 @@ using System; using Content.Client.Administration; +using Content.Shared.Administration; using Robust.Client.Console; using Robust.Client.GameObjects; using Robust.Shared.Console; @@ -10,6 +11,7 @@ using Robust.Shared.IoC; namespace Content.Client.Commands { + [AnyCommand] public class OpenAHelpCommand : IConsoleCommand { public string Command => "openahelp"; diff --git a/Content.Server/Administration/Commands/ReAdminCommand.cs b/Content.Server/Administration/Commands/ReAdminCommand.cs index 1d6764ee46..6d2804fd4a 100644 --- a/Content.Server/Administration/Commands/ReAdminCommand.cs +++ b/Content.Server/Administration/Commands/ReAdminCommand.cs @@ -1,4 +1,5 @@ using Content.Server.Administration.Managers; +using Content.Shared.Administration; using Robust.Server.Player; using Robust.Shared.Console; using Robust.Shared.IoC; diff --git a/Content.Server/Chat/Commands/MeCommand.cs b/Content.Server/Chat/Commands/MeCommand.cs index 94951e1dea..3103ffe83a 100644 --- a/Content.Server/Chat/Commands/MeCommand.cs +++ b/Content.Server/Chat/Commands/MeCommand.cs @@ -1,6 +1,7 @@ using Content.Server.Administration; using Content.Server.Chat.Managers; using Content.Server.Players; +using Content.Shared.Administration; using Robust.Server.Player; using Robust.Shared.Console; using Robust.Shared.Enums; diff --git a/Content.Server/Chat/Commands/OOCCommand.cs b/Content.Server/Chat/Commands/OOCCommand.cs index 440e1f8b5f..8b6047e102 100644 --- a/Content.Server/Chat/Commands/OOCCommand.cs +++ b/Content.Server/Chat/Commands/OOCCommand.cs @@ -1,5 +1,6 @@ using Content.Server.Administration; using Content.Server.Chat.Managers; +using Content.Shared.Administration; using Robust.Server.Player; using Robust.Shared.Console; using Robust.Shared.IoC; diff --git a/Content.Server/Chat/Commands/SayCommand.cs b/Content.Server/Chat/Commands/SayCommand.cs index a35e51c3c0..b49b6765ce 100644 --- a/Content.Server/Chat/Commands/SayCommand.cs +++ b/Content.Server/Chat/Commands/SayCommand.cs @@ -2,6 +2,7 @@ using Content.Server.Administration; using Content.Server.Chat.Managers; using Content.Server.Ghost.Components; using Content.Server.Players; +using Content.Shared.Administration; using Robust.Server.Player; using Robust.Shared.Console; using Robust.Shared.Enums; diff --git a/Content.Server/Chat/Commands/SuicideCommand.cs b/Content.Server/Chat/Commands/SuicideCommand.cs index 82e5a4e45a..66bf018893 100644 --- a/Content.Server/Chat/Commands/SuicideCommand.cs +++ b/Content.Server/Chat/Commands/SuicideCommand.cs @@ -8,6 +8,7 @@ using Content.Server.Hands.Components; using Content.Server.Items; using Content.Server.Players; using Content.Server.Popups; +using Content.Shared.Administration; using Content.Shared.Damage; using Content.Shared.Damage.Prototypes; using Content.Shared.Database; diff --git a/Content.Server/GameTicking/Commands/JoinGameCommand.cs b/Content.Server/GameTicking/Commands/JoinGameCommand.cs index 3e1aa2b03d..4e24403b8b 100644 --- a/Content.Server/GameTicking/Commands/JoinGameCommand.cs +++ b/Content.Server/GameTicking/Commands/JoinGameCommand.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using Content.Server.Administration; using Content.Server.Roles; using Content.Server.Station; +using Content.Shared.Administration; using Content.Shared.Roles; using Content.Shared.Station; using Robust.Server.Player; diff --git a/Content.Server/GameTicking/Commands/ObserveCommand.cs b/Content.Server/GameTicking/Commands/ObserveCommand.cs index 891b05bb74..34dc211a55 100644 --- a/Content.Server/GameTicking/Commands/ObserveCommand.cs +++ b/Content.Server/GameTicking/Commands/ObserveCommand.cs @@ -1,4 +1,5 @@ using Content.Server.Administration; +using Content.Shared.Administration; using Robust.Server.Player; using Robust.Shared.Console; using Robust.Shared.GameObjects; diff --git a/Content.Server/GameTicking/Commands/ToggleReadyCommand.cs b/Content.Server/GameTicking/Commands/ToggleReadyCommand.cs index 7cf36d859b..8084b55465 100644 --- a/Content.Server/GameTicking/Commands/ToggleReadyCommand.cs +++ b/Content.Server/GameTicking/Commands/ToggleReadyCommand.cs @@ -1,4 +1,5 @@ using Content.Server.Administration; +using Content.Shared.Administration; using Robust.Server.Player; using Robust.Shared.Console; using Robust.Shared.GameObjects; diff --git a/Content.Server/Ghost/Ghost.cs b/Content.Server/Ghost/Ghost.cs index 8fd698db34..65a591cd7d 100644 --- a/Content.Server/Ghost/Ghost.cs +++ b/Content.Server/Ghost/Ghost.cs @@ -1,6 +1,7 @@ using Content.Server.Administration; using Content.Server.GameTicking; using Content.Server.Players; +using Content.Shared.Administration; using Robust.Server.Player; using Robust.Shared.Console; using Robust.Shared.GameObjects; diff --git a/Content.Server/Ghost/Roles/GhostRoleSystem.cs b/Content.Server/Ghost/Roles/GhostRoleSystem.cs index 36c04f748c..5619a23fbf 100644 --- a/Content.Server/Ghost/Roles/GhostRoleSystem.cs +++ b/Content.Server/Ghost/Roles/GhostRoleSystem.cs @@ -5,6 +5,7 @@ using Content.Server.Ghost.Components; using Content.Server.Ghost.Roles.Components; using Content.Server.Ghost.Roles.UI; using Content.Server.Players; +using Content.Shared.Administration; using Content.Shared.GameTicking; using Content.Shared.Ghost; using Content.Shared.Ghost.Roles; diff --git a/Content.Server/Utility/Commands/EchoCommand.cs b/Content.Server/Utility/Commands/EchoCommand.cs index d5761c6ddf..50d73a9f04 100644 --- a/Content.Server/Utility/Commands/EchoCommand.cs +++ b/Content.Server/Utility/Commands/EchoCommand.cs @@ -1,4 +1,5 @@ using Content.Server.Administration; +using Content.Shared.Administration; using Robust.Shared.Console; using Robust.Shared.Localization; diff --git a/Content.Server/Administration/AnyCommandAttribute.cs b/Content.Shared/Administration/AnyCommandAttribute.cs similarity index 80% rename from Content.Server/Administration/AnyCommandAttribute.cs rename to Content.Shared/Administration/AnyCommandAttribute.cs index 0185cff723..426389b4e3 100644 --- a/Content.Server/Administration/AnyCommandAttribute.cs +++ b/Content.Shared/Administration/AnyCommandAttribute.cs @@ -2,12 +2,11 @@ using JetBrains.Annotations; using Robust.Shared.Console; -namespace Content.Server.Administration +namespace Content.Shared.Administration { /// /// Specifies that a command can be executed by any player. /// - /// [AttributeUsage(AttributeTargets.Class)] [BaseTypeRequired(typeof(IConsoleCommand))] [MeansImplicitUse] diff --git a/Resources/engineCommandPerms.yml b/Resources/engineCommandPerms.yml index 55a5240792..bfee0c7858 100644 --- a/Resources/engineCommandPerms.yml +++ b/Resources/engineCommandPerms.yml @@ -3,6 +3,7 @@ - disconnect - help - list + - quit - Flags: VAREDIT Commands: