mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
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
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user