From 85085977accff41aaa631e9c96c79524fa9682ed Mon Sep 17 00:00:00 2001 From: "Huaiyu (Kitty) Liu" Date: Tue, 19 Apr 2011 09:52:55 -0700 Subject: [PATCH] Fixed a bug in ScheduleTerseUpdate, and added a few debug lines. --- .../SymmetricSync/RegionSyncModule.cs | 34 +++++++++++++++++++ .../Framework/Scenes/SceneObjectPart.cs | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SymmetricSync/RegionSyncModule.cs b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SymmetricSync/RegionSyncModule.cs index 1985b1a4f1..12bdfc9733 100644 --- a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SymmetricSync/RegionSyncModule.cs +++ b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SymmetricSync/RegionSyncModule.cs @@ -2291,12 +2291,27 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule if (propertiesSyncInfo.Count>0) { + //SYNC DEBUG + string pString = ""; + foreach (PropertySyncInfo p in propertiesSyncInfo) + { + pString += p.Property.ToString() + " "; + } + m_log.DebugFormat("{0}: HandleUpdatedPrimProperties, for prim {1},{2} with updated properties -- {3}", LogHeader, sop.Name, sop.UUID, pString); + List propertiesUpdated = m_primSyncInfoManager.UpdatePrimSyncInfoBySync(sop, propertiesSyncInfo); + //SYNC DEBUG + if (propertiesUpdated.Contains(SceneObjectPartSyncProperties.Shape)) + { + m_log.DebugFormat("Shape updated: " + PropertySerializer.SerializeShape(sop)); + } + if (propertiesUpdated.Count > 0) { //Enqueue the updated SOP and its properties for sync ProcessAndEnqueuePrimUpdatesBySync(sop, propertiesUpdated); + //Calling SOP.ScheduleFullUpdate(), so that viewers, if any, //will receive updates as well. sop.ScheduleFullUpdate(null); @@ -3350,10 +3365,29 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule private void SendPrimPropertyUpdates(UUID primUUID, HashSet updatedProperties) { + SceneObjectPart sop = m_scene.GetSceneObjectPart(primUUID); + + if (sop == null || sop.ParentGroup.IsDeleted) + return; + OSDMap syncData = m_primSyncInfoManager.EncodePrimProperties(primUUID, updatedProperties); if (syncData.Count > 0) { + //SYNC DEBUG + string pString = ""; + foreach (SceneObjectPartSyncProperties property in updatedProperties) + { + pString += property.ToString() + " "; + } + m_log.DebugFormat("{0}: SendPrimPropertyUpdates for {1}, {2}, with updated properties -- {3}", LogHeader, sop.Name, sop.UUID, pString); + + //SYNC DEBUG + if (updatedProperties.Contains(SceneObjectPartSyncProperties.Shape)) + { + m_log.DebugFormat("Shape updated: " + PropertySerializer.SerializeShape(sop)); + } + SymmetricSyncMessage syncMsg = new SymmetricSyncMessage(SymmetricSyncMessage.MsgType.UpdatedPrimProperties, OSDParser.SerializeJsonString(syncData)); SendPrimUpdateToRelevantSyncConnectors(primUUID, syncMsg); } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index fca3f63d68..145ee80f89 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -6083,7 +6083,7 @@ namespace OpenSim.Region.Framework.Scenes { if (updatedProperties != null && updatedProperties.Count > 0) { - if (m_parentGroup != null && m_parentGroup.Scene.RegionSyncModule != null) + if (m_parentGroup != null && m_parentGroup.Scene != null && m_parentGroup.Scene.RegionSyncModule != null) { m_parentGroup.Scene.RegionSyncModule.ProcessAndEnqueuePrimUpdatesByLocal(this, updatedProperties); }