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 | |
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')
6 files changed, 52 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs index f040365..1ed92fb 100644 --- a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs +++ b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs | |||
@@ -197,5 +197,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
197 | /// A <see cref="Dictionary`2"/> | 197 | /// A <see cref="Dictionary`2"/> |
198 | /// </returns> | 198 | /// </returns> |
199 | Dictionary<UUID, string> GetScriptStates(); | 199 | Dictionary<UUID, string> GetScriptStates(); |
200 | |||
201 | bool CanBeDeleted(); | ||
200 | } | 202 | } |
201 | } | 203 | } |
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs index 2c4ddbd..10835b9 100644 --- a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs | |||
@@ -36,6 +36,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
36 | 36 | ||
37 | string GetAssemblyName(UUID itemID); | 37 | string GetAssemblyName(UUID itemID); |
38 | string GetXMLState(UUID itemID); | 38 | string GetXMLState(UUID itemID); |
39 | bool CanBeDeleted(UUID itemID); | ||
39 | 40 | ||
40 | bool PostScriptEvent(UUID itemID, string name, Object[] args); | 41 | bool PostScriptEvent(UUID itemID, string name, Object[] args); |
41 | bool PostObjectEvent(UUID itemID, string name, Object[] args); | 42 | bool PostObjectEvent(UUID itemID, string name, Object[] args); |
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 | } |