From 7ddb99117ecdaa1d27719908aca6283a0f90d74e Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 30 Jul 2025 17:06:44 +0800 Subject: Use getAvatars already called for Discord Party numbers so we don't have to make any extra getAvatars calls just for this, as it's pricy in crowds, and we'll just be piggybacking `updateSpeakerList` and `updateNearbyList`. --- indra/newview/llpanelpeople.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llpanelpeople.cpp') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 72fa553023..da7f524146 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -843,6 +843,9 @@ void LLPanelPeople::updateNearbyList() LLWorld::getInstance()->getAvatars(&mNearbyList->getIDs(), &positions, gAgent.getPositionGlobal(), gSavedSettings.getF32("MPVNearMeRange")); mNearbyList->setDirty(); +#ifdef LL_DISCORD + LLAppViewer::updateDiscordPartyMaxSize(mNearbyList->getIDs().size()); +#endif DISTANCE_COMPARATOR.updateAvatarsPositions(positions, mNearbyList->getIDs()); LLActiveSpeakerMgr::instance().update(true); -- cgit v1.2.3 From 0146a8b3119e2c6c652dd7b608de9efcdbd3fd50 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 30 Jul 2025 22:22:36 +0800 Subject: Update Discord Activity only when integration is enabled No need to check setting for the status change callback one, because getting there would need to be connected to Discord first, which in turn needs the integration to be enabled first. --- indra/newview/llpanelpeople.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanelpeople.cpp') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index da7f524146..bf2462d7d9 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -844,7 +844,8 @@ void LLPanelPeople::updateNearbyList() LLWorld::getInstance()->getAvatars(&mNearbyList->getIDs(), &positions, gAgent.getPositionGlobal(), gSavedSettings.getF32("MPVNearMeRange")); mNearbyList->setDirty(); #ifdef LL_DISCORD - LLAppViewer::updateDiscordPartyMaxSize(mNearbyList->getIDs().size()); + if (gSavedSettings.getBOOL("EnableDiscord")) + LLAppViewer::updateDiscordPartyMaxSize(mNearbyList->getIDs().size()); #endif DISTANCE_COMPARATOR.updateAvatarsPositions(positions, mNearbyList->getIDs()); -- cgit v1.2.3 From b81c1c4e871be0ff5e5dbbfa235571350cd477fe Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 31 Jul 2025 20:42:38 +0800 Subject: Optimise nearby tab distance & arrival time impl by not having extra calls to getAvatars, by avoiding unnecessary function overhead which actually make it possible to share some iterative code, and by piggybacking updateNearbyList and updateArrivalTime which is already done periodically though the range had to be lengthened to match nearby list range which is MPVNearMeRange instead of SLv's NearMeRange. Minimise differences from SLv too (arrival time really doesn't need to be updated *every* second.. every 5 seconds is just okay). --- indra/newview/llpanelpeople.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanelpeople.cpp') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index bf2462d7d9..6d1c71b893 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -160,6 +160,7 @@ public: mAvatarsPositions[*id_it] = *pos_it; } }; + const id_to_pos_map_t& getAvatarsPositions() const { return mAvatarsPositions; } protected: virtual bool doCompare(const LLAvatarListItem* item1, const LLAvatarListItem* item2) const @@ -849,6 +850,7 @@ void LLPanelPeople::updateNearbyList() #endif DISTANCE_COMPARATOR.updateAvatarsPositions(positions, mNearbyList->getIDs()); + mNearbyList->setAvatarsPositions(DISTANCE_COMPARATOR.getAvatarsPositions()); LLActiveSpeakerMgr::instance().update(true); } @@ -1569,7 +1571,7 @@ bool LLPanelPeople::updateNearbyArrivalTime() { std::vector positions; std::vector uuids; - static LLCachedControl range(gSavedSettings, "NearMeRange"); + static LLCachedControl range(gSavedSettings, "MPVNearMeRange"); LLWorld::getInstance()->getAvatars(&uuids, &positions, gAgent.getPositionGlobal(), range); LLRecentPeople::instance().updateAvatarsArrivalTime(uuids); return LLApp::isExiting(); -- cgit v1.2.3 From 3c464b4d8bb9bed58edc0418a8c91e8a609b5160 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 31 Jul 2025 23:39:09 +0800 Subject: Optimise arrival & departure notifications by not having extra calls to getAvatars. The avatars' positions member had to be moved to an object that is accessible from VOAvatar too, and that would be the global Agent. It makes sense too, that it's the object that keeps the positions of other agents. It even has a section for positions too. --- indra/newview/llpanelpeople.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llpanelpeople.cpp') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 6d1c71b893..aca8cf189b 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -850,7 +850,7 @@ void LLPanelPeople::updateNearbyList() #endif DISTANCE_COMPARATOR.updateAvatarsPositions(positions, mNearbyList->getIDs()); - mNearbyList->setAvatarsPositions(DISTANCE_COMPARATOR.getAvatarsPositions()); + gAgent.setAvatarsPositions(DISTANCE_COMPARATOR.getAvatarsPositions()); LLActiveSpeakerMgr::instance().update(true); } -- cgit v1.2.3