From 04d406a7c8f2fce7365bc215410e63608d2affc3 Mon Sep 17 00:00:00 2001 From: "Huaiyu (Kitty) Liu" Date: Tue, 3 May 2011 14:48:14 -0700 Subject: [PATCH] Added code to sync each SOP's LocalFlags property. Also, in DeselectPrim, feed the list of updated properties as FullUpdate, instead of only the IsSelected property, since SOP's Name, Description and some other properties might just have been edited by a user. --- .../SymmetricSync/RegionSyncModule.cs | 22 +++++++++++++++++++ .../Framework/Scenes/Scene.PacketHandlers.cs | 2 +- .../Framework/Scenes/SceneObjectPart.cs | 9 +++++--- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SymmetricSync/RegionSyncModule.cs b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SymmetricSync/RegionSyncModule.cs index 597a0db26e..a504bc6e91 100644 --- a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SymmetricSync/RegionSyncModule.cs +++ b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SymmetricSync/RegionSyncModule.cs @@ -4299,6 +4299,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule propertyData["Value"] = OSD.FromInteger((int)((scriptEvents)LastUpdateValue)); break; case SceneObjectPartSyncProperties.Flags: + case SceneObjectPartSyncProperties.LocalFlags: propertyData["Value"] = OSD.FromInteger((int)((PrimFlags)LastUpdateValue)); break; //////////////////////////// @@ -4523,6 +4524,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule //propertyData["Value"] = OSD.FromInteger((int)((scriptEvents)LastUpdateValue)); break; case SceneObjectPartSyncProperties.Flags: + case SceneObjectPartSyncProperties.LocalFlags: PrimFlags flags = (PrimFlags)(propertyData["Value"].AsInteger()); m_lastUpdateValue = (Object)flags; //propertyData["Value"] = OSD.FromInteger((int)((PrimFlags)LastUpdateValue)); @@ -5740,6 +5742,21 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule } } break; + case SceneObjectPartSyncProperties.LocalFlags: + if (!part.LocalFlags.Equals(m_propertiesSyncInfo[property].LastUpdateValue)) + { + if (lastUpdateByLocalTS > m_propertiesSyncInfo[property].LastUpdateTimeStamp) + { + m_propertiesSyncInfo[property].UpdateSyncInfoByLocal(lastUpdateByLocalTS, syncID, (Object)part.LocalFlags); + propertyUpdatedByLocal = true; + } + else if (lastUpdateByLocalTS < m_propertiesSyncInfo[property].LastUpdateTimeStamp) + { + //overwrite SOP's data + part.LocalFlags = (PrimFlags)m_propertiesSyncInfo[property].LastUpdateValue; + } + } + break; case SceneObjectPartSyncProperties.Material: if (!part.Material.Equals(m_propertiesSyncInfo[property].LastUpdateValue)) { @@ -6461,6 +6478,8 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule return (Object)part.LastOwnerID; case SceneObjectPartSyncProperties.LinkNum: return (Object)part.LinkNum; + case SceneObjectPartSyncProperties.LocalFlags: + return (Object)part.LocalFlags; case SceneObjectPartSyncProperties.Material: return (Object)part.Material; case SceneObjectPartSyncProperties.MediaUrl: @@ -6720,6 +6739,9 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule case SceneObjectPartSyncProperties.LinkNum: part.LinkNum = (int)pSyncInfo.LastUpdateValue; break; + case SceneObjectPartSyncProperties.LocalFlags: + part.LocalFlags = (PrimFlags)pSyncInfo.LastUpdateValue; + break; case SceneObjectPartSyncProperties.Material: part.Material = (byte)pSyncInfo.LastUpdateValue; break; diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 60eae3306e..f1de066c90 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs @@ -213,7 +213,7 @@ namespace OpenSim.Region.Framework.Scenes isAttachment = true; else //part.ParentGroup.ScheduleGroupForFullUpdate(); - part.ParentGroup.ScheduleGroupForFullUpdate(new List(){SceneObjectPartSyncProperties.IsSelected}); + part.ParentGroup.ScheduleGroupForFullUpdate(new List(){SceneObjectPartSyncProperties.FullUpdate}); // If it's not an attachment, and we are allowed to move it, // then we might have done so. If we moved across a parcel diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 1270533138..753712013c 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -4795,7 +4795,8 @@ namespace OpenSim.Region.Framework.Scenes // m_log.DebugFormat( // "[SCENE OBJECT PART]: Scheduling part {0} {1} for full update in aggregateScriptEvents()", Name, LocalId); //ScheduleFullUpdate(); - ScheduleFullUpdate(new List() { SceneObjectPartSyncProperties.Flags, SceneObjectPartSyncProperties.AggregateScriptEvents}); + ScheduleFullUpdate(new List() { SceneObjectPartSyncProperties.Flags, SceneObjectPartSyncProperties.LocalFlags, + SceneObjectPartSyncProperties.AggregateScriptEvents}); } } @@ -5218,7 +5219,8 @@ namespace OpenSim.Region.Framework.Scenes MediaUrl, TextureAnimation, ParticleSystem, - //Property names below copied from PhysicsActor, they are necessary in synchronization, but not covered the above properties + //Property names below copied from PhysicsActor, they are necessary in + //synchronization, but not covered by xml serialization //Physics properties "Velocity" is covered above Position, Size, @@ -5236,10 +5238,11 @@ namespace OpenSim.Region.Framework.Scenes //Properties need to be synced, but not in xml serializations AggregateScriptEvents, - IsAttachment, AttachedAvatar, AttachedPos, AttachmentPoint, + IsAttachment, + LocalFlags, //TODO!!!! To be handled in serialization/deserizaltion for synchronization Sound, //This indicates any Sound related property has changed: Sound, SoundGain, SoundFlags,SoundRadius, //Addition properties to be added here