summaryrefslogtreecommitdiff
path: root/indra/newview/llstartup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llstartup.cpp')
-rw-r--r--indra/newview/llstartup.cpp77
1 files changed, 69 insertions, 8 deletions
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 858c7b6656..c3c7945763 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -61,6 +61,7 @@
#include "lllocationhistory.h"
#include "llgltfmateriallist.h"
#include "llimageworker.h"
+#include "llregex.h"
#include "llloginflags.h"
#include "llmd5.h"
@@ -217,7 +218,6 @@
#include "fsfloatersearch.h"
-
//
// exported globals
//
@@ -350,13 +350,11 @@ void pump_idle_startup_network(void)
{
// while there are message to process:
// process one then call display_startup()
- S32 num_messages = 0;
{
LockMessageChecker lmc(gMessageSystem);
while (lmc.checkAllMessages(gFrameCount, gServicePump))
{
display_startup();
- ++num_messages;
}
lmc.processAcks();
}
@@ -407,6 +405,7 @@ bool idle_startup()
LL_WARNS_ONCE() << "gViewerWindow is not initialized" << LL_ENDL;
return false; // No world yet
}
+ LL_PROFILE_ZONE_SCOPED;
const F32 PRECACHING_DELAY = gSavedSettings.getF32("PrecachingDelay");
static LLTimer timeout;
@@ -447,7 +446,26 @@ bool idle_startup()
system = osString.substr (begIdx, endIdx - begIdx);
system += "Locale";
- LLStringUtil::setLocale (LLTrans::getString(system));
+ std::string locale = LLTrans::getString(system);
+ if (locale != LLStringUtil::getLocale()) // is there a reason to do this on repeat?
+ {
+ LLStringUtil::setLocale(locale);
+
+ // Not all locales have AMPM, test it
+ if (LLStringOps::sAM.empty()) // Might already be overriden from LLAppViewer::init()
+ {
+ LLDate datetime(0.0);
+ std::string val = datetime.toHTTPDateString("%p");
+ if (val.empty())
+ {
+ LL_DEBUGS("InitInfo") << "Current locale \"" << locale << "\" "
+ << "doesn't support AM/PM time format" << LL_ENDL;
+ // fallback to declarations in strings.xml
+ LLStringOps::sAM = LLTrans::getString("dateTimeAM");
+ LLStringOps::sPM = LLTrans::getString("dateTimePM");
+ }
+ }
+ }
//note: Removing this line will cause incorrect button size in the login screen. -- bao.
gTextureList.updateImages(0.01f) ;
@@ -752,6 +770,10 @@ bool idle_startup()
LL_WARNS("AppInit") << "Unreliable timers detected (may be bad PCI chipset)!!" << LL_ENDL;
}
+#ifdef LL_DISCORD
+ LLAppViewer::initDiscordSocial();
+#endif
+
//
// Log on to system
//
@@ -2133,9 +2155,6 @@ bool idle_startup()
do_startup_frame();
- // We're successfully logged in.
- gSavedSettings.setBOOL("FirstLoginThisInstall", false);
-
LLFloaterReg::showInitialVisibleInstances();
LLFloaterGridStatus::getInstance()->startGridStatusTimer();
@@ -2481,6 +2500,27 @@ 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)
+ {
+ // 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);
+ }
+ }
+
+ //// 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;
}
@@ -2567,6 +2607,27 @@ void release_notes_coro(const std::string url)
LLWeb::loadURLInternal(url);
}
+void validate_release_notes_coro(const std::string url)
+{
+ LLVersionInfo& versionInfo(LLVersionInfo::instance());
+ const boost::regex version_regex(R"(\b\d+\.\d+\.\d+\.\d+\b)");
+
+ if (url.find(versionInfo.getVersion()) == std::string::npos // has no our build version
+ && ll_regex_search(url, version_regex)) // has any version
+ {
+ LL_INFOS() << "Received release notes url \"" << url << "\" wwith mismatching build, falling back to locally generated url" << LL_ENDL;
+ // Updater only provides notes for a most recent version, if it is not
+ // the current one, fall back to the hardcoded URL.
+ LLSD info(LLAppViewer::instance()->getViewerInfo());
+ std::string alt_url = info["VIEWER_RELEASE_NOTES_URL"].asString();
+ release_notes_coro(alt_url);
+ }
+ else
+ {
+ release_notes_coro(url);
+ }
+}
+
/**
* Check if user is running a new version of the viewer.
* Display the Release Notes if it's not overriden by the "UpdaterShowReleaseNotes" setting.
@@ -2600,7 +2661,7 @@ void show_release_notes_if_required()
"showrelnotes",
[](const LLSD& url) {
LLCoros::instance().launch("releaseNotesCoro",
- boost::bind(&release_notes_coro, url.asString()));
+ boost::bind(&validate_release_notes_coro, url.asString()));
return false;
});
}