29 using System.Collections.Generic;
30 using System.Reflection;
34 using OpenSim.Region.Framework.Interfaces;
35 using OpenSim.Region.Framework.Scenes;
36 using OpenSim.Server.Base;
37 using OpenSim.Services.Interfaces;
41 namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
43 [Extension(Path =
"/OpenSim/RegionModules", NodeName =
"RegionModule", Id =
"LocalUserAccountServicesConnector")]
46 private static readonly ILog m_log =
48 MethodBase.GetCurrentMethod().DeclaringType);
58 private bool m_Enabled =
false;
60 #region ISharedRegionModule
62 public Type ReplaceableInterface
69 get {
return "LocalUserAccountServicesConnector"; }
74 IConfig moduleConfig = source.Configs[
"Modules"];
75 if (moduleConfig != null)
77 string name = moduleConfig.GetString(
"UserAccountServices",
"");
80 IConfig userConfig = source.Configs[
"UserAccountService"];
81 if (userConfig == null)
83 m_log.Error(
"[LOCAL USER ACCOUNT SERVICE CONNECTOR]: UserAccountService missing from OpenSim.ini");
87 string serviceDll = userConfig.GetString(
"LocalServiceModule", String.Empty);
89 if (serviceDll ==
String.Empty)
91 m_log.Error(
"[LOCAL USER ACCOUNT SERVICE CONNECTOR]: No LocalServiceModule named in section UserService");
98 if (UserAccountService == null)
101 "[LOCAL USER ACCOUNT SERVICE CONNECTOR]: Cannot load user account service specified as {0}", serviceDll);
107 m_log.Info(
"[LOCAL USER ACCOUNT SERVICE CONNECTOR]: Local user connector enabled");
146 m_log.InfoFormat(
"[LOCAL USER ACCOUNT SERVICE CONNECTOR]: Enabled local user accounts for region {0}", scene.RegionInfo.RegionName);
151 #region IUserAccountService
155 bool inCache =
false;
156 UserAccount account = m_Cache.Get(userID, out inCache);
160 account = UserAccountService.GetUserAccount(scopeID, userID);
161 m_Cache.Cache(userID, account);
168 bool inCache =
false;
169 UserAccount account = m_Cache.Get(firstName +
" " + lastName, out inCache);
173 account = UserAccountService.GetUserAccount(scopeID, firstName, lastName);
175 m_Cache.Cache(account.PrincipalID, account);
182 return UserAccountService.GetUserAccount(scopeID, Email);
192 return UserAccountService.GetUserAccounts(scopeID, query);
199 bool ret = UserAccountService.StoreUserAccount(data);
201 m_Cache.Cache(data.PrincipalID, data);
207 m_Cache.Invalidate(userID);
void RemoveRegion(Scene scene)
This is called whenever a Scene is removed. For shared modules, this can happen several times...
void AddRegion(Scene scene)
This is called whenever a Scene is added. For shared modules, this can happen several times...
List< UserAccount > GetUserAccountsWhere(UUID scopeID, string query)
UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName)
List< UserAccount > GetUserAccounts(UUID scopeID, string query)
Returns the list of avatars that matches both the search criterion and the scope ID passed ...
void Initialise(IConfigSource source)
This is called to initialize the region module. For shared modules, this is called exactly once...
UserAccount GetUserAccount(UUID scopeID, UUID userID)
void PostInitialise()
This is called exactly once after all the shared region-modules have been instanciated and IRegionMod...
void Close()
This is the inverse to Initialise. After a Close(), this instance won't be usable anymore...
void RegionLoaded(Scene scene)
This will be called once for every scene loaded. In a shared module this will be multiple times in on...
void InvalidateCache(UUID userID)
bool StoreUserAccount(UserAccount data)
Store the data given, wich replaces the stored data, therefore must be complete.
Interactive OpenSim region server
UserAccount GetUserAccount(UUID scopeID, string Email)