couple fixes to enable profiles in simian connector

viewer-2-initial-appearance
Master ScienceSim 2010-09-29 17:18:39 -07:00 committed by John Hurliman
parent eb58d91098
commit 9c6a591ad0
1 changed files with 33 additions and 5 deletions

View File

@ -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" },