Add reference to the profile module in the avatar profiles handler, plus

an example of how to override legacy core data with data retrieved from
the profile module
arthursv
Melanie 2009-08-13 13:19:12 +01:00
parent 94dfe2a20d
commit 0f3f2e1dc0
1 changed files with 8 additions and 0 deletions

View File

@ -41,6 +41,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Profiles
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private Scene m_scene;
private IProfileModule m_profileModule = null;
public AvatarProfilesModule()
{
@ -56,6 +57,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Profiles
public void PostInitialise()
{
m_profileModule = scene.RequestModuleInterface<IProfileModule>();
}
public void Close()
@ -108,6 +110,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Profiles
charterMember = Utils.StringToBytes(profile.CustomType);
}
if (m_profileModule != null)
{
Hashtable profileData = m_profileModule.GetProfileData(remoteClient.AgentId);
if (profileData["ProfileUrl"] != null)
profile.ProfileUrl = profileData["ProfileUrl"].ToString();
}
remoteClient.SendAvatarProperties(profile.ID, profile.AboutText,
Util.ToDateTime(profile.Created).ToString("M/d/yyyy", CultureInfo.InvariantCulture),
charterMember, profile.FirstLifeAboutText, (uint)(profile.UserFlags & 0xff),