2021-01-03 12:13:31 -03:00
|
|
|
using Content.Server.Interfaces.Chat;
|
|
|
|
|
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)]
|
2021-02-01 16:49:43 -08:00
|
|
|
class DSay : IConsoleCommand
|
2021-01-03 12:13:31 -03:00
|
|
|
{
|
|
|
|
|
public string Command => "dsay";
|
|
|
|
|
|
|
|
|
|
public string Description => Loc.GetString("Sends a message to deadchat as an admin");
|
|
|
|
|
|
|
|
|
|
public string Help => Loc.GetString($"Usage: {Command} <message>");
|
|
|
|
|
|
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-02-01 16:49:43 -08:00
|
|
|
shell.WriteLine("Only players can use 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);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|