From ddbcf74a8f171adabf3b61a8ce3419eea0d1e018 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Thu, 5 Jun 2025 22:31:43 -0700 Subject: Open Avatar Welcome Pack floater on first login (or cleared settings) and move it to the center of the screen. Adjust the size of the floater (height) slightly. --- indra/newview/llstartup.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'indra/newview/llstartup.cpp') diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index cc4f49c0b4..f065d286c8 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2103,9 +2103,6 @@ bool idle_startup() do_startup_frame(); - // We're successfully logged in. - gSavedSettings.setBOOL("FirstLoginThisInstall", false); - LLFloaterReg::showInitialVisibleInstances(); LLFloaterGridStatus::getInstance()->startGridStatusTimer(); @@ -2451,6 +2448,23 @@ bool idle_startup() LLPerfStats::StatsRecorder::setAutotuneInit(); + // Display Avatar Welcome Pack the first time a user logs in + // (or clears their settings....) + if (gSavedSettings.getBOOL("FirstLoginThisInstall")) + { + LLFloater* avatar_welcome_pack_floater = LLFloaterReg::findInstance("avatar_welcome_pack"); + if (avatar_welcome_pack_floater != nullptr) + { + avatar_welcome_pack_floater->center(); + avatar_welcome_pack_floater->setVisible(true); + } + } + + //// We're successfully logged in. + // 2025-06 Moved lower down in the state machine so the Avatar Welcome Pack + // floater display can be triggered correctly. + gSavedSettings.setBOOL("FirstLoginThisInstall", false); + return true; } -- cgit v1.2.3 From a366a49daff63af865aa5e3bda9186d8b0db4814 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Fri, 6 Jun 2025 17:21:19 -0700 Subject: tweak the size of the AWP floater to take account of new image sizes. Do not center floater anymore because it obscures the avatar. --- indra/newview/llstartup.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llstartup.cpp') diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index f065d286c8..6bf0a50d1c 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2455,7 +2455,11 @@ bool idle_startup() LLFloater* avatar_welcome_pack_floater = LLFloaterReg::findInstance("avatar_welcome_pack"); if (avatar_welcome_pack_floater != nullptr) { - avatar_welcome_pack_floater->center(); + // There is a (very - 1 in ~50 times) hard to repro bug where the login + // page is not hidden when the AWP floater is presented. This (agressive) + // approach to always close it seems like the best fix for now. + LLPanelLogin::closePanel(); + avatar_welcome_pack_floater->setVisible(true); } } -- cgit v1.2.3 From 74b0178b7b4d672c7f6b317102b0ecd26f1ea033 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sat, 12 Jul 2025 21:49:15 +0800 Subject: Rich Presence support using Discord Social SDK Download DiscordSocialSdk-1.4.9649.zip https://discord.com/developers/applications/1393451183741599796/social-sdk/downloads to your ~/Downloads folder. Add -DUSE_DISCORD:BOOL=ON to your cmake line. The authorisation is triggered by selecting Help > Discord Social. It seems that the user will need to do this every time they want Rich Presence support on the viewer while using Discord. The Discord app is still set to be a public client in the OAuth2 tab, I'm going to try to make it work with the app set to be a confidential client, next. All Discord-related code are contained within one file, llstartup.cpp, and other classes access it through some opaque layer, static functions, otherwise we'd get these "duplicate symbol" linking errors. --- indra/newview/llstartup.cpp | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'indra/newview/llstartup.cpp') diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 3450792d30..834b99555e 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -217,6 +217,11 @@ #include "fsfloatersearch.h" +#ifdef LL_DISCORD +#define DISCORDPP_IMPLEMENTATION +#include +static std::shared_ptr gDiscordClient; +#endif // // exported globals @@ -752,6 +757,17 @@ bool idle_startup() LL_WARNS("AppInit") << "Unreliable timers detected (may be bad PCI chipset)!!" << LL_ENDL; } +#ifdef LL_DISCORD + gDiscordClient = std::make_shared(); + gDiscordClient->SetStatusChangedCallback([](discordpp::Client::Status status, discordpp::Client::Error, int32_t) { + if (status == discordpp::Client::Status::Ready) { + discordpp::Activity activity; + activity.SetType(discordpp::ActivityTypes::Playing); + gDiscordClient->UpdateRichPresence(activity, [](discordpp::ClientResult) {}); + } + }); +#endif + // // Log on to system // @@ -3431,6 +3447,35 @@ bool LLStartUp::startLLProxy() return proxy_ok; } +#ifdef LL_DISCORD + +void LLStartUp::runDiscordCallbacks() +{ + discordpp::RunCallbacks(); +} + +void LLStartUp::handleDiscordSocial() +{ + static const uint64_t DISCORD_APPLICATION_ID = 1393451183741599796; + discordpp::AuthorizationArgs discordAuthArgs{}; + discordAuthArgs.SetClientId(DISCORD_APPLICATION_ID); + discordAuthArgs.SetScopes(discordpp::Client::GetDefaultPresenceScopes()); + auto discordCodeVerifier = gDiscordClient->CreateAuthorizationCodeVerifier(); + discordAuthArgs.SetCodeChallenge(discordCodeVerifier.Challenge()); + gDiscordClient->Authorize(discordAuthArgs, [discordCodeVerifier](auto result, auto code, auto redirectUri) { + if (result.Successful()) { + gDiscordClient->GetToken(DISCORD_APPLICATION_ID, code, discordCodeVerifier.Verifier(), redirectUri, [](discordpp::ClientResult result, std::string accessToken, std::string, discordpp::AuthorizationTokenType, int32_t, std::string) { + gDiscordClient->UpdateToken(discordpp::AuthorizationTokenType::Bearer, accessToken, [](discordpp::ClientResult result) { + if (result.Successful()) + gDiscordClient->Connect(); + }); + }); + } + }); +} + +#endif + bool login_alert_done(const LLSD& notification, const LLSD& response) { LLPanelLogin::giveFocus(); -- cgit v1.2.3