From 9bf67201c31d531e0480e67d8a96472d0a5b0c76 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 27 Jun 2008 16:36:19 +0000 Subject: * Remove responsibilty for signalling scene object change from SceneObjectPart.SendFullUpdate() * This means that we will no longer pointlessly repersist all the prims in the scene when OpenSim first starts up * This also means that force-update on the console will not trigger repersistence. * Also, in other places persistence is no longer done where it wasn't actually necessary * I think I changed the code for all instances correctly, but it's not possible that I missed some and some things which did persist properly have stopped * Please patch or mantis if this is the case --- OpenSim/Region/Environment/Scenes/InnerScene.cs | 1 + .../Region/Environment/Scenes/SceneObjectGroup.cs | 23 ++++++++++++++++---- .../Scenes/SceneObjectPart.Inventory.cs | 3 ++- .../Region/Environment/Scenes/SceneObjectPart.cs | 25 ++++++++++++++++++---- 4 files changed, 43 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes') diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index d74d763..ab0ed6b 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs @@ -1522,6 +1522,7 @@ namespace OpenSim.Region.Environment.Scenes } copy.StartScripts(); + copy.HasGroupChanged = true; copy.ScheduleGroupForFullUpdate(); return copy; } diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index b903674..74f9d6c 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -477,6 +477,7 @@ namespace OpenSim.Region.Environment.Scenes newPart.LinkNum = m_parts.Count; m_parts.Add(newPart.UUID, newPart); SetPartAsRoot(newPart); + // one of these is a proxy. if (shape.PCode != (byte)PCode.None && shape.PCode != (byte)PCode.ParticleSystem) AttachToBackup(); @@ -686,7 +687,12 @@ namespace OpenSim.Region.Environment.Scenes m_rootPart = part; } - + /// + /// Attach this scene object to the given avatar. + /// + /// + /// + /// public void AttachToAgent(LLUUID agentID, uint attachmentpoint, LLVector3 AttachOffset) { ScenePresence avatar = m_scene.GetScenePresence(agentID); @@ -752,6 +758,7 @@ namespace OpenSim.Region.Environment.Scenes m_rootPart.SetAttachmentPoint((byte)0); m_rootPart.m_IsAttachment = false; m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_scene.m_physicalPrim); + HasGroupChanged = true; AttachToBackup(); m_rootPart.ScheduleFullUpdate(); m_rootPart.ClearUndoState(); @@ -1026,6 +1033,7 @@ namespace OpenSim.Region.Environment.Scenes lock (m_targets) m_targets.Clear(); } + ScheduleGroupForFullUpdate(); } @@ -1037,6 +1045,7 @@ namespace OpenSim.Region.Environment.Scenes (int) (color.z * 0xff)); Text = text; + HasGroupChanged = true; m_rootPart.ScheduleFullUpdate(); } @@ -1229,6 +1238,7 @@ namespace OpenSim.Region.Environment.Scenes dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true); } + // Now we've made a copy that replaces this one, we need to // switch the owner to the person who did the copying // Second Life copies an object and duplicates the first one in it's place @@ -1257,8 +1267,9 @@ namespace OpenSim.Region.Environment.Scenes if (userExposed) { dupe.UpdateParentIDs(); - + dupe.HasGroupChanged = true; dupe.AttachToBackup(); + ScheduleGroupForFullUpdate(); } @@ -1386,7 +1397,6 @@ namespace OpenSim.Region.Environment.Scenes part.OwnerID = cAgentID; part.GroupID = cGroupID; - if (part.OwnerID != cAgentID) { // Apply Next Owner Permissions if we're not bypassing permissions @@ -1535,7 +1545,6 @@ namespace OpenSim.Region.Environment.Scenes /// public void ScheduleGroupForFullUpdate() { - HasGroupChanged = true; checkAtTargets(); lock (m_parts) { @@ -1774,6 +1783,7 @@ namespace OpenSim.Region.Environment.Scenes // The traffic caused is always going to be pretty minor, so it's not high priority //objectGroup.DeleteGroup(); + HasGroupChanged = true; ScheduleGroupForFullUpdate(); } @@ -1834,6 +1844,7 @@ namespace OpenSim.Region.Environment.Scenes m_scene.AddNewSceneObject(objectGroup, true); + HasGroupChanged = true; ScheduleGroupForFullUpdate(); } else @@ -2112,6 +2123,8 @@ namespace OpenSim.Region.Environment.Scenes m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor); } //if (part.UUID != m_rootPart.UUID) + + HasGroupChanged = true; ScheduleGroupForFullUpdate(); //if (part.UUID == m_rootPart.UUID) @@ -2552,6 +2565,8 @@ namespace OpenSim.Region.Environment.Scenes { part.SetGroup(GroupID, client); } + + HasGroupChanged = true; } ScheduleGroupForFullUpdate(); diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs index 5ef9c79..fbf2794 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs @@ -454,11 +454,12 @@ namespace OpenSim.Region.Environment.Scenes } } + if (scriptcount <= 0) { RemFlag(LLObject.ObjectFlags.Scripted); - ScheduleFullUpdate(); } + ScheduleFullUpdate(); return type; diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 94d661c..af535cc 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -1660,7 +1660,6 @@ namespace OpenSim.Region.Environment.Scenes { if (m_parentGroup != null) { - m_parentGroup.HasGroupChanged = true; m_parentGroup.QueueForUpdateCheck(); } @@ -1766,7 +1765,7 @@ namespace OpenSim.Region.Environment.Scenes #region Shape /// - /// + /// Update the shape of this part. /// /// public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock) @@ -1793,6 +1792,8 @@ namespace OpenSim.Region.Environment.Scenes { PhysActor.Shape = m_shape; } + + ParentGroup.HasGroupChanged = true; ScheduleFullUpdate(); } @@ -2012,6 +2013,7 @@ namespace OpenSim.Region.Environment.Scenes } } + ParentGroup.HasGroupChanged = true; ScheduleFullUpdate(); } @@ -2066,13 +2068,15 @@ namespace OpenSim.Region.Environment.Scenes #region Texture /// - /// + /// Update the texture entry for this part. /// /// public void UpdateTextureEntry(byte[] textureEntry) { m_shape.TextureEntry = textureEntry; TriggerScriptChangedEvent(Changed.TEXTURE); + + ParentGroup.HasGroupChanged = true; ScheduleFullUpdate(); } @@ -2301,7 +2305,7 @@ namespace OpenSim.Region.Environment.Scenes #region Resizing/Scale /// - /// + /// Resize this part. /// /// public void Resize(LLVector3 scale) @@ -2309,6 +2313,7 @@ namespace OpenSim.Region.Environment.Scenes StoreUndoState(); m_shape.Scale = scale; + ParentGroup.HasGroupChanged = true; ScheduleFullUpdate(); } @@ -2576,12 +2581,24 @@ namespace OpenSim.Region.Environment.Scenes { } + /// + /// Set the text displayed for this part. + /// + /// public void SetText(string text) { Text = text; + + ParentGroup.HasGroupChanged = true; ScheduleFullUpdate(); } + /// + /// Set the text displayed for this part. + /// + /// + /// + /// public void SetText(string text, Vector3 color, double alpha) { Color = Color.FromArgb(0xff - (int) (alpha*0xff), -- cgit v1.1