mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-26 18:17:12 +03:00
## Mirror of PR #26263: [Add stealthmins](https://github.com/space-wizards/space-station-14/pull/26263) from <img src="https://avatars.githubusercontent.com/u/10567778?v=4" alt="space-wizards" width="22"/> [space-wizards](https://github.com/space-wizards)/[space-station-14](https://github.com/space-wizards/space-station-14) ###### `dca0c6694bce56fcf962feab2b59ad4a849f4533` PR opened by <img src="https://avatars.githubusercontent.com/u/32041239?v=4" width="16"/><a href="https://github.com/nikthechampiongr"> nikthechampiongr</a> at 2024-03-19 16:14:22 UTC --- PR changed 11 files with 197 additions and 10 deletions. The PR had the following labels: - Status: Needs Review --- <details open="true"><summary><h1>Original Body</h1></summary> > <!-- Please read these guidelines before opening your PR: https://docs.spacestation14.io/en/getting-started/pr-guideline --> > <!-- The text between the arrows are comments - they will not be visible on your PR. --> > > resolve #26013 > > ## About the PR > <!-- What did you change in this PR? --> > This pr implements stealthmins as laid out in issue #26013. > > There is now the Stealth permission flag. This allows admins to use the stealthmin command and to see other stealthmins. > > When stealthmin is toggled, the admin will not show up in adminwho except for other admins with the Stealth permission. > > The stealthmin command sends fake de-admin/re-admin messages to admins without the Stealth flag. > > stealthmin persists in the same way deadmin does(it persists for the lifetime of the server). > > Admin login/logout messages are suppressed for stealthmins except for other admins with the Stealth flag. > > It is still possible possible to find stealthed admins using toolshed commands or logs. This is in line with the requirements of the issue, and I don't want to start clobbering functionality of logs and toolshed. > > ## Why / Balance > > See #26013 > > ## Technical details > <!-- If this is a code change, summarize at high level how your new code works. This makes it easier to review. --> > > Stealth flag now exist for AdminFlags. > > An admin's stealth status is saved in their admin registration and in ContentData. > > SendAdminAnnouncement now takes a whitelist flag and blacklist flag (This will work with multiple flags). This is necessary to suppress admin announcements where necessary. Blacklist takes priority over whitelist. > > ## Media > <!-- > PRs which make ingame changes (adding clothing, items, new features, etc) are required to have media attached that showcase the changes. > Small fixes/refactors are exempt. > Any media may be used in SS14 progress reports, with clear credit given. > > If you're unsure whether your PR will require media, ask a maintainer. > > Check the box below to confirm that you have in fact seen this (put an X in the brackets, like [X]): > --> > > https://github.com/space-wizards/space-station-14/assets/32041239/98ec48c3-170e-406a-b177-07003ff7d59f > > > - [x] I have added screenshots/videos to this PR showcasing its changes ingame, **or** this PR does not require an ingame showcase > > **Changelog** > <!-- > Make players aware of new features and changes that could affect how they play the game by adding a Changelog entry. Please read the Changelog guidelines located at: https://docs.spacestation14.io/en/getting-started/pr-guideline#changelog > --> > > <!-- > Make sure to take this Changelog template out of the comment block in order for it to show up. > 🆑 > - add: Added fun! > - remove: Removed fun! > - tweak: Changed fun! > - fix: Fixed fun! > --> > > 🆑 > ADMIN: > - add: The stealthmin command has been added. Admins with the Stealth permission can now hide themselves from adminwho except for other admins with that permission. </details> --------- Signed-off-by: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com> Co-authored-by: SimpleStation14 <Unknown> Co-authored-by: VMSolidus <evilexecutive@gmail.com> Co-authored-by: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com>
55 lines
2.8 KiB
C#
55 lines
2.8 KiB
C#
using System.Diagnostics.CodeAnalysis;
|
|
using Content.Shared.Administration;
|
|
using Content.Shared.Chat;
|
|
using Robust.Shared.Network;
|
|
using Robust.Shared.Player;
|
|
|
|
namespace Content.Server.Chat.Managers
|
|
{
|
|
public interface IChatManager
|
|
{
|
|
void Initialize();
|
|
|
|
/// <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 SendAdminAlert(string message);
|
|
void SendAdminAlert(EntityUid player, string message);
|
|
|
|
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);
|
|
|
|
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);
|
|
|
|
void ChatMessageToManyFiltered(Filter filter, ChatChannel channel, string message, string wrappedMessage, EntityUid source, bool hideChat, bool recordReplay, Color? colorOverride, string? audioPath = null, float audioVolume = 0);
|
|
|
|
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 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>
|
|
bool HandleRateLimit(ICommonSession player);
|
|
}
|
|
}
|