mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 21:48:58 +03:00
# Description Chatstack. Can be changed/disabled in settings, and the chat automatically updates to reflect the change. Does not interfere with filters, etc. Also updated ChatMessage class and serverside IChatManager with a new IgnoreChatStack bool option, default false. Currently is limited to looking up to 3 messages behind, only because I feel off adding a textbox to the options. --- # TODO - [x] Make sure it works - [x] Add it to settings --- <details><summary><h1>Media</h1></summary> <p>  [ee.webm](https://github.com/user-attachments/assets/bf1c92f0-b52a-47a0-b142-70b1ee5003cc) </p> </details> --- # Changelog 🆑 - add: Chatstack. Look for it in Options under "General - Accessibility". --------- Co-authored-by: sleepyyapril <123355664+sleepyyapril@users.noreply.github.com> (cherry picked from commit 78edbab4308bcef190fe387d36df79d90200e084)
53 lines
2.9 KiB
C#
53 lines
2.9 KiB
C#
using System.Diagnostics.CodeAnalysis;
|
|
using Content.Shared.Administration;
|
|
using Content.Shared.Chat;
|
|
using Content.Shared.Players.RateLimiting;
|
|
using Robust.Shared.Network;
|
|
using Robust.Shared.Player;
|
|
|
|
namespace Content.Server.Chat.Managers
|
|
{
|
|
public interface IChatManager : ISharedChatManager
|
|
{
|
|
/// <summary>
|
|
/// Dispatch a server announcement to every connected player.
|
|
/// </summary>
|
|
/// <param name="message"></param>
|
|
/// <param name="colorOverride">Override the color of the message being sent.</param>
|
|
void DispatchServerAnnouncement(string message, Color? colorOverride = null);
|
|
|
|
void DispatchServerMessage(ICommonSession player, string message, bool suppressLog = false);
|
|
|
|
void TrySendOOCMessage(ICommonSession player, string message, OOCChatType type);
|
|
|
|
void SendHookOOC(string sender, string message);
|
|
void SendAdminAnnouncement(string message, AdminFlags? flagBlacklist = null, AdminFlags? flagWhitelist = null);
|
|
void SendAdminAnnouncementMessage(ICommonSession player, string message, bool suppressLog = true);
|
|
|
|
void ChatMessageToOne(ChatChannel channel, string message, string wrappedMessage, EntityUid source, bool hideChat,
|
|
INetChannel client, Color? colorOverride = null, bool recordReplay = false, string? audioPath = null, float audioVolume = 0, NetUserId? author = null, bool ignoreChatStack = false);
|
|
|
|
void ChatMessageToMany(ChatChannel channel, string message, string wrappedMessage, EntityUid source, bool hideChat, bool recordReplay,
|
|
IEnumerable<INetChannel> clients, Color? colorOverride = null, string? audioPath = null, float audioVolume = 0, NetUserId? author = null, bool ignoreChatStack = false);
|
|
|
|
void ChatMessageToManyFiltered(Filter filter, ChatChannel channel, string message, string wrappedMessage, EntityUid source, bool hideChat, bool recordReplay, Color? colorOverride, string? audioPath = null, float audioVolume = 0, bool ignoreChatStack = false);
|
|
|
|
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, bool ignoreChatStack = false);
|
|
|
|
bool MessageCharacterLimit(ICommonSession player, string message);
|
|
|
|
void DeleteMessagesBy(ICommonSession player);
|
|
|
|
[return: NotNullIfNotNull(nameof(author))]
|
|
ChatUser? EnsurePlayer(NetUserId? author);
|
|
|
|
/// <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>
|
|
RateLimitStatus HandleRateLimit(ICommonSession player);
|
|
}
|
|
}
|