From c979fdd3cb4b9488fec5ae0faf534d504d2a16f1 Mon Sep 17 00:00:00 2001 From: "Huaiyu (Kitty) Liu" Date: Wed, 11 May 2011 11:27:51 -0700 Subject: [PATCH] Added checking if PhysActor is null or not in passing list of updated properties, especially for code (e.g. ScheduleGroupForTerseUpdate) that pass SceneObjectPartSyncProperties.Orientation as an updated property. --- .../SymmetricSync/RegionSyncModule.cs | 56 +++++++------------ .../Framework/Scenes/SceneObjectGroup.cs | 23 +++++++- 2 files changed, 41 insertions(+), 38 deletions(-) diff --git a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SymmetricSync/RegionSyncModule.cs b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SymmetricSync/RegionSyncModule.cs index 841562c89d..1e1613970f 100644 --- a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SymmetricSync/RegionSyncModule.cs +++ b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SymmetricSync/RegionSyncModule.cs @@ -3581,41 +3581,25 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule if (part.ParentGroup == null || part.ParentGroup.IsDeleted) return; + //Do some sanity checking of the properties + List checkedUpdatedProperties = new List(); + foreach (SceneObjectPartSyncProperties property in updatedProperties) + { + if (PrimSyncInfo.PrimPhysActorProperties.Contains(property) && part.PhysActor == null) + { + m_log.WarnFormat("ProcessAndEnqueuePrimUpdatesByLocal: informed that property {0} changed in {1},{2}, which does not have PhysActor yet. Wrong property passed in!!!", + property, part.Name, part.UUID); + } + else + { + checkedUpdatedProperties.Add(property); + } + } + //Sync values with SOP's data and update timestamp according, to //obtain the list of properties that really have been updated //and should be propogated to other sync nodes. - HashSet propertiesWithSyncInfoUpdated = m_primSyncInfoManager.UpdatePrimSyncInfoByLocal(part, updatedProperties); - - /* //Below is done at SOG level, not here (TO DOUBLE CHECK) - //For group properties, we only need to send it once per SOG, - //hence only enqueue it with root part - foreach (SceneObjectPartSyncProperties groupProperty in SceneObjectPart.GetGroupProperties()) - { - if (propertiesWithSyncInfoUpdated.Contains(groupProperty)) - { - SceneObjectPart rootpart = part.ParentGroup.RootPart; - if (m_primPropertyUpdates.ContainsKey(rootpart.UUID)) - { - m_primPropertyUpdates[rootpart.UUID].Add(groupProperty); - } - else - { - m_primPropertyUpdates.Add(rootpart.UUID, new HashSet() { groupProperty }); - } - } - propertiesWithSyncInfoUpdated.Remove(groupProperty); - } - * */ - - /* - if(updatedProperties.Contains(SceneObjectPartSyncProperties.Shape)) - { - string hashedShape = Util.Md5Hash((PropertySerializer.SerializeShape(part))); - m_log.DebugFormat("ProcessAndEnqueuePrimUpdatesByLocal: Shape of SOP {0}, {1} updated, ProfileShape {2}, hashed value in SOP: {3}, in PrimSyncInfoManager: {4}", - part.Name, part.UUID, part.Shape.ProfileShape, hashedShape, m_primSyncInfoManager.GetPrimSyncInfo(part.UUID).PropertiesSyncInfo[SceneObjectPartSyncProperties.Shape].LastUpdateValueHash); - } - * */ - + HashSet propertiesWithSyncInfoUpdated = m_primSyncInfoManager.UpdatePrimSyncInfoByLocal(part, checkedUpdatedProperties); //Enqueue the prim with the set of updated properties, excluding the group properties if (propertiesWithSyncInfoUpdated.Count > 0) @@ -4927,10 +4911,10 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule } private Object m_primSyncInfoLock = new Object(); - private static HashSet FullSetPrimProperties = SceneObjectPart.GetAllPrimProperties(); - private static HashSet PrimPhysActorProperties = SceneObjectPart.GetAllPhysActorProperties(); - private static HashSet PrimNonPhysActorProperties = SceneObjectPart.GetAllPrimNonPhysActorProperties(); - private static HashSet GroupProperties = SceneObjectPart.GetGroupProperties(); + public static HashSet FullSetPrimProperties = SceneObjectPart.GetAllPrimProperties(); + public static HashSet PrimPhysActorProperties = SceneObjectPart.GetAllPhysActorProperties(); + public static HashSet PrimNonPhysActorProperties = SceneObjectPart.GetAllPrimNonPhysActorProperties(); + public static HashSet GroupProperties = SceneObjectPart.GetGroupProperties(); private PrimSyncInfoManager m_syncInfoManager; diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 5e398af2d8..75e61cf7b5 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -3048,7 +3048,17 @@ namespace OpenSim.Region.Framework.Scenes HasGroupChanged = true; //ScheduleGroupForTerseUpdate(); - ScheduleGroupForTerseUpdate(new List(){SceneObjectPartSyncProperties.Orientation}); //Above actions only update m_rootPart's RotationOffset, and m_rootPart.UpdateRotation will taint RotationOffset as updated + //DSG SYNC + //Above actions only update m_rootPart's RotationOffset, and m_rootPart.UpdateRotation will taint RotationOffset as updated + if (actor != null) + { + ScheduleGroupForTerseUpdate(new List() {SceneObjectPartSyncProperties.RotationOffset, SceneObjectPartSyncProperties.Orientation }); + } + else + { + ScheduleGroupForTerseUpdate(new List() { SceneObjectPartSyncProperties.RotationOffset }); + } + //end DSG SYNC } /// @@ -3074,8 +3084,17 @@ namespace OpenSim.Region.Framework.Scenes AbsolutePosition = pos; HasGroupChanged = true; + //DSG SYNC //ScheduleGroupForTerseUpdate(); - ScheduleGroupForTerseUpdate(new List(){SceneObjectPartSyncProperties.Position, SceneObjectPartSyncProperties.Orientation}); //RotationOffset is only updated for m_rootPart, and m_rootPart.UpdateRotation should already taint RotationOffset as updated + if (actor != null) + { + //RotationOffset is only updated for m_rootPart, and m_rootPart.UpdateRotation should already taint RotationOffset as updated + ScheduleGroupForTerseUpdate(new List() { SceneObjectPartSyncProperties.Position, SceneObjectPartSyncProperties.Orientation }); + } + else + { + ScheduleGroupForTerseUpdate(new List() { SceneObjectPartSyncProperties.Position }); + } } ///