From 29053b19d884f5e603aae9bf110b3c4e7aa8018c Mon Sep 17 00:00:00 2001 From: "Huaiyu (Kitty) Liu" Date: Tue, 8 Feb 2011 10:08:09 -0800 Subject: [PATCH 1/3] Added set functions for the last a few properties. For some property assignments in SOP, changed from "m_xxx=" to "Xxx=" to trigger UpdateBucketSyncInfo() as desired. --- .../Framework/Scenes/SceneObjectPart.cs | 118 +++++++++++++----- 1 file changed, 90 insertions(+), 28 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index ccfded4752..d8fc82b281 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -831,14 +831,34 @@ namespace OpenSim.Region.Framework.Scenes public Byte[] TextureAnimation { get { return m_TextureAnimation; } - set { m_TextureAnimation = value; } + set + { + SetTextureAnimation(value); + UpdateBucketSyncInfo("TextureAnimation"); + //m_TextureAnimation = value; + } + } + //SYMMETRIC SYNC + public void SetTextureAnimation(Byte[] value) + { + m_TextureAnimation = value; } public Byte[] ParticleSystem { get { return m_particleSystem; } - set { m_particleSystem = value; } + set + { + SetParticleSystem(value); + UpdateBucketSyncInfo("ParticleSystem"); + //m_particleSystem = value; + } + } + //SYMMETRIC SYNC + public void SetParticleSystem(Byte[] value) + { + m_particleSystem = value; } @@ -1461,12 +1481,24 @@ namespace OpenSim.Region.Framework.Scenes set { + SetMediaUrl(value); + UpdateBucketSyncInfo("MediaUrl"); + /* m_mediaUrl = value; if (ParentGroup != null) ParentGroup.HasGroupChanged = true; + * */ } } + //SYMMETRIC SYNC + public void SetMediaUrl(string value) + { + m_mediaUrl = value; + + if (ParentGroup != null) + ParentGroup.HasGroupChanged = true; + } public bool CreateSelected @@ -1868,15 +1900,35 @@ namespace OpenSim.Region.Framework.Scenes get { return m_collisionSound; } set { - m_collisionSound = value; + SetCollisionSound(value); + UpdateBucketSyncInfo("CollisionSound"); + //m_collisionSound = value; aggregateScriptEvents(); } } + //SYMMETRIC SYNC + //CollisionSound is a special case. We won't call aggregateScriptEvents inside SetCollisionSound, + //so that when RegionSynModule triggers SOP.UpdateAllProperties, it calls SetCollisionSound + public void SetCollisionSound(UUID value) + { + m_collisionSound = value; + } + public float CollisionSoundVolume { get { return m_collisionSoundVolume; } - set { m_collisionSoundVolume = value; } + set + { + SetCollisionSoundVolume(value); + UpdateBucketSyncInfo("CollisionSoundVolume"); + //m_collisionSoundVolume = value; + } + } + //SYMMETRIC SYNC + public void SetCollisionSoundVolume(float value) + { + m_collisionSoundVolume = value; } #endregion Public Properties with only Get @@ -1986,12 +2038,16 @@ namespace OpenSim.Region.Framework.Scenes public void AddNewParticleSystem(Primitive.ParticleSystem pSystem) { - m_particleSystem = pSystem.GetBytes(); + //SYMMETRIC SYNC + //m_particleSystem = pSystem.GetBytes(); + ParticleSystem = pSystem.GetBytes(); } public void RemoveParticleSystem() { - m_particleSystem = new byte[0]; + //SYMMETRIC SYNC + //m_particleSystem = new byte[0]; + ParticleSystem = new byte[0]; } /// Terse updates @@ -2028,7 +2084,9 @@ namespace OpenSim.Region.Framework.Scenes Utils.FloatToBytes(pTexAnim.Length).CopyTo(data, pos + 4); Utils.FloatToBytes(pTexAnim.Rate).CopyTo(data, pos + 8); - m_TextureAnimation = data; + //m_TextureAnimation = data; + //SYMMETRIC SYNC + TextureAnimation = data; } public void AdjustSoundGain(double volume) @@ -3564,12 +3622,12 @@ namespace OpenSim.Region.Framework.Scenes // Tricks physics engine into thinking we've changed the part shape. PrimitiveBaseShape m_newshape = m_shape.Copy(); PhysActor.Shape = m_newshape; - m_shape = m_newshape; - - m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); //SYMMETRIC SYNC - UpdateBucketSyncInfo("Shape"); + //m_shape = m_newshape; + Shape = m_newshape; + + m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); } } } @@ -4850,32 +4908,36 @@ namespace OpenSim.Region.Framework.Scenes case 1: if (god) { - _baseMask = ApplyMask(_baseMask, set, mask); - Inventory.ApplyGodPermissions(_baseMask); //SYMMETRIC SYNC - UpdateBucketSyncInfo("BaseMask"); + //_baseMask = ApplyMask(_baseMask, set, mask); + BaseMask = ApplyMask(_baseMask, set, mask); + Inventory.ApplyGodPermissions(_baseMask); + } break; case 2: - _ownerMask = ApplyMask(_ownerMask, set, mask) & - baseMask; //SYMMETRIC SYNC - UpdateBucketSyncInfo("OwnerMask"); + //_ownerMask = ApplyMask(_ownerMask, set, mask) & + // baseMask; + OwnerMask = ApplyMask(_ownerMask, set, mask) & baseMask; break; case 4: - _groupMask = ApplyMask(_groupMask, set, mask) & - baseMask; //SYMMETRIC SYNC - UpdateBucketSyncInfo("GroupMask"); + //_groupMask = ApplyMask(_groupMask, set, mask) & + // baseMask; + GroupMask = ApplyMask(_groupMask, set, mask) & + baseMask; break; case 8: - _everyoneMask = ApplyMask(_everyoneMask, set, mask) & - baseMask; //SYMMETRIC SYNC - UpdateBucketSyncInfo("EveryoneMask"); + //_everyoneMask = ApplyMask(_everyoneMask, set, mask) & + // baseMask; + EveryoneMask = ApplyMask(_everyoneMask, set, mask) & + baseMask; break; case 16: + //SYMMETRIC SYNC _nextOwnerMask = ApplyMask(_nextOwnerMask, set, mask) & baseMask; // Prevent the client from creating no mod, no copy @@ -4883,10 +4945,9 @@ namespace OpenSim.Region.Framework.Scenes if ((_nextOwnerMask & (uint)PermissionMask.Copy) == 0) _nextOwnerMask |= (uint)PermissionMask.Transfer; - _nextOwnerMask |= (uint)PermissionMask.Move; - - //SYMMETRIC SYNC - UpdateBucketSyncInfo("NextOwnerMask"); + //_nextOwnerMask |= (uint)PermissionMask.Move; + NextOwnerMask = _nextOwnerMask | (uint)PermissionMask.Move; + break; } @@ -5801,7 +5862,8 @@ namespace OpenSim.Region.Framework.Scenes { if (this.CollisionSound != updatedCollisionSound) { - m_collisionSound = updatedCollisionSound; + //m_collisionSound = updatedCollisionSound; + SetCollisionSound(updatedCollisionSound); return true; } return false; From e8e9a0fb43be02315ab46373f054bd3f7ed6f57d Mon Sep 17 00:00:00 2001 From: "Huaiyu (Kitty) Liu" Date: Tue, 8 Feb 2011 15:33:54 -0800 Subject: [PATCH 2/3] Enabled all synchronized properties to be updated by calling through SetXXX() to set values. --- OpenSim/Region/Framework/Scenes/Scene.cs | 2 +- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 2 +- .../Framework/Scenes/SceneObjectGroup.cs | 150 ++++++++++++++++-- .../Framework/Scenes/SceneObjectPart.cs | 100 +++++++++--- 4 files changed, 222 insertions(+), 32 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 9341c577e0..282491b153 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -795,7 +795,7 @@ namespace OpenSim.Region.Framework.Scenes //Set the property values as in the incoming copy of the object group SceneObjectGroup localGroup = root.ParentGroup; - localGroup.UpdateObjectProperties(linkedGroup); + localGroup.UpdateObjectGroupBySync(linkedGroup); //debug /* diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index d698e9eb42..d75cad2931 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -2299,7 +2299,7 @@ namespace OpenSim.Region.Framework.Scenes } else { - localAfterGroup.UpdateObjectProperties(incomingAfterDelinkGroupsDictionary[localAfterGroup.UUID]); + localAfterGroup.UpdateObjectGroupBySync(incomingAfterDelinkGroupsDictionary[localAfterGroup.UUID]); } } } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 236a17f1d6..74ac1f2171 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -294,6 +294,11 @@ namespace OpenSim.Region.Framework.Scenes get { return m_rootPart.GroupPosition; } set { + SetAbsolutePosition(value); + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + parts[i].UpdateBucketSyncInfo("GroupPosition"); + /* Vector3 val = value; //REGION SYNC touched @@ -328,6 +333,39 @@ namespace OpenSim.Region.Framework.Scenes //m_rootPart.GroupPosition.Z); //m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); //} + * */ + } + } + public void SetAbsolutePosition(Vector3 value) + { + Vector3 val = value; + + //REGION SYNC touched + + //if ((m_scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || m_scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W) + // || m_scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || m_scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S)) + // && !IsAttachmentCheckFull()) + if (m_scene.IsBorderCrossing(LocX, LocY, val) && !IsAttachmentCheckFull() && (!m_scene.LoadingPrims)) + { + m_scene.CrossPrimGroupIntoNewRegion(val, this, true); + } + //end REGION SYNC touched + if (RootPart.GetStatusSandbox()) + { + if (Util.GetDistanceTo(RootPart.StatusSandboxPos, value) > 10) + { + RootPart.ScriptSetPhysicsStatus(false); + Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"), + ChatTypeEnum.DebugChannel, 0x7FFFFFFF, RootPart.AbsolutePosition, Name, UUID, false); + return; + } + } + + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + { + //parts[i].GroupPosition = val; + parts[i].SetGroupPosition(val); } } @@ -465,6 +503,20 @@ namespace OpenSim.Region.Framework.Scenes #region Constructors + //SYMMETRIC SYNC + public SceneObjectGroup(SceneObjectPart part, bool newGroupBySync) + { + if (!newGroupBySync) + { + SetRootPart(part); + } + else + { + SetRootPartBySync(part); + } + + } + /// /// Constructor /// @@ -3728,7 +3780,8 @@ namespace OpenSim.Region.Framework.Scenes if (part.LinkNum > linkPart.LinkNum) { //part.LinkNum--; - part.SetLinkNum(part.LinkNum--); + int linkNum = part.LinkNum - 1; + part.SetLinkNum(linkNum); } } } @@ -3761,7 +3814,9 @@ namespace OpenSim.Region.Framework.Scenes linkPart.SetOffsetPosition(new Vector3(0, 0, 0)); linkPart.SetRotationOffset(worldRot); - SceneObjectGroup objectGroup = new SceneObjectGroup(linkPart); + //SceneObjectGroup objectGroup = new SceneObjectGroup(linkPart); + bool newGroupBySync = true; + SceneObjectGroup objectGroup = new SceneObjectGroup(linkPart, newGroupBySync); m_scene.AddNewSceneObjectBySync(objectGroup, true); @@ -3777,7 +3832,23 @@ namespace OpenSim.Region.Framework.Scenes return objectGroup; } + /// + /// Set a part to act as the root part for this scene object, in which SetLinkNum() is called instead of "LinkNum=". + /// + /// + public void SetRootPartBySync(SceneObjectPart part) + { + if (part == null) + throw new ArgumentNullException("Cannot give SceneObjectGroup a null root SceneObjectPart"); + part.SetParent(this); + m_rootPart = part; + if (!IsAttachment) + part.ParentID = 0; + part.SetLinkNum(0); + + m_parts.Add(m_rootPart.UUID, m_rootPart); + } public void ScheduleGroupForFullUpdate_SyncInfoUnchanged() { @@ -3806,21 +3877,27 @@ namespace OpenSim.Region.Framework.Scenes Vector3 oldGroupPosition = linkPart.GroupPosition; Quaternion oldRootRotation = linkPart.RotationOffset; - linkPart.OffsetPosition = linkPart.GroupPosition - AbsolutePosition; - linkPart.GroupPosition = AbsolutePosition; + //linkPart.OffsetPosition = linkPart.GroupPosition - AbsolutePosition; + //linkPart.GroupPosition = AbsolutePosition; + linkPart.SetOffsetPosition(linkPart.GroupPosition - AbsolutePosition); + linkPart.SetGroupPosition(AbsolutePosition); Vector3 axPos = linkPart.OffsetPosition; Quaternion parentRot = m_rootPart.RotationOffset; axPos *= Quaternion.Inverse(parentRot); - linkPart.OffsetPosition = axPos; + //linkPart.OffsetPosition = axPos; + linkPart.SetOffsetPosition(axPos); Quaternion oldRot = linkPart.RotationOffset; Quaternion newRot = Quaternion.Inverse(parentRot) * oldRot; - linkPart.RotationOffset = newRot; + //linkPart.RotationOffset = newRot; + linkPart.SetRotationOffset(newRot); + //ParentID is only valid locally, so remote value is ignored and no syncinfo will be modified linkPart.ParentID = m_rootPart.LocalId; if (m_rootPart.LinkNum == 0) - m_rootPart.LinkNum = 1; + //m_rootPart.LinkNum = 1; + m_rootPart.SetLinkNum(1); lock (m_parts.SyncRoot) { @@ -3836,11 +3913,13 @@ namespace OpenSim.Region.Framework.Scenes if (part.LinkNum != 1) { // Don't update root prim link number - part.LinkNum += objectGroup.PrimCount; + //part.LinkNum += objectGroup.PrimCount; + part.SetLinkNum(objectGroup.PrimCount); } } - linkPart.LinkNum = 2; + //linkPart.LinkNum = 2; + linkPart.SetLinkNum(2); linkPart.SetParent(this); linkPart.CreateSelected = true; @@ -3859,7 +3938,7 @@ namespace OpenSim.Region.Framework.Scenes { SceneObjectPart part = ogParts[i]; if (part.UUID != objectGroup.m_rootPart.UUID) - LinkNonRootPart(part, oldGroupPosition, oldRootRotation, linkNum++); + LinkNonRootPartBySync(part, oldGroupPosition, oldRootRotation, linkNum++); part.ClearUndoState(); } } @@ -3877,10 +3956,59 @@ namespace OpenSim.Region.Framework.Scenes // Here's the deal, this is ABSOLUTELY CRITICAL so the physics scene gets the update about the // position of linkset prims. IF YOU CHANGE THIS, YOU MUST TEST colliding with just linked and // unmoved prims! - ResetChildPrimPhysicsPositions(); + //ResetChildPrimPhysicsPositions(); + //EntityBase sogBase = (EntityBase)this; + //sogBase.AbsolutePosition = AbsolutePosition; + SetAbsolutePosition(AbsolutePosition); } + private void LinkNonRootPartBySync(SceneObjectPart part, Vector3 oldGroupPosition, Quaternion oldGroupRotation, int linkNum) + { + Quaternion parentRot = oldGroupRotation; + Quaternion oldRot = part.RotationOffset; + Quaternion worldRot = parentRot * oldRot; + + parentRot = oldGroupRotation; + + Vector3 axPos = part.OffsetPosition; + + axPos *= parentRot; + //part.OffsetPosition = axPos; + //part.GroupPosition = oldGroupPosition + part.OffsetPosition; + //part.OffsetPosition = Vector3.Zero; + //part.RotationOffset = worldRot; + part.SetOffsetPosition(axPos); + part.SetGroupPosition(oldGroupPosition + part.OffsetPosition); + part.SetOffsetPosition(Vector3.Zero); + part.SetRotationOffset(worldRot); + + part.SetParent(this); + part.ParentID = m_rootPart.LocalId; + + m_parts.Add(part.UUID, part); + + //part.LinkNum = linkNum; + part.SetLinkNum(linkNum); + + //part.OffsetPosition = part.GroupPosition - AbsolutePosition; + part.SetOffsetPosition(part.GroupPosition - AbsolutePosition); + + Quaternion rootRotation = m_rootPart.RotationOffset; + + Vector3 pos = part.OffsetPosition; + pos *= Quaternion.Inverse(rootRotation); + //part.OffsetPosition = pos; + part.SetOffsetPosition(pos); + + parentRot = m_rootPart.RotationOffset; + oldRot = part.RotationOffset; + Quaternion newRot = Quaternion.Inverse(parentRot) * oldRot; + //part.RotationOffset = newRot; + part.SetRotationOffset(newRot); + } + + /* public void SyncInfoUpdate() { diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index d8fc82b281..4edfdf93c7 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -335,7 +335,24 @@ namespace OpenSim.Region.Framework.Scenes public bool IgnoreUndoUpdate = false; - public PrimFlags LocalFlags; + //SYMMETRIC SYNC + //public PrimFlags LocalFlags; + private PrimFlags m_localFlags; + public PrimFlags LocalFlags + { + get { return m_localFlags; } + set + { + SetLocalFlags(value); + UpdateBucketSyncInfo("LocalFlags"); + } + } + public void SetLocalFlags(PrimFlags value) + { + m_localFlags = value; + } + + private float m_damage = -1.0f; private byte[] m_TextureAnimation; private byte m_clickAction; @@ -675,7 +692,9 @@ namespace OpenSim.Region.Framework.Scenes { get { return m_name; } set - { + { + SetName(value); + UpdateBucketSyncInfo("Name"); /* m_name = value; if (PhysActor != null) @@ -1239,7 +1258,8 @@ namespace OpenSim.Region.Framework.Scenes set { SetAcceleration(value); - //UpdateBucketSyncInfo("Acceleration"); + + UpdateBucketSyncInfo("Acceleration"); //m_acceleration = value; } } @@ -1255,7 +1275,7 @@ namespace OpenSim.Region.Framework.Scenes set { SetDescription(value); - //UpdateBucketSyncInfo("Description"); + UpdateBucketSyncInfo("Description"); /* m_description = value; PhysicsActor actor = PhysActor; @@ -1286,7 +1306,7 @@ namespace OpenSim.Region.Framework.Scenes set { SetColor(value); - //UpdateBucketSyncInfo("Color"); + UpdateBucketSyncInfo("Color"); //m_color = value; /* ScheduleFullUpdate() need not be called b/c after @@ -1315,7 +1335,7 @@ namespace OpenSim.Region.Framework.Scenes set { SetText(value, false); - //UpdateBucketSyncInfo("Text"); + UpdateBucketSyncInfo("Text"); //m_text = value; } } @@ -1333,7 +1353,7 @@ namespace OpenSim.Region.Framework.Scenes set { SetSitName(value); - //UpdateBucketSyncInfo("SitName"); + UpdateBucketSyncInfo("SitName"); //m_sitName = value; } } @@ -1381,7 +1401,7 @@ namespace OpenSim.Region.Framework.Scenes set { SetClickAction(value); - //UpdateBucketSyncInfo("ClickAction"); + UpdateBucketSyncInfo("ClickAction"); //m_clickAction = value; } } @@ -1579,6 +1599,11 @@ namespace OpenSim.Region.Framework.Scenes //m_sitTargetPosition = value; } } + //SYMMETRIC SYNC + public void SetSitTargetPositionLL(Vector3 value) + { + m_sitTargetPosition = value; + } public Quaternion SitTargetOrientationLL { @@ -1599,6 +1624,11 @@ namespace OpenSim.Region.Framework.Scenes //m_sitTargetOrientation = new Quaternion(value.X, value.Y, value.Z, value.W); } } + //SYMMETRIC SYNC + public void SetSitTargetOrientationLL(Quaternion value) + { + m_sitTargetOrientation = value; + } public bool Stopped { @@ -5673,8 +5703,8 @@ namespace OpenSim.Region.Framework.Scenes "RotationOffset", "Velocity", "AngularVelocity", - //"Acceleration", - "SOP_Acceleration", //SOP and PA read/write their own local copies of acceleration, so we distinguish the copies + "Acceleration", //This is the property maintained in SOP. SOP and PA read/write their own local copies of acceleration, so we distinguish the copies + //"SOP_Acceleration", //SOP and PA read/write their own local copies of acceleration, so we distinguish the copies "Description", "Color", "Text", @@ -5997,21 +6027,53 @@ namespace OpenSim.Region.Framework.Scenes SetPassTouches(updatedPart.PassTouches); //RegionHandle skipped SetScriptAccessPin(updatedPart.ScriptAccessPin); - - //SetAcceleration(updatedPart.Acceleration); - //SetDescription(updatedPart.Description); - //SetColor(updatedPart.Color); - //SetText(updatedPart.Text); - //SetSitName(updatedPart.SitName); - + SetAcceleration(updatedPart.Acceleration); + SetDescription(updatedPart.Description); + SetColor(updatedPart.Color); + SetText(updatedPart.Text); + SetSitName(updatedPart.SitName); SetTouchName(updatedPart.TouchName); SetLinkNum(updatedPart.LinkNum); - //SetClickAction(updatedPart.ClickAction); - + SetClickAction(updatedPart.ClickAction); SetShape(updatedPart.Shape); + //UpdateFlag skipped: It's a flag meanful locally, especially in scheduling updates to viewers. + //Only in one place will it cause updating some "last" variables (see SendScheduledUpdates). + SetSitTargetOrientation(updatedPart.SitTargetOrientation); + SetSitTargetPosition(updatedPart.SitTargetPosition); + SetSitTargetPositionLL(updatedPart.SitTargetPositionLL); + SetSitTargetOrientationLL(updatedPart.SitTargetOrientationLL); + //ParentID skipped, the value is assigned locally and only meaningful locally (LinkObjects and LinkObjectsBySync will set it appropriately)\ + SetCreationDate(updatedPart.CreationDate); + SetCategory(updatedPart.Category); + SetSalePrice(updatedPart.SalePrice); + SetObjectSaleType(updatedPart.ObjectSaleType); + SetOwnershipCost(updatedPart.OwnershipCost); + SetGroupID(updatedPart.GroupID); + SetOwnerID(updatedPart.OwnerID); + SetLastOwnerID(updatedPart.LastOwnerID); + SetBaseMask(updatedPart.BaseMask); + SetOwnerMask(updatedPart.OwnerMask); + SetGroupMask(updatedPart.GroupMask); + SetEveryoneMask(updatedPart.EveryoneMask); + SetNextOwnerMask(updatedPart.NextOwnerMask); + SetFlags(updatedPart.Flags); + //Treat CollisionSound in a different way, so that if any property needs to be changed due to aggregateScriptEvents(), timestamp can be updated after + //the current copying-property-values-from-remote-sync-message is done. + bool collisionSoundUpdated = UpdateCollisionSound(updatedPart.CollisionSound); + SetCollisionSoundVolume(updatedPart.CollisionSoundVolume); + SetMediaUrl(updatedPart.MediaUrl); + SetTextureAnimation(updatedPart.TextureAnimation); + SetParticleSystem(updatedPart.ParticleSystem); + m_bucketSyncInfoList[bucketName].LastUpdateTimeStamp = updatedPart.BucketSyncInfoList[bucketName].LastUpdateTimeStamp; m_bucketSyncInfoList[bucketName].LastUpdateActorID = updatedPart.BucketSyncInfoList[bucketName].LastUpdateActorID; + + if (collisionSoundUpdated) + { + //If the local actor is Script Engine, it will catch this evnet and trigger aggregateScriptEvents() + m_parentGroup.Scene.EventManager.TriggerAggregateScriptEvents(this); + } } } From 2dc857b31d9e70b2652ecda2acadb11c917988d6 Mon Sep 17 00:00:00 2001 From: "Huaiyu (Kitty) Liu" Date: Tue, 8 Feb 2011 15:55:00 -0800 Subject: [PATCH 3/3] Added code to serialization/deserialize LocalFlags. Need further testing to see if it's necessary. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 1 + .../Scenes/Serialization/SceneObjectSerializer.cs | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 4edfdf93c7..489b94a80a 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -5734,6 +5734,7 @@ namespace OpenSim.Region.Framework.Scenes "EveryoneMask", "NextOwnerMask", "Flags", + "LocalFlags", "CollisionSound", "CollisionSoundVolume", "MediaUrl", diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index 415be99c69..4189c1fc88 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs @@ -330,6 +330,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization m_SOPXmlProcessors.Add("ParticleSystem", ProcessParticleSystem); //SYMMETRIC SYNC + m_SOPXmlProcessors.Add("LocalFlags", ProcessLocalFlags); //m_SOPXmlProcessors.Add("LastUpdateTimeStamp", ProcessUpdateTimeStamp); //m_SOPXmlProcessors.Add("LastUpdateActorID", ProcessLastUpdateActorID); m_SOPXmlProcessors.Add("BucketSyncInfoList", ProcessBucketSyncInfo); @@ -713,7 +714,12 @@ namespace OpenSim.Region.Framework.Scenes.Serialization { obj.LastUpdateActorID = reader.ReadElementContentAsString("LastUpdateActorID", string.Empty); } - * */ + * */ + + private static void ProcessLocalFlags(SceneObjectPart obj, XmlTextReader reader) + { + obj.LocalFlags = Util.ReadEnum(reader, "LocalFlags"); + } public static void ProcessBucketSyncInfo(SceneObjectPart obj, XmlTextReader reader) { @@ -1236,8 +1242,10 @@ namespace OpenSim.Region.Framework.Scenes.Serialization writer.WriteElementString("EveryoneMask", sop.EveryoneMask.ToString()); writer.WriteElementString("NextOwnerMask", sop.NextOwnerMask.ToString()); //SYMMETRIC SYNC: also serialize SceneObjectPart:LocalFlags, so that it can be propogated across actors - //WriteFlags(writer, "Flags", sop.Flags.ToString(), options); - WriteFlags(writer, "Flags", sop.GetEffectiveObjectFlags().ToString(), options); + WriteFlags(writer, "Flags", sop.Flags.ToString(), options); + WriteFlags(writer, "LocalFlags", sop.LocalFlags.ToString(), options); + //writer.WriteElementString("Flags", sop.Flags.ToString()); + //writer.WriteElementString("LocalFlags", sop.Flags.ToString()); //end SYMMETRIC SYNC WriteUUID(writer, "CollisionSound", sop.CollisionSound, options); writer.WriteElementString("CollisionSoundVolume", sop.CollisionSoundVolume.ToString());