From 1ab4df995401f380ed695ec3ba77f669545e6b69 Mon Sep 17 00:00:00 2001 From: "Huaiyu (Kitty) Liu" Date: Fri, 11 Mar 2011 11:50:46 -0800 Subject: [PATCH] In RegionSyncModule.PrimUpdatesPhysicsBucketSender, if no PhysicsActor for the SOP, still sending out "GroupPosition" and a few other properties in physics bucket. Sync'ing of phantom objects now seems working fine. --- .../SymmetricSync/RegionSyncModule.cs | 47 ++++++++++--------- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 9 ++-- .../Framework/Scenes/SceneObjectGroup.cs | 2 +- .../Framework/Scenes/SceneObjectPart.cs | 11 +++-- 4 files changed, 38 insertions(+), 31 deletions(-) diff --git a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SymmetricSync/RegionSyncModule.cs b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SymmetricSync/RegionSyncModule.cs index db453df85c..e7667cf875 100644 --- a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SymmetricSync/RegionSyncModule.cs +++ b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SymmetricSync/RegionSyncModule.cs @@ -202,6 +202,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule { lock (m_primUpdateLocks[bucketName]) { + m_log.Debug("Queueing to bucket " + bucketName + " with part " + part.Name + ", " + part.UUID); m_primUpdates[bucketName][part.UUID] = part; } } @@ -245,6 +246,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule { if (m_primUpdates[bucketName].Count > 0) { + m_log.Debug(m_primUpdates[bucketName].Count + " updated parts in bucket " + bucketName); lock (m_primUpdateLocks[bucketName]) { updated = true; @@ -299,6 +301,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule } } * */ + m_log.Debug(LogHeader + " calling update sender for bucket " + bucketName); m_primUpdatesPerBucketSender[bucketName](bucketName, primUpdates[bucketName]); } } @@ -734,14 +737,10 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule { updatedPart.UpdateTaintedBucketSyncInfo(bucketName, DateTime.Now.Ticks); - Physics.Manager.PhysicsActor pa = updatedPart.PhysActor; - if (pa == null) - return; - OSDMap data = new OSDMap(); - // data["UUID"] = OSD.FromUUID(updatedPart.UUID); - data["UUID"] = OSD.FromUUID(pa.UUID); + data["UUID"] = OSD.FromUUID(updatedPart.UUID); + //data["UUID"] = OSD.FromUUID(pa.UUID); data["Bucket"] = OSD.FromString(bucketName); data["GroupPosition"] = OSD.FromVector3(updatedPart.GroupPosition); @@ -749,25 +748,31 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule data["Scale"] = OSD.FromVector3(updatedPart.Scale); data["AngularVelocity"] = OSD.FromVector3(updatedPart.AngularVelocity); data["RotationOffset"] = OSD.FromQuaternion(updatedPart.RotationOffset); - data["Size"] = OSD.FromVector3(pa.Size); - data["Position"] = OSD.FromVector3(pa.Position); - data["Force"] = OSD.FromVector3(pa.Force); - data["Velocity"] = OSD.FromVector3(pa.Velocity); - data["RotationalVelocity"] = OSD.FromVector3(pa.RotationalVelocity); - data["PA_Acceleration"] = OSD.FromVector3(pa.Acceleration); - data["Torque"] = OSD.FromVector3(pa.Torque); - data["Orientation"] = OSD.FromQuaternion(pa.Orientation); - data["IsPhysical"] = OSD.FromBoolean(pa.IsPhysical); - data["Flying"] = OSD.FromBoolean(pa.Flying); - data["Kinematic"] = OSD.FromBoolean(pa.Kinematic); - data["Buoyancy"] = OSD.FromReal(pa.Buoyancy); - data["CollidingGround"] = OSD.FromBoolean(pa.CollidingGround); - data["IsColliding"] = OSD.FromBoolean(pa.IsColliding); + + Physics.Manager.PhysicsActor pa = updatedPart.PhysActor; + if (pa != null) + { + + data["Size"] = OSD.FromVector3(pa.Size); + data["Position"] = OSD.FromVector3(pa.Position); + data["Force"] = OSD.FromVector3(pa.Force); + data["Velocity"] = OSD.FromVector3(pa.Velocity); + data["RotationalVelocity"] = OSD.FromVector3(pa.RotationalVelocity); + data["PA_Acceleration"] = OSD.FromVector3(pa.Acceleration); + data["Torque"] = OSD.FromVector3(pa.Torque); + data["Orientation"] = OSD.FromQuaternion(pa.Orientation); + data["IsPhysical"] = OSD.FromBoolean(pa.IsPhysical); + data["Flying"] = OSD.FromBoolean(pa.Flying); + data["Kinematic"] = OSD.FromBoolean(pa.Kinematic); + data["Buoyancy"] = OSD.FromReal(pa.Buoyancy); + data["CollidingGround"] = OSD.FromBoolean(pa.CollidingGround); + data["IsColliding"] = OSD.FromBoolean(pa.IsColliding); + } data["LastUpdateTimeStamp"] = OSD.FromLong(updatedPart.BucketSyncInfoList[bucketName].LastUpdateTimeStamp); data["LastUpdateActorID"] = OSD.FromString(updatedPart.BucketSyncInfoList[bucketName].LastUpdateActorID); - m_log.Debug(LogHeader + " Send out Physics Bucket updates for " + updatedPart.Name + ". GroupPosition: " + updatedPart.GroupPosition.ToString() + ", Position = " + pa.Position); + m_log.Debug(LogHeader + " Send out Physics Bucket updates for " + updatedPart.Name + ". GroupPosition: " + updatedPart.GroupPosition.ToString()); SymmetricSyncMessage syncMsg = new SymmetricSyncMessage(SymmetricSyncMessage.MsgType.UpdatedBucketProperties, OSDParser.SerializeJsonString(data)); //m_log.DebugFormat("{0}: PhysBucketSender for {1}, pos={2}", LogHeader, updatedPart.UUID.ToString(), pa.Position.ToString()); diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index e523e10f98..f915ea368e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -468,7 +468,7 @@ namespace OpenSim.Region.Framework.Scenes lock (m_updateList) { m_updateList[obj.UUID] = obj; - //m_log.Debug("added " + obj.UUID + " to m_updateList"); + m_log.Debug("added " + obj.Name+","+ obj.UUID + " to m_updateList"); } } @@ -489,12 +489,12 @@ namespace OpenSim.Region.Framework.Scenes { updates = new List(m_updateList.Values); - /* + if (updates.Count > 0) { - m_log.Debug("SceneGraph: " + updates.Count + " objects to send updates for"); + m_log.Debug("SceneGraph.UpdateObjectGroups: " + updates.Count + " objects to send updates for"); } - * */ + m_updateList.Clear(); @@ -508,6 +508,7 @@ namespace OpenSim.Region.Framework.Scenes // Don't abort the whole update if one entity happens to give us an exception. try { + m_log.Debug("SceneGraph: calling update for obj " + sog.Name + "," + sog.UUID); sog.Update(); } catch (Exception e) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 9f9f193360..68372cd129 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -1950,7 +1950,7 @@ namespace OpenSim.Region.Framework.Scenes //public void ScheduleGroupForTerseUpdate() public void ScheduleGroupForTerseUpdate(List updatedProperties) { -// m_log.DebugFormat("[SOG]: Scheduling terse update for {0} {1}", Name, UUID); + m_log.DebugFormat("[SOG]: Scheduling terse update for {0} {1}", Name, UUID); SceneObjectPart[] parts = m_parts.GetArray(); for (int i = 0; i < parts.Length; i++) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 3749ddc5b1..a053a46f01 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -2980,9 +2980,9 @@ namespace OpenSim.Region.Framework.Scenes TimeStampTerse = (uint) Util.UnixTimeSinceEpoch(); m_updateFlag = 1; - // m_log.DebugFormat( - // "[SCENE OBJECT PART]: Scheduling terse update for {0}, {1} at {2}", - // UUID, Name, TimeStampTerse); + m_log.DebugFormat( + "[SCENE OBJECT PART]: Scheduling terse update for {0}, {1} at {2}", + UUID, Name, TimeStampTerse); } } @@ -3204,6 +3204,7 @@ namespace OpenSim.Region.Framework.Scenes //SYMMETRIC SYNC if (m_parentGroup.Scene.RegionSyncModule != null) { + m_log.Debug("SOP.SendScheduledUpdates: Calling RegionSyncModule.QueueSceneObjectPartForUpdate"); m_parentGroup.Scene.RegionSyncModule.QueueSceneObjectPartForUpdate((SceneObjectPart)this); } //end of SYMMETRIC SYNC @@ -5854,8 +5855,8 @@ namespace OpenSim.Region.Framework.Scenes { if (updatedProperties != null && updatedProperties.Count > 0) { - //m_log.DebugFormat("{0}: Tainting bucket for properties {1}", - // "[SCENE OBJECT PART]", updatedProperties.ToString()); + m_log.DebugFormat("{0}: Tainting bucket for properties {1}", + "[SCENE OBJECT PART]", updatedProperties.ToString()); foreach (SceneObjectPartProperties property in updatedProperties) { TaintBucketSyncInfo(property);