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.cpp384
1 files changed, 215 insertions, 169 deletions
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 9b715be26e..3450792d30 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -209,6 +209,7 @@
#include "threadpool.h"
#include "llperfstats.h"
+#include "rlvhandler.h"
#if LL_WINDOWS
#include "lldxhardware.h"
@@ -304,16 +305,62 @@ 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()
+ S32 num_messages = 0;
{
LockMessageChecker lmc(gMessageSystem);
while (lmc.checkAllMessages(gFrameCount, gServicePump))
{
display_startup();
+ ++num_messages;
}
lmc.processAcks();
}
+ // finally call one last display_startup()
display_startup();
}
@@ -630,21 +677,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;
@@ -770,7 +802,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;
@@ -835,7 +867,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
@@ -866,7 +898,7 @@ bool idle_startup()
}
LL_DEBUGS("AppInit") << "PeekMessage processed" << LL_ENDL;
#endif
- display_startup();
+ do_startup_frame();
timeout.reset();
return false;
}
@@ -881,7 +913,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;
@@ -903,6 +935,8 @@ bool idle_startup()
return false;
}
+ RlvHandler::setEnabled(gSavedSettings.get<bool>(Rlv::Settings::Main));
+
// reset the values that could have come in from a slurl
// DEV-42215: Make sure they're not empty -- gUserCredential
// might already have been set from gSavedSettings, and it's too bad
@@ -1063,7 +1097,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();
@@ -1072,6 +1106,7 @@ bool idle_startup()
login->setSerialNumber(LLAppViewer::instance()->getSerialNumber());
login->setLastExecEvent(gLastExecEvent);
login->setLastExecDuration(gLastExecDuration);
+ login->setLastAgentSessionId(gLastAgentSessionId);
// This call to LLLoginInstance::connect() starts the
// authentication process.
@@ -1099,7 +1134,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
@@ -1171,7 +1206,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();
}
@@ -1199,7 +1234,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());
@@ -1251,7 +1286,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);
}
}
@@ -1274,7 +1309,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;
@@ -1290,71 +1325,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;
@@ -1363,18 +1398,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
@@ -1395,7 +1430,7 @@ bool idle_startup()
{
LLStartUp::multimediaInit();
LLStartUp::setStartupState( STATE_FONT_INIT );
- display_startup();
+ do_startup_frame();
return false;
}
@@ -1404,7 +1439,7 @@ bool idle_startup()
{
LLStartUp::fontInit();
LLStartUp::setStartupState( STATE_SEED_GRANTED_WAIT );
- display_startup();
+ do_startup_frame();
return false;
}
@@ -1420,7 +1455,7 @@ bool idle_startup()
}
else if (regionp->capabilitiesError())
{
- LL_WARNS("AppInit") << "Failed to get capabilities. Backing up to login screen!" << LL_ENDL;
+ LL_WARNS("AppInit") << "Failed to get capabilities. Logging out and backing up to login screen!" << LL_ENDL;
if (gRememberPassword)
{
LLNotificationsUtil::add("LoginPacketNeverReceived", LLSD(), LLSD(), login_alert_status);
@@ -1429,6 +1464,15 @@ bool idle_startup()
{
LLNotificationsUtil::add("LoginPacketNeverReceivedNoTP", LLSD(), LLSD(), login_alert_status);
}
+
+ // Session was created, don't just hang up on server, send a logout request
+ LLMessageSystem* msg = gMessageSystem;
+ msg->newMessageFast(_PREHASH_LogoutRequest);
+ msg->nextBlockFast(_PREHASH_AgentData);
+ msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
+ msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
+ gAgent.sendReliableMessage();
+
reset_login();
}
else
@@ -1436,7 +1480,7 @@ bool idle_startup()
U32 num_retries = regionp->getNumSeedCapRetries();
if (num_retries > MAX_SEED_CAP_ATTEMPTS_BEFORE_ABORT)
{
- LL_WARNS("AppInit") << "Failed to get capabilities. Backing up to login screen!" << LL_ENDL;
+ LL_WARNS("AppInit") << "Failed to get capabilities. Logging out and backing up to login screen!" << LL_ENDL;
if (gRememberPassword)
{
LLNotificationsUtil::add("LoginPacketNeverReceived", LLSD(), LLSD(), login_alert_status);
@@ -1445,6 +1489,15 @@ bool idle_startup()
{
LLNotificationsUtil::add("LoginPacketNeverReceivedNoTP", LLSD(), LLSD(), login_alert_status);
}
+
+ // Session was created, don't just hang up on server, send a logout request
+ LLMessageSystem* msg = gMessageSystem;
+ msg->newMessageFast(_PREHASH_LogoutRequest);
+ msg->nextBlockFast(_PREHASH_AgentData);
+ msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
+ msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
+ gAgent.sendReliableMessage();
+
reset_login();
}
else if (num_retries > 0)
@@ -1458,7 +1511,7 @@ bool idle_startup()
set_startup_status(0.4f, LLTrans::getString("LoginRequestSeedCapGrant"), gAgent.mMOTD.c_str());
}
}
- display_startup();
+ do_startup_frame();
return false;
}
@@ -1469,7 +1522,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
@@ -1478,9 +1531,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
@@ -1488,15 +1541,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
@@ -1505,23 +1558,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
@@ -1529,12 +1582,12 @@ 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
LLFloaterIMContainer *im_inst = LLFloaterIMContainer::getInstance();
- if(gAgent.isFirstLogin())
+ if(gAgent.isFirstLogin() && im_inst)
{
im_inst->openFloater(im_inst->getKey());
}
@@ -1550,12 +1603,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
//
@@ -1580,7 +1633,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
@@ -1591,7 +1644,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;
@@ -1602,7 +1655,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
@@ -1616,12 +1669,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.
@@ -1650,7 +1703,7 @@ bool idle_startup()
NULL);
timeout.reset();
- display_startup();
+ do_startup_frame();
return false;
}
@@ -1677,7 +1730,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;
@@ -1691,7 +1744,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
@@ -1706,7 +1768,7 @@ bool idle_startup()
LLStartUp::setStartupState( STATE_AGENT_WAIT ); // Go to STATE_AGENT_WAIT
timeout.reset();
- display_startup();
+ do_startup_frame();
return false;
}
@@ -1715,39 +1777,17 @@ 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)
{
- LL_WARNS("AppInit") << "Backing up to login screen!" << LL_ENDL;
+ LL_WARNS("AppInit") << "Timeout on agent movement. Sending logout and backing up to login screen!" << LL_ENDL;
if (gRememberPassword)
{
LLNotificationsUtil::add("LoginPacketNeverReceived", LLSD(), LLSD(), login_alert_status);
@@ -1756,6 +1796,15 @@ bool idle_startup()
{
LLNotificationsUtil::add("LoginPacketNeverReceivedNoTP", LLSD(), LLSD(), login_alert_status);
}
+
+ // Session was created, don't just hang up on server, send a logout request
+ LLMessageSystem* msg = gMessageSystem;
+ msg->newMessageFast(_PREHASH_LogoutRequest);
+ msg->nextBlockFast(_PREHASH_AgentData);
+ msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
+ msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
+ gAgent.sendReliableMessage();
+
reset_login();
}
return false;
@@ -1767,7 +1816,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;
@@ -1777,12 +1826,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;
@@ -1797,7 +1846,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())
@@ -1809,9 +1858,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;
}
@@ -1830,7 +1879,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())
@@ -1841,9 +1890,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;
}
@@ -1889,7 +1938,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;
@@ -1917,7 +1966,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
@@ -1926,21 +1975,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.
@@ -1959,7 +2008,7 @@ bool idle_startup()
LLInventoryModelBackgroundFetch::instance().start();
gInventory.createCommonSystemCategories();
LLStartUp::setStartupState(STATE_INVENTORY_CALLBACKS );
- display_startup();
+ do_startup_frame();
return false;
}
@@ -1971,7 +2020,7 @@ bool idle_startup()
{
if (!LLInventoryModel::isSysFoldersReady())
{
- display_startup();
+ do_startup_frame();
return false;
}
@@ -1996,29 +2045,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;
}
@@ -2068,7 +2115,7 @@ bool idle_startup()
gSavedSettings.setBOOL("ShowStartLocation", true);
}
- display_startup();
+ do_startup_frame();
// Load stored local environment if needed.
LLEnvironment::instance().loadFromSettings();
@@ -2076,7 +2123,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"))
{
@@ -2084,21 +2131,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
@@ -2136,7 +2180,7 @@ bool idle_startup()
LLGestureMgr::instance().startFetch();
}
gDisplaySwapBuffers = true;
- display_startup();
+ do_startup_frame();
LLMessageSystem* msg = gMessageSystem;
msg->setHandlerFuncFast(_PREHASH_SoundTrigger, process_sound_trigger);
@@ -2214,10 +2258,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();
@@ -2226,7 +2270,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
@@ -2252,7 +2296,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())
@@ -2277,7 +2321,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;
@@ -2305,7 +2349,7 @@ bool idle_startup()
LLStartUp::setStartupState( STATE_CLEANUP );
}
- display_startup();
+ do_startup_frame();
if (gAgent.isOutfitChosen() && (wearables_time > MAX_WEARABLES_TIME))
{
@@ -2346,7 +2390,7 @@ bool idle_startup()
if (STATE_CLEANUP == LLStartUp::getStartupState())
{
set_startup_status(1.0, "", "");
- display_startup();
+ do_startup_frame();
if (!mBenefitsSuccessfullyInit)
{
@@ -2367,7 +2411,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
@@ -2399,7 +2443,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
@@ -2415,7 +2459,7 @@ bool idle_startup()
LLAgentPicksInfo::getInstance()->requestNumberOfPicks();
- display_startup();
+ do_startup_frame();
llassert(LLPathfindingManager::getInstance() != NULL);
LLPathfindingManager::getInstance()->initSystem();
@@ -2434,6 +2478,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;
}
@@ -3028,9 +3093,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;
@@ -3094,7 +3157,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()
@@ -3102,7 +3165,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();
}
@@ -3559,11 +3622,12 @@ 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);
gDebugInfo["SessionID"] = text;
+ LLAppViewer::instance()->recordSessionToMarker();
// Session id needed for parcel info request in LLUrlEntryParcel
// to resolve parcel name.
@@ -3798,14 +3862,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.
@@ -3876,25 +3940,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