mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Players: out of range group updates will now get sent every 5 seconds instead of as soon as they are available to reflect retail behaivior. (#23323)
* according to sniffs the group update packet for out of range members has a fixed 5 seconds interval instead of spaming packets like crazy for example when updating positions. On 4.x and above this will fix a very nasty and ugly fps drop
* validated with 4.3.4 and 3.3.5 sniffs
(cherry picked from commit 635cefc67e)
This commit is contained in:
@@ -348,6 +348,8 @@ Player::Player(WorldSession* session) : Unit(true), m_sceneMgr(this)
|
||||
for (uint8 i = 0; i < MAX_CUF_PROFILES; ++i)
|
||||
_CUFProfiles[i] = nullptr;
|
||||
|
||||
m_groupUpdateTimer.Reset(5000);
|
||||
|
||||
_advancedCombatLoggingEnabled = false;
|
||||
|
||||
_restMgr = std::make_unique<RestMgr>(this);
|
||||
@@ -1209,7 +1211,12 @@ void Player::Update(uint32 p_time)
|
||||
}
|
||||
|
||||
// group update
|
||||
SendUpdateToOutOfRangeGroupMembers();
|
||||
m_groupUpdateTimer.Update(p_time);
|
||||
if (m_groupUpdateTimer.Passed())
|
||||
{
|
||||
SendUpdateToOutOfRangeGroupMembers();
|
||||
m_groupUpdateTimer.Reset(5000);
|
||||
}
|
||||
|
||||
Pet* pet = GetPet();
|
||||
if (pet && !pet->IsWithinDistInMap(this, GetMap()->GetVisibilityRange()) && !pet->isPossessed())
|
||||
|
||||
@@ -3005,6 +3005,8 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
|
||||
std::array<std::unique_ptr<CUFProfile>, MAX_CUF_PROFILES> _CUFProfiles;
|
||||
|
||||
TimeTrackerSmall m_groupUpdateTimer;
|
||||
|
||||
private:
|
||||
// internal common parts for CanStore/StoreItem functions
|
||||
InventoryResult CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemPosCountVec& dest, ItemTemplate const* pProto, uint32& count, bool swap, Item* pSrcItem) const;
|
||||
|
||||
Reference in New Issue
Block a user