diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index d175695..256e3b0 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -31,6 +31,7 @@ using System.IO; | |||
31 | using System.Collections.Generic; | 31 | using System.Collections.Generic; |
32 | using System.Collections; | 32 | using System.Collections; |
33 | using System.Reflection; | 33 | using System.Reflection; |
34 | using System.Threading; | ||
34 | using OpenMetaverse; | 35 | using OpenMetaverse; |
35 | using log4net; | 36 | using log4net; |
36 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
@@ -201,6 +202,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
201 | if ((int)InventoryType.LSL == item.InvType) | 202 | if ((int)InventoryType.LSL == item.InvType) |
202 | { | 203 | { |
203 | CreateScriptInstance(item, startParam, postOnRez, engine, stateSource); | 204 | CreateScriptInstance(item, startParam, postOnRez, engine, stateSource); |
205 | Thread.Sleep(10); // workaround for Mono cpu utilization > 100% bug | ||
204 | } | 206 | } |
205 | } | 207 | } |
206 | } | 208 | } |
@@ -258,7 +260,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
258 | // m_log.InfoFormat( | 260 | // m_log.InfoFormat( |
259 | // "[PRIM INVENTORY]: " + | 261 | // "[PRIM INVENTORY]: " + |
260 | // "Starting script {0}, {1} in prim {2}, {3}", | 262 | // "Starting script {0}, {1} in prim {2}, {3}", |
261 | // item.Name, item.ItemID, Name, UUID); | 263 | // item.Name, item.ItemID, m_part.Name, m_part.UUID); |
262 | 264 | ||
263 | if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID)) | 265 | if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID)) |
264 | return; | 266 | return; |
@@ -296,20 +298,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
296 | } | 298 | } |
297 | else | 299 | else |
298 | { | 300 | { |
299 | if (m_part.ParentGroup.m_savedScriptState != null) | ||
300 | RestoreSavedScriptState(item.OldItemID, item.ItemID); | ||
301 | |||
302 | lock (m_items) | 301 | lock (m_items) |
303 | { | 302 | { |
303 | if (m_part.ParentGroup.m_savedScriptState != null) | ||
304 | RestoreSavedScriptState(item.OldItemID, item.ItemID); | ||
305 | |||
304 | m_items[item.ItemID].PermsMask = 0; | 306 | m_items[item.ItemID].PermsMask = 0; |
305 | m_items[item.ItemID].PermsGranter = UUID.Zero; | 307 | m_items[item.ItemID].PermsGranter = UUID.Zero; |
308 | |||
309 | string script = Utils.BytesToString(asset.Data); | ||
310 | m_part.ParentGroup.Scene.EventManager.TriggerRezScript( | ||
311 | m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource); | ||
312 | m_part.ParentGroup.AddActiveScriptCount(1); | ||
313 | m_part.ScheduleFullUpdate(); | ||
306 | } | 314 | } |
307 | |||
308 | string script = Utils.BytesToString(asset.Data); | ||
309 | m_part.ParentGroup.Scene.EventManager.TriggerRezScript( | ||
310 | m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource); | ||
311 | m_part.ParentGroup.AddActiveScriptCount(1); | ||
312 | m_part.ScheduleFullUpdate(); | ||
313 | } | 315 | } |
314 | } | 316 | } |
315 | ); | 317 | ); |