diff options
| author | Erik Kundiman <erik@megapahit.org> | 2023-10-04 06:08:09 +0800 | 
|---|---|---|
| committer | Erik Kundiman <erik@megapahit.org> | 2023-10-04 06:08:09 +0800 | 
| commit | a332b8faefef8a044a2409957b415b62d6a85181 (patch) | |
| tree | e76c2d8c9500c700d2d45ea1b4708747854f2f7d /indra/newview/llstartup.cpp | |
| parent | bdfd8198eb8fe7128230d562fe37eafac5c52bec (diff) | |
| parent | f352fd1090ce4d50db349cdadfa61d66783a20e8 (diff) | |
Merge tag '6.6.15-release'
source for viewer 6.6.15.581961
Diffstat (limited to 'indra/newview/llstartup.cpp')
| -rw-r--r-- | indra/newview/llstartup.cpp | 79 | 
1 files changed, 68 insertions, 11 deletions
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 1b0a814c45..ad87fca25b 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -256,7 +256,7 @@ static bool mLoginStatePastUI = false;  static bool mBenefitsSuccessfullyInit = false;  const F32 STATE_AGENT_WAIT_TIMEOUT = 240; //seconds -const S32 MAX_SEED_CAP_ATTEMPTS_BEFORE_LOGIN = 3; // Give region 3 chances +const S32 MAX_SEED_CAP_ATTEMPTS_BEFORE_ABORT = 4; // Give region 4 chances  std::unique_ptr<LLEventPump> LLStartUp::sStateWatcher(new LLEventStream("StartupState"));  std::unique_ptr<LLStartupListener> LLStartUp::sListener(new LLStartupListener()); @@ -1412,11 +1412,18 @@ bool idle_startup()  		else  		{  			U32 num_retries = regionp->getNumSeedCapRetries(); -            if (num_retries > MAX_SEED_CAP_ATTEMPTS_BEFORE_LOGIN) +            if (num_retries > MAX_SEED_CAP_ATTEMPTS_BEFORE_ABORT)              { -                // Region will keep trying to get capabilities, -                // but for now continue as if caps were granted -                LLStartUp::setStartupState(STATE_SEED_CAP_GRANTED); +                LL_WARNS("AppInit") << "Failed to get capabilities. Backing up to login screen!" << LL_ENDL; +                if (gRememberPassword) +                { +                    LLNotificationsUtil::add("LoginPacketNeverReceived", LLSD(), LLSD(), login_alert_status); +                } +                else +                { +                    LLNotificationsUtil::add("LoginPacketNeverReceivedNoTP", LLSD(), LLSD(), login_alert_status); +                } +                reset_login();              }  			else if (num_retries > 0)  			{ @@ -1915,6 +1922,34 @@ bool idle_startup()          LLInventoryModelBackgroundFetch::instance().start();  		gInventory.createCommonSystemCategories(); +        LLStartUp::setStartupState(STATE_INVENTORY_CALLBACKS ); +        display_startup(); + +        return FALSE; +    } + +    //--------------------------------------------------------------------- +    // STATE_INVENTORY_CALLBACKS  +    //--------------------------------------------------------------------- +    if (STATE_INVENTORY_CALLBACKS  == LLStartUp::getStartupState()) +    { +        if (!LLInventoryModel::isSysFoldersReady()) +        { +            display_startup(); +            return FALSE; +        } +        LLInventoryModelBackgroundFetch::instance().start(); +        LLUUID cof_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT); +        LLViewerInventoryCategory* cof = gInventory.getCategory(cof_id); +        if (cof +            && cof->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN) +        { +            // Special case, dupplicate request prevention. +            // Cof folder will be requested via FetchCOF +            // in appearance manager, prevent recursive fetch +            cof->setFetching(LLViewerInventoryCategory::FETCH_RECURSIVE); +        } +  		// It's debatable whether this flag is a good idea - sets all  		// bits, and in general it isn't true that inventory @@ -2176,7 +2211,7 @@ bool idle_startup()  			gAgentWearables.notifyLoadingStarted();  			gAgent.setOutfitChosen(TRUE);  			gAgentWearables.sendDummyAgentWearablesUpdate(); -			callAfterCategoryFetch(LLAppearanceMgr::instance().getCOF(), set_flags_and_update_appearance); +            callAfterCOFFetch(set_flags_and_update_appearance);  		}  		display_startup(); @@ -2787,7 +2822,7 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name,  	// Not going through the processAgentInitialWearables path, so need to set this here.  	LLAppearanceMgr::instance().setAttachmentInvLinkEnable(true);  	// Initiate creation of COF, since we're also bypassing that. -	gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT); +	gInventory.ensureCategoryForTypeExists(LLFolderType::FT_CURRENT_OUTFIT);  	ESex gender;  	if (gender_name == "male") @@ -2840,8 +2875,15 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name,  		bool do_append = false;  		LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id);  		// Need to fetch cof contents before we can wear. -		callAfterCategoryFetch(LLAppearanceMgr::instance().getCOF(), +        if (do_copy) +        { +            callAfterCategoryFetch(LLAppearanceMgr::instance().getCOF(),  							   boost::bind(&LLAppearanceMgr::wearInventoryCategory, LLAppearanceMgr::getInstance(), cat, do_copy, do_append)); +        } +        else +        { +            callAfterCategoryLinksFetch(cat_id, boost::bind(&LLAppearanceMgr::wearInventoryCategory, LLAppearanceMgr::getInstance(), cat, do_copy, do_append)); +        }  		LL_DEBUGS() << "initial outfit category id: " << cat_id << LL_ENDL;  	} @@ -2894,6 +2936,7 @@ std::string LLStartUp::startupStateToString(EStartupState state)  		RTNENUM( STATE_AGENT_SEND );  		RTNENUM( STATE_AGENT_WAIT );  		RTNENUM( STATE_INVENTORY_SEND ); +        RTNENUM(STATE_INVENTORY_CALLBACKS );  		RTNENUM( STATE_MISC );  		RTNENUM( STATE_PRECACHE );  		RTNENUM( STATE_WEARABLES_WAIT ); @@ -2948,6 +2991,11 @@ void reset_login()  	LLFloaterReg::hideVisibleInstances();      LLStartUp::setStartupState( STATE_BROWSER_INIT ); +    if (LLVoiceClient::instanceExists()) +    { +        LLVoiceClient::getInstance()->terminate(); +    } +      // Clear any verified certs and verify them again on next login      // to ensure cert matches server instead of just getting reused      LLPointer<LLCertificateStore> store = gSecAPIHandler->getCertificateStore(""); @@ -3621,7 +3669,7 @@ bool process_login_success_response()  		std::string flag = login_flags["ever_logged_in"];  		if(!flag.empty())  		{ -			gAgent.setFirstLogin((flag == "N") ? TRUE : FALSE); +			gAgent.setFirstLogin(flag == "N");  		}  		/*  Flag is currently ignored by the viewer. @@ -3712,7 +3760,7 @@ bool process_login_success_response()  	std::string fake_initial_outfit_name = gSavedSettings.getString("FakeInitialOutfitName");  	if (!fake_initial_outfit_name.empty())  	{ -		gAgent.setFirstLogin(TRUE); +		gAgent.setFirstLogin(true);  		sInitialOutfit = fake_initial_outfit_name;  		if (sInitialOutfitGender.empty())  		{ @@ -3747,7 +3795,9 @@ bool process_login_success_response()  	// Only save mfa_hash for future logins if the user wants their info remembered. -	if(response.has("mfa_hash") && gSavedSettings.getBOOL("RememberUser") && gSavedSettings.getBOOL("RememberPassword")) +	if(response.has("mfa_hash") +       && gSavedSettings.getBOOL("RememberUser") +       && LLLoginInstance::getInstance()->saveMFA())  	{  		std::string grid(LLGridManager::getInstance()->getGridId());  		std::string user_id(gUserCredential->userID()); @@ -3755,6 +3805,13 @@ bool process_login_success_response()  		// 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(); +    }  	bool success = false;  	// JC: gesture loading done below, when we have an asset system  | 
