From 7cadb89a0f5a298beda619c395c0810ca198a718 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 7 Sep 2011 23:16:19 +0100 Subject: When a region is added to the HG Inventory Broker, also pass this through to the embedded local inventory connector to prevent an NRE when that connector tries to lookup the UserManager through the scene. This is to address http://opensimulator.org/mantis/view.php?id=5669 However, if this failure was happening I'm kind of surprised that local HG inventory was working at all..... We probably weren't seeing these exceptions previously because we weren't logging them when the reached the top of a FireAndForget thread. --- .../Inventory/RemoteXInventoryServiceConnector.cs | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs index 97fdd4e..eb90774 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs @@ -45,6 +45,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + /// + /// Scene used by this module. This currently needs to be publicly settable for HGInventoryBroker. + /// + public Scene Scene { get; set; } + private bool m_Enabled = false; private Scene m_Scene; private XInventoryServicesConnector m_RemoteConnector; @@ -56,24 +61,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory { if (m_UserManager == null) { - m_UserManager = m_Scene.RequestModuleInterface(); + m_UserManager = Scene.RequestModuleInterface(); if (m_UserManager == null) m_log.ErrorFormat( "[XINVENTORY CONNECTOR]: Could not retrieve IUserManagement module from {0}", - m_Scene.RegionInfo.RegionName); + Scene.RegionInfo.RegionName); } return m_UserManager; } - - set - { - m_log.WarnFormat( - "[XINVENTORY CONNECTOR]: Manually setting UserManager {0} (scene {1})", value, m_Scene); - - m_UserManager = value; - } } public Type ReplaceableInterface @@ -141,15 +138,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory scene.RegisterModuleInterface(this); - if (m_Scene == null) - m_Scene = scene; + if (Scene == null) + Scene = scene; } public void RemoveRegion(Scene scene) { if (!m_Enabled) return; - } public void RegionLoaded(Scene scene) -- cgit v1.1