feat(Core/ChatHandler/Conf): Flood Control Addon Messages (#12603)

* feat(Core/ChatHandler): Flood Control Addon Messages

Original Closed PR by @Kitzunu
https://github.com/azerothcore/azerothcore-wotlk/pull/11675

Cherrypicked TC:
cherry-pick commit (TrinityCore/TrinityCore@5384fc1)
cherry-pick commit (stoneharry/TrinityCore@a0629fc)

Co-Authored-By: stoneharry 3818405+stoneharry@users.noreply.github.com
Co-Authored-By: Shauren shauren.trinity@gmail.com
Co-Authored-By: stoneharry <3818405+stoneharry@users.noreply.github.com>
Co-Authored-By: Shauren <shauren.trinity@gmail.com>
Co-Authored-By: Kitzunu <24550914+Kitzunu@users.noreply.github.com>

* update: (pr): Review Response

* update: (core): Chathandler

No reason why this case should even exist. Previous or current.  This cast is under two sided interations which will always lead to you being in a group of some sorts. there is literally zero sense having a above or equal to level 80 if statement here.

* update (cleanup): Code Style

suggestion per @Nefertumm

Co-Authored-By: Angelo Venturini <nefertum.dev@protonmail.com>

Co-authored-by: stoneharry <3818405+stoneharry@users.noreply.github.com>
Co-authored-by: Shauren <shauren.trinity@gmail.com>
Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
Co-authored-by: Angelo Venturini <nefertum.dev@protonmail.com>
This commit is contained in:
M'Dic
2022-08-17 10:37:34 -04:00
committed by GitHub
parent b2e449fd15
commit 8b9541873a
9 changed files with 70 additions and 32 deletions

View File

@@ -130,6 +130,7 @@ WorldSession::WorldSession(uint32 id, std::string&& name, std::shared_ptr<WorldS
isRecruiter(isARecruiter),
m_currentVendorEntry(0),
_calendarEventCreationCooldown(0),
_addonMessageReceiveCount(0),
_timeSyncClockDeltaQueue(6),
_timeSyncClockDelta(0),
_pendingTimeSyncRequests()
@@ -446,6 +447,8 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
_recvQueue.readd(requeuePackets.begin(), requeuePackets.end());
METRIC_VALUE("processed_packets", processedPackets);
METRIC_VALUE("addon_messages", _addonMessageReceiveCount.load());
_addonMessageReceiveCount = 0;
if (!updater.ProcessUnsafe()) // <=> updater is of type MapSessionFilter
{