summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Meadows <leviathan@lindenlab.com>2025-02-26 10:24:19 -0800
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2025-02-27 19:50:17 +0200
commitb52842ee2a328d80834f9a62c1b130ec757b9a03 (patch)
treeb2327dcd08fa4701fab7a76fffffaf6e8ec5264a
parent100861aec17239543b21b3356ed2d8d009ba77ac (diff)
theoretical earlier start to asset downloads during startup (#3589)
* process UDP packets earlier in startup sequence * call lazyAttach() when nonzero pending attachments
-rw-r--r--indra/newview/llappviewer.cpp5
-rw-r--r--indra/newview/llappviewer.h2
-rw-r--r--indra/newview/llstartup.cpp272
-rw-r--r--indra/newview/llvoavatar.cpp5
4 files changed, 153 insertions, 131 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 241dbeaae5..18ad19f6bc 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -349,8 +349,6 @@ std::string gLastVersionChannel;
LLVector3 gWindVec(3.0, 3.0, 0.0);
LLVector3 gRelativeWindVec(0.0, 0.0, 0.0);
-U32 gPacketsIn = 0;
-
bool gRandomizeFramerate = false;
bool gPeriodicSlowFrame = false;
@@ -359,6 +357,7 @@ bool gLLErrorActivated = false;
bool gLogoutInProgress = false;
bool gSimulateMemLeak = false;
+bool gDoDisconnect = false;
// We don't want anyone, especially threads working on the graphics pipeline,
// to have to block due to this WorkQueue being full.
@@ -372,7 +371,6 @@ const std::string MARKER_FILE_NAME("SecondLife.exec_marker");
const std::string START_MARKER_FILE_NAME("SecondLife.start_marker");
const std::string ERROR_MARKER_FILE_NAME("SecondLife.error_marker");
const std::string LOGOUT_MARKER_FILE_NAME("SecondLife.logout_marker");
-static bool gDoDisconnect = false;
static std::string gLaunchFileOnQuit;
// Used on Win32 for other apps to identify our window (eg, win_setup)
@@ -5393,7 +5391,6 @@ void LLAppViewer::idleNetwork()
}
total_decoded++;
- gPacketsIn++;
if (total_decoded > MESSAGE_MAX_PER_FRAME)
{
diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h
index 832d61101a..ad42c4a6f1 100644
--- a/indra/newview/llappviewer.h
+++ b/indra/newview/llappviewer.h
@@ -411,10 +411,10 @@ extern std::string gLastVersionChannel;
extern LLVector3 gWindVec;
extern LLVector3 gRelativeWindVec;
-extern U32 gPacketsIn;
extern bool gRandomizeFramerate;
extern bool gPeriodicSlowFrame;
+extern bool gDoDisconnect;
extern bool gSimulateMemLeak;
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 5cd27352de..eb0e9ef4bc 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -297,16 +297,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();
}
@@ -728,7 +774,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;
@@ -793,7 +839,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
@@ -824,7 +870,7 @@ bool idle_startup()
}
LL_DEBUGS("AppInit") << "PeekMessage processed" << LL_ENDL;
#endif
- display_startup();
+ do_startup_frame();
timeout.reset();
return false;
}
@@ -839,7 +885,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;
@@ -1021,7 +1067,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();
@@ -1058,7 +1104,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
@@ -1130,7 +1176,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();
}
@@ -1158,7 +1204,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());
@@ -1210,7 +1256,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);
}
}
@@ -1233,7 +1279,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;
@@ -1249,71 +1295,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;
@@ -1322,18 +1368,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
@@ -1354,7 +1400,7 @@ bool idle_startup()
{
LLStartUp::multimediaInit();
LLStartUp::setStartupState( STATE_FONT_INIT );
- display_startup();
+ do_startup_frame();
return false;
}
@@ -1363,7 +1409,7 @@ bool idle_startup()
{
LLStartUp::fontInit();
LLStartUp::setStartupState( STATE_SEED_GRANTED_WAIT );
- display_startup();
+ do_startup_frame();
return false;
}
@@ -1435,7 +1481,7 @@ bool idle_startup()
set_startup_status(0.4f, LLTrans::getString("LoginRequestSeedCapGrant"), gAgent.mMOTD.c_str());
}
}
- display_startup();
+ do_startup_frame();
return false;
}
@@ -1446,7 +1492,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
@@ -1455,9 +1501,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
@@ -1465,15 +1511,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
@@ -1482,23 +1528,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
@@ -1506,7 +1552,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
@@ -1527,12 +1573,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
//
@@ -1557,7 +1603,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
@@ -1568,7 +1614,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;
@@ -1579,7 +1625,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
@@ -1593,12 +1639,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.
@@ -1627,7 +1673,7 @@ bool idle_startup()
NULL);
timeout.reset();
- display_startup();
+ do_startup_frame();
return false;
}
@@ -1654,7 +1700,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;
@@ -1668,7 +1714,7 @@ bool idle_startup()
gAssetStorage->setUpstream(regionp->getHost());
gCacheName->setUpstream(regionp->getHost());
}
- display_startup();
+ do_startup_frame();
// Create login effect
// But not on first login, because you can't see your avatar then
@@ -1683,7 +1729,7 @@ bool idle_startup()
LLStartUp::setStartupState( STATE_AGENT_WAIT ); // Go to STATE_AGENT_WAIT
timeout.reset();
- display_startup();
+ do_startup_frame();
return false;
}
@@ -1692,35 +1738,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)
{
@@ -1753,7 +1777,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;
@@ -1763,12 +1787,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;
@@ -1783,7 +1807,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())
@@ -1795,9 +1819,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;
}
@@ -1816,7 +1840,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())
@@ -1827,9 +1851,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;
}
@@ -1875,7 +1899,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;
@@ -1903,7 +1927,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
@@ -1912,21 +1936,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.
@@ -1945,7 +1969,7 @@ bool idle_startup()
LLInventoryModelBackgroundFetch::instance().start();
gInventory.createCommonSystemCategories();
LLStartUp::setStartupState(STATE_INVENTORY_CALLBACKS );
- display_startup();
+ do_startup_frame();
return false;
}
@@ -1957,7 +1981,7 @@ bool idle_startup()
{
if (!LLInventoryModel::isSysFoldersReady())
{
- display_startup();
+ do_startup_frame();
return false;
}
@@ -1982,7 +2006,7 @@ 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;
@@ -1993,18 +2017,18 @@ bool idle_startup()
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;
}
@@ -2054,7 +2078,7 @@ bool idle_startup()
gSavedSettings.setBOOL("ShowStartLocation", true);
}
- display_startup();
+ do_startup_frame();
// Load stored local environment if needed.
LLEnvironment::instance().loadFromSettings();
@@ -2062,7 +2086,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"))
{
@@ -2070,7 +2094,7 @@ bool idle_startup()
LLViewerHelp::instance().showTopic("");
}
- display_startup();
+ do_startup_frame();
// We're successfully logged in.
gSavedSettings.setBOOL("FirstLoginThisInstall", false);
@@ -2079,12 +2103,12 @@ bool idle_startup()
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
@@ -2122,7 +2146,7 @@ bool idle_startup()
LLGestureMgr::instance().startFetch();
}
gDisplaySwapBuffers = true;
- display_startup();
+ do_startup_frame();
LLMessageSystem* msg = gMessageSystem;
msg->setHandlerFuncFast(_PREHASH_SoundTrigger, process_sound_trigger);
@@ -2200,10 +2224,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();
@@ -2212,7 +2236,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
@@ -2238,7 +2262,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())
@@ -2263,7 +2287,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;
@@ -2291,7 +2315,7 @@ bool idle_startup()
LLStartUp::setStartupState( STATE_CLEANUP );
}
- display_startup();
+ do_startup_frame();
if (gAgent.isOutfitChosen() && (wearables_time > MAX_WEARABLES_TIME))
{
@@ -2332,7 +2356,7 @@ bool idle_startup()
if (STATE_CLEANUP == LLStartUp::getStartupState())
{
set_startup_status(1.0, "", "");
- display_startup();
+ do_startup_frame();
if (!mBenefitsSuccessfullyInit)
{
@@ -2353,7 +2377,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
@@ -2385,7 +2409,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
@@ -2401,7 +2425,7 @@ bool idle_startup()
LLAgentPicksInfo::getInstance()->requestNumberOfPicks();
- display_startup();
+ do_startup_frame();
llassert(LLPathfindingManager::getInstance() != NULL);
LLPathfindingManager::getInstance()->initSystem();
@@ -3006,9 +3030,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;
@@ -3072,7 +3094,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()
@@ -3080,7 +3102,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();
}
@@ -3777,14 +3799,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.
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 51991c1261..40312b7f4e 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -2794,7 +2794,10 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time)
}
// attach objects that were waiting for a drawable
- lazyAttach();
+ if (!mPendingAttachment.empty())
+ {
+ lazyAttach();
+ }
// animate the character
// store off last frame's root position to be consistent with camera position