From 9c6a591ad0080e3664f04161906fa376df7b996d Mon Sep 17 00:00:00 2001 From: Master ScienceSim Date: Wed, 29 Sep 2010 17:18:39 -0700 Subject: couple fixes to enable profiles in simian connector --- .../Connectors/SimianGrid/SimianProfiles.cs | 38 +++++++++++++++++++--- 1 file changed, 33 insertions(+), 5 deletions(-) (limited to 'OpenSim/Services') 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 public SimianProfiles() { } public string Name { get { return "SimianProfiles"; } } - public void AddRegion(Scene scene) { if (m_Enabled) { CheckEstateManager(scene); scene.EventManager.OnClientConnect += ClientConnectHandler; } } - public void RemoveRegion(Scene scene) { if (m_Enabled) { scene.EventManager.OnClientConnect -= ClientConnectHandler; } } + + public void AddRegion(Scene scene) + { + if (m_Enabled) + { + CheckEstateManager(scene); + scene.EventManager.OnClientConnect += ClientConnectHandler; + } + } + + public void RemoveRegion(Scene scene) + { + if (m_Enabled) + { + scene.EventManager.OnClientConnect -= ClientConnectHandler; + } + } #endregion INonSharedRegionModule @@ -89,13 +104,16 @@ namespace OpenSim.Services.Connectors.SimianGrid public void Initialise(IConfigSource source) { - IConfig profileConfig = source.Configs["Profile"]; + IConfig profileConfig = source.Configs["Profiles"]; if (profileConfig == null) return; if (profileConfig.GetString("Module", String.Empty) != Name) return; + m_log.DebugFormat("[SIMIAN PROFILES] module enabled"); + m_Enabled = true; + IConfig gridConfig = source.Configs["UserAccountService"]; if (gridConfig != null) { @@ -265,6 +283,8 @@ namespace OpenSim.Services.Connectors.SimianGrid private void RequestAvatarPropertiesHandler(IClientAPI client, UUID avatarID) { + m_log.DebugFormat("[SIMIAN PROFILES]: Request avatar properties for {0}",avatarID); + OSDMap user = FetchUserData(avatarID); ProfileFlags flags = ProfileFlags.AllowPublish | ProfileFlags.MaturePublish; @@ -274,8 +294,14 @@ namespace OpenSim.Services.Connectors.SimianGrid OSDMap about = null; if (user.ContainsKey("LLAbout")) { - try { about = OSDParser.DeserializeJson(user["LLAbout"].AsString()) as OSDMap; } - catch { } + try + { + about = OSDParser.DeserializeJson(user["LLAbout"].AsString()) as OSDMap; + } + catch + { + m_log.WarnFormat("[SIMIAN PROFILES]: Unable to decode LLAbout"); + } } if (about == null) @@ -428,6 +454,8 @@ namespace OpenSim.Services.Connectors.SimianGrid private OSDMap FetchUserData(UUID userID) { + m_log.DebugFormat("[SIMIAN PROFILES]: Fetch information about {0}",userID); + NameValueCollection requestArgs = new NameValueCollection { { "RequestMethod", "GetUser" }, -- cgit v1.1