mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 04:05:42 +08:00
use UserProfileProperties instead of obsolete UserProfileData
This commit is contained in:
@@ -8582,17 +8582,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
return;
|
||||
|
||||
AvatarPropertiesUpdatePacket.PropertiesDataBlock Properties = avatarProps.PropertiesData;
|
||||
UserProfileData UserProfile = new UserProfileData();
|
||||
UserProfile.ID = m_agentId;
|
||||
UserProfile.AboutText = Utils.BytesToString(Properties.AboutText);
|
||||
UserProfile.FirstLifeAboutText = Utils.BytesToString(Properties.FLAboutText);
|
||||
UserProfile.FirstLifeImage = Properties.FLImageID;
|
||||
UserProfile.Image = Properties.ImageID;
|
||||
UserProfile.ProfileUrl = Utils.BytesToString(Properties.ProfileURL);
|
||||
UserProfile.UserFlags &= ~3;
|
||||
UserProfile.UserFlags |= Properties.AllowPublish ? 1 : 0;
|
||||
UserProfile.UserFlags |= Properties.MaturePublish ? 2 : 0;
|
||||
|
||||
UserProfileProperties UserProfile = new UserProfileProperties
|
||||
{
|
||||
UserId = AgentId,
|
||||
WebUrl = Utils.BytesToString(Properties.ProfileURL),
|
||||
ImageId = Properties.ImageID,
|
||||
FirstLifeImageId = Properties.FLImageID,
|
||||
AboutText = Utils.BytesToString(Properties.AboutText),
|
||||
FirstLifeText = Utils.BytesToString(Properties.FLAboutText),
|
||||
PublishProfile = Properties.AllowPublish,
|
||||
PublishMature = Properties.MaturePublish
|
||||
};
|
||||
OnUpdateAvatarProperties?.Invoke(this, UserProfile);
|
||||
}
|
||||
|
||||
|
||||
@@ -1463,7 +1463,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
||||
uce.props = null;
|
||||
}
|
||||
}
|
||||
|
||||
RequestAvatarProperties(remoteClient, remoteClient.AgentId);
|
||||
}
|
||||
|
||||
public void RequestAvatarProperties(IClientAPI remoteClient, UUID avatarID)
|
||||
@@ -1672,46 +1672,33 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
||||
/// <param name='newProfile'>
|
||||
/// New profile.
|
||||
/// </param>
|
||||
public void AvatarPropertiesUpdate(IClientAPI remoteClient, UserProfileData newProfile)
|
||||
public void AvatarPropertiesUpdate(IClientAPI remoteClient, UserProfileProperties newProfile)
|
||||
{
|
||||
if (remoteClient.AgentId == newProfile.ID)
|
||||
GetUserProfileServerURI(remoteClient.AgentId, out string serverURI);
|
||||
if (string.IsNullOrWhiteSpace(serverURI))
|
||||
return;
|
||||
|
||||
if (!m_allowUserProfileWebURLs)
|
||||
newProfile.WebUrl = string.Empty;
|
||||
|
||||
object Prop = newProfile;
|
||||
if(!rpc.JsonRpcRequest(ref Prop, "avatar_properties_update", serverURI, UUID.Random().ToString()))
|
||||
{
|
||||
UserProfileProperties prop = new UserProfileProperties();
|
||||
|
||||
prop.UserId = remoteClient.AgentId;
|
||||
prop.WebUrl = newProfile.ProfileUrl;
|
||||
prop.ImageId = newProfile.Image;
|
||||
prop.AboutText = newProfile.AboutText;
|
||||
prop.FirstLifeImageId = newProfile.FirstLifeImage;
|
||||
prop.FirstLifeText = newProfile.FirstLifeAboutText;
|
||||
|
||||
if(!m_allowUserProfileWebURLs)
|
||||
prop.WebUrl ="";
|
||||
|
||||
string serverURI = string.Empty;
|
||||
GetUserProfileServerURI(remoteClient.AgentId, out serverURI);
|
||||
|
||||
object Prop = prop;
|
||||
|
||||
if(!rpc.JsonRpcRequest(ref Prop, "avatar_properties_update", serverURI, UUID.Random().ToString()))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage(
|
||||
"Error updating properties", false);
|
||||
return;
|
||||
}
|
||||
|
||||
// flush cache
|
||||
UserProfileCacheEntry uce = null;
|
||||
lock(m_profilesCache)
|
||||
{
|
||||
if(m_profilesCache.TryGetValue(remoteClient.AgentId, out uce) && uce != null)
|
||||
{
|
||||
uce.props = null;
|
||||
}
|
||||
}
|
||||
|
||||
RequestAvatarProperties(remoteClient, newProfile.ID);
|
||||
remoteClient.SendAgentAlertMessage("Error updating properties", false);
|
||||
return;
|
||||
}
|
||||
|
||||
// flush cache
|
||||
UserProfileCacheEntry uce = null;
|
||||
lock(m_profilesCache)
|
||||
{
|
||||
if(m_profilesCache.TryGetValue(remoteClient.AgentId, out uce) && uce != null)
|
||||
{
|
||||
uce.props = null;
|
||||
}
|
||||
}
|
||||
|
||||
RequestAvatarProperties(remoteClient, remoteClient.AgentId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user