Skip to content

Commit

Permalink
Merge branch 'master' into only_admin_use_adminwho
Browse files Browse the repository at this point in the history
  • Loading branch information
Schrodinger71 authored Jun 30, 2024
2 parents ad3e84b + c93b0f0 commit 0a9477e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
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 0a9477e

Please sign in to comment.