diff options
| author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-10-26 18:27:08 -0400 | 
|---|---|---|
| committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-10-26 18:27:08 -0400 | 
| commit | 3aeff074cfc2f14b661b96bc0664087a95a99eff (patch) | |
| tree | 4e36fc435812894b5854fac3252149518eff5e34 /indra | |
| parent | 6c62c4e716753456b7de47652a575fafdba45049 (diff) | |
SH-3469 FIX - use callback mechanism to handle possible race between getting caps and setting agent region
Diffstat (limited to 'indra')
| -rwxr-xr-x | indra/newview/llagent.cpp | 23 | ||||
| -rwxr-xr-x[-rw-r--r--] | indra/newview/llagent.h | 1 | ||||
| -rwxr-xr-x | indra/newview/llappearancemgr.cpp | 4 | 
3 files changed, 24 insertions, 4 deletions
| diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 9eb2723dcf..c49caf93be 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -809,6 +809,18 @@ void LLAgent::standUp()  } +void LLAgent::handleServerBakeRegionTransition(const LLUUID& region_id) +{ +	llinfos << "called" << llendl; + +	if (isAgentAvatarValid() && +		!gAgentAvatarp->isUsingServerBakes() && +		(mRegionp->getCentralBakeVersion()>0)) +	{ +		LLAppearanceMgr::instance().requestServerAppearanceUpdate(); +	} +} +  //-----------------------------------------------------------------------------  // setRegion()  //----------------------------------------------------------------------------- @@ -908,11 +920,14 @@ void LLAgent::setRegion(LLViewerRegion *regionp)  	// If the newly entered region is using server bakes, and our  	// current appearance is non-baked, request appearance update from  	// server. -	if (isAgentAvatarValid() && -		!gAgentAvatarp->isUsingServerBakes() && -		(mRegionp->getCentralBakeVersion()>0)) +	if (mRegionp->capabilitiesReceived())  	{ -		LLAppearanceMgr::instance().requestServerAppearanceUpdate(); +		handleServerBakeRegionTransition(mRegionp->getRegionID()); +	} +	else +	{ +		// Need to handle via callback after caps arrive. +		mRegionp->setCapabilitiesReceivedCallback(boost::bind(&LLAgent::handleServerBakeRegionTransition,this,_1));  	}  } diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index ae5efb2287..693c123851 100644..100755 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -610,6 +610,7 @@ private:  	void            handleTeleportFinished();  	void            handleTeleportFailed(); +	void			handleServerBakeRegionTransition(const LLUUID& region_id);  	//--------------------------------------------------------------------  	// Teleport State diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index c57269d0b0..7a8586ebdc 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2677,6 +2677,10 @@ void LLAppearanceMgr::requestServerAppearanceUpdate()  	{  		llwarns << "Region not set, cannot request server appearance update" << llendl;  	} +	if (gAgent.getRegion()->getCentralBakeVersion()==0) +	{ +		llwarns << "Region does not support baking" << llendl; +	}  	std::string url = gAgent.getRegion()->getCapability("UpdateAvatarAppearance");	  	if (url.empty())  	{ | 
