From 77ebb7c9f30acaad1cc44a2bce799d05282a5f48 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 22 Jun 2009 13:14:48 +0000 Subject: Committing RemoteUserServiceConnector out connector, local user service connector and the glue code. --- .../User/LocalUserServiceConnector.cs | 6 +++--- .../User/RemoteUserServiceConnector.cs | 25 ++++++++++++++++++++-- OpenSim/Services/Interfaces/IUserService.cs | 5 ++--- OpenSim/Services/UserService/UserService.cs | 2 +- 4 files changed, 29 insertions(+), 9 deletions(-) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/User/LocalUserServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/User/LocalUserServiceConnector.cs index f364999..1efb8f6 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/User/LocalUserServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/User/LocalUserServiceConnector.cs @@ -42,7 +42,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.User LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType); - private IUserService m_UserService; + private IUserDataService m_UserService; private bool m_Enabled = false; @@ -77,7 +77,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.User Object[] args = new Object[] { source }; m_UserService = - ServerUtils.LoadPlugin(serviceDll, + ServerUtils.LoadPlugin(serviceDll, args); if (m_UserService == null) @@ -108,7 +108,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.User if (!m_Enabled) return; - scene.RegisterModuleInterface(m_UserService); + scene.RegisterModuleInterface(m_UserService); } public void RemoveRegion(Scene scene) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/User/RemoteUserServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/User/RemoteUserServiceConnector.cs index 00a2478..2e9739b 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/User/RemoteUserServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/User/RemoteUserServiceConnector.cs @@ -26,14 +26,22 @@ */ using Nini.Config; +using log4net; +using System.Reflection; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Services.Interfaces; +using OpenSim.Services.Connectors; namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.User { - public class RemoteUserServicesConnector : ISharedRegionModule + public class RemoteUserServicesConnector : UserServicesConnector, + ISharedRegionModule, IUserDataService { + private static readonly ILog m_log = + LogManager.GetLogger( + MethodBase.GetCurrentMethod().DeclaringType); + private bool m_Enabled = false; public string Name @@ -41,7 +49,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.User get { return "RemoteUserServicesConnector"; } } - public void Initialise(IConfigSource source) + public override void Initialise(IConfigSource source) { IConfig moduleConfig = source.Configs["Modules"]; if (moduleConfig != null) @@ -49,7 +57,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.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 OpanSim.ini"); + return; + } + m_Enabled = true; + + base.Initialise(source); + + m_log.Info("[USER CONNECTOR]: Remote users enabled"); } } } @@ -70,6 +89,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.User { if (!m_Enabled) return; + + scene.RegisterModuleInterface(this); } public void RemoveRegion(Scene scene) diff --git a/OpenSim/Services/Interfaces/IUserService.cs b/OpenSim/Services/Interfaces/IUserService.cs index 823a86d..eb77bd4 100644 --- a/OpenSim/Services/Interfaces/IUserService.cs +++ b/OpenSim/Services/Interfaces/IUserService.cs @@ -35,7 +35,7 @@ namespace OpenSim.Services.Interfaces public string FirstName; public string LastName; public UUID UserID; - public UUID scopeID; + public UUID ScopeID; // For informational purposes only! // @@ -59,7 +59,7 @@ namespace OpenSim.Services.Interfaces public string AccountType; }; - public interface IUserService + public interface IUserDataService { UserData GetUserData(UUID scopeID, UUID userID); UserData GetUserData(UUID scopeID, string FirstName, string LastName); @@ -71,7 +71,6 @@ namespace OpenSim.Services.Interfaces // Returns the list of avatars that matches both the search // criterion and the scope ID passed - // ONLY THE NAME, SCOPE ID and UUID will be filled in! // List GetAvatarPickerData(UUID scopeID, string query); } diff --git a/OpenSim/Services/UserService/UserService.cs b/OpenSim/Services/UserService/UserService.cs index 3443643..5a6e5fb 100644 --- a/OpenSim/Services/UserService/UserService.cs +++ b/OpenSim/Services/UserService/UserService.cs @@ -35,7 +35,7 @@ using OpenMetaverse; namespace OpenSim.Services.UserService { - public class UserService : UserServiceBase, IUserService + public class UserService : UserServiceBase, IUserDataService { public UserService(IConfigSource config) : base(config) { -- cgit v1.1