* reeeecolllaaaaaaaa * gonna convert these to public while I'm here for consistency sake * requested changes.
33 lines
923 B
C#
33 lines
923 B
C#
using Content.Server.Chat.Managers;
|
|
using Content.Shared.Administration;
|
|
using Robust.Shared.Console;
|
|
|
|
namespace Content.Server.Chat.Commands
|
|
{
|
|
[AnyCommand]
|
|
internal sealed class OOCCommand : LocalizedCommands
|
|
{
|
|
[Dependency] private readonly IChatManager _chatManager = default!;
|
|
|
|
public override string Command => "ooc";
|
|
|
|
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
|
{
|
|
if (shell.Player is not { } player)
|
|
{
|
|
shell.WriteError(Loc.GetString($"shell-cannot-run-command-from-server"));
|
|
return;
|
|
}
|
|
|
|
if (args.Length < 1)
|
|
return;
|
|
|
|
var message = string.Join(" ", args).Trim();
|
|
if (string.IsNullOrEmpty(message))
|
|
return;
|
|
|
|
_chatManager.TrySendOOCMessage(player, message, OOCChatType.OOC);
|
|
}
|
|
}
|
|
}
|