From a83218fd085f5dd8ee1a55a958fe4bb569f960cc Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 14 Nov 2012 04:17:39 +0000 Subject: [PATCH] If no ISimulationDataStore or IEstateDataStore implementations could be loaded then halt with informative message rather than a later NRE. Halt already occurs if the relevant config sections are not present. So it also makes sense to halt if the implementations themselves cannot be loaded. --- OpenSim/Region/Application/OpenSimBase.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 7b591a88be..7fdf75682f 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -207,19 +207,33 @@ namespace OpenSim IConfig simDataConfig = m_config.Source.Configs["SimulationDataStore"]; if (simDataConfig == null) throw new Exception("Configuration file is missing the [SimulationDataStore] section. Have you copied OpenSim.ini.example to OpenSim.ini to reference config-include/ files?"); + string module = simDataConfig.GetString("LocalServiceModule", String.Empty); if (String.IsNullOrEmpty(module)) throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [SimulationDataStore] section."); + m_simulationDataService = ServerUtils.LoadPlugin(module, new object[] { m_config.Source }); + if (m_simulationDataService == null) + throw new Exception( + string.Format( + "Could not load an ISimulationDataService implementation from {0}, as configured in the LocalServiceModule parameter of the [SimulationDataStore] config section.", + module)); // Load the estate data service IConfig estateDataConfig = m_config.Source.Configs["EstateDataStore"]; if (estateDataConfig == null) throw new Exception("Configuration file is missing the [EstateDataStore] section. Have you copied OpenSim.ini.example to OpenSim.ini to reference config-include/ files?"); + module = estateDataConfig.GetString("LocalServiceModule", String.Empty); if (String.IsNullOrEmpty(module)) throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [EstateDataStore] section"); + m_estateDataService = ServerUtils.LoadPlugin(module, new object[] { m_config.Source }); + if (m_estateDataService == null) + throw new Exception( + string.Format( + "Could not load an IEstateDataService implementation from {0}, as configured in the LocalServiceModule parameter of the [EstateDataStore] config section.", + module)); base.StartupSpecific();