From 9b955d8e959e36e95376ae90c7dc9048c5795d20 Mon Sep 17 00:00:00 2001 From: "Huaiyu (Kitty) Liu" Date: Wed, 11 May 2011 12:03:02 -0700 Subject: [PATCH] Removed code in SceneGraph, SceneObjectGroup and SceneObjectPart that were either commented out before, or no longer in use. Base for removing BucketSyncInfo. --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 60 --- .../Framework/Scenes/SceneObjectGroup.cs | 122 +----- .../Framework/Scenes/SceneObjectPart.cs | 355 +++--------------- 3 files changed, 74 insertions(+), 463 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index f5f4c6ac41..a8045ba464 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -2000,66 +2000,6 @@ namespace OpenSim.Region.Framework.Scenes #endregion - #region REGION SYNC - - protected internal bool IsObjectInScene(SceneObjectGroup sog) - { - if (Entities.ContainsKey(sog.UUID)) - return true; - else - { - return false; - } - } - - //Return false if the entity with the UUID is not a SceneObjectGroup, - //otherwise, return true. - /* - protected internal bool AddOrUpdateObjectInScene(SceneObjectGroup updatedSog, bool debugWithViewer) - { - UUID sogID = updatedSog.UUID; - - if (Entities.ContainsKey(sogID)) - { - //update the object - EntityBase entity = Entities[sogID]; - if (entity is SceneObjectGroup) - { - SceneObjectGroup oldSog = (SceneObjectGroup)entity; - oldSog.UpdateObjectProperties(updatedSog); - - if (debugWithViewer) - { - //if we need to debug the script engine with a viewer attaching to it, - //we need to schedule updates to be sent to the viewer - oldSog.ScheduleGroupForFullUpdate(new List(){SceneObjectPartProperties.None}); - } - } - else - { - m_log.WarnFormat("{0}: Entity with {1} is not of type SceneObjectGroup: {2}", - "[SCENE GRAPH]", sogID, entity.GetType().ToString()); - //return false; - } - return false; - } - else - { - //Add a new object - //For now, we set sendClientUpdates to true, for debugging purpose -- so that we could log a viewer in to - //see if scripts are running properly - //Since this is a Script Engine's local Scene cache, do not backup to DB - AddSceneObject(updatedSog, false, debugWithViewer); - //AddSceneObject(updatedSog, false, false); - - return true; - } - - } - * */ - - #endregion // REGION SYNC - #region DSG SYNC public Scene.ObjectUpdateResult UpdateObjectBySynchronization(SceneObjectGroup updatedSog) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 75e61cf7b5..07f2f302ca 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -296,12 +296,6 @@ namespace OpenSim.Region.Framework.Scenes { 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 !=null && m_scene.IsBorderCrossing(LocX, LocY, val) && !IsAttachmentCheckFull()&& (!m_scene.LoadingPrims)) if (Scene != null) { if ((Scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || Scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W) @@ -311,7 +305,6 @@ namespace OpenSim.Region.Framework.Scenes m_scene.CrossPrimGroupIntoNewRegion(val, this, true); } } - //end REGION SYNC touched if (RootPart.GetStatusSandbox()) { if (Util.GetDistanceTo(RootPart.StatusSandboxPos, value) > 10) @@ -3555,59 +3548,6 @@ namespace OpenSim.Region.Framework.Scenes set { m_locY = value; } } - - //update the existing copy of the object with updated properties in 'updatedSog' - //TODO: handle updates on script content seperately (e.g. user edited the script and saved it). - public void UpdateObjectProperties(SceneObjectGroup updatedSog) - { - if (!this.GroupID.Equals(updatedSog.GroupID)) - return; - - //So far this function is written with Script Engine updating local Scene cache in mind. - - //We do not want to simply call SceneObjectGroup.Copy here to clone the object. - //We need to preserve the references to the prims (SceneObjectParts) inside the group, - //since their scripts are referencing back to the prims, and we have to update those - //references if we call SceneObjectGroup.Copy(), which creates new SceneObjectPart for all - //non root parts. (So is SceneObjectGroup.CopyPart().) - //Plus, we do not need to trigger client updating, since Script engine does not have client connections. - lock (m_parts.SyncRoot) - { - // Adds and updates parts in this SOG - Dictionary updatedParts = new Dictionary(); - foreach (SceneObjectPart updatedPart in updatedSog.Parts) - { - SceneObjectPart oldPart; - m_parts.TryGetValue(updatedPart.UUID, out oldPart); - if(oldPart != null) - { - oldPart.UpdateObjectPartProperties(updatedPart); - updatedParts.Add(updatedPart.UUID, updatedPart); - } - else - { - //a new part - m_parts.Add(updatedPart.UUID, updatedPart); - } - } - - // Deletes parts that are no longer in this SOG - List deletedParts = new List(); - foreach(SceneObjectPart part in m_parts.GetArray()) - { - if(!updatedParts.ContainsKey(part.UUID)) - { - deletedParts.Add(part.UUID); - } - } - foreach(UUID deletedPart in deletedParts) - m_parts.Remove(deletedPart); - } - - //update the authoritative scene that this object is located, which is identified by (LocX, LocY) - this.m_locX = updatedSog.LocX; - this.m_locY = updatedSog.LocY; - } #endregion #region DSG SYNC @@ -3955,23 +3895,15 @@ namespace OpenSim.Region.Framework.Scenes linkPart.OffsetPosition = linkPart.GroupPosition - AbsolutePosition; linkPart.GroupPosition = AbsolutePosition; - //linkPart.SetOffsetPosition(linkPart.GroupPosition - AbsolutePosition); - //linkPart.SetGroupPosition(AbsolutePosition); - //linkPart.SetProperty("OffsetPosition", linkPart.GroupPosition - AbsolutePosition); - //linkPart.SetProperty("GroupPosition", AbsolutePosition); Vector3 axPos = linkPart.OffsetPosition; Quaternion parentRot = m_rootPart.RotationOffset; axPos *= Quaternion.Inverse(parentRot); linkPart.OffsetPosition = axPos; - //linkPart.SetOffsetPosition(axPos); - //linkPart.SetProperty("OffsetPosition", axPos); Quaternion oldRot = linkPart.RotationOffset; Quaternion newRot = Quaternion.Inverse(parentRot) * oldRot; linkPart.RotationOffset = newRot; - //linkPart.SetRotationOffset(newRot); - //linkPart.SetProperty("RotationOffset", newRot); //ParentID is only valid locally, so remote value is ignored and no syncinfo will be modified linkPart.ParentID = m_rootPart.LocalId; @@ -3994,12 +3926,10 @@ namespace OpenSim.Region.Framework.Scenes { // Don't update root prim link number part.LinkNum += objectGroup.PrimCount; - //part.SetProperty("LinkNum",objectGroup.PrimCount); } } linkPart.LinkNum = 2; - //linkPart.SetProperty("LinkNum",2); linkPart.SetParent(this); linkPart.CreateSelected = true; @@ -4059,65 +3989,28 @@ namespace OpenSim.Region.Framework.Scenes 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.SetProperty("OffsetPosition", axPos); - //part.SetProperty("GroupPosition", oldGroupPosition + part.OffsetPosition); - //part.SetProperty("OffsetPosition", Vector3.Zero); - //part.SetProperty("RotationOffset", worldRot); - part.SetParent(this); part.ParentID = m_rootPart.LocalId; m_parts.Add(part.UUID, linkPart); part.LinkNum = linkNum; - //part.SetProperty("LinkNum",linkNum); part.OffsetPosition = part.GroupPosition - AbsolutePosition; - //part.SetOffsetPosition(part.GroupPosition - AbsolutePosition); - //part.SetProperty("OffsetPosition", part.GroupPosition - AbsolutePosition); Quaternion rootRotation = m_rootPart.RotationOffset; Vector3 pos = part.OffsetPosition; pos *= Quaternion.Inverse(rootRotation); part.OffsetPosition = pos; - //part.SetOffsetPosition(pos); - //part.SetProperty("OffsetPosition", pos); parentRot = m_rootPart.RotationOffset; oldRot = part.RotationOffset; Quaternion newRot = Quaternion.Inverse(parentRot) * oldRot; part.RotationOffset = newRot; - //part.SetRotationOffset(newRot); - //part.SetProperty("RotationOffset", newRot); } - - public void BucketSyncInfoUpdate() - { - long timeStamp = DateTime.Now.Ticks; - string actorID = m_scene.GetSyncActorID(); - foreach (SceneObjectPart part in Parts) - { - //part.SyncInfoUpdate(timeStamp, actorID); - part.UpdateAllBucketSyncInfo(timeStamp); - } - } - - /* - public void SyncInfoUpdate(long timeStamp, string actorID) - { - foreach (SceneObjectPart part in Parts) - { - part.SyncInfoUpdate(timeStamp, actorID); - } - } - * */ /// /// Attach this object to a scene after a new object is created due to receiving a sync message. @@ -4157,6 +4050,21 @@ namespace OpenSim.Region.Framework.Scenes } + /////////////////////////////////////////////////////////////////////// + // Bucket based sync + /////////////////////////////////////////////////////////////////////// + + public void BucketSyncInfoUpdate() + { + long timeStamp = DateTime.Now.Ticks; + string actorID = m_scene.GetSyncActorID(); + foreach (SceneObjectPart part in Parts) + { + //part.SyncInfoUpdate(timeStamp, actorID); + part.UpdateAllBucketSyncInfo(timeStamp); + } + } + public void UpdateTaintedBucketSyncInfo(long timeStamp) { foreach (SceneObjectPart part in Parts) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index ad470467b2..2f4fe6fda8 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -4934,78 +4934,12 @@ namespace OpenSim.Region.Framework.Scenes return new Color4(color.R, color.G, color.B, (byte)(0xFF - color.A)); } - #region REGION SYNC - - public void UpdateObjectPartProperties(SceneObjectPart updatedPart) - { - //So far this function is written with Script Engine updating local Scene cache in mind. - // - //Assumptions: - //(1) prim's UUID and LocalID won't change. - //(2) CreaterIF, OwnerID, GroupID, won't change - //For now, we only update a small set of properties, which is a subset of the serialized object data. - //We simply assume other properties won't change. (Just a temporary work-around.) - //Properties that will be updated: - //GroupPosition, OffsetPosition,RotationOffset, Velocity, AngularVelocity, Acceleration, - // 0 , Scale - // - //And we do not update Physics properties. - - //The above assumptions and limited updating actions can be easily fixed once Scene supports - //[property name, property value] type of detailed updates. - - //Need to be able to update TaskInventory, so that new scripts will be added - - if (updatedPart == null) - return; - - this.GroupPosition = updatedPart.GroupPosition; - this.OffsetPosition = updatedPart.OffsetPosition; - this.RotationOffset = updatedPart.RotationOffset; - this.AngularVelocity = updatedPart.AngularVelocity; - this.Acceleration = updatedPart.Acceleration; - this.Color = updatedPart.Color; - this.LinkNum = updatedPart.LinkNum; - this.Velocity = updatedPart.Velocity; - this.Scale = updatedPart.Scale; - this.SitAnimation = updatedPart.SitAnimation; - this.SitName = updatedPart.SitName; - this.SitTargetAvatar = updatedPart.SitTargetAvatar; - this.SitTargetOrientation = updatedPart.SitTargetOrientation; - this.SitTargetOrientationLL = updatedPart.SitTargetOrientationLL; - this.SitTargetPosition = updatedPart.SitTargetPosition; - this.SitTargetPositionLL = updatedPart.SitTargetPositionLL; - - this.ObjectFlags = updatedPart.ObjectFlags; - - this.m_inventory.Items = (TaskInventoryDictionary)updatedPart.m_inventory.Items.Clone(); - - //update shape information, for now, only update fileds in Shape whose set functions are defined in PrimitiveBaseShape - this.Shape = updatedPart.Shape.Copy(); - this.Shape.TextureEntry = updatedPart.Shape.TextureEntry; - - } - - #endregion - - #region DSG SYNC - - //Time stamp for the most recent update on this prim. We only have one time-stamp per prim for now. - //The goal is to evetually have time-stamp per property bucket for each prim. - private long m_lastUpdateTimeStamp = DateTime.Now.Ticks; - public long LastUpdateTimeStamp - { - get { return m_lastUpdateTimeStamp; } - set { m_lastUpdateTimeStamp = value; } - } - - #endregion - } //DSG SYNC //Information for concurrency control of one bucket of prim proproperties. + public class BucketSyncInfo { private long m_lastUpdateTimeStamp; @@ -5084,82 +5018,6 @@ namespace OpenSim.Region.Framework.Scenes } } - /* - public enum SceneObjectPartProperties:ulong - { - //Following properties copied from SceneObjectSerializer(), - AllowedDrop = (ulong) 1<<0, - CreatorID = (ulong) 1<<1, - CreatorData = (ulong) 1 <<2, - FolderID = (ulong) 1 << 3, - InventorySerial = (ulong) 1 << 4, - TaskInventory = (ulong) 1 << 5, - //UUID", - //LocalId", - Name = (ulong) 1 << 6, - Material = (ulong) 1 <<7, - PassTouches = (ulong) 1 << 8, - RegionHandle = (ulong) 1 << 9, - ScriptAccessPin = (ulong) 1 << 10, - GroupPosition = (ulong) 1 << 11, - OffsetPosition = (ulong) 1 << 12, - RotationOffset = (ulong) 1 << 13, - Velocity = (ulong) 1 << 14, - AngularVelocity = (ulong) 1 << 15, - //"Acceleration", - SOP_Acceleration = (ulong) 1 << 16, //SOP and PA read/write their own local copies of acceleration, so we distinguish the copies - Description = (ulong) 1 << 17, - Color = (ulong) 1 << 18, - Text = (ulong) 1 << 19, - SitName = (ulong) 1 << 20, - TouchName = (ulong) 1 << 21, - LinkNum = (ulong) 1 << 22, - ClickAction = (ulong) 1 << 23, - Shape = (ulong) 1 << 24, - Scale = (ulong) 1 << 25, - UpdateFlag = (ulong) 1 << 26, - SitTargetOrientation = (ulong) 1 << 27, - SitTargetPosition = (ulong) 1 << 28, - SitTargetPositionLL = (ulong) 1 << 29, - SitTargetOrientationLL = (ulong) 1 << 30, - ParentID = (ulong)1 << 31, - CreationDate = (ulong) 1 << 32, - Category = (ulong) 1 << 33, - SalePrice = (ulong) 1 << 34, - ObjectSaleType = (ulong) 1 << 35, - OwnershipCost = (ulong) 1 << 36, - GroupID = (ulong) 1 << 37, - OwnerID = (ulong) 1 << 38, - LastOwnerID = (ulong) 1 << 39, - BaseMask = (ulong) 1 << 40, - OwnerMask = (ulong) 1 << 41, - GroupMask = (ulong) 1 << 42, - EveryoneMask = (ulong) 1 << 43, - NextOwnerMask = (ulong) 1 << 44, - Flags = (ulong) 1 << 45, - CollisionSound = (ulong) 1 << 46, - CollisionSoundVolume = (ulong) 1 << 47, - MediaUrl = (ulong) 1 << 48, - TextureAnimation = (ulong) 1 << 49, - ParticleSystem = (ulong) 1 << 50, - //Property names below copied from PhysicsActor, they are necessary in synchronization, but not covered the above properties - //Physics properties "Velocity" is covered above - Position = (ulong) 1 << 51, - Size = (ulong) 1 << 52, - Force = (ulong) 1 << 53, - RotationalVelocity = (ulong) 1 << 54, - PA_Acceleration = (ulong) 1 << 55, - Torque = (ulong) 1 << 56, - Orientation = (ulong) 1 << 57, - IsPhysical = (ulong) 1 << 58, - Flying = (ulong) 1 << 59, - Buoyancy = (ulong) 1 << 60, - //To be handled - AttachmentPoint = (ulong)1 << 61, - FullUpdate = UInt64.MaxValue - } - */ - public enum SceneObjectPartSyncProperties { None, @@ -5297,82 +5155,7 @@ namespace OpenSim.Region.Framework.Scenes //property set functions will be called and might trigger UpdateBucketSyncInfo() if not guarded carefully. private bool m_syncEnabled = false; - //The list of each prim's properties. This is the list of properties that matter in synchronizing prim copies on different actors. - //This list is created based on properties included in the serialization/deserialization process (see SceneObjectSerializer()) and the - //properties Physics Engine needs to synchronize to other actors. - /* - public static List PropertyList = new List() - { - //Following properties copied from SceneObjectSerializer() - "AllowedDrop", - "CreatorID", - "CreatorData", - "FolderID", - "InventorySerial", - "TaskInventory", - "UUID", - "LocalId", - "Name", - "Material", - "PassTouches", - "RegionHandle", - "ScriptAccessPin", - "GroupPosition", - "OffsetPosition", - "RotationOffset", - "Velocity", - "AngularVelocity", - //"Acceleration", - "SOP_Acceleration", //SOP and PA read/write their own local copies of acceleration, so we distinguish the copies - "Description", - "Color", - "Text", - "SitName", - "TouchName", - "LinkNum", - "ClickAction", - "Shape", - "Scale", - "UpdateFlag", - "SitTargetOrientation", - "SitTargetPosition", - "SitTargetPositionLL", - "SitTargetOrientationLL", - "ParentID", - "CreationDate", - "Category", - "SalePrice", - "ObjectSaleType", - "OwnershipCost", - "GroupID", - "OwnerID", - "LastOwnerID", - "BaseMask", - "OwnerMask", - "GroupMask", - "EveryoneMask", - "NextOwnerMask", - "Flags", - "CollisionSound", - "CollisionSoundVolume", - "MediaUrl", - "TextureAnimation", - "ParticleSystem", - //Property names below copied from PhysicsActor, they are necessary in synchronization, but not covered the above properties - //Physics properties "Velocity" is covered above - "Position", - "Size", - "Force", - "RotationalVelocity", - "PA_Acceleration", - "Torque", - "Orientation", - "IsPhysical", - "Flying", - "Buoyancy", - }; - * */ - + #region SceneObjectPartSyncProperties categorization /// /// Return the list of all prim (SOP) properties, in enum type. /// Excluding None, FullUpdate. @@ -5477,6 +5260,10 @@ namespace OpenSim.Region.Framework.Scenes return allProperties; } + #endregion SceneObjectPartSyncProperties categorization + + + #region BucketSync public static void InitializePropertyBucketInfo(Dictionary propertyBucketMap, List bucketNames, string actorID) { m_primPropertyBucketMap = propertyBucketMap; @@ -5487,20 +5274,6 @@ namespace OpenSim.Region.Framework.Scenes //RegisterBucketUpdateProcessor(); } - public string DebugObjectPartProperties() - { - string debugMsg = "UUID " + UUID + ", Name " + Name + ", localID " + LocalId; - //debugMsg += ", parentID " + ParentID + ", parentUUID " + ParentUUID; - //foreach (KeyValuePair pair in m_bucketSyncInfoList) - //{ - // debugMsg += ", Bucket " + pair.Key + ": TimeStamp - " + pair.Value.LastUpdateTimeStamp + ", ActorID - " + pair.Value.LastUpdateActorID; - //} - debugMsg += ", AggregateScriptEvents = " + AggregateScriptEvents.ToString()+", OffsetPosition: "+OffsetPosition; - String hashedShape = Util.Md5Hash(SerializeShape()); - debugMsg += ", hashed Shape = " + hashedShape; - return debugMsg; - } - /// /// Link each bucket with the function that applies updates to properties in the bucket upon receiving sync messages. /// This is the "hard-coded" part in the property-buckets implementation. When new buckets are implemented, @@ -5640,37 +5413,6 @@ namespace OpenSim.Region.Framework.Scenes m_bucketSyncInfoList[bucketName].TaintBucketBySync(); } - // Do any subscriptions based on the AggregateScriptEvents - public void aggregateScriptEventSubscriptions() - { - if ( - ((AggregateScriptEvents & scriptEvents.collision) != 0) || - ((AggregateScriptEvents & scriptEvents.collision_end) != 0) || - ((AggregateScriptEvents & scriptEvents.collision_start) != 0) || - ((AggregateScriptEvents & scriptEvents.land_collision_start) != 0) || - ((AggregateScriptEvents & scriptEvents.land_collision) != 0) || - ((AggregateScriptEvents & scriptEvents.land_collision_end) != 0) || - (CollisionSound != UUID.Zero) - ) - { - // subscribe to physics updates. - if (PhysActor != null) - { - PhysActor.OnCollisionUpdate += PhysicsCollision; - PhysActor.SubscribeEvents(1000); - - } - } - else - { - if (PhysActor != null) - { - PhysActor.UnSubscribeEvents(); - PhysActor.OnCollisionUpdate -= PhysicsCollision; - } - } - } - //NOTE: //1. Only touch the properties and BucketSyncInfo that is related to //the given bucketName. Other properties and buckets may not be filled @@ -5884,7 +5626,6 @@ namespace OpenSim.Region.Framework.Scenes } } - /// /// Update the timestamp information of each property bucket, and clear out the taint on each bucket. This function won't /// clear the taints. Caller should clear the taints if needed. @@ -6056,38 +5797,9 @@ namespace OpenSim.Region.Framework.Scenes return partUpdateResult; } - //Implementation of ScheduleFullUpdate and ScheduleTerseUpdate for Bucket - //based synchronization - /* - public override void ScheduleFullUpdate(List updatedProperties) - { - if (updatedProperties != null && updatedProperties.Count > 0) - { - foreach (SceneObjectPartProperties property in updatedProperties) - { - TaintBucketSyncInfo(property); - } - } - base.ScheduleFullUpdate(updatedProperties); - //TaintBucketSyncInfo(property); - } - - public override void ScheduleTerseUpdate(List updatedProperties) - { - if (updatedProperties != null && updatedProperties.Count > 0) - { - //m_log.DebugFormat("{0}: Tainting bucket for properties {1}", - // "[SCENE OBJECT PART]", updatedProperties.ToString()); - foreach (SceneObjectPartProperties property in updatedProperties) - { - TaintBucketSyncInfo(property); - } - } - base.ScheduleTerseUpdate(updatedProperties); - //TaintBucketSyncInfo(property); - } - * */ + #endregion BucketSync + #region overridden SOPBase functions //Implementation of ScheduleFullUpdate and ScheduleTerseUpdate for Bucket //based synchronization public override void ScheduleFullUpdate(List updatedProperties) @@ -6129,6 +5841,9 @@ namespace OpenSim.Region.Framework.Scenes base.ScheduleTerseUpdate(updatedProperties); } + #endregion overridden SOPBase functions + + #region DSG SYNC supporting functions /// /// Schedules this prim for a full update, without changing the timestamp or actorID (info on when and who modified any property). @@ -6173,6 +5888,52 @@ namespace OpenSim.Region.Framework.Scenes base.PhysicsCollision(e); } + + public string DebugObjectPartProperties() + { + string debugMsg = "UUID " + UUID + ", Name " + Name + ", localID " + LocalId; + //debugMsg += ", parentID " + ParentID + ", parentUUID " + ParentUUID; + //foreach (KeyValuePair pair in m_bucketSyncInfoList) + //{ + // debugMsg += ", Bucket " + pair.Key + ": TimeStamp - " + pair.Value.LastUpdateTimeStamp + ", ActorID - " + pair.Value.LastUpdateActorID; + //} + debugMsg += ", AggregateScriptEvents = " + AggregateScriptEvents.ToString() + ", OffsetPosition: " + OffsetPosition; + String hashedShape = Util.Md5Hash(SerializeShape()); + debugMsg += ", hashed Shape = " + hashedShape; + return debugMsg; + } + + // Do any subscriptions based on the AggregateScriptEvents + public void aggregateScriptEventSubscriptions() + { + if ( + ((AggregateScriptEvents & scriptEvents.collision) != 0) || + ((AggregateScriptEvents & scriptEvents.collision_end) != 0) || + ((AggregateScriptEvents & scriptEvents.collision_start) != 0) || + ((AggregateScriptEvents & scriptEvents.land_collision_start) != 0) || + ((AggregateScriptEvents & scriptEvents.land_collision) != 0) || + ((AggregateScriptEvents & scriptEvents.land_collision_end) != 0) || + (CollisionSound != UUID.Zero) + ) + { + // subscribe to physics updates. + if (PhysActor != null) + { + PhysActor.OnCollisionUpdate += PhysicsCollision; + PhysActor.SubscribeEvents(1000); + + } + } + else + { + if (PhysActor != null) + { + PhysActor.UnSubscribeEvents(); + PhysActor.OnCollisionUpdate -= PhysicsCollision; + } + } + } + /////////////////////////////////////////////////////////////////////// //Per property sync functions /////////////////////////////////////////////////////////////////////// @@ -6192,6 +5953,8 @@ namespace OpenSim.Region.Framework.Scenes } return serializedShape; } + + #endregion DSG SYNC supporting functions } //end of DSG SYNC