diff options
| author | tiggs@lindenlab.com <tiggs@lindenlab.com> | 2010-12-20 13:54:32 -0500 | 
|---|---|---|
| committer | tiggs@lindenlab.com <tiggs@lindenlab.com> | 2010-12-20 13:54:32 -0500 | 
| commit | 59b381c549e9e47194b96361ccee5a7bdcb2c89b (patch) | |
| tree | b27d3ee739e4aa6b07172ffa1e6ef2e2c81f9f90 | |
| parent | 0239421aa0c69fe9ce6b12671e927baaf05e5ae1 (diff) | |
fix for ER-350; wait until connection is finished before send update. rvw'd by Nyx
| -rw-r--r-- | indra/newview/llviewermessage.cpp | 69 | 
1 files changed, 35 insertions, 34 deletions
| diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 5cbd5ffa0b..f2fee88f56 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4055,54 +4055,55 @@ void send_agent_update(BOOL force_send, BOOL send_reliable)  	if (duplicate_count < DUP_MSGS && !gDisconnected)  	{ -		LLFastTimer t(FTM_AGENT_UPDATE_SEND); -		// Build the message -		msg->newMessageFast(_PREHASH_AgentUpdate); -		msg->nextBlockFast(_PREHASH_AgentData); -		msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); -		msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); -		msg->addQuatFast(_PREHASH_BodyRotation, body_rotation); -		msg->addQuatFast(_PREHASH_HeadRotation, head_rotation); -		msg->addU8Fast(_PREHASH_State, render_state); -		msg->addU8Fast(_PREHASH_Flags, flags); +		if (LLStartUp::getStartupState() >= STATE_STARTED) +		{ +			LLFastTimer t(FTM_AGENT_UPDATE_SEND); +			// Build the message +			msg->newMessageFast(_PREHASH_AgentUpdate); +			msg->nextBlockFast(_PREHASH_AgentData); +			msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); +			msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); +			msg->addQuatFast(_PREHASH_BodyRotation, body_rotation); +			msg->addQuatFast(_PREHASH_HeadRotation, head_rotation); +			msg->addU8Fast(_PREHASH_State, render_state); +			msg->addU8Fast(_PREHASH_Flags, flags);  //		if (camera_pos_agent.mV[VY] > 255.f)  //		{  //			LL_INFOS("Messaging") << "Sending camera center " << camera_pos_agent << LL_ENDL;  //		} -		msg->addVector3Fast(_PREHASH_CameraCenter, camera_pos_agent); -		msg->addVector3Fast(_PREHASH_CameraAtAxis, LLViewerCamera::getInstance()->getAtAxis()); -		msg->addVector3Fast(_PREHASH_CameraLeftAxis, LLViewerCamera::getInstance()->getLeftAxis()); -		msg->addVector3Fast(_PREHASH_CameraUpAxis, LLViewerCamera::getInstance()->getUpAxis()); -		msg->addF32Fast(_PREHASH_Far, gAgentCamera.mDrawDistance); +			msg->addVector3Fast(_PREHASH_CameraCenter, camera_pos_agent); +			msg->addVector3Fast(_PREHASH_CameraAtAxis, LLViewerCamera::getInstance()->getAtAxis()); +			msg->addVector3Fast(_PREHASH_CameraLeftAxis, LLViewerCamera::getInstance()->getLeftAxis()); +			msg->addVector3Fast(_PREHASH_CameraUpAxis, LLViewerCamera::getInstance()->getUpAxis()); +			msg->addF32Fast(_PREHASH_Far, gAgentCamera.mDrawDistance); -		msg->addU32Fast(_PREHASH_ControlFlags, control_flags); +			msg->addU32Fast(_PREHASH_ControlFlags, control_flags); -		if (gDebugClicks) -		{ -			if (control_flags & AGENT_CONTROL_LBUTTON_DOWN) +			if (gDebugClicks)  			{ -				LL_INFOS("Messaging") << "AgentUpdate left button down" << LL_ENDL; +				if (control_flags & AGENT_CONTROL_LBUTTON_DOWN) +				{ +					LL_INFOS("Messaging") << "AgentUpdate left button down" << LL_ENDL; +				} + +				if (control_flags & AGENT_CONTROL_LBUTTON_UP) +				{ +					LL_INFOS("Messaging") << "AgentUpdate left button up" << LL_ENDL; +				}  			} -			if (control_flags & AGENT_CONTROL_LBUTTON_UP) +			gAgent.enableControlFlagReset(); +			if (!send_reliable)  			{ -				LL_INFOS("Messaging") << "AgentUpdate left button up" << LL_ENDL; +				gAgent.sendMessage(); +			} +			else +			{ +				gAgent.sendReliableMessage();  			}  		} - -		gAgent.enableControlFlagReset(); - -		if (!send_reliable) -		{ -			gAgent.sendMessage(); -		} -		else -		{ -			gAgent.sendReliableMessage(); -		} -  //		LL_DEBUGS("Messaging") << "agent " << avatar_pos_agent << " cam " << camera_pos_agent << LL_ENDL;  		// Copy the old data  | 
