diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 40 |
1 files changed, 29 insertions, 11 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 2a3727a..2ff6a51 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -158,7 +158,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
158 | 158 | ||
159 | HasInventoryChanged = true; | 159 | HasInventoryChanged = true; |
160 | m_part.ParentGroup.HasGroupChanged = true; | 160 | m_part.ParentGroup.HasGroupChanged = true; |
161 | IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values); | 161 | List<TaskInventoryItem> items = GetInventoryItems(); |
162 | foreach (TaskInventoryItem item in items) | 162 | foreach (TaskInventoryItem item in items) |
163 | { | 163 | { |
164 | if (ownerId != item.OwnerID) | 164 | if (ownerId != item.OwnerID) |
@@ -207,10 +207,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
207 | foreach (TaskInventoryItem item in items) | 207 | foreach (TaskInventoryItem item in items) |
208 | { | 208 | { |
209 | if ((int)InventoryType.LSL == item.InvType) | 209 | if ((int)InventoryType.LSL == item.InvType) |
210 | { | ||
211 | CreateScriptInstance(item, startParam, postOnRez, engine, stateSource); | 210 | CreateScriptInstance(item, startParam, postOnRez, engine, stateSource); |
212 | Thread.Sleep(10); // workaround for Mono cpu utilization > 100% bug | ||
213 | } | ||
214 | } | 211 | } |
215 | } | 212 | } |
216 | 213 | ||
@@ -256,8 +253,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
256 | m_part.RemoveScriptEvents(item.ItemID); | 253 | m_part.RemoveScriptEvents(item.ItemID); |
257 | } | 254 | } |
258 | } | 255 | } |
259 | |||
260 | |||
261 | } | 256 | } |
262 | 257 | ||
263 | /// <summary> | 258 | /// <summary> |
@@ -270,7 +265,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
270 | // m_log.InfoFormat( | 265 | // m_log.InfoFormat( |
271 | // "[PRIM INVENTORY]: " + | 266 | // "[PRIM INVENTORY]: " + |
272 | // "Starting script {0}, {1} in prim {2}, {3}", | 267 | // "Starting script {0}, {1} in prim {2}, {3}", |
273 | // item.Name, item.ItemID, m_part.Name, m_part.UUID); | 268 | // item.Name, item.ItemID, Name, UUID); |
274 | 269 | ||
275 | if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID)) | 270 | if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID)) |
276 | { | 271 | { |
@@ -558,7 +553,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
558 | 553 | ||
559 | /// <summary> | 554 | /// <summary> |
560 | /// Check if the inventory holds an item with a given name. | 555 | /// Check if the inventory holds an item with a given name. |
561 | /// This method assumes that the task inventory is already locked. | ||
562 | /// </summary> | 556 | /// </summary> |
563 | /// <param name="name"></param> | 557 | /// <param name="name"></param> |
564 | /// <returns></returns> | 558 | /// <returns></returns> |
@@ -663,7 +657,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
663 | else | 657 | else |
664 | m_part.TriggerScriptChangedEvent(Changed.INVENTORY); | 658 | m_part.TriggerScriptChangedEvent(Changed.INVENTORY); |
665 | 659 | ||
666 | |||
667 | m_inventorySerial++; | 660 | m_inventorySerial++; |
668 | //m_inventorySerial += 2; | 661 | //m_inventorySerial += 2; |
669 | HasInventoryChanged = true; | 662 | HasInventoryChanged = true; |
@@ -754,7 +747,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
754 | // changed since permissions were last set. | 747 | // changed since permissions were last set. |
755 | if (item.GroupPermissions != (uint)PermissionMask.None) | 748 | if (item.GroupPermissions != (uint)PermissionMask.None) |
756 | item.GroupID = m_part.GroupID; | 749 | item.GroupID = m_part.GroupID; |
757 | 750 | ||
758 | if (item.AssetID == UUID.Zero) | 751 | if (item.AssetID == UUID.Zero) |
759 | { | 752 | { |
760 | item.AssetID = m_items[item.ItemID].AssetID; | 753 | item.AssetID = m_items[item.ItemID].AssetID; |
@@ -1114,6 +1107,30 @@ namespace OpenSim.Region.Framework.Scenes | |||
1114 | 1107 | ||
1115 | return ret; | 1108 | return ret; |
1116 | } | 1109 | } |
1110 | |||
1111 | public List<TaskInventoryItem> GetInventoryItems() | ||
1112 | { | ||
1113 | List<TaskInventoryItem> ret = new List<TaskInventoryItem>(); | ||
1114 | |||
1115 | lock (m_items) | ||
1116 | ret = new List<TaskInventoryItem>(m_items.Values); | ||
1117 | |||
1118 | return ret; | ||
1119 | } | ||
1120 | |||
1121 | public List<TaskInventoryItem> GetInventoryScripts() | ||
1122 | { | ||
1123 | List<TaskInventoryItem> ret = new List<TaskInventoryItem>(); | ||
1124 | |||
1125 | lock (m_items) | ||
1126 | { | ||
1127 | foreach (TaskInventoryItem item in m_items.Values) | ||
1128 | if (item.InvType == (int)InventoryType.LSL) | ||
1129 | ret.Add(item); | ||
1130 | } | ||
1131 | |||
1132 | return ret; | ||
1133 | } | ||
1117 | 1134 | ||
1118 | public Dictionary<UUID, string> GetScriptStates() | 1135 | public Dictionary<UUID, string> GetScriptStates() |
1119 | { | 1136 | { |
@@ -1181,10 +1198,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1181 | engine.ResumeScript(item.ItemID); | 1198 | engine.ResumeScript(item.ItemID); |
1182 | } | 1199 | } |
1183 | } | 1200 | } |
1184 | } | 1201 | } |
1185 | } | 1202 | } |
1186 | 1203 | ||
1187 | Items.LockItemsForRead(false); | 1204 | Items.LockItemsForRead(false); |
1188 | } | 1205 | } |
1206 | |||
1189 | } | 1207 | } |
1190 | } | 1208 | } |