From 16efb78698fc505fb33ad87962b39047939d636c Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 11 May 2009 22:54:09 +0000 Subject: Changes to the new user system to add the modularity developed for the asset system --- .../Asset/LocalAssetServiceConnector.cs | 2 +- .../User/LocalUserServiceConnector.cs | 37 ++++++++++++++++++++-- .../User/RemoteUserServiceConnector.cs | 1 - 3 files changed, 36 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/CoreModules/ServiceConnectors') diff --git a/OpenSim/Region/CoreModules/ServiceConnectors/Asset/LocalAssetServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectors/Asset/LocalAssetServiceConnector.cs index 1aaf552..bd4638a 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectors/Asset/LocalAssetServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectors/Asset/LocalAssetServiceConnector.cs @@ -67,7 +67,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectors.Asset IConfig assetConfig = source.Configs["AssetService"]; if (assetConfig == null) { - m_log.Error("[ASSET CONNECTOR]: AssetService missing from OpanSim.ini"); + m_log.Error("[ASSET CONNECTOR]: AssetService missing from OpenSim.ini"); return; } diff --git a/OpenSim/Region/CoreModules/ServiceConnectors/User/LocalUserServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectors/User/LocalUserServiceConnector.cs index 1528ef2..637931e 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectors/User/LocalUserServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectors/User/LocalUserServiceConnector.cs @@ -25,16 +25,23 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System; +using System.Reflection; +using log4net; using Nini.Config; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; +using OpenSim.Servers.Base; using OpenSim.Services.Interfaces; -using OpenSim.Services.UserService; namespace OpenSim.Region.CoreModules.ServiceConnectors.User { public class LocalUserServicesConnector : ISharedRegionModule { + private static readonly ILog m_log = + LogManager.GetLogger( + MethodBase.GetCurrentMethod().DeclaringType); + private IUserService m_UserService; private bool m_Enabled = false; @@ -52,8 +59,34 @@ namespace OpenSim.Region.CoreModules.ServiceConnectors.User string name = moduleConfig.GetString("UserServices", ""); if (name == Name) { + IConfig userConfig = source.Configs["UserService"]; + if (userConfig == null) + { + m_log.Error("[USER CONNECTOR]: UserService missing from OpenSim.ini"); + return; + } + + string serviceDll = userConfig.GetString("LocalServiceModule", + String.Empty); + + if (serviceDll == String.Empty) + { + m_log.Error("[USER CONNECTOR]: No LocalServiceModule named in section UserService"); + return; + } + + Object[] args = new Object[] { source }; + m_UserService = + ServerUtils.LoadPlugin(serviceDll, + args); + + if (m_UserService == null) + { + m_log.Error("[USER CONNECTOR]: Can't load user service"); + return; + } m_Enabled = true; - m_UserService = new UserService(source); + m_log.Info("[USER CONNECTOR]: Local user connector enabled"); } } } diff --git a/OpenSim/Region/CoreModules/ServiceConnectors/User/RemoteUserServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectors/User/RemoteUserServiceConnector.cs index 58e52ac..e56aac5 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectors/User/RemoteUserServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectors/User/RemoteUserServiceConnector.cs @@ -29,7 +29,6 @@ using Nini.Config; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Services.Interfaces; -using OpenSim.Services.UserService; namespace OpenSim.Region.CoreModules.ServiceConnectors.User { -- cgit v1.1