diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs index 56c73ec..deb8695 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs | |||
@@ -55,6 +55,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
55 | 55 | ||
56 | private string m_serverUrl = String.Empty; | 56 | private string m_serverUrl = String.Empty; |
57 | private ExpiringCache<UUID, UserAccount> m_accountCache; | 57 | private ExpiringCache<UUID, UserAccount> m_accountCache; |
58 | private bool m_Enabled = false; | ||
58 | 59 | ||
59 | #region ISharedRegionModule | 60 | #region ISharedRegionModule |
60 | 61 | ||
@@ -65,8 +66,8 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
65 | 66 | ||
66 | public SimianUserAccountServiceConnector() { } | 67 | public SimianUserAccountServiceConnector() { } |
67 | public string Name { get { return "SimianUserAccountServiceConnector"; } } | 68 | public string Name { get { return "SimianUserAccountServiceConnector"; } } |
68 | public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface<IUserAccountService>(this); } } | 69 | public void AddRegion(Scene scene) { if (m_Enabled) { scene.RegisterModuleInterface<IUserAccountService>(this); } } |
69 | public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface<IUserAccountService>(this); } } | 70 | public void RemoveRegion(Scene scene) { if (m_Enabled) { scene.UnregisterModuleInterface<IUserAccountService>(this); } } |
70 | 71 | ||
71 | #endregion ISharedRegionModule | 72 | #endregion ISharedRegionModule |
72 | 73 | ||
@@ -77,24 +78,28 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
77 | 78 | ||
78 | public void Initialise(IConfigSource source) | 79 | public void Initialise(IConfigSource source) |
79 | { | 80 | { |
80 | if (Simian.IsSimianEnabled(source, "UserAccountServices", this.Name)) | 81 | IConfig moduleConfig = source.Configs["Modules"]; |
82 | if (moduleConfig != null) | ||
81 | { | 83 | { |
82 | IConfig assetConfig = source.Configs["UserAccountService"]; | 84 | string name = moduleConfig.GetString("UserAccountServices", ""); |
83 | if (assetConfig == null) | 85 | if (name == Name) |
84 | { | 86 | { |
85 | m_log.Error("[SIMIAN ACCOUNT CONNECTOR]: UserAccountService missing from OpenSim.ini"); | 87 | IConfig gridConfig = source.Configs["UserAccountService"]; |
86 | throw new Exception("User account connector init error"); | 88 | if (gridConfig != null) |
87 | } | 89 | { |
90 | string serviceUrl = gridConfig.GetString("UserAccountServerURI"); | ||
91 | if (!String.IsNullOrEmpty(serviceUrl)) | ||
92 | { | ||
93 | if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) | ||
94 | serviceUrl = serviceUrl + '/'; | ||
95 | m_serverUrl = serviceUrl; | ||
96 | m_Enabled = true; | ||
97 | } | ||
98 | } | ||
88 | 99 | ||
89 | string serviceURI = assetConfig.GetString("UserAccountServerURI"); | 100 | if (String.IsNullOrEmpty(m_serverUrl)) |
90 | if (String.IsNullOrEmpty(serviceURI)) | 101 | m_log.Info("[SIMIAN ACCOUNT CONNECTOR]: No UserAccountServerURI specified, disabling connector"); |
91 | { | ||
92 | m_log.Error("[SIMIAN ACCOUNT CONNECTOR]: No UserAccountServerURI in section UserAccountService, skipping SimianUserAccountServiceConnector"); | ||
93 | throw new Exception("User account connector init error"); | ||
94 | } | 102 | } |
95 | |||
96 | m_accountCache = new ExpiringCache<UUID, UserAccount>(); | ||
97 | m_serverUrl = serviceURI; | ||
98 | } | 103 | } |
99 | } | 104 | } |
100 | 105 | ||