aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs
diff options
context:
space:
mode:
authorMaster ScienceSim2010-09-29 17:18:39 -0700
committerJohn Hurliman2010-09-30 09:59:53 -0700
commit9c6a591ad0080e3664f04161906fa376df7b996d (patch)
tree61da5a3419eff0b4d38caf3ec927821f4f21fd70 /OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs
parentPrevent dropping someone else's attachments (diff)
downloadopensim-SC_OLD-9c6a591ad0080e3664f04161906fa376df7b996d.zip
opensim-SC_OLD-9c6a591ad0080e3664f04161906fa376df7b996d.tar.gz
opensim-SC_OLD-9c6a591ad0080e3664f04161906fa376df7b996d.tar.bz2
opensim-SC_OLD-9c6a591ad0080e3664f04161906fa376df7b996d.tar.xz
couple fixes to enable profiles in simian connector
Diffstat (limited to 'OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs')
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs38
1 files changed, 33 insertions, 5 deletions
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs
index 0ef4974..6aefc38 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs
@@ -77,8 +77,23 @@ namespace OpenSim.Services.Connectors.SimianGrid
77 77
78 public SimianProfiles() { } 78 public SimianProfiles() { }
79 public string Name { get { return "SimianProfiles"; } } 79 public string Name { get { return "SimianProfiles"; } }
80 public void AddRegion(Scene scene) { if (m_Enabled) { CheckEstateManager(scene); scene.EventManager.OnClientConnect += ClientConnectHandler; } } 80
81 public void RemoveRegion(Scene scene) { if (m_Enabled) { scene.EventManager.OnClientConnect -= ClientConnectHandler; } } 81 public void AddRegion(Scene scene)
82 {
83 if (m_Enabled)
84 {
85 CheckEstateManager(scene);
86 scene.EventManager.OnClientConnect += ClientConnectHandler;
87 }
88 }
89
90 public void RemoveRegion(Scene scene)
91 {
92 if (m_Enabled)
93 {
94 scene.EventManager.OnClientConnect -= ClientConnectHandler;
95 }
96 }
82 97
83 #endregion INonSharedRegionModule 98 #endregion INonSharedRegionModule
84 99
@@ -89,13 +104,16 @@ namespace OpenSim.Services.Connectors.SimianGrid
89 104
90 public void Initialise(IConfigSource source) 105 public void Initialise(IConfigSource source)
91 { 106 {
92 IConfig profileConfig = source.Configs["Profile"]; 107 IConfig profileConfig = source.Configs["Profiles"];
93 if (profileConfig == null) 108 if (profileConfig == null)
94 return; 109 return;
95 110
96 if (profileConfig.GetString("Module", String.Empty) != Name) 111 if (profileConfig.GetString("Module", String.Empty) != Name)
97 return; 112 return;
98 113
114 m_log.DebugFormat("[SIMIAN PROFILES] module enabled");
115 m_Enabled = true;
116
99 IConfig gridConfig = source.Configs["UserAccountService"]; 117 IConfig gridConfig = source.Configs["UserAccountService"];
100 if (gridConfig != null) 118 if (gridConfig != null)
101 { 119 {
@@ -265,6 +283,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
265 283
266 private void RequestAvatarPropertiesHandler(IClientAPI client, UUID avatarID) 284 private void RequestAvatarPropertiesHandler(IClientAPI client, UUID avatarID)
267 { 285 {
286 m_log.DebugFormat("[SIMIAN PROFILES]: Request avatar properties for {0}",avatarID);
287
268 OSDMap user = FetchUserData(avatarID); 288 OSDMap user = FetchUserData(avatarID);
269 289
270 ProfileFlags flags = ProfileFlags.AllowPublish | ProfileFlags.MaturePublish; 290 ProfileFlags flags = ProfileFlags.AllowPublish | ProfileFlags.MaturePublish;
@@ -274,8 +294,14 @@ namespace OpenSim.Services.Connectors.SimianGrid
274 OSDMap about = null; 294 OSDMap about = null;
275 if (user.ContainsKey("LLAbout")) 295 if (user.ContainsKey("LLAbout"))
276 { 296 {
277 try { about = OSDParser.DeserializeJson(user["LLAbout"].AsString()) as OSDMap; } 297 try
278 catch { } 298 {
299 about = OSDParser.DeserializeJson(user["LLAbout"].AsString()) as OSDMap;
300 }
301 catch
302 {
303 m_log.WarnFormat("[SIMIAN PROFILES]: Unable to decode LLAbout");
304 }
279 } 305 }
280 306
281 if (about == null) 307 if (about == null)
@@ -428,6 +454,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
428 454
429 private OSDMap FetchUserData(UUID userID) 455 private OSDMap FetchUserData(UUID userID)
430 { 456 {
457 m_log.DebugFormat("[SIMIAN PROFILES]: Fetch information about {0}",userID);
458
431 NameValueCollection requestArgs = new NameValueCollection 459 NameValueCollection requestArgs = new NameValueCollection
432 { 460 {
433 { "RequestMethod", "GetUser" }, 461 { "RequestMethod", "GetUser" },