From 18c39edba9e48c43bf350d36d5ebd157d2ffe85b Mon Sep 17 00:00:00 2001 From: Secret Foxtail Date: Wed, 6 Aug 2025 03:57:47 -0600 Subject: Retire MPVNearMeRange Use NearMeRange to minimize difference with SLv --- indra/newview/app_settings/settings.xml | 11 ----------- indra/newview/llpanelpeople.cpp | 4 ++-- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 7ada2925bf..4305aa0a33 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -14358,17 +14358,6 @@ Value 0 - MPVNearMeRange - - Comment - Search radius in the people panel - Persist - 1 - Type - F32 - Value - 4096 - RenderVSyncEnabled Comment diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index aca8cf189b..01541968de 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -842,7 +842,7 @@ void LLPanelPeople::updateNearbyList() std::vector positions; - LLWorld::getInstance()->getAvatars(&mNearbyList->getIDs(), &positions, gAgent.getPositionGlobal(), gSavedSettings.getF32("MPVNearMeRange")); + LLWorld::getInstance()->getAvatars(&mNearbyList->getIDs(), &positions, gAgent.getPositionGlobal(), gSavedSettings.getF32("NearMeRange")); mNearbyList->setDirty(); #ifdef LL_DISCORD if (gSavedSettings.getBOOL("EnableDiscord")) @@ -1571,7 +1571,7 @@ bool LLPanelPeople::updateNearbyArrivalTime() { std::vector positions; std::vector uuids; - static LLCachedControl range(gSavedSettings, "MPVNearMeRange"); + static LLCachedControl range(gSavedSettings, "NearMeRange"); LLWorld::getInstance()->getAvatars(&uuids, &positions, gAgent.getPositionGlobal(), range); LLRecentPeople::instance().updateAvatarsArrivalTime(uuids); return LLApp::isExiting(); -- cgit v1.2.3 From 4930f8cf56d407d1325a41fb6c674e12725e23b5 Mon Sep 17 00:00:00 2001 From: Secret Foxtail Date: Wed, 6 Aug 2025 03:59:17 -0600 Subject: Nearby tab slider Add slider allowing users to adjust NearMeRange --- indra/newview/skins/default/xui/en/panel_people.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index f1c03fdaa8..8363ef614f 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -177,6 +177,18 @@ Learn about [https://community.secondlife.com/knowledgebase/joining-and-particip function="People.DelFriend" /> + Date: Wed, 6 Aug 2025 18:33:01 -0600 Subject: panel_people.xml adjustment Add "m" after the NearMeRange slider distance. --- indra/newview/skins/default/xui/en/panel_people.xml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index 8363ef614f..ec097a9dde 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -181,14 +181,21 @@ Learn about [https://community.secondlife.com/knowledgebase/joining-and-particip control_name="NearMeRange" decimal_digits="0" increment="1" - follows="top|left" + follows="left|top" left="5" min_val="0" max_val="4096" label="Range:" name="near_me_range" tool_tip="Nearby people range" - width="250" /> + width="230"/> + + m + Date: Thu, 7 Aug 2025 11:00:14 +0800 Subject: Rich Presence w/o requiring access to friends list Thank you Signal Linden for the pointer from https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#af0a85e30f2b3d8a0b502fd23744ee58e "Note: On Desktop, rich presence can be set before calling Client::Connect, but it will be cleared if the Client connects. When Client is not connected, this sets the rich presence in the current user's Discord client when available." This lead me to setting the Application ID here https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#ad452335c06b28be0406dab824acccc49 in place of setting it on https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1AuthorizationArgs.html which would lead Authorize, GetToken, UpdateToken, Connect, and so on. This means we don't even need the SecAPI saveCredential, loadCredential and deleteCredential parts now. --- indra/newview/llappviewer.cpp | 97 ++++------------------------------- indra/newview/llfloaterpreference.cpp | 2 +- 2 files changed, 10 insertions(+), 89 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 8dec75e64e..c9bdc29bea 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -5933,100 +5933,21 @@ void LLAppViewer::initDiscordSocial() gDiscordPartyMaxSize = 0; gDiscordTimestampsStart = time(nullptr); gDiscordClient = std::make_shared(); - gDiscordClient->SetStatusChangedCallback([](discordpp::Client::Status status, discordpp::Client::Error, int32_t) { - if (status == discordpp::Client::Status::Ready) - { - updateDiscordActivity(); - } - }); - if (gSavedSettings.getBOOL("EnableDiscord")) - { - auto credential = gSecAPIHandler->loadCredential("Discord"); - if (credential.notNull()) - { - gDiscordClient->UpdateToken(discordpp::AuthorizationTokenType::Bearer, credential->getAuthenticator()["token"].asString(), [](discordpp::ClientResult result) { - if (result.Successful()) - gDiscordClient->Connect(); - else - LL_WARNS("Discord") << result.Error() << LL_ENDL; - }); - } - else - { - LL_WARNS("Discord") << "Integration was enabled, but no credentials. Disabling integration." << LL_ENDL; - gSavedSettings.setBOOL("EnableDiscord", false); - } - } + gDiscordClient->SetApplicationId(1393451183741599796); + updateDiscordActivity(); } -void LLAppViewer::toggleDiscordIntegration(const LLSD& value) +void LLAppViewer::updateDiscordActivity() { - static const uint64_t APPLICATION_ID = 1393451183741599796; - if (value.asBoolean()) - { - discordpp::AuthorizationArgs args{}; - args.SetClientId(APPLICATION_ID); - args.SetScopes(discordpp::Client::GetDefaultPresenceScopes()); - auto codeVerifier = gDiscordClient->CreateAuthorizationCodeVerifier(); - args.SetCodeChallenge(codeVerifier.Challenge()); - gDiscordClient->Authorize(args, [codeVerifier](auto result, auto code, auto redirectUri) { - if (result.Successful()) - { - gDiscordClient->GetToken(APPLICATION_ID, code, codeVerifier.Verifier(), redirectUri, [](discordpp::ClientResult result, std::string accessToken, std::string, discordpp::AuthorizationTokenType, int32_t, std::string) { - if (result.Successful()) - { - gDiscordClient->UpdateToken(discordpp::AuthorizationTokenType::Bearer, accessToken, [accessToken](discordpp::ClientResult result) { - if (result.Successful()) - { - LLSD authenticator = LLSD::emptyMap(); - authenticator["token"] = accessToken; - gSecAPIHandler->saveCredential(gSecAPIHandler->createCredential("Discord", LLSD::emptyMap(), authenticator), true); - gDiscordClient->Connect(); - } - else - { - LL_WARNS("Discord") << result.Error() << LL_ENDL; - } - }); - } - else - { - LL_WARNS("Discord") << result.Error() << LL_ENDL; - } - }); - } - else - { - LL_WARNS("Discord") << result.Error() << LL_ENDL; - gSavedSettings.setBOOL("EnableDiscord", false); - } - }); - } - else + LL_PROFILE_ZONE_SCOPED; + + static LLCachedControl integration_enabled(gSavedSettings, "EnableDiscord", true); + if (!integration_enabled) { - gDiscordClient->Disconnect(); - auto credential = gSecAPIHandler->loadCredential("Discord"); - if (credential.notNull()) - { - gDiscordClient->RevokeToken(APPLICATION_ID, credential->getAuthenticator()["token"].asString(), [](discordpp::ClientResult result) { - if (result.Successful()) - LL_INFOS("Discord") << "Access token successfully revoked." << LL_ENDL; - else - LL_WARNS("Discord") << "No access token to revoke." << LL_ENDL; - }); - auto cred = new LLCredential("Discord"); - gSecAPIHandler->deleteCredential(cred); - } - else - { - LL_WARNS("Discord") << "Credentials are already nonexistent." << LL_ENDL; - } + gDiscordClient->ClearRichPresence(); + return; } -} -void LLAppViewer::updateDiscordActivity() -{ - LL_PROFILE_ZONE_SCOPED; discordpp::Activity activity; activity.SetType(discordpp::ActivityTypes::Playing); discordpp::ActivityTimestamps timestamps; diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 2a6360cef8..585032870e 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -367,7 +367,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.DeleteTranscripts", boost::bind(&LLFloaterPreference::onDeleteTranscripts, this)); mCommitCallbackRegistrar.add("UpdateFilter", boost::bind(&LLFloaterPreference::onUpdateFilterTerm, this, false)); // Hook up for filtering #ifdef LL_DISCORD - gSavedSettings.getControl("EnableDiscord")->getCommitSignal()->connect(boost::bind(&LLAppViewer::toggleDiscordIntegration, _2)); + gSavedSettings.getControl("EnableDiscord")->getCommitSignal()->connect(boost::bind(&LLAppViewer::updateDiscordActivity)); gSavedSettings.getControl("ShowDiscordActivityDetails")->getCommitSignal()->connect(boost::bind(&LLAppViewer::updateDiscordActivity)); gSavedSettings.getControl("ShowDiscordActivityState")->getCommitSignal()->connect(boost::bind(&LLAppViewer::updateDiscordActivity)); #endif -- cgit v1.2.3 From b031df0cd0813a5e2c2a8c1e5084420a9866461a Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 7 Aug 2025 11:09:04 +0800 Subject: Discord integration is enabled by default per spec now that we don't need the user to authorise Discord SDK to have any access to the user's friends list, etc. (which are Discord Relationships related, and not needed just for Rich Presence). --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 4305aa0a33..ba960d156f 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1170,7 +1170,7 @@ Type Boolean Value - 0 + 1 ShowDiscordActivityDetails -- cgit v1.2.3 From 2516f0229c84795d8427a2c223ef4081e443c81b Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 7 Aug 2025 11:13:05 +0800 Subject: "Hidden Region" if Discord location sharing is off instead of blank. The coords are hidden too, but the Party numbers are still shown, for consistency with TPVs' implementations. --- indra/newview/llappviewer.cpp | 56 ++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index c9bdc29bea..3e1e07ceae 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -5975,37 +5975,39 @@ void LLAppViewer::updateDiscordActivity() activity.SetDetails(gDiscordActivityDetails); } + auto agent_pos_region = gAgent.getPositionAgent(); + S32 pos_x = S32(agent_pos_region.mV[VX] + 0.5f); + S32 pos_y = S32(agent_pos_region.mV[VY] + 0.5f); + S32 pos_z = S32(agent_pos_region.mV[VZ] + 0.5f); + F32 velocity_mag_sq = gAgent.getVelocity().magVecSquared(); + const F32 FLY_CUTOFF = 6.f; + const F32 FLY_CUTOFF_SQ = FLY_CUTOFF * FLY_CUTOFF; + const F32 WALK_CUTOFF = 1.5f; + const F32 WALK_CUTOFF_SQ = WALK_CUTOFF * WALK_CUTOFF; + if (velocity_mag_sq > FLY_CUTOFF_SQ) + { + pos_x -= pos_x % 4; + pos_y -= pos_y % 4; + } + else if (velocity_mag_sq > WALK_CUTOFF_SQ) + { + pos_x -= pos_x % 2; + pos_y -= pos_y % 2; + } + + std::string location = "Hidden Region"; static LLCachedControl show_state(gSavedSettings, "ShowDiscordActivityState", false); if (show_state) { - auto agent_pos_region = gAgent.getPositionAgent(); - S32 pos_x = S32(agent_pos_region.mV[VX] + 0.5f); - S32 pos_y = S32(agent_pos_region.mV[VY] + 0.5f); - S32 pos_z = S32(agent_pos_region.mV[VZ] + 0.5f); - F32 velocity_mag_sq = gAgent.getVelocity().magVecSquared(); - const F32 FLY_CUTOFF = 6.f; - const F32 FLY_CUTOFF_SQ = FLY_CUTOFF * FLY_CUTOFF; - const F32 WALK_CUTOFF = 1.5f; - const F32 WALK_CUTOFF_SQ = WALK_CUTOFF * WALK_CUTOFF; - if (velocity_mag_sq > FLY_CUTOFF_SQ) - { - pos_x -= pos_x % 4; - pos_y -= pos_y % 4; - } - else if (velocity_mag_sq > WALK_CUTOFF_SQ) - { - pos_x -= pos_x % 2; - pos_y -= pos_y % 2; - } - auto location = llformat("%s (%d, %d, %d)", gAgent.getRegion()->getName().c_str(), pos_x, pos_y, pos_z); - activity.SetState(location); - - discordpp::ActivityParty party; - party.SetId(location); - party.SetCurrentSize(gDiscordPartyCurrentSize); - party.SetMaxSize(gDiscordPartyMaxSize); - activity.SetParty(party); + location = llformat("%s (%d, %d, %d)", gAgent.getRegion()->getName().c_str(), pos_x, pos_y, pos_z); } + activity.SetState(location); + + discordpp::ActivityParty party; + party.SetId(location); + party.SetCurrentSize(gDiscordPartyCurrentSize); + party.SetMaxSize(gDiscordPartyMaxSize); + activity.SetParty(party); gDiscordClient->UpdateRichPresence(activity, [](discordpp::ClientResult) {}); } -- cgit v1.2.3 From 2eeb6c956e36151cad52dd653530f6be995c5bf7 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 7 Aug 2025 11:59:51 +0800 Subject: Don't show self arrivals/departures --- indra/newview/llvoavatar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index f52d45b4b9..b8f8a4a88c 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -819,7 +819,7 @@ LLVOAvatar::~LLVOAvatar() sInstances.remove(this); static LLCachedControl show_arrival_departures(gSavedSettings, "IMShowArrivalsDepartures", false); - if (show_arrival_departures) + if (show_arrival_departures && !isSelf()) { auto full_name = getFullname(); if (!full_name.empty()) @@ -2583,7 +2583,7 @@ U32 LLVOAvatar::processUpdateMessage(LLMessageSystem *mesgsys, mDebugExistenceTimer.reset(); debugAvatarRezTime("AvatarRezArrivedNotification", "avatar arrived"); static LLCachedControl show_arrival_departures(gSavedSettings, "IMShowArrivalsDepartures", false); - if (show_arrival_departures) + if (show_arrival_departures && !isSelf()) { auto full_name = getFullname(); if (!full_name.empty()) -- cgit v1.2.3 From cbf64f875831992386dadc5a094b9739b678b764 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 7 Aug 2025 12:02:19 +0800 Subject: Make sure sed is installed on Arch Turns out it's not necessarily pulled by some other dependencies on a fresh Arch installation. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d27f5cd72b..636416eb44 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ $ cd build-`uname -s|tr '[:upper:]' '[:lower:]'`-`uname -m` ### Arch ``` -$ sudo pacman -S cmake base-devel python apr-util boost fltk glm glu hunspell minizip nanosvg libnghttp2 openjpeg2 libpipewire sdl2 vlc libvorbis xxhash +$ sudo pacman -S cmake base-devel sed python apr-util boost fltk glm glu hunspell minizip nanosvg libnghttp2 openjpeg2 libpipewire sdl2 vlc libvorbis xxhash $ export LL_BUILD="-O3 -std=c++20 -fPIC -DLL_LINUX=1" ``` build with FMOD Studio: ([register with fmod to get linux package][fmod] and then place the `.tar.gz` in `~/Downloads`) -- cgit v1.2.3 From db8a8840caa0fb2eac605b55d83b688d533a40b8 Mon Sep 17 00:00:00 2001 From: Secret Foxtail Date: Thu, 7 Aug 2025 01:34:10 -0600 Subject: panel_people.xml avatar list fix Adding NearMeRange slider caused avatar at the bottom of the nearby list to be cut off. Fix by reducing height. --- indra/newview/skins/default/xui/en/panel_people.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index ec097a9dde..a19376d032 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -235,7 +235,7 @@ Learn about [https://community.secondlife.com/knowledgebase/joining-and-particip Date: Thu, 7 Aug 2025 01:51:10 -0600 Subject: avatar list stepper adjustment Noticed later that the bottom scrollbar stepper was still slightly cut-off. Reduce list height again by 3. --- indra/newview/skins/default/xui/en/panel_people.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index a19376d032..0766cc06ee 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -235,7 +235,7 @@ Learn about [https://community.secondlife.com/knowledgebase/joining-and-particip Date: Thu, 7 Aug 2025 17:48:22 +0800 Subject: Remove toggleDiscordIntegration declaration The definition had already been removed, I had forgotten to remove this one. --- indra/newview/llappviewer.h | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 61a568a151..b7202d0c91 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -252,7 +252,6 @@ public: #ifdef LL_DISCORD static void initDiscordSocial(); - static void toggleDiscordIntegration(const LLSD& value); static void updateDiscordActivity(); static void updateDiscordPartyCurrentSize(int32_t size); static void updateDiscordPartyMaxSize(int32_t size); -- cgit v1.2.3