diff options
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Prioritizer.cs | 3 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 22 |
2 files changed, 15 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs index 7b7677b..de3c360 100644 --- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs +++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs | |||
@@ -52,6 +52,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
52 | public double GetUpdatePriority(IClientAPI client, ISceneEntity entity) | 52 | public double GetUpdatePriority(IClientAPI client, ISceneEntity entity) |
53 | { | 53 | { |
54 | double priority = 0; | 54 | double priority = 0; |
55 | |||
56 | if (entity == null) | ||
57 | return 100000; | ||
55 | 58 | ||
56 | switch (m_scene.UpdatePrioritizationScheme) | 59 | switch (m_scene.UpdatePrioritizationScheme) |
57 | { | 60 | { |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 866bb6e..3a8f168 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; |
@@ -200,6 +201,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
200 | if ((int)InventoryType.LSL == item.InvType) | 201 | if ((int)InventoryType.LSL == item.InvType) |
201 | { | 202 | { |
202 | CreateScriptInstance(item, startParam, postOnRez, engine, stateSource); | 203 | CreateScriptInstance(item, startParam, postOnRez, engine, stateSource); |
204 | Thread.Sleep(10); // workaround for Mono cpu utilization > 100% bug | ||
203 | } | 205 | } |
204 | } | 206 | } |
205 | } | 207 | } |
@@ -257,7 +259,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
257 | // m_log.InfoFormat( | 259 | // m_log.InfoFormat( |
258 | // "[PRIM INVENTORY]: " + | 260 | // "[PRIM INVENTORY]: " + |
259 | // "Starting script {0}, {1} in prim {2}, {3}", | 261 | // "Starting script {0}, {1} in prim {2}, {3}", |
260 | // item.Name, item.ItemID, Name, UUID); | 262 | // item.Name, item.ItemID, m_part.Name, m_part.UUID); |
261 | 263 | ||
262 | if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID)) | 264 | if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID)) |
263 | return; | 265 | return; |
@@ -293,20 +295,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
293 | } | 295 | } |
294 | else | 296 | else |
295 | { | 297 | { |
296 | if (m_part.ParentGroup.m_savedScriptState != null) | ||
297 | RestoreSavedScriptState(item.OldItemID, item.ItemID); | ||
298 | |||
299 | lock (m_items) | 298 | lock (m_items) |
300 | { | 299 | { |
300 | if (m_part.ParentGroup.m_savedScriptState != null) | ||
301 | RestoreSavedScriptState(item.OldItemID, item.ItemID); | ||
302 | |||
301 | m_items[item.ItemID].PermsMask = 0; | 303 | m_items[item.ItemID].PermsMask = 0; |
302 | m_items[item.ItemID].PermsGranter = UUID.Zero; | 304 | m_items[item.ItemID].PermsGranter = UUID.Zero; |
305 | |||
306 | string script = Utils.BytesToString(asset.Data); | ||
307 | m_part.ParentGroup.Scene.EventManager.TriggerRezScript( | ||
308 | m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource); | ||
309 | m_part.ParentGroup.AddActiveScriptCount(1); | ||
310 | m_part.ScheduleFullUpdate(); | ||
303 | } | 311 | } |
304 | |||
305 | string script = Utils.BytesToString(asset.Data); | ||
306 | m_part.ParentGroup.Scene.EventManager.TriggerRezScript( | ||
307 | m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource); | ||
308 | m_part.ParentGroup.AddActiveScriptCount(1); | ||
309 | m_part.ScheduleFullUpdate(); | ||
310 | } | 312 | } |
311 | } | 313 | } |
312 | } | 314 | } |