aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs')
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs54
1 files changed, 19 insertions, 35 deletions
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs
index d30d880..0ef4974 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs
@@ -67,6 +67,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
67 MethodBase.GetCurrentMethod().DeclaringType); 67 MethodBase.GetCurrentMethod().DeclaringType);
68 68
69 private string m_serverUrl = String.Empty; 69 private string m_serverUrl = String.Empty;
70 private bool m_Enabled = false;
70 71
71 #region INonSharedRegionModule 72 #region INonSharedRegionModule
72 73
@@ -76,8 +77,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
76 77
77 public SimianProfiles() { } 78 public SimianProfiles() { }
78 public string Name { get { return "SimianProfiles"; } } 79 public string Name { get { return "SimianProfiles"; } }
79 public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { CheckEstateManager(scene); scene.EventManager.OnClientConnect += ClientConnectHandler; } } 80 public void AddRegion(Scene scene) { if (m_Enabled) { CheckEstateManager(scene); scene.EventManager.OnClientConnect += ClientConnectHandler; } }
80 public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.EventManager.OnClientConnect -= ClientConnectHandler; } } 81 public void RemoveRegion(Scene scene) { if (m_Enabled) { scene.EventManager.OnClientConnect -= ClientConnectHandler; } }
81 82
82 #endregion INonSharedRegionModule 83 #endregion INonSharedRegionModule
83 84
@@ -88,44 +89,27 @@ namespace OpenSim.Services.Connectors.SimianGrid
88 89
89 public void Initialise(IConfigSource source) 90 public void Initialise(IConfigSource source)
90 { 91 {
91 if (Simian.IsSimianEnabled(source, "UserAccountServices", "SimianUserAccountServiceConnector")) 92 IConfig profileConfig = source.Configs["Profile"];
92 { 93 if (profileConfig == null)
93 IConfig gridConfig = source.Configs["UserAccountService"]; 94 return;
94 if (gridConfig == null)
95 {
96 m_log.Error("[SIMIAN PROFILES]: UserAccountService missing from OpenSim.ini");
97 throw new Exception("Profiles init error");
98 }
99
100 string serviceUrl = gridConfig.GetString("UserAccountServerURI");
101 if (String.IsNullOrEmpty(serviceUrl))
102 {
103 m_log.Error("[SIMIAN PROFILES]: No UserAccountServerURI in section UserAccountService");
104 throw new Exception("Profiles init error");
105 }
106 95
107 if (!serviceUrl.EndsWith("/")) 96 if (profileConfig.GetString("Module", String.Empty) != Name)
108 serviceUrl = serviceUrl + '/'; 97 return;
109 98
110 m_serverUrl = serviceUrl; 99 IConfig gridConfig = source.Configs["UserAccountService"];
111 IConfig profilesConfig = source.Configs["Profiles"]; 100 if (gridConfig != null)
112 if (profilesConfig == null) 101 {
102 string serviceUrl = gridConfig.GetString("UserAccountServerURI");
103 if (!String.IsNullOrEmpty(serviceUrl))
113 { 104 {
114 // Do not run this module by default. 105 if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
115 return; 106 serviceUrl = serviceUrl + '/';
116 } 107 m_serverUrl = serviceUrl;
117 else
118 {
119 // if profiles aren't enabled, we're not needed.
120 // if we're not specified as the connector to use, then we're not wanted
121 if (profilesConfig.GetString("Module", String.Empty) != Name)
122 {
123
124 return;
125 }
126 m_log.InfoFormat("[SIMIAN ACCOUNT CONNECTOR]: Initializing {0}", this.Name);
127 } 108 }
128 } 109 }
110
111 if (String.IsNullOrEmpty(m_serverUrl))
112 m_log.Info("[SIMIAN PROFILES]: No UserAccountServerURI specified, disabling connector");
129 } 113 }
130 114
131 private void ClientConnectHandler(IClientCore clientCore) 115 private void ClientConnectHandler(IClientCore clientCore)