From 1ac80a81f3990c207b04d560453db831831c1049 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Fri, 21 May 2010 17:27:39 -0700 Subject: Fixed the login screen sometimes stuck on 'Connecting to Region...' while logging onto OpenSim, added debugging info for checking the startup state --- linden/indra/newview/app_settings/logcontrol.xml | 6 ++- linden/indra/newview/llstartup.cpp | 49 ++++++++++++++++++++---- 2 files changed, 46 insertions(+), 9 deletions(-) diff --git a/linden/indra/newview/app_settings/logcontrol.xml b/linden/indra/newview/app_settings/logcontrol.xml index cc4b63b..e276e48 100644 --- a/linden/indra/newview/app_settings/logcontrol.xml +++ b/linden/indra/newview/app_settings/logcontrol.xml @@ -42,8 +42,10 @@ - - + + + + diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index e2b6cc5..bbf55f7 100644 --- a/linden/indra/newview/llstartup.cpp +++ b/linden/indra/newview/llstartup.cpp @@ -322,12 +322,13 @@ bool idle_startup() LLMemType mt1(LLMemType::MTYPE_STARTUP); const F32 PRECACHING_DELAY = gSavedSettings.getF32("PrecachingDelay"); - const F32 TIMEOUT_SECONDS = 5.f; + const F32 TIMEOUT_SECONDS = 10.f; // changed from 5 to 10 seconds for OpenSim lag -- MC const S32 MAX_TIMEOUT_COUNT = 3; static LLTimer timeout; static S32 timeout_count = 0; static LLTimer login_time; + static LLTimer connecting_region_timer; static LLFrameTimer wearables_timer; // until this is encapsulated, this little hack for the @@ -382,6 +383,7 @@ bool idle_startup() if ( STATE_FIRST == LLStartUp::getStartupState() ) { + LL_DEBUGS("AppInitStartupState") << "STATE_FIRST" << LL_ENDL; gViewerWindow->showCursor(); gViewerWindow->getWindow()->setCursor(UI_CURSOR_WAIT); @@ -737,7 +739,7 @@ bool idle_startup() if (STATE_BROWSER_INIT == LLStartUp::getStartupState()) { - LL_DEBUGS("AppInit") << "STATE_BROWSER_INIT" << LL_ENDL; + LL_DEBUGS("AppInitStartupState") << "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(); @@ -831,6 +833,7 @@ bool idle_startup() if (STATE_LOGIN_WAIT == LLStartUp::getStartupState()) { + LL_DEBUGS("AppInitStartupState") << "STATE_LOGIN_WAIT" << LL_ENDL; // Don't do anything. Wait for the login view to call the login_callback, // which will push us to the next state. @@ -841,6 +844,7 @@ bool idle_startup() if (STATE_LOGIN_CLEANUP == LLStartUp::getStartupState()) { + LL_DEBUGS("AppInitStartupState") << "STATE_LOGIN_CLEANUP" << LL_ENDL; //reset the values that could have come in from a slurl if (!gLoginHandler.getWebLoginKey().isNull()) { @@ -1042,12 +1046,14 @@ bool idle_startup() if (STATE_UPDATE_CHECK == LLStartUp::getStartupState()) { + LL_DEBUGS("AppInitStartupState") << "STATE_UPDATE_CHECK" << LL_ENDL; // wait for user to give input via dialog box return FALSE; } if(STATE_LOGIN_AUTH_INIT == LLStartUp::getStartupState()) { + LL_DEBUGS("AppInitStartupState") << "STATE_LOGIN_AUTH_INIT" << LL_ENDL; //#define LL_MINIMIAL_REQUESTED_OPTIONS gDebugInfo["GridName"] = LLViewerLogin::getInstance()->getGridLabel(); @@ -1109,7 +1115,7 @@ bool idle_startup() if (STATE_LOGIN_AUTHENTICATE == LLStartUp::getStartupState()) { - LL_DEBUGS("AppInit") << "STATE_LOGIN_AUTHENTICATE" << LL_ENDL; + LL_DEBUGS("AppInitStartupState") << "STATE_LOGIN_AUTHENTICATE" << LL_ENDL; set_startup_status(progress, auth_desc, auth_message); progress += 0.02f; display_startup(); @@ -1186,7 +1192,7 @@ bool idle_startup() if(STATE_LOGIN_NO_DATA_YET == LLStartUp::getStartupState()) { - LL_DEBUGS("AppInit") << "STATE_LOGIN_NO_DATA_YET" << LL_ENDL; + LL_DEBUGS("AppInitStartupState") << "STATE_LOGIN_NO_DATA_YET" << LL_ENDL; // If we get here we have gotten past the potential stall // in curl, so take "may appear frozen" out of progress bar. JC auth_desc = "Logging in..."; @@ -1211,7 +1217,7 @@ bool idle_startup() if(STATE_LOGIN_DOWNLOADING == LLStartUp::getStartupState()) { - LL_DEBUGS("AppInit") << "STATE_LOGIN_DOWNLOADING" << LL_ENDL; + LL_DEBUGS("AppInitStartupState") << "STATE_LOGIN_DOWNLOADING" << LL_ENDL; // Process messages to keep from dropping circuit. LLMessageSystem* msg = gMessageSystem; while (msg->checkAllMessages(gFrameCount, gServicePump)) @@ -1232,7 +1238,7 @@ bool idle_startup() if(STATE_LOGIN_PROCESS_RESPONSE == LLStartUp::getStartupState()) { - LL_DEBUGS("AppInit") << "STATE_LOGIN_PROCESS_RESPONSE" << LL_ENDL; + LL_DEBUGS("AppInitStartupState") << "STATE_LOGIN_PROCESS_RESPONSE" << LL_ENDL; std::ostringstream emsg; bool quit = false; std::string login_response; @@ -1724,6 +1730,7 @@ bool idle_startup() //--------------------------------------------------------------------- if (STATE_WORLD_INIT == LLStartUp::getStartupState()) { + LL_DEBUGS("AppInitStartupState") << "STATE_WORLD_INIT" << LL_ENDL; set_startup_status(0.40f, LLTrans::getString("LoginInitializingWorld"), gAgent.mMOTD); gDisconnected=FALSE; display_startup(); @@ -1798,6 +1805,7 @@ bool idle_startup() //--------------------------------------------------------------------- if (STATE_MULTIMEDIA_INIT == LLStartUp::getStartupState()) { + LL_DEBUGS("AppInitStartupState") << "STATE_MULTIMEDIA_INIT" << LL_ENDL; LLStartUp::multimediaInit(); LLStartUp::setStartupState( STATE_SEED_GRANTED_WAIT ); return FALSE; @@ -1808,6 +1816,7 @@ bool idle_startup() //--------------------------------------------------------------------- if(STATE_SEED_GRANTED_WAIT == LLStartUp::getStartupState()) { + LL_DEBUGS("AppInitStartupState") << "STATE_SEED_GRANTED_WAIT" << LL_ENDL; return FALSE; } @@ -1818,6 +1827,7 @@ bool idle_startup() //--------------------------------------------------------------------- if (STATE_SEED_CAP_GRANTED == LLStartUp::getStartupState()) { + LL_DEBUGS("AppInitStartupState") << "STATE_SEED_CAP_GRANTED" << LL_ENDL; update_texture_fetch(); if ( gViewerWindow != NULL) @@ -2065,9 +2075,12 @@ bool idle_startup() LLHUDManager::getInstance()->sendEffects(); } + // Drop out if we can't connect after TIMEOUT_SECONDS -- MC + connecting_region_timer.start(); LLStartUp::setStartupState( STATE_AGENT_WAIT ); // Go to STATE_AGENT_WAIT timeout.reset(); + return FALSE; } @@ -2076,6 +2089,22 @@ bool idle_startup() //--------------------------------------------------------------------- if (STATE_AGENT_WAIT == LLStartUp::getStartupState()) { + LL_DEBUGS("AppInitStartupState") << "STATE_AGENT_WAIT" << LL_ENDL; + if (connecting_region_timer.getElapsedTimeF32() > TIMEOUT_SECONDS) + { + // Bounce back to the login screen -- MC + LL_WARNS("AppInit") << "Bad login - can't connect to this region for some reason" << LL_ENDL; + LLSD args; + args["ERROR_MESSAGE"] = "Unable to connect to the current region. Try logging into a different region instead. The default login location can be set in the General tab in Preferences."; + LLNotifications::instance().add("ErrorMessage", args, LLSD(), login_alert_done); + LLStartUp::resetLogin(); + gSavedSettings.setBOOL("AutoLogin", FALSE); + //this might be redundant + LLStartUp::setShouldAutoLogin(false); + show_connect_box = true; + connecting_region_timer.reset(); + } + LLMessageSystem* msg = gMessageSystem; while (msg->checkAllMessages(gFrameCount, gServicePump)) { @@ -2098,6 +2127,7 @@ bool idle_startup() if (gAgentMovementCompleted) { LLStartUp::setStartupState( STATE_INVENTORY_SEND ); + connecting_region_timer.reset(); } return FALSE; @@ -2108,6 +2138,8 @@ bool idle_startup() //--------------------------------------------------------------------- if (STATE_INVENTORY_SEND == LLStartUp::getStartupState()) { + LL_DEBUGS("AppInitStartupState") << "STATE_INVENTORY_SEND" << LL_ENDL; + // unpack thin inventory LLUserAuth::options_t options; options.clear(); @@ -2303,6 +2335,7 @@ bool idle_startup() //--------------------------------------------------------------------- if (STATE_MISC == LLStartUp::getStartupState()) { + LL_DEBUGS("AppInitStartupState") << "STATE_MISC" << LL_ENDL; // We have a region, and just did a big inventory download. // We can estimate the user's connection speed, and set their // max bandwidth accordingly. JC @@ -2493,6 +2526,7 @@ bool idle_startup() if (STATE_PRECACHE == LLStartUp::getStartupState()) { + LL_DEBUGS("AppInitStartupState") << "STATE_PRECACHE" << LL_ENDL; F32 timeout_frac = timeout.getElapsedTimeF32()/PRECACHING_DELAY; // We now have an inventory skeleton, so if this is a user's first @@ -2535,7 +2569,7 @@ bool idle_startup() if (STATE_WEARABLES_WAIT == LLStartUp::getStartupState()) { - + LL_DEBUGS("AppInitStartupState") << "STATE_WEARABLES_WAIT" << LL_ENDL; const F32 wearables_time = wearables_timer.getElapsedTimeF32(); const F32 MAX_WEARABLES_TIME = 10.f; @@ -2595,6 +2629,7 @@ bool idle_startup() if (STATE_CLEANUP == LLStartUp::getStartupState()) { + LL_DEBUGS("AppInitStartupState") << "STATE_CLEANUP" << LL_ENDL; set_startup_status(1.0, "", ""); LLFirstUse::ClientTags(); -- cgit v1.1