Files
OldThink/Content.Server/Chat/Commands/OOCCommand.cs
rhailrake 1594dff648 Gulag v2 (#21)
* Components или чет типо того

* Gulag System

* Shared shit

* Cvars

* Ban manager update

* Ghost roles shit

* No ooc for gulaged

* Connection manager update

* Gulag proto shit

* Merge conflict issue

* Fixing shit

* Фикс говняхи плюс QOL

* Pendos loc

* better loc

* More qol

* ctrl+s issue

* No bwoink for banned

* Ore shit

* MAP!!!!!!

---------

Co-authored-by: Mona Hmiza <you@example.com>
2024-02-03 11:39:40 +00:00

40 lines
1.2 KiB
C#

using Content.Server._Miracle.GulagSystem;
using Content.Server.Chat.Managers;
using Content.Shared.Administration;
using Robust.Shared.Console;
namespace Content.Server.Chat.Commands
{
[AnyCommand]
internal sealed class OOCCommand : IConsoleCommand
{
public string Command => "ooc";
public string Description => "Send Out Of Character chat messages.";
public string Help => "ooc <text>";
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
if (shell.Player is not { } player)
{
shell.WriteError("This command cannot be run from the server.");
return;
}
var gulag = EntitySystem.Get<GulagSystem>();
if (gulag.IsUserGulaged(shell.Player.UserId, out var _))
{
return;
}
if (args.Length < 1)
return;
var message = string.Join(" ", args).Trim();
if (string.IsNullOrEmpty(message))
return;
IoCManager.Resolve<IChatManager>().TrySendOOCMessage(player, message, OOCChatType.OOC);
}
}
}