2021-06-09 22:19:39 +02:00
|
|
|
using Content.Server.Chat.Managers;
|
2021-01-03 12:13:31 -03:00
|
|
|
using Content.Shared.Administration;
|
2021-02-11 01:13:03 -08:00
|
|
|
using Robust.Server.Player;
|
2021-02-01 16:49:43 -08:00
|
|
|
using Robust.Shared.Console;
|
2021-01-03 12:13:31 -03:00
|
|
|
using Robust.Shared.IoC;
|
|
|
|
|
using Robust.Shared.Localization;
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.Administration.Commands
|
|
|
|
|
{
|
|
|
|
|
[AdminCommand(AdminFlags.Admin)]
|
2022-02-16 00:23:23 -07:00
|
|
|
sealed class DSay : IConsoleCommand
|
2021-01-03 12:13:31 -03:00
|
|
|
{
|
|
|
|
|
public string Command => "dsay";
|
|
|
|
|
|
2021-06-21 02:13:54 +02:00
|
|
|
public string Description => Loc.GetString("dsay-command-description");
|
2021-01-03 12:13:31 -03:00
|
|
|
|
2021-06-21 02:13:54 +02:00
|
|
|
public string Help => Loc.GetString("dsay-command-help-text", ("command", Command));
|
2021-01-03 12:13:31 -03:00
|
|
|
|
2021-02-01 16:49:43 -08:00
|
|
|
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
2021-01-03 12:13:31 -03:00
|
|
|
{
|
2021-02-01 16:49:43 -08:00
|
|
|
var player = shell.Player as IPlayerSession;
|
2021-01-03 12:13:31 -03:00
|
|
|
if (player == null)
|
|
|
|
|
{
|
2021-06-21 02:13:54 +02:00
|
|
|
shell.WriteLine("shell-only-players-can-run-this-command");
|
2021-01-03 12:13:31 -03:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (args.Length < 1)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
var message = string.Join(" ", args).Trim();
|
|
|
|
|
if (string.IsNullOrEmpty(message))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
var chat = IoCManager.Resolve<IChatManager>();
|
|
|
|
|
|
|
|
|
|
chat.SendAdminDeadChat(player, message);
|
2021-06-09 22:19:39 +02:00
|
|
|
|
2021-01-03 12:13:31 -03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|