Merge branch 'azerothcore:master' into Playerbot

This commit is contained in:
ZhengPeiRu21
2022-08-18 13:48:09 -06:00
committed by GitHub
13 changed files with 96 additions and 65 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(),
@@ -459,6 +460,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
{

View File

@@ -1206,6 +1206,9 @@ private:
// Packets cooldown
time_t _calendarEventCreationCooldown;
// Addon Message count for Metric
std::atomic<uint32> _addonMessageReceiveCount;
CircularBuffer<std::pair<int64, uint32>> _timeSyncClockDeltaQueue; // first member: clockDelta. Second member: latency of the packet exchange that was used to compute that clockDelta.
int64 _timeSyncClockDelta;
void ComputeNewClockDelta();