From 8a3958ad048535ad4f8a752cbd71d9114e53a42b Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 5 Oct 2016 13:17:23 +0100 Subject: dont let ignored AgentUpdates change their throttles. Apply respective movement to physics on the handling thread, not heartbeat, avoiding missing transitions that should get into physics. Make some usefull sp state flags visible everywhere --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 49 ++++++++++++++++-------- 1 file changed, 33 insertions(+), 16 deletions(-) (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 bb6e89b..6f4d6c3 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -281,7 +281,9 @@ namespace OpenSim.Region.Framework.Scenes private bool m_followCamAuto = false; - private Vector3? m_forceToApply; +// private object m_forceToApplyLock = new object(); +// private bool m_forceToApplyValid; +// private Vector3 m_forceToApply; private int m_userFlags; public int UserFlags { @@ -582,11 +584,11 @@ namespace OpenSim.Region.Framework.Scenes { get { - return m_drawDistance; + return m_drawDistance; } set { - m_drawDistance = Util.Clamp(value, 32f, m_scene.MaxDrawDistance); + m_drawDistance = Util.Clamp(value, 32f, m_scene.MaxDrawDistance); } } @@ -594,7 +596,7 @@ namespace OpenSim.Region.Framework.Scenes { get { - return Util.Clamp(m_drawDistance, 32f, m_scene.MaxRegionViewDistance); + return Util.Clamp(m_drawDistance, 32f, m_scene.MaxRegionViewDistance); } } @@ -2120,6 +2122,7 @@ namespace OpenSim.Region.Framework.Scenes if (haveAnims) SendAnimPackToAgent(this, animIDs, animseqs, animsobjs); + // we should be able to receive updates, etc // so release them m_inTransit = false; @@ -2238,6 +2241,9 @@ namespace OpenSim.Region.Framework.Scenes } finally { + haveGroupInformation = false; + gotCrossUpdate = false; + crossingFlags = 0; m_inTransit = false; } // if hide force a check @@ -2247,9 +2253,6 @@ namespace OpenSim.Region.Framework.Scenes // m_currentParcelHide = newhide; // } - haveGroupInformation = false; - gotCrossUpdate = false; - crossingFlags = 0; m_scene.EventManager.OnRegionHeartbeatEnd += RegionHeartbeatEnd; @@ -3006,7 +3009,8 @@ namespace OpenSim.Region.Framework.Scenes MovingToTarget = false; // MoveToPositionTarget = Vector3.Zero; - m_forceToApply = null; // cancel possible last action +// lock(m_forceToApplyLock) +// m_forceToApplyValid = false; // cancel possible last action // We need to reset the control flag as the ScenePresenceAnimator uses this to determine the correct // resting animation (e.g. hover or stand). NPCs don't have a client that will quickly reset this flag. @@ -3638,8 +3642,14 @@ namespace OpenSim.Region.Framework.Scenes } // m_log.DebugFormat("[SCENE PRESENCE]: Setting force to apply to {0} for {1}", direc, Name); - - m_forceToApply = direc; +/* + lock(m_forceToApplyLock) + { + m_forceToApply = direc; + m_forceToApplyValid = true; + } +*/ + Velocity = direc; Animator.UpdateMovementAnimations(); } @@ -4734,17 +4744,21 @@ namespace OpenSim.Region.Framework.Scenes /// public void UpdateMovement() { +/* if (IsInTransit) return; - if (m_forceToApply.HasValue) - { - Vector3 force = m_forceToApply.Value; - Velocity = force; + lock(m_forceToApplyLock) + { + if (m_forceToApplyValid) + { + Velocity = m_forceToApply; - m_forceToApply = null; - TriggerScenePresenceUpdated(); + m_forceToApplyValid = false; + TriggerScenePresenceUpdated(); + } } +*/ } /// @@ -4767,6 +4781,9 @@ namespace OpenSim.Region.Framework.Scenes // Appearance.SetHeight(); Appearance.SetSize(new Vector3(0.45f,0.6f,1.9f)); +// lock(m_forceToApplyLock) +// m_forceToApplyValid = false; + PhysicsScene scene = m_scene.PhysicsScene; Vector3 pVec = AbsolutePosition; -- cgit v1.1