From 70d3b9aecaf5bf2447b43a1359c631eb60ca66aa Mon Sep 17 00:00:00 2001
From: Tom Grimshaw
Date: Sat, 26 Jun 2010 11:14:58 -0700
Subject: Add a DeleteAllSceneObjects(bool exceptNoCopy) method to allow
NoCopy objects to be retained when the scene is cleared.
---
OpenSim/Region/Framework/Scenes/Scene.cs | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index dc58d84..c596baa 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2183,6 +2183,14 @@ namespace OpenSim.Region.Framework.Scenes
///
public void DeleteAllSceneObjects()
{
+ DeleteAllSceneObjects(false);
+ }
+
+ ///
+ /// Delete every object from the scene. This does not include attachments worn by avatars.
+ ///
+ public void DeleteAllSceneObjects(bool exceptNoCopy)
+ {
lock (Entities)
{
ICollection entities = new List(Entities);
@@ -2192,8 +2200,13 @@ namespace OpenSim.Region.Framework.Scenes
if (e is SceneObjectGroup)
{
SceneObjectGroup sog = (SceneObjectGroup)e;
- if (!sog.IsAttachment)
- DeleteSceneObject((SceneObjectGroup)e, false);
+ if (sog != null && !sog.IsAttachment)
+ {
+ if (!exceptNoCopy || ((sog.GetEffectivePermissions() & (uint)PermissionMask.Copy) != 0))
+ {
+ DeleteSceneObject((SceneObjectGroup)e, false);
+ }
+ }
}
}
}
--
cgit v1.1
From acab2a159d150072aa9952100aa6722cbd51c1ea Mon Sep 17 00:00:00 2001
From: Tom Grimshaw
Date: Sat, 26 Jun 2010 11:24:36 -0700
Subject: Return objects which are NoCopy instead of just leaving them when
cleaning the scene, if exceptNoCopy = true.
---
OpenSim/Region/Framework/Scenes/Scene.cs | 4 ++++
1 file changed, 4 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index c596baa..abc7377 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2206,6 +2206,10 @@ namespace OpenSim.Region.Framework.Scenes
{
DeleteSceneObject((SceneObjectGroup)e, false);
}
+ else
+ {
+ DeRezObject(null, sog.RootPart.LocalId, sog.RootPart.GroupID, DeRezAction.Return, UUID.Zero);
+ }
}
}
}
--
cgit v1.1
From d188ed8ed86661a79b68f5c43ce0a94dc51308f0 Mon Sep 17 00:00:00 2001
From: Tom Grimshaw
Date: Sat, 26 Jun 2010 13:07:17 -0700
Subject: Return everything at once, it's more efficient that way
---
OpenSim/Region/Framework/Scenes/Scene.cs | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index abc7377..bbac919 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2191,6 +2191,7 @@ namespace OpenSim.Region.Framework.Scenes
///
public void DeleteAllSceneObjects(bool exceptNoCopy)
{
+ List toReturn = new List();
lock (Entities)
{
ICollection entities = new List(Entities);
@@ -2208,12 +2209,16 @@ namespace OpenSim.Region.Framework.Scenes
}
else
{
- DeRezObject(null, sog.RootPart.LocalId, sog.RootPart.GroupID, DeRezAction.Return, UUID.Zero);
+ toReturn.Add((SceneObjectGroup)e);
}
}
}
}
}
+ if (toReturn.Count > 0)
+ {
+ returnObjects(toReturn.ToArray(), UUID.Zero);
+ }
}
///
--
cgit v1.1
From 8f0adfbfb264532d55c0f0bab5bc508d36ad365e Mon Sep 17 00:00:00 2001
From: Tom Grimshaw
Date: Sat, 26 Jun 2010 15:15:19 -0700
Subject: Trigger the RegionLightShareData OnSave event properly when the
profile is saved
---
OpenSim/Region/Framework/Scenes/Scene.cs | 1 +
1 file changed, 1 insertion(+)
(limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index bbac919..c5fb198 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1770,6 +1770,7 @@ namespace OpenSim.Region.Framework.Scenes
public void StoreWindlightProfile(RegionLightShareData wl)
{
m_regInfo.WindlightSettings = wl;
+ wl.Save();
m_storageManager.DataStore.StoreRegionWindlightSettings(wl);
m_eventManager.TriggerOnSaveNewWindlightProfile();
}
--
cgit v1.1