Committing RemoteUserServiceConnector out connector, local user service

connector and the glue code.
0.6.6-post-fixes
Melanie Thielker 2009-06-22 13:14:48 +00:00
parent 044446821b
commit 77ebb7c9f3
4 changed files with 29 additions and 9 deletions

View File

@ -42,7 +42,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.User
LogManager.GetLogger( LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType); MethodBase.GetCurrentMethod().DeclaringType);
private IUserService m_UserService; private IUserDataService m_UserService;
private bool m_Enabled = false; private bool m_Enabled = false;
@ -77,7 +77,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.User
Object[] args = new Object[] { source }; Object[] args = new Object[] { source };
m_UserService = m_UserService =
ServerUtils.LoadPlugin<IUserService>(serviceDll, ServerUtils.LoadPlugin<IUserDataService>(serviceDll,
args); args);
if (m_UserService == null) if (m_UserService == null)
@ -108,7 +108,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.User
if (!m_Enabled) if (!m_Enabled)
return; return;
scene.RegisterModuleInterface<IUserService>(m_UserService); scene.RegisterModuleInterface<IUserDataService>(m_UserService);
} }
public void RemoveRegion(Scene scene) public void RemoveRegion(Scene scene)

View File

@ -26,14 +26,22 @@
*/ */
using Nini.Config; using Nini.Config;
using log4net;
using System.Reflection;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
using OpenSim.Services.Connectors;
namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.User 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; private bool m_Enabled = false;
public string Name public string Name
@ -41,7 +49,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.User
get { return "RemoteUserServicesConnector"; } get { return "RemoteUserServicesConnector"; }
} }
public void Initialise(IConfigSource source) public override void Initialise(IConfigSource source)
{ {
IConfig moduleConfig = source.Configs["Modules"]; IConfig moduleConfig = source.Configs["Modules"];
if (moduleConfig != null) if (moduleConfig != null)
@ -49,7 +57,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.User
string name = moduleConfig.GetString("UserServices", ""); string name = moduleConfig.GetString("UserServices", "");
if (name == Name) 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; 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) if (!m_Enabled)
return; return;
scene.RegisterModuleInterface<IUserDataService>(this);
} }
public void RemoveRegion(Scene scene) public void RemoveRegion(Scene scene)

View File

@ -35,7 +35,7 @@ namespace OpenSim.Services.Interfaces
public string FirstName; public string FirstName;
public string LastName; public string LastName;
public UUID UserID; public UUID UserID;
public UUID scopeID; public UUID ScopeID;
// For informational purposes only! // For informational purposes only!
// //
@ -59,7 +59,7 @@ namespace OpenSim.Services.Interfaces
public string AccountType; public string AccountType;
}; };
public interface IUserService public interface IUserDataService
{ {
UserData GetUserData(UUID scopeID, UUID userID); UserData GetUserData(UUID scopeID, UUID userID);
UserData GetUserData(UUID scopeID, string FirstName, string LastName); 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 // Returns the list of avatars that matches both the search
// criterion and the scope ID passed // criterion and the scope ID passed
// ONLY THE NAME, SCOPE ID and UUID will be filled in!
// //
List<UserData> GetAvatarPickerData(UUID scopeID, string query); List<UserData> GetAvatarPickerData(UUID scopeID, string query);
} }

View File

@ -35,7 +35,7 @@ using OpenMetaverse;
namespace OpenSim.Services.UserService namespace OpenSim.Services.UserService
{ {
public class UserService : UserServiceBase, IUserService public class UserService : UserServiceBase, IUserDataService
{ {
public UserService(IConfigSource config) : base(config) public UserService(IConfigSource config) : base(config)
{ {