stone_linden avatar stone_linden committed 9294687

EXP-625 No longer stuck as a cloud on initial login by fixing logic around fetching library items from the Inventory capabilities.

Comments (0)

Files changed (2)

indra/newview/llinventoryobserver.cpp

 void fetch_items_from_llsd(const LLSD& items_llsd)
 {
 	if (!items_llsd.size() || gDisconnected) return;
+
 	LLSD body;
 	body[0]["cap_name"] = "FetchInventory2";
 	body[1]["cap_name"] = "FetchLib2";
 			body[0]["items"].append(items_llsd[i]);
 			continue;
 		}
-		if (items_llsd[i]["owner_id"].asString() == ALEXANDRIA_LINDEN_ID.asString())
+		else if (items_llsd[i]["owner_id"].asString() == ALEXANDRIA_LINDEN_ID.asString())
 		{
 			body[1]["items"].append(items_llsd[i]);
 			continue;
 		
 	for (S32 i=0; i<body.size(); i++)
 	{
-		if(!gAgent.getRegion())
+		if (!gAgent.getRegion())
 		{
-			llwarns<<"Agent's region is null"<<llendl;
+			llwarns << "Agent's region is null" << llendl;
 			break;
 		}
-		if (0 >= body[i].size()) continue;
+
+		if (0 == body[i]["items"].size()) {
+			lldebugs << "Skipping body with no items to fetch" << llendl;
+			continue;
+		}
+
 		std::string url = gAgent.getRegion()->getCapability(body[i]["cap_name"].asString());
-
 		if (!url.empty())
 		{
 			body[i]["agent_id"]	= gAgent.getID();
 			LLHTTPClient::post(url, body[i], new LLInventoryModel::fetchInventoryResponder(body[i]));
-			break;
+			continue;
 		}
 
 		LLMessageSystem* msg = gMessageSystem;
 		// It's incomplete, so put it on the incomplete container, and
 		// pack this on the message.
 		mIncomplete.push_back(*it);
-		
+
 		// Prepare the data to fetch
 		LLSD item_entry;
 		item_entry["owner_id"] = owner_id;

indra/newview/llstartup.cpp

 void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name,
 								   const std::string& gender_name )
 {
-	llinfos << "starting" << llendl;
+	lldebugs << "starting" << llendl;
 
 	// Not going through the processAgentInitialWearables path, so need to set this here.
 	LLAppearanceMgr::instance().setAttachmentInvLinkEnable(true);
 	std::string same_gender_gestures;
 	if (gender_name == "male")
 	{
+		lldebugs << "male" << llendl;
 		gender = OPT_MALE;
 		same_gender_gestures = MALE_GESTURES_FOLDER;
 	}
 	else
 	{
+		lldebugs << "female" << llendl;
 		gender = OPT_FEMALE;
 		same_gender_gestures = FEMALE_GESTURES_FOLDER;
 	}
 		outfit_folder_name);
 	if (cat_id.isNull())
 	{
+		lldebugs << "standard wearables" << llendl;
 		gAgentWearables.createStandardWearables(gender);
 	}
 	else
 		bool do_append = false;
 		LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id);
 		LLAppearanceMgr::instance().wearInventoryCategory(cat, do_copy, do_append);
+		lldebugs << "initial outfit category id: " << cat_id << llendl;
 	}
 
 	// Copy gestures
 	copyLibraryGestures(same_gender_gestures);
-	
+
 	// This is really misnamed -- it means we have started loading
 	// an outfit/shape that will give the avatar a gender eventually. JC
 	gAgent.setGenderChosen(TRUE);
-
 }
 
 //static
 void LLStartUp::saveInitialOutfit()
 {
-	if (sInitialOutfit.empty()) return;
+	if (sInitialOutfit.empty()) {
+		lldebugs << "sInitialOutfit is empty" << llendl;
+		return;
+	}
 	
 	if (sWearablesLoadedCon.connected())
 	{
+		lldebugs << "sWearablesLoadedCon is connected, disconnecting" << llendl;
 		sWearablesLoadedCon.disconnect();
 	}
+	lldebugs << "calling makeNewOutfitLinks( \"" << sInitialOutfit << "\" )" << llendl;
 	LLAppearanceMgr::getInstance()->makeNewOutfitLinks(sInitialOutfit,false);
 }
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.