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.cpp426
1 files changed, 259 insertions, 167 deletions
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 6c3f3849ce..a9ea741c89 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -57,6 +57,7 @@
#include "lllocationhistory.h"
#include "llgltfmateriallist.h"
#include "llimageworker.h"
+#include "llregex.h"
#include "llloginflags.h"
#include "llmd5.h"
@@ -121,6 +122,7 @@
#include "llpanellogin.h"
#include "llmutelist.h"
#include "llavatarpropertiesprocessor.h"
+#include "llpaneldirbrowser.h"
#include "llpanelgrouplandmoney.h"
#include "llpanelgroupnotices.h"
#include "llparcel.h"
@@ -297,8 +299,51 @@ void callback_cache_name(const LLUUID& id, const std::string& full_name, bool is
// exported functionality
//
+void do_startup_frame()
+{
+ // Until after STATE_AGENT_SEND we don't get very many UDP packets to poll the socket,
+ // and after STATE_PRECACHE the LLAppViewer::idleNetwork() will do UDP processing,
+ // so we only bother to process between those two states.
+ EStartupState state = LLStartUp::getStartupState();
+ if (state > STATE_AGENT_SEND && state < STATE_PRECACHE)
+ {
+ // drain the UDP socket...
+ U64 t0 = totalTime();
+ constexpr U64 MAX_STARTUP_FRAME_TIME = 2000; // usec
+ constexpr U64 MAX_STARTUP_FRAME_MESSAGES = 100;
+ S32 num_messages = 0;
+ bool needs_drain = false;
+ LockMessageChecker lmc(gMessageSystem);
+ while (lmc.checkAllMessages(gFrameCount, gServicePump))
+ {
+ if (gDoDisconnect)
+ {
+ // We're disconnecting, don't process any more messages from the server
+ // We're usually disconnecting due to either network corruption or a
+ // server going down, so this is OK.
+ break;
+ }
+ if (++num_messages >= MAX_STARTUP_FRAME_MESSAGES
+ || (totalTime() - t0) > MAX_STARTUP_FRAME_TIME)
+ {
+ needs_drain = true;
+ break;
+ }
+ }
+ if (needs_drain || gMessageSystem->mPacketRing.getNumBufferedPackets() > 0)
+ {
+ gMessageSystem->drainUdpSocket();
+ }
+ lmc.processAcks();
+ }
+ // ...then call display_startup()
+ display_startup();
+}
+
void pump_idle_startup_network(void)
{
+ // while there are message to process:
+ // process one then call display_startup()
{
LockMessageChecker lmc(gMessageSystem);
while (lmc.checkAllMessages(gFrameCount, gServicePump))
@@ -307,6 +352,7 @@ void pump_idle_startup_network(void)
}
lmc.processAcks();
}
+ // finally call one last display_startup()
display_startup();
}
@@ -353,6 +399,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;
@@ -393,7 +440,52 @@ 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");
+ }
+ else
+ {
+ std::wstring utf16str = ll_convert<std::wstring>(val);
+ if (utf16str.size() > 4)
+ {
+ LL_DEBUGS("InitInfo") << "Current locale \"" << locale << "\" "
+ << "has impracitcally long AM/PM time format" << LL_ENDL;
+ // fallback to declarations in strings.xml
+ LLStringOps::sAM = LLTrans::getString("dateTimeAM");
+ LLStringOps::sPM = LLTrans::getString("dateTimePM");
+ }
+ }
+ }
+
+ // Some locales (as well some of our own dateTimeAM/PM) return long
+ // strings for AM/PM which aren't practical to display in the UI.
+ // Hardcode to "AM"/"PM" in those cases.
+ std::wstring utf16str = ll_convert<std::wstring>(LLStringOps::sAM);
+ if (utf16str.size() > 4)
+ {
+ LLStringOps::sAM = "AM";
+ }
+ utf16str = ll_convert<std::wstring>(LLStringOps::sPM);
+ if (utf16str.size() > 4)
+ {
+ LLStringOps::sPM = "PM";
+ }
+ }
//note: Removing this line will cause incorrect button size in the login screen. -- bao.
gTextureList.updateImages(0.01f) ;
@@ -623,21 +715,6 @@ bool idle_startup()
F32 dropPercent = gSavedSettings.getF32("PacketDropPercentage");
msg->mPacketRing.setDropPercentage(dropPercent);
-
- F32 inBandwidth = gSavedSettings.getF32("InBandwidth");
- F32 outBandwidth = gSavedSettings.getF32("OutBandwidth");
- if (inBandwidth != 0.f)
- {
- LL_DEBUGS("AppInit") << "Setting packetring incoming bandwidth to " << inBandwidth << LL_ENDL;
- msg->mPacketRing.setUseInThrottle(true);
- msg->mPacketRing.setInBandwidth(inBandwidth);
- }
- if (outBandwidth != 0.f)
- {
- LL_DEBUGS("AppInit") << "Setting packetring outgoing bandwidth to " << outBandwidth << LL_ENDL;
- msg->mPacketRing.setUseOutThrottle(true);
- msg->mPacketRing.setOutBandwidth(outBandwidth);
- }
}
LL_INFOS("AppInit") << "Message System Initialized." << LL_ENDL;
@@ -693,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
//
@@ -743,7 +824,7 @@ bool idle_startup()
LL_DEBUGS("AppInit") << "STATE_BROWSER_INIT" << LL_ENDL;
std::string msg = LLTrans::getString("LoginInitializingBrowser");
set_startup_status(0.03f, msg.c_str(), gAgent.mMOTD.c_str());
- display_startup();
+ do_startup_frame();
// LLViewerMedia::initBrowser();
LLStartUp::setStartupState( STATE_LOGIN_SHOW );
return false;
@@ -808,7 +889,7 @@ bool idle_startup()
LL_DEBUGS("AppInit") << "FirstLoginThisInstall off" << LL_ENDL;
}
}
- display_startup();
+ do_startup_frame();
LLStartUp::setStartupState( STATE_LOGIN_WAIT ); // Wait for user input
}
else
@@ -839,7 +920,7 @@ bool idle_startup()
}
LL_DEBUGS("AppInit") << "PeekMessage processed" << LL_ENDL;
#endif
- display_startup();
+ do_startup_frame();
timeout.reset();
return false;
}
@@ -854,7 +935,7 @@ bool idle_startup()
// Don't do anything. Wait for the login view to call the login_callback,
// which will push us to the next state.
- // display() function will be the one to run display_startup()
+ // display() function will be the one to run do_startup_frame()
// Sleep so we don't spin the CPU
ms_sleep(1);
return false;
@@ -1036,7 +1117,7 @@ bool idle_startup()
auth_desc = LLTrans::getString("LoginInProgress");
set_startup_status(progress, auth_desc, auth_message);
progress += 0.02f;
- display_startup();
+ do_startup_frame();
// Setting initial values...
LLLoginInstance* login = LLLoginInstance::getInstance();
@@ -1073,7 +1154,7 @@ bool idle_startup()
emsg << LLTrans::getString("LoginFailedHeader") << "\n";
if(LLLoginInstance::getInstance()->authFailure())
{
- LL_INFOS("LLStartup") << "Login failed, LLLoginInstance::getResponse(): "
+ LL_INFOS("LLStartUp") << "Login failed, LLLoginInstance::getResponse(): "
<< LLLoginInstance::getInstance()->getResponse() << LL_ENDL;
LLSD response = LLLoginInstance::getInstance()->getResponse();
// Still have error conditions that may need some
@@ -1145,7 +1226,7 @@ bool idle_startup()
// If optional was skipped this case shouldn't
// be reached.
- LL_INFOS("LLStartup") << "Forcing a quit due to update." << LL_ENDL;
+ LL_INFOS("LLStartUp") << "Forcing a quit due to update." << LL_ENDL;
LLLoginInstance::getInstance()->disconnect();
LLAppViewer::instance()->forceQuit();
}
@@ -1173,7 +1254,7 @@ bool idle_startup()
}
catch (LLCertException &cert_exception)
{
- LL_WARNS("LLStartup", "SECAPI") << "Caught " << cert_exception.what() << " certificate expception on getCertificate("<< response["certificate"] << ")" << LL_ENDL;
+ LL_WARNS("LLStartUp", "SECAPI") << "Caught " << cert_exception.what() << " certificate expception on getCertificate("<< response["certificate"] << ")" << LL_ENDL;
LLSD args;
args["REASON"] = LLTrans::getString(cert_exception.what());
@@ -1225,7 +1306,7 @@ bool idle_startup()
// notificatioin message.
LLSD args;
args["ERROR_MESSAGE"] = emsg.str();
- LL_INFOS("LLStartup") << "Notification: " << args << LL_ENDL;
+ LL_INFOS("LLStartUp") << "Notification: " << args << LL_ENDL;
LLNotificationsUtil::add("ErrorMessage", args, LLSD(), login_alert_done);
}
}
@@ -1248,7 +1329,7 @@ bool idle_startup()
{
LLSD args;
args["ERROR_MESSAGE"] = emsg.str();
- LL_INFOS("LLStartup") << "Notification: " << args << LL_ENDL;
+ LL_INFOS("LLStartUp") << "Notification: " << args << LL_ENDL;
LLNotificationsUtil::add("ErrorMessage", args, LLSD(), login_alert_done);
transition_back_to_login_panel(emsg.str());
show_connect_box = true;
@@ -1264,71 +1345,71 @@ bool idle_startup()
if (STATE_WORLD_INIT == LLStartUp::getStartupState())
{
set_startup_status(0.30f, LLTrans::getString("LoginInitializingWorld"), gAgent.mMOTD);
- display_startup();
+ do_startup_frame();
// We should have an agent id by this point.
llassert(!(gAgentID == LLUUID::null));
// Finish agent initialization. (Requires gSavedSettings, builds camera)
gAgent.init();
- display_startup();
+ do_startup_frame();
gAgentCamera.init();
- display_startup();
- display_startup();
+ do_startup_frame();
+ do_startup_frame();
// Since we connected, save off the settings so the user doesn't have to
// type the name/password again if we crash.
gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), true);
LLUIColorTable::instance().saveUserSettings();
- display_startup();
+ do_startup_frame();
//
// Initialize classes w/graphics stuff.
//
LLSurface::initClasses();
- display_startup();
+ do_startup_frame();
- display_startup();
+ do_startup_frame();
LLDrawable::initClass();
- display_startup();
+ do_startup_frame();
// init the shader managers
LLPostProcess::initClass();
- display_startup();
+ do_startup_frame();
LLAvatarAppearance::initClass("avatar_lad.xml","avatar_skeleton.xml");
- display_startup();
+ do_startup_frame();
LLViewerObject::initVOClasses();
- display_startup();
+ do_startup_frame();
// Initialize all our tools. Must be done after saved settings loaded.
// NOTE: This also is where gToolMgr used to be instantiated before being turned into a singleton.
LLToolMgr::getInstance()->initTools();
- display_startup();
+ do_startup_frame();
// Pre-load floaters, like the world map, that are slow to spawn
// due to XML complexity.
gViewerWindow->initWorldUI();
- display_startup();
+ do_startup_frame();
// This is where we used to initialize gWorldp. Original comment said:
// World initialization must be done after above window init
// User might have overridden far clip
LLWorld::getInstance()->setLandFarClip(gAgentCamera.mDrawDistance);
- display_startup();
+ do_startup_frame();
// Before we create the first region, we need to set the agent's mOriginGlobal
// This is necessary because creating objects before this is set will result in a
// bad mPositionAgent cache.
gAgent.initOriginGlobal(from_region_handle(gFirstSimHandle));
- display_startup();
+ do_startup_frame();
LLWorld::getInstance()->addRegion(gFirstSimHandle, gFirstSim);
- display_startup();
+ do_startup_frame();
LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(gFirstSimHandle);
LL_INFOS("AppInit") << "Adding initial simulator " << regionp->getOriginGlobal() << LL_ENDL;
@@ -1337,18 +1418,18 @@ bool idle_startup()
<< gFirstSimSeedCap << LL_ENDL;
regionp->setSeedCapability(gFirstSimSeedCap);
LL_DEBUGS("AppInit") << "Waiting for seed grant ...." << LL_ENDL;
- display_startup();
+ do_startup_frame();
// Set agent's initial region to be the one we just created.
gAgent.setRegion(regionp);
- display_startup();
+ do_startup_frame();
// Set agent's initial position, which will be read by LLVOAvatar when the avatar
// object is created. I think this must be done after setting the region. JC
gAgent.setPositionAgent(agent_start_position_region);
- display_startup();
+ do_startup_frame();
LLStartUp::initExperiences();
- display_startup();
+ do_startup_frame();
// If logging should be enebled, turns it on and loads history from disk
// Note: does not happen on init of singleton because preferences can use
@@ -1369,7 +1450,7 @@ bool idle_startup()
{
LLStartUp::multimediaInit();
LLStartUp::setStartupState( STATE_FONT_INIT );
- display_startup();
+ do_startup_frame();
return false;
}
@@ -1378,7 +1459,7 @@ bool idle_startup()
{
LLStartUp::fontInit();
LLStartUp::setStartupState( STATE_SEED_GRANTED_WAIT );
- display_startup();
+ do_startup_frame();
return false;
}
@@ -1450,7 +1531,7 @@ bool idle_startup()
set_startup_status(0.4f, LLTrans::getString("LoginRequestSeedCapGrant"), gAgent.mMOTD.c_str());
}
}
- display_startup();
+ do_startup_frame();
return false;
}
@@ -1461,7 +1542,7 @@ bool idle_startup()
//---------------------------------------------------------------------
if (STATE_SEED_CAP_GRANTED == LLStartUp::getStartupState())
{
- display_startup();
+ do_startup_frame();
// These textures are not warrantied to be cached, so needs
// to hapen with caps granted
@@ -1470,9 +1551,9 @@ bool idle_startup()
// will init images, should be done with caps, but before gSky.init()
LLEnvironment::getInstance()->initSingleton();
- display_startup();
+ do_startup_frame();
update_texture_fetch();
- display_startup();
+ do_startup_frame();
if ( gViewerWindow != NULL)
{ // This isn't the first logon attempt, so show the UI
@@ -1480,15 +1561,15 @@ bool idle_startup()
}
gLoginMenuBarView->setVisible( false );
gLoginMenuBarView->setEnabled( false );
- display_startup();
+ do_startup_frame();
// direct logging to the debug console's line buffer
LLError::logToFixedBuffer(gDebugView->mDebugConsolep);
- display_startup();
+ do_startup_frame();
// set initial visibility of debug console
gDebugView->mDebugConsolep->setVisible(gSavedSettings.getBOOL("ShowDebugConsole"));
- display_startup();
+ do_startup_frame();
//
// Set message handlers
@@ -1497,23 +1578,23 @@ bool idle_startup()
// register callbacks for messages. . . do this after initial handshake to make sure that we don't catch any unwanted
register_viewer_callbacks(gMessageSystem);
- display_startup();
+ do_startup_frame();
// Debugging info parameters
gMessageSystem->setMaxMessageTime( 0.5f ); // Spam if decoding all msgs takes more than 500 ms
- display_startup();
+ do_startup_frame();
#ifndef LL_RELEASE_FOR_DOWNLOAD
gMessageSystem->setTimeDecodes( true ); // Time the decode of each msg
gMessageSystem->setTimeDecodesSpamThreshold( 0.05f ); // Spam if a single msg takes over 50ms to decode
#endif
- display_startup();
+ do_startup_frame();
gXferManager->registerCallbacks(gMessageSystem);
- display_startup();
+ do_startup_frame();
LLStartUp::initNameCache();
- display_startup();
+ do_startup_frame();
// update the voice settings *after* gCacheName initialization
// so that we can construct voice UI that relies on the name cache
@@ -1521,7 +1602,7 @@ bool idle_startup()
{
LLVoiceClient::getInstance()->updateSettings();
}
- display_startup();
+ do_startup_frame();
// create a container's instance for start a controlling conversation windows
// by the voice's events
@@ -1542,12 +1623,12 @@ bool idle_startup()
// register null callbacks for audio until the audio system is initialized
gMessageSystem->setHandlerFuncFast(_PREHASH_SoundTrigger, null_message_callback, NULL);
gMessageSystem->setHandlerFuncFast(_PREHASH_AttachedSound, null_message_callback, NULL);
- display_startup();
+ do_startup_frame();
//reset statistics
LLViewerStats::instance().resetStats();
- display_startup();
+ do_startup_frame();
//
// Set up region and surface defaults
//
@@ -1572,7 +1653,7 @@ bool idle_startup()
LLViewerCamera::getInstance()->setAspect(gViewerWindow->getWorldViewAspectRatio());
// Initialize FOV
LLViewerCamera::getInstance()->setDefaultFOV(gSavedSettings.getF32("CameraAngle"));
- display_startup();
+ do_startup_frame();
// Move agent to starting location. The position handed to us by
// the space server is in global coordinates, but the agent frame
@@ -1583,7 +1664,7 @@ bool idle_startup()
gAgent.resetAxes(gAgentStartLookAt);
gAgentCamera.stopCameraAnimation();
gAgentCamera.resetCamera();
- display_startup();
+ do_startup_frame();
// Initialize global class data needed for surfaces (i.e. textures)
LL_DEBUGS("AppInit") << "Initializing sky..." << LL_ENDL;
@@ -1594,7 +1675,7 @@ bool idle_startup()
LLGLState::checkStates();
- display_startup();
+ do_startup_frame();
LL_DEBUGS("AppInit") << "Decoding images..." << LL_ENDL;
// For all images pre-loaded into viewer cache, init
@@ -1608,12 +1689,12 @@ bool idle_startup()
{
F32 frac = (F32)i / (F32)DECODE_TIME_SEC;
set_startup_status(0.45f + frac*0.1f, LLTrans::getString("LoginDecodingImages"), gAgent.mMOTD);
- display_startup();
+ do_startup_frame();
gTextureList.decodeAllImages(1.f);
}
LLStartUp::setStartupState( STATE_WORLD_WAIT );
- display_startup();
+ do_startup_frame();
// JC - Do this as late as possible to increase likelihood Purify
// will run.
@@ -1642,7 +1723,7 @@ bool idle_startup()
NULL);
timeout.reset();
- display_startup();
+ do_startup_frame();
return false;
}
@@ -1669,7 +1750,7 @@ bool idle_startup()
{
LL_DEBUGS("AppInit") << "Connecting to region..." << LL_ENDL;
set_startup_status(0.60f, LLTrans::getString("LoginConnectingToRegion"), gAgent.mMOTD);
- display_startup();
+ do_startup_frame();
// register with the message system so it knows we're
// expecting this message
LLMessageSystem* msg = gMessageSystem;
@@ -1683,7 +1764,16 @@ bool idle_startup()
gAssetStorage->setUpstream(regionp->getHost());
gCacheName->setUpstream(regionp->getHost());
}
- display_startup();
+
+ // It is entirely possible that we may get the friends list _before_ we have the callbacks registered to process that.
+ // This will lead to the friends list not being processed properly and online statuses not being updated appropriately at login.
+ // So, we need to make sure that we have the callbacks registered before we get the friends list.
+ // This appears to crop up on some systems somewhere between STATE_AGENT_SEND and STATE_INVENTORY_SEND. It's happened to me a few times now.
+ // -Geenz 2025-03-12
+ LL_INFOS() << " AvatarTracker" << LL_ENDL;
+ LLAvatarTracker::instance().registerCallbacks(gMessageSystem);
+
+ do_startup_frame();
// Create login effect
// But not on first login, because you can't see your avatar then
@@ -1698,7 +1788,7 @@ bool idle_startup()
LLStartUp::setStartupState( STATE_AGENT_WAIT ); // Go to STATE_AGENT_WAIT
timeout.reset();
- display_startup();
+ do_startup_frame();
return false;
}
@@ -1707,35 +1797,13 @@ bool idle_startup()
//---------------------------------------------------------------------
if (STATE_AGENT_WAIT == LLStartUp::getStartupState())
{
- {
- LockMessageChecker lmc(gMessageSystem);
- while (lmc.checkAllMessages(gFrameCount, gServicePump))
- {
- if (gAgentMovementCompleted)
- {
- // Sometimes we have more than one message in the
- // queue. break out of this loop and continue
- // processing. If we don't, then this could skip one
- // or more login steps.
- break;
- }
- else
- {
- LL_DEBUGS("AppInit") << "Awaiting AvatarInitComplete, got "
- << gMessageSystem->getMessageName() << LL_ENDL;
- }
- display_startup();
- }
- lmc.processAcks();
- }
-
- display_startup();
+ do_startup_frame();
if (gAgentMovementCompleted)
{
LLStartUp::setStartupState( STATE_INVENTORY_SEND );
}
- display_startup();
+ do_startup_frame();
if (!gAgentMovementCompleted && timeout.getElapsedTimeF32() > STATE_AGENT_WAIT_TIMEOUT)
{
@@ -1768,7 +1836,7 @@ bool idle_startup()
if (STATE_INVENTORY_SEND == LLStartUp::getStartupState())
{
LL_PROFILE_ZONE_NAMED("State inventory send")
- display_startup();
+ do_startup_frame();
// request mute list
LL_INFOS() << "Requesting Mute List" << LL_ENDL;
@@ -1778,12 +1846,12 @@ bool idle_startup()
LL_INFOS() << "Requesting Money Balance" << LL_ENDL;
LLStatusBar::sendMoneyBalanceRequest();
- display_startup();
+ do_startup_frame();
// Inform simulator of our language preference
LLAgentLanguage::update();
- display_startup();
+ do_startup_frame();
// unpack thin inventory
LLSD response = LLLoginInstance::getInstance()->getResponse();
//bool dump_buffer = false;
@@ -1798,7 +1866,7 @@ bool idle_startup()
gInventory.setLibraryRootFolderID(id.asUUID());
}
}
- display_startup();
+ do_startup_frame();
LLSD inv_lib_owner = response["inventory-lib-owner"];
if(inv_lib_owner.isDefined())
@@ -1810,9 +1878,9 @@ bool idle_startup()
gInventory.setLibraryOwnerID(LLUUID(id.asUUID()));
}
}
- display_startup();
+ do_startup_frame();
LLStartUp::setStartupState(STATE_INVENTORY_SKEL);
- display_startup();
+ do_startup_frame();
return false;
}
@@ -1831,7 +1899,7 @@ bool idle_startup()
LL_WARNS("AppInit") << "Problem loading inventory-skel-lib" << LL_ENDL;
}
}
- display_startup();
+ do_startup_frame();
LLSD inv_skeleton = response["inventory-skeleton"];
if (inv_skeleton.isDefined())
@@ -1842,9 +1910,9 @@ bool idle_startup()
LL_WARNS("AppInit") << "Problem loading inventory-skel-targets" << LL_ENDL;
}
}
- display_startup();
+ do_startup_frame();
LLStartUp::setStartupState(STATE_INVENTORY_SEND2);
- display_startup();
+ do_startup_frame();
return false;
}
@@ -1890,7 +1958,7 @@ bool idle_startup()
list[agent_id] = new LLRelationship(given_rights, has_rights, false);
}
LLAvatarTracker::instance().addBuddyList(list);
- display_startup();
+ do_startup_frame();
}
bool show_hud = false;
@@ -1918,7 +1986,7 @@ bool idle_startup()
//}
}
}
- display_startup();
+ do_startup_frame();
// Either we want to show tutorial because this is the first login
// to a Linden Help Island or the user quit with the tutorial
@@ -1927,21 +1995,21 @@ bool idle_startup()
{
LLFloaterReg::showInstance("hud", LLSD(), false);
}
- display_startup();
+ do_startup_frame();
LLSD event_notifications = response["event_notifications"];
if(event_notifications.isDefined())
{
gEventNotifier.load(event_notifications);
}
- display_startup();
+ do_startup_frame();
LLSD classified_categories = response["classified_categories"];
if(classified_categories.isDefined())
{
LLClassifiedInfo::loadCategories(classified_categories);
}
- display_startup();
+ do_startup_frame();
// This method MUST be called before gInventory.findCategoryUUIDForType because of
// gInventory.mIsAgentInvUsable is set to true in the gInventory.buildParentChildMap.
@@ -1960,7 +2028,7 @@ bool idle_startup()
LLInventoryModelBackgroundFetch::instance().start();
gInventory.createCommonSystemCategories();
LLStartUp::setStartupState(STATE_INVENTORY_CALLBACKS );
- display_startup();
+ do_startup_frame();
return false;
}
@@ -1972,7 +2040,7 @@ bool idle_startup()
{
if (!LLInventoryModel::isSysFoldersReady())
{
- display_startup();
+ do_startup_frame();
return false;
}
@@ -1997,29 +2065,27 @@ bool idle_startup()
gInventory.addChangedMask(LLInventoryObserver::ALL, LLUUID::null);
gInventory.notifyObservers();
- display_startup();
+ do_startup_frame();
// set up callbacks
LL_INFOS() << "Registering Callbacks" << LL_ENDL;
LLMessageSystem* msg = gMessageSystem;
LL_INFOS() << " Inventory" << LL_ENDL;
LLInventoryModel::registerCallbacks(msg);
- LL_INFOS() << " AvatarTracker" << LL_ENDL;
- LLAvatarTracker::instance().registerCallbacks(msg);
LL_INFOS() << " Landmark" << LL_ENDL;
LLLandmark::registerCallbacks(msg);
- display_startup();
+ do_startup_frame();
// request all group information
LL_INFOS() << "Requesting Agent Data" << LL_ENDL;
gAgent.sendAgentDataUpdateRequest();
- display_startup();
+ do_startup_frame();
// Create the inventory views
LL_INFOS() << "Creating Inventory Views" << LL_ENDL;
LLFloaterReg::getInstance("inventory");
- display_startup();
+ do_startup_frame();
LLStartUp::setStartupState( STATE_MISC );
- display_startup();
+ do_startup_frame();
return false;
}
@@ -2069,7 +2135,7 @@ bool idle_startup()
gSavedSettings.setBOOL("ShowStartLocation", true);
}
- display_startup();
+ do_startup_frame();
// Load stored local environment if needed.
LLEnvironment::instance().loadFromSettings();
@@ -2077,7 +2143,7 @@ bool idle_startup()
// *TODO : Uncomment that line once the whole grid migrated to SLM and suppress it from LLAgent::handleTeleportFinished() (llagent.cpp)
//check_merchant_status();
- display_startup();
+ do_startup_frame();
if (gSavedSettings.getBOOL("HelpFloaterOpen"))
{
@@ -2085,21 +2151,18 @@ bool idle_startup()
LLViewerHelp::instance().showTopic("");
}
- display_startup();
-
- // We're successfully logged in.
- gSavedSettings.setBOOL("FirstLoginThisInstall", false);
+ do_startup_frame();
LLFloaterReg::showInitialVisibleInstances();
LLFloaterGridStatus::getInstance()->startGridStatusTimer();
- display_startup();
+ do_startup_frame();
- display_startup();
+ do_startup_frame();
// JC: Initializing audio requests many sounds for download.
init_audio();
- display_startup();
+ do_startup_frame();
// JC: Initialize "active" gestures. This may also trigger
// many gesture downloads, if this is the user's first
@@ -2137,7 +2200,7 @@ bool idle_startup()
LLGestureMgr::instance().startFetch();
}
gDisplaySwapBuffers = true;
- display_startup();
+ do_startup_frame();
LLMessageSystem* msg = gMessageSystem;
msg->setHandlerFuncFast(_PREHASH_SoundTrigger, process_sound_trigger);
@@ -2215,10 +2278,10 @@ bool idle_startup()
}
}
- display_startup();
+ do_startup_frame();
//DEV-17797. get null folder. Any items found here moved to Lost and Found
LLInventoryModelBackgroundFetch::instance().findLostItems();
- display_startup();
+ do_startup_frame();
LLStartUp::setStartupState( STATE_PRECACHE );
timeout.reset();
@@ -2227,7 +2290,7 @@ bool idle_startup()
if (STATE_PRECACHE == LLStartUp::getStartupState())
{
- display_startup();
+ do_startup_frame();
F32 timeout_frac = timeout.getElapsedTimeF32()/PRECACHING_DELAY;
// We now have an inventory skeleton, so if this is a user's first
@@ -2253,7 +2316,7 @@ bool idle_startup()
callAfterCOFFetch(set_flags_and_update_appearance);
}
- display_startup();
+ do_startup_frame();
// wait precache-delay and for agent's avatar or a lot longer.
if ((timeout_frac > 1.f) && isAgentAvatarValid())
@@ -2278,7 +2341,7 @@ bool idle_startup()
set_startup_status(0.60f + 0.30f * timeout_frac,
LLTrans::getString("LoginPrecaching"),
gAgent.mMOTD.c_str());
- display_startup();
+ do_startup_frame();
}
return true;
@@ -2306,7 +2369,7 @@ bool idle_startup()
LLStartUp::setStartupState( STATE_CLEANUP );
}
- display_startup();
+ do_startup_frame();
if (gAgent.isOutfitChosen() && (wearables_time > MAX_WEARABLES_TIME))
{
@@ -2347,7 +2410,7 @@ bool idle_startup()
if (STATE_CLEANUP == LLStartUp::getStartupState())
{
set_startup_status(1.0, "", "");
- display_startup();
+ do_startup_frame();
if (!mBenefitsSuccessfullyInit)
{
@@ -2368,7 +2431,7 @@ bool idle_startup()
//gViewerWindow->revealIntroPanel();
gViewerWindow->setStartupComplete();
gViewerWindow->setProgressCancelButtonVisible(false);
- display_startup();
+ do_startup_frame();
// We're not away from keyboard, even though login might have taken
// a while. JC
@@ -2400,7 +2463,7 @@ bool idle_startup()
// LLUserAuth::getInstance()->reset();
LLStartUp::setStartupState( STATE_STARTED );
- display_startup();
+ do_startup_frame();
// Unmute audio if desired and setup volumes.
// This is a not-uncommon crash site, so surround it with
@@ -2416,7 +2479,7 @@ bool idle_startup()
LLAgentPicksInfo::getInstance()->requestNumberOfPicks();
- display_startup();
+ do_startup_frame();
llassert(LLPathfindingManager::getInstance() != NULL);
LLPathfindingManager::getInstance()->initSystem();
@@ -2435,6 +2498,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;
}
@@ -2521,6 +2605,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.
@@ -2554,7 +2659,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;
});
}
@@ -2793,6 +2898,13 @@ void register_viewer_callbacks(LLMessageSystem* msg)
msg->setHandlerFunc("AvatarPickerReply", LLFloaterAvatarPicker::processAvatarPickerReply);
+ msg->setHandlerFunc("DirPlacesReply", LLPanelDirBrowser::processDirPlacesReply);
+ msg->setHandlerFunc("DirPeopleReply", LLPanelDirBrowser::processDirPeopleReply);
+ msg->setHandlerFunc("DirEventsReply", LLPanelDirBrowser::processDirEventsReply);
+ msg->setHandlerFunc("DirGroupsReply", LLPanelDirBrowser::processDirGroupsReply);
+ msg->setHandlerFunc("DirClassifiedReply", LLPanelDirBrowser::processDirClassifiedReply);
+ msg->setHandlerFunc("DirLandReply", LLPanelDirBrowser::processDirLandReply);
+
msg->setHandlerFunc("MapBlockReply", LLWorldMapMessage::processMapBlockReply);
msg->setHandlerFunc("MapItemReply", LLWorldMapMessage::processMapItemReply);
msg->setHandlerFunc("EventInfoReply", LLEventNotifier::processEventInfoReply);
@@ -3021,9 +3133,7 @@ std::string LLStartUp::startupStateToString(EStartupState state)
// static
void LLStartUp::setStartupState( EStartupState state )
{
- LL_INFOS("AppInit") << "Startup state changing from " <<
- getStartupStateString() << " to " <<
- startupStateToString(state) << LL_ENDL;
+ LL_INFOS("AppInit") << getStartupStateString() << " --> " << startupStateToString(state) << LL_ENDL;
getPhases().stopPhase(getStartupStateString());
gStartupState = state;
@@ -3087,7 +3197,7 @@ void LLStartUp::multimediaInit()
LL_DEBUGS("AppInit") << "Initializing Multimedia...." << LL_ENDL;
std::string msg = LLTrans::getString("LoginInitializingMultimedia");
set_startup_status(0.42f, msg.c_str(), gAgent.mMOTD.c_str());
- display_startup();
+ do_startup_frame();
}
void LLStartUp::fontInit()
@@ -3095,7 +3205,7 @@ void LLStartUp::fontInit()
LL_DEBUGS("AppInit") << "Initializing fonts...." << LL_ENDL;
std::string msg = LLTrans::getString("LoginInitializingFonts");
set_startup_status(0.45f, msg.c_str(), gAgent.mMOTD.c_str());
- display_startup();
+ do_startup_frame();
LLFontGL::loadDefaultFonts();
}
@@ -3552,7 +3662,7 @@ bool process_login_success_response()
// Agent id needed for parcel info request in LLUrlEntryParcel
// to resolve parcel name.
- LLUrlEntryParcel::setAgentID(gAgentID);
+ LLUrlEntryBase::setAgentID(gAgentID);
text = response["session_id"].asString();
if(!text.empty()) gAgentSessionID.set(text);
@@ -3792,14 +3902,14 @@ bool process_login_success_response()
{
// We got an answer from the grid -> use that for map for the current session
gSavedSettings.setString("CurrentMapServerURL", map_server_url);
- LL_INFOS("LLStartup") << "map-server-url : we got an answer from the grid : " << map_server_url << LL_ENDL;
+ LL_INFOS("LLStartUp") << "map-server-url : we got an answer from the grid : " << map_server_url << LL_ENDL;
}
else
{
// No answer from the grid -> use the default setting for current session
map_server_url = gSavedSettings.getString("MapServerURL");
gSavedSettings.setString("CurrentMapServerURL", map_server_url);
- LL_INFOS("LLStartup") << "map-server-url : no map-server-url answer, we use the default setting for the map : " << map_server_url << LL_ENDL;
+ LL_INFOS("LLStartUp") << "map-server-url : no map-server-url answer, we use the default setting for the map : " << map_server_url << LL_ENDL;
}
// Default male and female avatars allowing the user to choose their avatar on first login.
@@ -3870,25 +3980,7 @@ bool process_login_success_response()
LLViewerMedia::getInstance()->openIDSetup(openid_url, openid_token);
}
-
- // Only save mfa_hash for future logins if the user wants their info remembered.
- if(response.has("mfa_hash")
- && gSavedSettings.getBOOL("RememberUser")
- && LLLoginInstance::getInstance()->saveMFA())
- {
- std::string grid(LLGridManager::getInstance()->getGridId());
- std::string user_id(gUserCredential->userID());
- gSecAPIHandler->addToProtectedMap("mfa_hash", grid, user_id, response["mfa_hash"]);
- // TODO(brad) - related to SL-17223 consider building a better interface that sync's automatically
- gSecAPIHandler->syncProtectedMap();
- }
- else if (!LLLoginInstance::getInstance()->saveMFA())
- {
- std::string grid(LLGridManager::getInstance()->getGridId());
- std::string user_id(gUserCredential->userID());
- gSecAPIHandler->removeFromProtectedMap("mfa_hash", grid, user_id);
- gSecAPIHandler->syncProtectedMap();
- }
+ LLLoginInstance::getInstance()->saveMFAHash(response);
bool success = false;
// JC: gesture loading done below, when we have an asset system