diff options
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llfirstuse.cpp | 2 | ||||
| -rwxr-xr-x[-rw-r--r--] | indra/newview/llmeshrepository.cpp | 75 | ||||
| -rwxr-xr-x[-rw-r--r--] | indra/newview/llmeshrepository.h | 3 | 
3 files changed, 62 insertions, 18 deletions
| diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp index 2c4153688a..a9f52282a5 100644 --- a/indra/newview/llfirstuse.cpp +++ b/indra/newview/llfirstuse.cpp @@ -131,7 +131,7 @@ void LLFirstUse::notMoving(bool enable)  // static  void LLFirstUse::viewPopup(bool enable)  { -	firstUseNotification("FirstViewPopup", enable, "HintView", LLSD(), LLSD().with("target", "view_popup").with("direction", "right")); +//	firstUseNotification("FirstViewPopup", enable, "HintView", LLSD(), LLSD().with("target", "view_popup").with("direction", "right"));  }  // static diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 0a1eadf4d0..5305f3dbca 100644..100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -85,6 +85,8 @@ U32 LLMeshRepository::sPeakKbps = 0;  const U32 MAX_TEXTURE_UPLOAD_RETRIES = 5; +void dumpLLSDToFile(const LLSD& content, std::string filename); +  std::string header_lod[] =   {  	"lowest_lod", @@ -489,15 +491,36 @@ public:  		mThread(thread)  	{  	} -	virtual void completedRaw(U32 status, const std::string& reason, -							  const LLChannelDescriptors& channels, -							  const LLIOPipe::buffer_ptr_t& buffer) +	virtual void completed(U32 status, +						   const std::string& reason, +						   const LLSD& content)  	{ -		assert_main_thread(); +		//assert_main_thread();  		llinfos << "completed" << llendl;  		mThread->mPendingUploads--; +		dumpLLSDToFile(content,"whole_model_response.xml"); + +		mThread->mWholeModelUploadURL = content["uploader"];  +	} +}; + +class LLWholeModelUploadResponder: public LLCurl::Responder +{ +	LLMeshUploadThread* mThread; +public: +	LLWholeModelUploadResponder(LLMeshUploadThread* thread): +		mThread(thread) +	{ +	} +	virtual void completed(U32 status, +						   const std::string& reason, +						   const LLSD& content) +	{ +		//assert_main_thread(); +		llinfos << "upload completed" << llendl; +		mThread->mPendingUploads--; +		dumpLLSDToFile(content,"whole_model_upload_response.xml");  	} -	  };  LLMeshRepoThread::LLMeshRepoThread() @@ -1261,7 +1284,7 @@ LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data,  	mUploadObjectAssetCapability = gAgent.getRegion()->getCapability("UploadObjectAsset");  	mNewInventoryCapability = gAgent.getRegion()->getCapability("NewFileAgentInventoryVariablePrice"); -	mWholeModelUploadCapability = gAgent.getRegion()->getCapability("NewFileAgentInventory"); +	mWholeModelFeeCapability = gAgent.getRegion()->getCapability("NewFileAgentInventory");  	mOrigin += gAgent.getAtAxis() * scale.magVec();  } @@ -1363,8 +1386,8 @@ void LLMeshUploadThread::run()  	}  } -#if 0 -void dumpLLSDToFile(LLSD& content, std::string& filename) +#if 1 +void dumpLLSDToFile(const LLSD& content, std::string filename)  {  	std::ofstream of(filename);  	LLSDSerialize::toPrettyXML(content,of); @@ -1374,9 +1397,10 @@ void dumpLLSDToFile(LLSD& content, std::string& filename)  void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)  {  	// TODO where do textures go? -	 +  	LLSD result; +	LLSD res;  	result["folder_id"] = gInventory.findCategoryUUIDForType(LLFolderType::FT_OBJECT);  	result["asset_type"] = "mesh";  	result["inventory_type"] = "object"; @@ -1385,9 +1409,9 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)  	// TODO "optional" fields from the spec -	LLSD res;  	res["mesh_list"] = LLSD::emptyArray(); -	res["texture_list"] = LLSD::emptyArray(); +// TODO Textures +	//res["texture_list"] = LLSD::emptyArray();  	S32 mesh_num = 0;  	S32 texture_num = 0; @@ -1433,10 +1457,15 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)  		LLQuaternion rot;  		LLMatrix4 transformation = instance.mTransform;  		decomposeMeshMatrix(transformation,pos,rot,scale); -		 + +#if 0  		mesh_entry["childpos"] = ll_sd_from_vector3(pos);  		mesh_entry["childrot"] = ll_sd_from_quaternion(rot);  		mesh_entry["scale"] = ll_sd_from_vector3(scale); +#endif +		mesh_entry["position"] = ll_sd_from_vector3(LLVector3()); +		mesh_entry["rotation"] = ll_sd_from_quaternion(rot); +		mesh_entry["scale"] = ll_sd_from_vector3(scale);  		// TODO should be binary.  		std::string str = ostr.str(); @@ -1480,9 +1509,8 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)  	}  	result["asset_resources"] = res; -#if 0	 -	std::string name("whole_model.xml"); -	dumpLLSDToFile(result,name); +#if 1	 +	dumpLLSDToFile(result,"whole_model.xml");  #endif  	dest = result; @@ -1541,9 +1569,24 @@ void LLMeshUploadThread::doWholeModelUpload()  	mPendingUploads++;  	LLCurlRequest::headers_t headers; -	mCurlRequest->post(mWholeModelUploadCapability, headers, model_data.asString(), +	mCurlRequest->post(mWholeModelFeeCapability, headers, model_data,  					   new LLWholeModelFeeResponder(this)); +	do +	{ +		mCurlRequest->process(); +	} while (mCurlRequest->getQueued() > 0); + +	mCurlRequest->post(mWholeModelUploadURL, headers, model_data["asset_resources"], new LLWholeModelUploadResponder(this)); +	 +	do +	{ +		mCurlRequest->process(); +	} while (mCurlRequest->getQueued() > 0); + +	delete mCurlRequest; +	mCurlRequest = NULL; +  	// Currently a no-op.  	mFinished = true;  } diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 802e3e1aba..f859e29c07 100644..100755 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -387,7 +387,8 @@ public:  	LLHost			mHost;  	std::string		mUploadObjectAssetCapability;  	std::string		mNewInventoryCapability; -	std::string		mWholeModelUploadCapability; +	std::string		mWholeModelFeeCapability; +	std::string		mWholeModelUploadURL;  	std::queue<LLMeshUploadData> mUploadQ;  	std::queue<LLMeshUploadData> mConfirmedQ; | 
