Skip to content

Commit

Permalink
Merge branch 'master' into RAT-textures
Browse files Browse the repository at this point in the history
  • Loading branch information
Ratyyy authored Jun 30, 2024
2 parents cbe89f4 + b09b964 commit 64f2d01
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Content.Server/Administration/Commands/AdminWhoCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Content.Server.Administration.Commands;

[AnyCommand] // Corvax: Allow use to everyone
[AdminCommand(AdminFlags.Adminchat)] // Use only administration with flag AdminChat, eddit ADT
public sealed class AdminWhoCommand : IConsoleCommand
{
public string Command => "adminwho";
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Administration/Systems/BwoinkSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ protected override void OnBwoinkTextMessage(BwoinkTextMessage message, EntitySes
}
else if (senderAdmin is not null && senderAdmin.HasFlag(AdminFlags.Adminhelp))
{
bwoinkText = $"[color=red]{senderSession.Name}[/color]";
bwoinkText = $"\\[{senderAdmin.Title}\\][color=red]{senderSession.Name}[/color]"; //сообщение админа. тут подставляется префикс звания админа в сообщение. Tweak ADT
}
else
{
Expand Down
12 changes: 11 additions & 1 deletion Content.Server/Chat/Managers/ChatManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,19 @@ private void SendAdminChat(ICommonSession player, string message)
}

var clients = _adminManager.ActiveAdmins.Select(p => p.Channel);
var senderAdmin = _adminManager.GetAdminData(player); // Start-ADT Schrodinger Tweak: Отсюда сможем получить инфу о префиксе админа
if (senderAdmin == null)
{
return;
}
var senderName = player.Name; // Добавил переменную senderName, в ней содержиться player.Name и приставляем префикс к имени
if (!string.IsNullOrEmpty(senderAdmin.Title))
{
senderName += $"\\[{senderAdmin.Title}\\]";
} // End-ADT Tweak
var wrappedMessage = Loc.GetString("chat-manager-send-admin-chat-wrap-message",
("adminChannelName", Loc.GetString("chat-manager-admin-channel-name")),
("playerName", player.Name), ("message", FormattedMessage.EscapeText(message)));
("playerName", senderName), ("message", FormattedMessage.EscapeText(message))); // ADT Tweak тут заменил player.Name на senderName

foreach (var client in clients)
{
Expand Down

0 comments on commit 64f2d01

Please sign in to comment.