2024-01-27 15:19:52 +03:00
|
|
|
using Content.Server.Chat.Systems;
|
|
|
|
|
using Content.Shared.Administration;
|
2024-01-28 18:37:24 +07:00
|
|
|
using Content.Shared._White.Cult;
|
2024-07-28 16:54:32 +00:00
|
|
|
using Content.Shared._White.Cult.Components;
|
2024-01-27 15:19:52 +03:00
|
|
|
using Robust.Shared.Console;
|
|
|
|
|
using Robust.Shared.Enums;
|
2024-01-29 01:02:37 +07:00
|
|
|
using CultistComponent = Content.Shared._White.Cult.Components.CultistComponent;
|
2024-01-27 15:19:52 +03:00
|
|
|
|
|
|
|
|
namespace Content.Server.Chat.Commands
|
|
|
|
|
{
|
|
|
|
|
[AnyCommand]
|
|
|
|
|
internal sealed class CultCommand : IConsoleCommand
|
|
|
|
|
{
|
|
|
|
|
public string Command => "csay";
|
2024-01-28 16:31:58 +07:00
|
|
|
|
2024-01-27 15:19:52 +03:00
|
|
|
public string Description => "Send cult message";
|
2024-01-28 16:31:58 +07:00
|
|
|
|
2024-01-27 15:19:52 +03:00
|
|
|
public string Help => "csay <text>";
|
|
|
|
|
|
|
|
|
|
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
|
|
|
|
{
|
2024-01-27 16:02:34 +03:00
|
|
|
if (shell.Player is not { } player)
|
2024-01-27 15:19:52 +03:00
|
|
|
{
|
|
|
|
|
shell.WriteError("This command cannot be run from the server.");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (player.AttachedEntity is not { Valid: true } entity)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (player.Status != SessionStatus.InGame)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (args.Length < 1)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
var entityManager = IoCManager.Resolve<EntityManager>();
|
|
|
|
|
|
2024-07-28 16:54:32 +00:00
|
|
|
if (!entityManager.HasComponent<CultistComponent>(entity) &&
|
|
|
|
|
!entityManager.HasComponent<ConstructComponent>(entity))
|
2024-01-27 15:19:52 +03:00
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var message = string.Join(" ", args).Trim();
|
|
|
|
|
if (string.IsNullOrEmpty(message))
|
|
|
|
|
return;
|
2024-01-28 16:31:58 +07:00
|
|
|
|
|
|
|
|
entityManager.System<ChatSystem>()
|
|
|
|
|
.TrySendInGameOOCMessage(entity, message, InGameOOCChatType.Cult, false, shell, player);
|
2024-01-27 15:19:52 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|