From 58b72933c814ed393bdf29622d218dd66805af4d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 18 Jul 2012 22:09:20 +0100 Subject: Fix bug where region ready was being triggered twice in quick succession if a region contained no scripts. --- OpenSim/Region/Framework/Scenes/Scene.cs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 12cc0d3..cadcec0 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1488,22 +1488,25 @@ namespace OpenSim.Region.Framework.Scenes IConfig startupConfig = m_config.Configs["Startup"]; if (startupConfig == null || !startupConfig.GetBoolean("StartDisabled", false)) { - // This handles a case of a region having no scripts for the RegionReady module - if (m_sceneGraph.GetActiveScriptsCount() == 0) + if (LoginLock) { - // need to be able to tell these have changed in RegionReady - LoginLock = false; - EventManager.TriggerLoginsEnabled(this); + // This handles a case of a region having no scripts for the RegionReady module + if (m_sceneGraph.GetActiveScriptsCount() == 0) + { + // XXX: need to be able to tell these have changed in RegionReady, since it will not + // detect a scenario where the region has no scripts - it's listening to the + // script compile queue. + EventManager.TriggerLoginsEnabled(this); + } } - - // For RegionReady lockouts - if (!LoginLock) + else { m_log.InfoFormat("[REGION]: Enabling logins for {0}", RegionInfo.RegionName); LoginsDisabled = false; + EventManager.TriggerLoginsEnabled(this); EventManager.TriggerRegionReady(this); } - + m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface(), RegionInfo); } else -- cgit v1.1