2023-11-05 18:19:59 -08:00
|
|
|
using System.Diagnostics.CodeAnalysis;
|
2024-03-24 17:39:53 +02:00
|
|
|
using Content.Shared.Administration;
|
2022-03-30 22:21:58 -07:00
|
|
|
using Content.Shared.Chat;
|
2024-09-30 01:19:00 +13:00
|
|
|
using Content.Shared.Players.RateLimiting;
|
2022-03-30 22:21:58 -07:00
|
|
|
using Robust.Shared.Network;
|
2022-06-03 21:37:35 +10:00
|
|
|
using Robust.Shared.Player;
|
2019-04-13 09:45:09 +02:00
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Server.Chat.Managers
|
2019-04-13 09:45:09 +02:00
|
|
|
{
|
2024-09-30 01:19:00 +13:00
|
|
|
public interface IChatManager : ISharedChatManager
|
2019-04-13 09:45:09 +02:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Dispatch a server announcement to every connected player.
|
|
|
|
|
/// </summary>
|
2022-03-01 05:21:28 -08:00
|
|
|
/// <param name="message"></param>
|
|
|
|
|
/// <param name="colorOverride">Override the color of the message being sent.</param>
|
|
|
|
|
void DispatchServerAnnouncement(string message, Color? colorOverride = null);
|
2019-04-13 09:45:09 +02:00
|
|
|
|
2023-08-30 21:46:11 -07:00
|
|
|
void DispatchServerMessage(ICommonSession player, string message, bool suppressLog = false);
|
2019-04-13 09:45:09 +02:00
|
|
|
|
2023-10-28 09:59:53 +11:00
|
|
|
void TrySendOOCMessage(ICommonSession player, string message, OOCChatType type);
|
2019-04-17 23:31:43 +02:00
|
|
|
|
|
|
|
|
void SendHookOOC(string sender, string message);
|
2024-03-24 17:39:53 +02:00
|
|
|
void SendAdminAnnouncement(string message, AdminFlags? flagBlacklist = null, AdminFlags? flagWhitelist = null);
|
2024-05-26 08:18:05 +12:00
|
|
|
void SendAdminAnnouncementMessage(ICommonSession player, string message, bool suppressLog = true);
|
2022-03-30 22:21:58 -07:00
|
|
|
|
2022-10-18 19:59:09 +13:00
|
|
|
void ChatMessageToOne(ChatChannel channel, string message, string wrappedMessage, EntityUid source, bool hideChat,
|
2023-11-05 18:19:59 -08:00
|
|
|
INetChannel client, Color? colorOverride = null, bool recordReplay = false, string? audioPath = null, float audioVolume = 0, NetUserId? author = null);
|
2022-11-23 00:52:19 +13:00
|
|
|
|
|
|
|
|
void ChatMessageToMany(ChatChannel channel, string message, string wrappedMessage, EntityUid source, bool hideChat, bool recordReplay,
|
2023-11-05 18:19:59 -08:00
|
|
|
IEnumerable<INetChannel> clients, Color? colorOverride = null, string? audioPath = null, float audioVolume = 0, NetUserId? author = null);
|
2022-11-23 00:52:19 +13:00
|
|
|
|
2022-12-19 21:39:01 -06:00
|
|
|
void ChatMessageToManyFiltered(Filter filter, ChatChannel channel, string message, string wrappedMessage, EntityUid source, bool hideChat, bool recordReplay, Color? colorOverride, string? audioPath = null, float audioVolume = 0);
|
2022-11-23 00:52:19 +13:00
|
|
|
|
2023-11-05 18:19:59 -08:00
|
|
|
void ChatMessageToAll(ChatChannel channel, string message, string wrappedMessage, EntityUid source, bool hideChat, bool recordReplay, Color? colorOverride = null, string? audioPath = null, float audioVolume = 0, NetUserId? author = null);
|
2022-03-30 22:21:58 -07:00
|
|
|
|
2023-10-28 09:59:53 +11:00
|
|
|
bool MessageCharacterLimit(ICommonSession player, string message);
|
2023-10-14 02:02:56 -07:00
|
|
|
|
2024-08-31 11:38:03 +00:00
|
|
|
void DeleteMessagesBy(NetUserId uid);
|
2023-11-05 18:19:59 -08:00
|
|
|
|
|
|
|
|
[return: NotNullIfNotNull(nameof(author))]
|
|
|
|
|
ChatUser? EnsurePlayer(NetUserId? author);
|
2023-11-27 04:08:30 +01:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Called when a player sends a chat message to handle rate limits.
|
|
|
|
|
/// Will update counts and do necessary actions if breached.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="player">The player sending a chat message.</param>
|
|
|
|
|
/// <returns>False if the player has violated rate limits and should be blocked from sending further messages.</returns>
|
2024-06-21 00:13:02 +02:00
|
|
|
RateLimitStatus HandleRateLimit(ICommonSession player);
|
2019-04-13 09:45:09 +02:00
|
|
|
}
|
|
|
|
|
}
|