Better notes and bans (#14228)

Co-authored-by: Chief-Engineer <119664036+Chief-Engineer@users.noreply.github.com>
This commit is contained in:
Riggle
2023-07-21 13:38:52 +02:00
committed by GitHub
parent c6cb6ad928
commit 579913b617
84 changed files with 9820 additions and 886 deletions

View File

@@ -0,0 +1,38 @@
using Content.Server.Administration.Notes;
using Content.Shared.Administration;
using Content.Shared.CCVar;
using Robust.Server.Player;
using Robust.Shared.Configuration;
using Robust.Shared.Console;
namespace Content.Server.Administration.Commands;
[AnyCommand]
public sealed class OpenUserVisibleNotesCommand : IConsoleCommand
{
[Dependency] private readonly IConfigurationManager _configuration = default!;
[Dependency] private readonly IAdminNotesManager _notes = default!;
public const string CommandName = "adminremarks";
public string Command => CommandName;
public string Description => Loc.GetString("admin-remarks-command-description");
public string Help => $"Usage: {Command}";
public async void Execute(IConsoleShell shell, string argStr, string[] args)
{
if (!_configuration.GetCVar(CCVars.SeeOwnNotes))
{
shell.WriteError(Loc.GetString("admin-remarks-command-error"));
return;
}
if (shell.Player is not IPlayerSession player)
{
shell.WriteError("This does not work from the server console.");
return;
}
await _notes.OpenUserNotesEui(player);
}
}