Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add prefix for achat #32

Merged
merged 8 commits into from
Jun 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading