aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs62
1 files changed, 38 insertions, 24 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index dbefb4a..c2ec5d0 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -57,11 +57,11 @@ namespace OpenSim.Region.Framework.Scenes
57 protected AsyncInventorySender m_asyncInventorySender; 57 protected AsyncInventorySender m_asyncInventorySender;
58 58
59 /// <summary> 59 /// <summary>
60 /// Start all the scripts in the scene which should be started. 60 /// Creates all the scripts in the scene which should be started.
61 /// </summary> 61 /// </summary>
62 public void CreateScriptInstances() 62 public void CreateScriptInstances()
63 { 63 {
64 m_log.Info("[PRIM INVENTORY]: Starting scripts in scene"); 64 m_log.Info("[PRIM INVENTORY]: Creating scripts in scene");
65 65
66 EntityBase[] entities = Entities.GetEntities(); 66 EntityBase[] entities = Entities.GetEntities();
67 foreach (EntityBase group in entities) 67 foreach (EntityBase group in entities)
@@ -74,6 +74,26 @@ namespace OpenSim.Region.Framework.Scenes
74 } 74 }
75 } 75 }
76 76
77 /// <summary>
78 /// Lets the script engines start processing scripts.
79 /// </summary>
80 public void StartScripts()
81 {
82 m_log.Info("[PRIM INVENTORY]: Starting scripts in scene");
83
84 IScriptModule[] engines = RequestModuleInterfaces<IScriptModule>();
85 if (engines != null)
86 {
87 foreach (IScriptModule engine in engines)
88 {
89 if (engine != null)
90 {
91 engine.StartProcessing();
92 }
93 }
94 }
95 }
96
77 public void AddUploadedInventoryItem(UUID agentID, InventoryItemBase item) 97 public void AddUploadedInventoryItem(UUID agentID, InventoryItemBase item)
78 { 98 {
79 IMoneyModule money = RequestModuleInterface<IMoneyModule>(); 99 IMoneyModule money = RequestModuleInterface<IMoneyModule>();
@@ -211,16 +231,10 @@ namespace OpenSim.Region.Framework.Scenes
211 231
212 // Retrieve group 232 // Retrieve group
213 SceneObjectPart part = GetSceneObjectPart(primId); 233 SceneObjectPart part = GetSceneObjectPart(primId);
214 SceneObjectGroup group = part.ParentGroup; 234 if (part == null)
215 if (null == group)
216 {
217 m_log.ErrorFormat(
218 "[PRIM INVENTORY]: " +
219 "Prim inventory update requested for item ID {0} in prim ID {1} but this prim does not exist",
220 itemId, primId);
221
222 return new ArrayList(); 235 return new ArrayList();
223 } 236
237 SceneObjectGroup group = part.ParentGroup;
224 238
225 // Retrieve item 239 // Retrieve item
226 TaskInventoryItem item = group.GetInventoryItem(part.LocalId, itemId); 240 TaskInventoryItem item = group.GetInventoryItem(part.LocalId, itemId);
@@ -709,7 +723,10 @@ namespace OpenSim.Region.Framework.Scenes
709 newName = item.Name; 723 newName = item.Name;
710 } 724 }
711 725
712 if (remoteClient.AgentId == oldAgentID || (LibraryService != null && LibraryService.LibraryRootFolder != null && oldAgentID == LibraryService.LibraryRootFolder.Owner)) 726 if (remoteClient.AgentId == oldAgentID
727 || (LibraryService != null
728 && LibraryService.LibraryRootFolder != null
729 && oldAgentID == LibraryService.LibraryRootFolder.Owner))
713 { 730 {
714 CreateNewInventoryItem( 731 CreateNewInventoryItem(
715 remoteClient, item.CreatorId, item.CreatorData, newFolderID, newName, item.Flags, callbackID, asset, (sbyte)item.InvType, 732 remoteClient, item.CreatorId, item.CreatorData, newFolderID, newName, item.Flags, callbackID, asset, (sbyte)item.InvType,
@@ -971,12 +988,12 @@ namespace OpenSim.Region.Framework.Scenes
971 if (part != null) 988 if (part != null)
972 { 989 {
973 group = part.ParentGroup; 990 group = part.ParentGroup;
974 } 991 }
975 if (part != null && group != null) 992 if (part != null && group != null)
976 { 993 {
977 if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId)) 994 if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId))
978 return; 995 return;
979 996
980 TaskInventoryItem item = group.GetInventoryItem(localID, itemID); 997 TaskInventoryItem item = group.GetInventoryItem(localID, itemID);
981 if (item == null) 998 if (item == null)
982 return; 999 return;
@@ -986,18 +1003,10 @@ namespace OpenSim.Region.Framework.Scenes
986 part.RemoveScriptEvents(itemID); 1003 part.RemoveScriptEvents(itemID);
987 EventManager.TriggerRemoveScript(localID, itemID); 1004 EventManager.TriggerRemoveScript(localID, itemID);
988 } 1005 }
989 1006
990 group.RemoveInventoryItem(localID, itemID); 1007 group.RemoveInventoryItem(localID, itemID);
991 part.GetProperties(remoteClient); 1008 part.GetProperties(remoteClient);
992 } 1009 }
993 else
994 {
995 m_log.ErrorFormat(
996 "[PRIM INVENTORY]: " +
997 "Removal of item {0} requested of prim {1} but this prim does not exist",
998 itemID,
999 localID);
1000 }
1001 } 1010 }
1002 1011
1003 private InventoryItemBase CreateAgentInventoryItemFromTask(UUID destAgent, SceneObjectPart part, UUID itemId) 1012 private InventoryItemBase CreateAgentInventoryItemFromTask(UUID destAgent, SceneObjectPart part, UUID itemId)
@@ -1780,7 +1789,7 @@ namespace OpenSim.Region.Framework.Scenes
1780 } 1789 }
1781 1790
1782 // Already deleted by someone else 1791 // Already deleted by someone else
1783 if (part.ParentGroup == null || part.ParentGroup.IsDeleted) 1792 if (part.ParentGroup.IsDeleted)
1784 { 1793 {
1785 //Client still thinks the object exists, kill it 1794 //Client still thinks the object exists, kill it
1786 deleteIDs.Add(localID); 1795 deleteIDs.Add(localID);
@@ -2158,6 +2167,9 @@ namespace OpenSim.Region.Framework.Scenes
2158 foreach (uint localID in localIDs) 2167 foreach (uint localID in localIDs)
2159 { 2168 {
2160 SceneObjectPart part = GetSceneObjectPart(localID); 2169 SceneObjectPart part = GetSceneObjectPart(localID);
2170 if (part == null)
2171 continue;
2172
2161 if (!groups.Contains(part.ParentGroup)) 2173 if (!groups.Contains(part.ParentGroup))
2162 groups.Add(part.ParentGroup); 2174 groups.Add(part.ParentGroup);
2163 } 2175 }
@@ -2203,6 +2215,8 @@ namespace OpenSim.Region.Framework.Scenes
2203 foreach (uint localID in localIDs) 2215 foreach (uint localID in localIDs)
2204 { 2216 {
2205 SceneObjectPart part = GetSceneObjectPart(localID); 2217 SceneObjectPart part = GetSceneObjectPart(localID);
2218 if (part == null)
2219 continue;
2206 part.GetProperties(remoteClient); 2220 part.GetProperties(remoteClient);
2207 } 2221 }
2208 } 2222 }