diff options
Added OnRemoveScript(uint localID, LLUUID itemID) event , trigged when a script in a primitive is deleted.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | 20 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneEvents.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 22 |
5 files changed, 61 insertions, 2 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index fa1b865..9cbd65b 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | |||
@@ -208,6 +208,26 @@ namespace OpenSim.Region.Environment.Scenes | |||
208 | } | 208 | } |
209 | } | 209 | } |
210 | 210 | ||
211 | public void RemoveTaskInventory(IClientAPI remoteClient, LLUUID itemID, uint localID) | ||
212 | { | ||
213 | bool hasPrim = false; | ||
214 | foreach (EntityBase ent in Entities.Values) | ||
215 | { | ||
216 | if (ent is SceneObjectGroup) | ||
217 | { | ||
218 | hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID); | ||
219 | if (hasPrim != false) | ||
220 | { | ||
221 | int type = ((SceneObjectGroup)ent).RemoveInventoryItem(remoteClient, localID, itemID); | ||
222 | if (type == 10) | ||
223 | { | ||
224 | this.EventManager.TriggerRemoveScript(localID, itemID); | ||
225 | } | ||
226 | } | ||
227 | } | ||
228 | } | ||
229 | } | ||
230 | |||
211 | public void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID) | 231 | public void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID) |
212 | { | 232 | { |
213 | CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); | 233 | CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 62eb547..91ff0a8 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -716,6 +716,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
716 | client.OnRequestXfer += xferManager.RequestXfer; | 716 | client.OnRequestXfer += xferManager.RequestXfer; |
717 | client.OnConfirmXfer += xferManager.AckPacket; | 717 | client.OnConfirmXfer += xferManager.AckPacket; |
718 | client.OnRezScript += RezScript; | 718 | client.OnRezScript += RezScript; |
719 | client.OnRemoveTaskItem += RemoveTaskInventory; | ||
719 | 720 | ||
720 | client.OnRequestAvatarProperties += RequestAvatarProperty; | 721 | client.OnRequestAvatarProperties += RequestAvatarProperty; |
721 | 722 | ||
diff --git a/OpenSim/Region/Environment/Scenes/SceneEvents.cs b/OpenSim/Region/Environment/Scenes/SceneEvents.cs index 09a7f21..3c6b277 100644 --- a/OpenSim/Region/Environment/Scenes/SceneEvents.cs +++ b/OpenSim/Region/Environment/Scenes/SceneEvents.cs | |||
@@ -40,6 +40,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
40 | public delegate void NewRezScript(uint localID, LLUUID itemID, string script); | 40 | public delegate void NewRezScript(uint localID, LLUUID itemID, string script); |
41 | public event NewRezScript OnRezScript; | 41 | public event NewRezScript OnRezScript; |
42 | 42 | ||
43 | public delegate void RemoveScript(uint localID, LLUUID itemID); | ||
44 | public event RemoveScript OnRemoveScript; | ||
43 | 45 | ||
44 | public void TriggerPermissionError(LLUUID user, string reason) | 46 | public void TriggerPermissionError(LLUUID user, string reason) |
45 | { | 47 | { |
@@ -117,5 +119,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
117 | OnRezScript(localID, itemID, script); | 119 | OnRezScript(localID, itemID, script); |
118 | } | 120 | } |
119 | } | 121 | } |
122 | |||
123 | public void TriggerRemoveScript(uint localID, LLUUID itemID) | ||
124 | { | ||
125 | if (OnRemoveScript != null) | ||
126 | { | ||
127 | OnRemoveScript(localID, itemID); | ||
128 | } | ||
129 | } | ||
120 | } | 130 | } |
121 | } | 131 | } |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index c50809f..c3d70ea 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -643,6 +643,16 @@ namespace OpenSim.Region.Environment.Scenes | |||
643 | 643 | ||
644 | } | 644 | } |
645 | 645 | ||
646 | public int RemoveInventoryItem(IClientAPI remoteClient, uint localID, LLUUID itemID) | ||
647 | { | ||
648 | SceneObjectPart part = this.GetChildPart(localID); | ||
649 | if (part != null) | ||
650 | { | ||
651 | return part.RemoveInventoryItem(remoteClient, localID, itemID); | ||
652 | } | ||
653 | return -1; | ||
654 | } | ||
655 | |||
646 | /// <summary> | 656 | /// <summary> |
647 | /// | 657 | /// |
648 | /// </summary> | 658 | /// </summary> |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 8a59d88..567681a 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -422,10 +422,28 @@ namespace OpenSim.Region.Environment.Scenes | |||
422 | this.m_inventorySerial++; | 422 | this.m_inventorySerial++; |
423 | } | 423 | } |
424 | 424 | ||
425 | public void RemoveInventoryItem() | 425 | public int RemoveInventoryItem(IClientAPI remoteClient, uint localID, LLUUID itemID) |
426 | { | 426 | { |
427 | 427 | if (localID == this.LocalID) | |
428 | { | ||
429 | if (this.TaskInventory.ContainsKey(itemID)) | ||
430 | { | ||
431 | string type = TaskInventory[itemID].inv_type; | ||
432 | this.TaskInventory.Remove(itemID); | ||
433 | this.m_inventorySerial++; | ||
434 | if (type == "lsltext") | ||
435 | { | ||
436 | return 10; | ||
437 | } | ||
438 | else | ||
439 | { | ||
440 | return 0; | ||
441 | } | ||
442 | } | ||
443 | } | ||
444 | return -1; | ||
428 | } | 445 | } |
446 | |||
429 | /// <summary> | 447 | /// <summary> |
430 | /// | 448 | /// |
431 | /// </summary> | 449 | /// </summary> |