diff options
author | Melanie | 2009-08-04 03:17:13 +0100 |
---|---|---|
committer | Melanie | 2009-08-04 03:17:13 +0100 |
commit | 17bdc45c5ce623549b185a6c4bd5e8fdf00c8d8e (patch) | |
tree | b1e75c63acc472c6e211f2054abedf99ccf1bf06 /OpenSim/Region/Framework/Scenes | |
parent | Minor: formatting changes. (diff) | |
download | opensim-SC_OLD-17bdc45c5ce623549b185a6c4bd5e8fdf00c8d8e.zip opensim-SC_OLD-17bdc45c5ce623549b185a6c4bd5e8fdf00c8d8e.tar.gz opensim-SC_OLD-17bdc45c5ce623549b185a6c4bd5e8fdf00c8d8e.tar.bz2 opensim-SC_OLD-17bdc45c5ce623549b185a6c4bd5e8fdf00c8d8e.tar.xz |
Add plumbing for the SceneObjectDeleter to wait for the script engine to
allow final deletion of objects. Meant to support the attach(NULL_KEY) event,
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
4 files changed, 49 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs index 4ef1749..f8208ec 100644 --- a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs +++ b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs | |||
@@ -109,7 +109,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
109 | 109 | ||
110 | while (InventoryDeQueueAndDelete()) | 110 | while (InventoryDeQueueAndDelete()) |
111 | { | 111 | { |
112 | m_log.Debug("[SCENE]: Sent item successfully to inventory, continuing..."); | 112 | //m_log.Debug("[SCENE]: Sent item successfully to inventory, continuing..."); |
113 | } | 113 | } |
114 | } | 114 | } |
115 | 115 | ||
@@ -128,11 +128,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
128 | int left = m_inventoryDeletes.Count; | 128 | int left = m_inventoryDeletes.Count; |
129 | if (left > 0) | 129 | if (left > 0) |
130 | { | 130 | { |
131 | x = m_inventoryDeletes.Dequeue(); | ||
132 | if (!x.objectGroup.CanBeDeleted()) | ||
133 | { | ||
134 | m_inventoryDeletes.Enqueue(x); | ||
135 | return true; | ||
136 | } | ||
137 | |||
131 | m_log.DebugFormat( | 138 | m_log.DebugFormat( |
132 | "[SCENE]: Sending object to user's inventory, {0} item(s) remaining.", left); | 139 | "[SCENE]: Sending object to user's inventory, {0} item(s) remaining.", left); |
133 | 140 | ||
134 | x = m_inventoryDeletes.Dequeue(); | ||
135 | |||
136 | try | 141 | try |
137 | { | 142 | { |
138 | m_scene.DeleteToInventory(x.action, x.folderID, x.objectGroup, x.remoteClient); | 143 | m_scene.DeleteToInventory(x.action, x.folderID, x.objectGroup, x.remoteClient); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 0f7bd00..21e133b 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -3383,5 +3383,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
3383 | SetFromAssetID(uuid); | 3383 | SetFromAssetID(uuid); |
3384 | } | 3384 | } |
3385 | #endregion | 3385 | #endregion |
3386 | |||
3387 | public bool CanBeDeleted() | ||
3388 | { | ||
3389 | foreach (SceneObjectPart part in Children.Values) | ||
3390 | { | ||
3391 | if (!part.CanBeDeleted()) | ||
3392 | return false; | ||
3393 | } | ||
3394 | |||
3395 | return true; | ||
3396 | } | ||
3386 | } | 3397 | } |
3387 | } | 3398 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index a4d455c..bc11709 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -3787,5 +3787,10 @@ if (m_shape != null) { | |||
3787 | 3787 | ||
3788 | Inventory.ApplyNextOwnerPermissions(); | 3788 | Inventory.ApplyNextOwnerPermissions(); |
3789 | } | 3789 | } |
3790 | |||
3791 | public bool CanBeDeleted() | ||
3792 | { | ||
3793 | return Inventory.CanBeDeleted(); | ||
3794 | } | ||
3790 | } | 3795 | } |
3791 | } | 3796 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 084aa50..582f44d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -910,5 +910,30 @@ namespace OpenSim.Region.Framework.Scenes | |||
910 | } | 910 | } |
911 | return ret; | 911 | return ret; |
912 | } | 912 | } |
913 | |||
914 | public bool CanBeDeleted() | ||
915 | { | ||
916 | if (!ContainsScripts()) | ||
917 | return true; | ||
918 | |||
919 | IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>(); | ||
920 | |||
921 | if (engines == null) // No engine at all | ||
922 | return true; | ||
923 | |||
924 | foreach (TaskInventoryItem item in m_items.Values) | ||
925 | { | ||
926 | if (item.InvType == (int)InventoryType.LSL) | ||
927 | { | ||
928 | foreach (IScriptModule e in engines) | ||
929 | { | ||
930 | if(!e.CanBeDeleted(item.ItemID)) | ||
931 | return false; | ||
932 | } | ||
933 | } | ||
934 | } | ||
935 | |||
936 | return true; | ||
937 | } | ||
913 | } | 938 | } |
914 | } | 939 | } |