From cdbeb8b83b671df1ffb6bf7890c64a27e4a85730 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Wed, 28 Oct 2009 03:21:53 -0700 Subject: Track timestamps when terse updates were last sent for a prim or avatar to avoid floating away forever until a key is pressed (deviates from SL behavior in a hopefully good way) --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 87fac0c..92f00c4 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -96,6 +96,7 @@ namespace OpenSim.Region.Framework.Scenes private Vector3 m_lastPosition; private Quaternion m_lastRotation; private Vector3 m_lastVelocity; + private int m_lastTerseSent; private bool m_updateflag; private byte m_movementflag; @@ -2363,6 +2364,7 @@ namespace OpenSim.Region.Framework.Scenes { const float VELOCITY_TOLERANCE = 0.01f; const float POSITION_TOLERANCE = 10.0f; + const int TIME_MS_TOLERANCE = 3000; SendPrimUpdates(); @@ -2377,7 +2379,8 @@ namespace OpenSim.Region.Framework.Scenes // Throw away duplicate or insignificant updates if (m_bodyRot != m_lastRotation || (m_velocity - m_lastVelocity).Length() > VELOCITY_TOLERANCE || - (m_pos - m_lastPosition).Length() > POSITION_TOLERANCE) + (m_pos - m_lastPosition).Length() > POSITION_TOLERANCE || + Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE) { SendTerseUpdateToAllClients(); @@ -2385,6 +2388,7 @@ namespace OpenSim.Region.Framework.Scenes m_lastPosition = m_pos; m_lastRotation = m_bodyRot; m_lastVelocity = m_velocity; + m_lastTerseSent = Environment.TickCount; } // followed suggestion from mic bowman. reversed the two lines below. -- cgit v1.1