-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-picked commit dca0c66 from space-wizards/space-station-14/master
- Loading branch information
1 parent
b68ed3c
commit 9bb149f
Showing
11 changed files
with
190 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
Content.Server/Administration/Commands/StealthminCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using Content.Server.Administration.Managers; | ||
using Content.Shared.Administration; | ||
using JetBrains.Annotations; | ||
using Robust.Shared.Console; | ||
using Robust.Shared.Utility; | ||
|
||
namespace Content.Server.Administration.Commands; | ||
|
||
[UsedImplicitly] | ||
[AdminCommand(AdminFlags.Stealth)] | ||
public sealed class StealthminCommand : LocalizedCommands | ||
{ | ||
public override string Command => "stealthmin"; | ||
|
||
public override void Execute(IConsoleShell shell, string argStr, string[] args) | ||
{ | ||
var player = shell.Player; | ||
if (player == null) | ||
{ | ||
shell.WriteLine(Loc.GetString("cmd-stealthmin-no-console")); | ||
return; | ||
} | ||
|
||
var mgr = IoCManager.Resolve<IAdminManager>(); | ||
|
||
var adminData = mgr.GetAdminData(player); | ||
|
||
DebugTools.AssertNotNull(adminData); | ||
|
||
if (!adminData!.Stealth) | ||
{ | ||
mgr.Stealth(player); | ||
} | ||
else | ||
{ | ||
mgr.UnStealth(player); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
Resources/Locale/en-US/administration/commands/stealthmin-command.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
cmd-stealthmin-desc = Toggle whether others can see you in adminwho. | ||
cmd-stealthmin-help = Usage: stealthmin\nUse stealthmin to toggle whether you appear in the output of the adminwho command. | ||
cmd-stealthmin-no-console = You cannot use this command from the server console. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters