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:
Ovah
2019-05-27 21:37:47 +02:00
committed by Shauren
parent 6b2e40257a
commit 0d433b1bc8
2 changed files with 10 additions and 1 deletions

View File

@@ -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())

View File

@@ -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;