From af5e9147f04cf949045377a4c344b866af2009c7 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 29 Nov 2008 14:16:09 +0000 Subject: Start scripts in attachments only after a successful attach. Elimininate a gratuitious asset fetch when region crossing. --- OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | 5 +++-- OpenSim/Region/Environment/Scenes/SceneGraph.cs | 4 ++++ OpenSim/Region/Environment/Scenes/SceneObjectPartInventory.cs | 9 +++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes') diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 113b16c..d1e0c24 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -2088,10 +2088,11 @@ namespace OpenSim.Region.Environment.Scenes } // Fire on_rez - group.CreateScriptInstances(0, true, DefaultScriptEngine, 0); - if (!attachment) + { + group.CreateScriptInstances(0, true, DefaultScriptEngine, 0); rootPart.ScheduleFullUpdate(); + } if (!Permissions.BypassPermissions()) { diff --git a/OpenSim/Region/Environment/Scenes/SceneGraph.cs b/OpenSim/Region/Environment/Scenes/SceneGraph.cs index da3be08..22e5150 100644 --- a/OpenSim/Region/Environment/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Environment/Scenes/SceneGraph.cs @@ -472,6 +472,10 @@ namespace OpenSim.Region.Environment.Scenes objatt.ScheduleGroupForFullUpdate(); if (tainted) objatt.HasGroupChanged = true; + + // Fire after attach, so we don't get messy perms dialogs + // + objatt.CreateScriptInstances(0, true, m_parentScene.DefaultScriptEngine, 0); } return objatt; } diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPartInventory.cs index 793d31b..99ac722 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPartInventory.cs @@ -241,6 +241,15 @@ namespace OpenSim.Region.Environment.Scenes if (!m_part.ParentGroup.Scene.RegionInfo.RegionSettings.DisableScripts) { + if (stateSource == 1) // Prim crossing + { + m_items[item.ItemID].PermsMask = 0; + m_items[item.ItemID].PermsGranter = UUID.Zero; + m_part.ParentGroup.Scene.EventManager.TriggerRezScript( + m_part.LocalId, item.ItemID, String.Empty, startParam, postOnRez, engine, stateSource); + m_part.ParentGroup.AddActiveScriptCount(1); + m_part.ScheduleFullUpdate(); + } AssetCache cache = m_part.ParentGroup.Scene.AssetCache; cache.GetAsset(item.AssetID, delegate(UUID assetID, AssetBase asset) -- cgit v1.1