Skip to content

Commit

Permalink
Ahelpfix (#109)
Browse files Browse the repository at this point in the history
* fix ahelp system for logging

* fix ahelp system v2

* try fix ahelp v3

* fixed ahelp sys

* try fix ahelp
  • Loading branch information
Sh1ntra authored Oct 31, 2024
1 parent b9de0bc commit 29490ac
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Content.Server/Administration/Systems/BwoinkSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,30 @@ protected override void OnBwoinkTextMessage(BwoinkTextMessage message, EntitySes
RaiseNetworkEvent(msg, session.Channel);
}
}
var sendsWebhook = _webhookUrl != string.Empty;
if (sendsWebhook)
{
if (!_messageQueues.ContainsKey(msg.UserId))
_messageQueues[msg.UserId] = new Queue<string>();

var str = message.Text;
var unameLength = senderSession.Name.Length;

if (unameLength + str.Length + _maxAdditionalChars > DescriptionMax)
{
str = str[..(DescriptionMax - _maxAdditionalChars - unameLength)];
}
var nonAfkAdmins = GetNonAfkAdmins();
_messageQueues[msg.UserId].Enqueue(GenerateAHelpMessage(senderSession.Name, str, !personalChannel, _gameTicker.RoundDuration().ToString("hh\\:mm\\:ss"), _gameTicker.RunLevel, playedSound: playSound, noReceivers: nonAfkAdmins.Count == 0));
}

if (admins.Count != 0 || sendsWebhook)
return;

// No admin online, let the player know
var systemText = Loc.GetString("bwoink-system-starmute-message-no-other-users");
var starMuteMsg = new BwoinkTextMessage(message.UserId, SystemUserId, systemText);
RaiseNetworkEvent(starMuteMsg, senderSession.Channel);
}

private IList<INetChannel> GetNonAfkAdmins()
Expand Down

0 comments on commit 29490ac

Please sign in to comment.