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.AgentPreferences
43 [Extension(Path =
"/OpenSim/RegionModules", NodeName =
"RegionModule", Id =
"LocalAgentPreferencesServicesConnector")]
46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
49 private bool m_Enabled =
false;
51 #region ISharedRegionModule
53 public Type ReplaceableInterface
60 get {
return "LocalAgentPreferencesServicesConnector"; }
65 IConfig moduleConfig = source.Configs[
"Modules"];
66 if (moduleConfig != null)
68 string name = moduleConfig.GetString(
"AgentPreferencesServices",
"");
71 IConfig userConfig = source.Configs[
"AgentPreferencesService"];
72 if (userConfig == null)
74 m_log.Error(
"[AGENT PREFERENCES CONNECTOR]: AgentPreferencesService missing from OpenSim.ini");
78 string serviceDll = userConfig.GetString(
"LocalServiceModule", String.Empty);
80 if (
String.IsNullOrEmpty(serviceDll))
82 m_log.Error(
"[AGENT PREFERENCES CONNECTOR]: No AgentPreferencesModule named in section AgentPreferencesService");
89 if (m_AgentPreferencesService == null)
91 m_log.Error(
"[AGENT PREFERENCES CONNECTOR]: Can't load agent preferences service");
95 m_log.Info(
"[AGENT PREFERENCES CONNECTOR]: Local agent preferences connector enabled");
132 #endregion ISharedRegionModule
134 #region IAgentPreferencesService
138 return m_AgentPreferencesService.GetAgentPreferences(principalID);
143 return m_AgentPreferencesService.StoreAgentPreferences(data);
148 return m_AgentPreferencesService.GetLang(principalID);
151 #endregion IAgentPreferencesService
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...
void Close()
This is the inverse to Initialise. After a Close(), this instance won't be usable anymore...
void Initialise(IConfigSource source)
This is called to initialize the region module. For shared modules, this is called exactly once...
string GetLang(UUID principalID)
AgentPrefs GetAgentPreferences(UUID principalID)
void PostInitialise()
This is called exactly once after all the shared region-modules have been instanciated and IRegionMod...
bool StoreAgentPreferences(AgentPrefs data)
Interactive OpenSim region server
void RegionLoaded(Scene scene)
This will be called once for every scene loaded. In a shared module this will be multiple times in on...