Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim

viewer-2-initial-appearance
Melanie 2010-10-01 05:42:42 +01:00
commit 2427e16b42
1 changed files with 33 additions and 5 deletions

View File

@ -77,8 +77,23 @@ namespace OpenSim.Services.Connectors.SimianGrid
public SimianProfiles() { } public SimianProfiles() { }
public string Name { get { return "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 #endregion INonSharedRegionModule
@ -89,13 +104,16 @@ namespace OpenSim.Services.Connectors.SimianGrid
public void Initialise(IConfigSource source) public void Initialise(IConfigSource source)
{ {
IConfig profileConfig = source.Configs["Profile"]; IConfig profileConfig = source.Configs["Profiles"];
if (profileConfig == null) if (profileConfig == null)
return; return;
if (profileConfig.GetString("Module", String.Empty) != Name) if (profileConfig.GetString("Module", String.Empty) != Name)
return; return;
m_log.DebugFormat("[SIMIAN PROFILES] module enabled");
m_Enabled = true;
IConfig gridConfig = source.Configs["UserAccountService"]; IConfig gridConfig = source.Configs["UserAccountService"];
if (gridConfig != null) if (gridConfig != null)
{ {
@ -265,6 +283,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
private void RequestAvatarPropertiesHandler(IClientAPI client, UUID avatarID) private void RequestAvatarPropertiesHandler(IClientAPI client, UUID avatarID)
{ {
m_log.DebugFormat("[SIMIAN PROFILES]: Request avatar properties for {0}",avatarID);
OSDMap user = FetchUserData(avatarID); OSDMap user = FetchUserData(avatarID);
ProfileFlags flags = ProfileFlags.AllowPublish | ProfileFlags.MaturePublish; ProfileFlags flags = ProfileFlags.AllowPublish | ProfileFlags.MaturePublish;
@ -274,8 +294,14 @@ namespace OpenSim.Services.Connectors.SimianGrid
OSDMap about = null; OSDMap about = null;
if (user.ContainsKey("LLAbout")) if (user.ContainsKey("LLAbout"))
{ {
try { about = OSDParser.DeserializeJson(user["LLAbout"].AsString()) as OSDMap; } try
catch { } {
about = OSDParser.DeserializeJson(user["LLAbout"].AsString()) as OSDMap;
}
catch
{
m_log.WarnFormat("[SIMIAN PROFILES]: Unable to decode LLAbout");
}
} }
if (about == null) if (about == null)
@ -428,6 +454,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
private OSDMap FetchUserData(UUID userID) private OSDMap FetchUserData(UUID userID)
{ {
m_log.DebugFormat("[SIMIAN PROFILES]: Fetch information about {0}",userID);
NameValueCollection requestArgs = new NameValueCollection NameValueCollection requestArgs = new NameValueCollection
{ {
{ "RequestMethod", "GetUser" }, { "RequestMethod", "GetUser" },