From 39736e52d87d9e04092262c1a41e3c434f087e36 Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Tue, 13 Dec 2011 21:37:17 -0800 Subject: Reorder clearing of upate schedule on SOP to before sending updates. Fix potential race condition. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index c8b39a4..f5a00d7 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -259,8 +259,6 @@ namespace OpenSim.Region.Framework.Scenes private bool m_passTouches; - private UpdateRequired m_updateFlag; - private PhysicsActor m_physActor; protected Vector3 m_acceleration; protected Vector3 m_angularVelocity; @@ -1004,11 +1002,7 @@ namespace OpenSim.Region.Framework.Scenes } } - public UpdateRequired UpdateFlag - { - get { return m_updateFlag; } - set { m_updateFlag = value; } - } + public UpdateRequired UpdateFlag { get; set; } /// /// Used for media on a prim. @@ -2949,6 +2943,7 @@ namespace OpenSim.Region.Framework.Scenes { case UpdateRequired.TERSE: { + ClearUpdateSchedule(); // Throw away duplicate or insignificant updates if (!RotationOffset.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) || !Acceleration.Equals(m_lastAcceleration) || @@ -2958,9 +2953,7 @@ namespace OpenSim.Region.Framework.Scenes !OffsetPosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) || Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE) { - SendTerseUpdateToAllClients(); - ClearUpdateSchedule(); // Update the "last" values m_lastPosition = OffsetPosition; @@ -2974,12 +2967,11 @@ namespace OpenSim.Region.Framework.Scenes } case UpdateRequired.FULL: { + ClearUpdateSchedule(); SendFullUpdateToAllClients(); break; } } - - ClearUpdateSchedule(); } /// -- cgit v1.1 From f43e5f92fd207fd6b24d5635eadce84acd66de1e Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Tue, 13 Dec 2011 23:34:59 -0800 Subject: Just adding a comment to SendFullUpdatToClient --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 9587d5f..f9e0b83 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -1373,6 +1373,8 @@ namespace OpenSim.Region.Framework.Scenes #endregion + // Send the parts of this SOG to a single client + // Used when the client initially connects and when client sends RequestPrim packet public void SendFullUpdateToClient(IClientAPI remoteClient) { RootPart.SendFullUpdate( -- cgit v1.1