2023-08-29 05:59:14 +06:00
|
|
|
using Content.Server.Chat.Managers;
|
|
|
|
|
using Content.Shared.Administration;
|
|
|
|
|
using Content.Shared.Chat;
|
|
|
|
|
using Robust.Server.Player;
|
|
|
|
|
using Robust.Shared.Console;
|
|
|
|
|
using Robust.Shared.Enums;
|
|
|
|
|
|
2024-01-28 18:18:54 +07:00
|
|
|
namespace Content.Server._White.Commands;
|
2023-08-29 05:59:14 +06:00
|
|
|
|
|
|
|
|
[AnyCommand]
|
|
|
|
|
internal sealed class NoticeCommand : IConsoleCommand
|
|
|
|
|
{
|
|
|
|
|
public string Command => "notice";
|
|
|
|
|
public string Description => "Send a chat message to self.";
|
|
|
|
|
public string Help => "notice <text>";
|
|
|
|
|
|
|
|
|
|
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
|
|
|
|
{
|
2024-01-23 08:43:11 +03:00
|
|
|
if (shell.Player is not { } player)
|
2023-08-29 05:59:14 +06:00
|
|
|
{
|
|
|
|
|
shell.WriteError("This command cannot be run from the server.");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (player.Status != SessionStatus.InGame)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (player.AttachedEntity is not { } playerEntity)
|
|
|
|
|
{
|
2023-09-15 14:43:18 +03:00
|
|
|
//shell.WriteError("You don't have an entity!"); By HitPanda: Breaks test
|
2023-08-29 05:59:14 +06:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (args.Length < 1)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
var message = string.Join(" ", args).Trim();
|
|
|
|
|
if (string.IsNullOrEmpty(message))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
IoCManager.Resolve<IChatManager>().ChatMessageToOne(ChatChannel.Emotes, message, message, EntityUid.Invalid, false, player.ConnectedClient, recordReplay: false);
|
|
|
|
|
}
|
|
|
|
|
}
|