From d97e27434c27b02e1b104abb5577d42452b39452 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 18 Jul 2012 22:17:39 +0100 Subject: Fix bug where region ready would be triggered a second time if a script was rezzed on a previously script-free region. There is no need to listen for OnRezScript in RegionReadyModule since OnEmptyScriptCompileQueue will only fire if scripts were compiled. --- .../RegionReadyModule/RegionReadyModule.cs | 53 ++++++++++------------ 1 file changed, 23 insertions(+), 30 deletions(-) (limited to 'OpenSim/Region/OptionalModules/Scripting') diff --git a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs index e09e633..6b09c3b 100644 --- a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs @@ -99,14 +99,15 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady m_lastOarLoadedOk = true; m_scene.EventManager.OnOarFileLoaded += OnOarFileLoaded; - m_scene.EventManager.OnRezScript += OnRezScript; m_log.DebugFormat("[RegionReady]: Enabled for region {0}", scene.RegionInfo.RegionName); if (m_disable_logins) { + m_scene.LoginLock = true; m_scene.EventManager.OnLoginsEnabled += OnLoginsEnabled; - scene.LoginLock = true; + m_scene.EventManager.OnEmptyScriptCompileQueue += OnEmptyScriptCompileQueue; + m_log.InfoFormat("[RegionReady]: Region {0} - LOGINS DISABLED DURING INITIALIZATION.", m_scene.Name); if (m_uri != string.Empty) @@ -116,16 +117,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady } } - void OnRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource) - { - if (!m_ScriptRez) - { - m_ScriptRez = true; - m_scene.EventManager.OnEmptyScriptCompileQueue += OnEmptyScriptCompileQueue; - m_scene.EventManager.OnRezScript -= OnRezScript; - } - } - public void RemoveRegion(Scene scene) { if (!m_enabled) @@ -134,7 +125,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady m_scene.EventManager.OnOarFileLoaded -= OnOarFileLoaded; if (m_disable_logins) + { m_scene.EventManager.OnLoginsEnabled -= OnLoginsEnabled; + m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue; + } if (m_uri != string.Empty) { @@ -249,25 +243,24 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady { // Let's bypass this for now until some better feedback can be established // - return; - if (msg == "load") - { - m_scene.EventManager.OnEmptyScriptCompileQueue += OnEmptyScriptCompileQueue; - m_scene.EventManager.OnOarFileLoaded += OnOarFileLoaded; - m_scene.EventManager.OnLoginsEnabled += OnLoginsEnabled; - m_scene.EventManager.OnRezScript += OnRezScript; - m_oarFileLoading = true; - m_firstEmptyCompileQueue = true; - - m_scene.LoginsDisabled = true; - m_scene.LoginLock = true; - if ( m_uri != string.Empty ) - { - RRAlert("loading oar"); - RRAlert("disabled"); - } - } +// if (msg == "load") +// { +// m_scene.EventManager.OnEmptyScriptCompileQueue += OnEmptyScriptCompileQueue; +// m_scene.EventManager.OnOarFileLoaded += OnOarFileLoaded; +// m_scene.EventManager.OnLoginsEnabled += OnLoginsEnabled; +// m_scene.EventManager.OnRezScript += OnRezScript; +// m_oarFileLoading = true; +// m_firstEmptyCompileQueue = true; +// +// m_scene.LoginsDisabled = true; +// m_scene.LoginLock = true; +// if ( m_uri != string.Empty ) +// { +// RRAlert("loading oar"); +// RRAlert("disabled"); +// } +// } } public void RRAlert(string status) -- cgit v1.1