Added ProfileURL field to Avatar, added UpdateAvatar(Avatar a) to AvatarManager for updating profiles. (Hi AdamZaius!)

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@505 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
mindtriggerz
2006-11-05 01:51:29 +00:00
parent 2a5efb7adb
commit 1c76ea281f
2 changed files with 37 additions and 0 deletions

View File

@@ -150,6 +150,8 @@ namespace libsecondlife
public string LanguagesText;
public TextureEntry Textures;
public string ProfileURL;
}
/// <summary>

View File

@@ -97,6 +97,40 @@ namespace libsecondlife
return Avatars.ContainsKey(id);
}
public void UpdateAvatar(Avatar a)
{
//Basic profile properties
AvatarPropertiesUpdatePacket apup = new AvatarPropertiesUpdatePacket();
AvatarPropertiesUpdatePacket.AgentDataBlock adb = new AvatarPropertiesUpdatePacket.AgentDataBlock();
adb.AgentID = a.ID;
adb.SessionID = Client.Network.SessionID;
apup.AgentData = adb;
AvatarPropertiesUpdatePacket.PropertiesDataBlock pdb = new AvatarPropertiesUpdatePacket.PropertiesDataBlock();
pdb.AllowPublish = a.AllowPublish;
pdb.FLAboutText = Helpers.StringToField(a.FirstLifeText);
pdb.FLImageID = a.FirstLifeImage;
pdb.ImageID = a.ProfileImage;
pdb.MaturePublish = a.MaturePublish;
pdb.ProfileURL = Helpers.StringToField(a.ProfileURL);
apup.PropertiesData = pdb;
//Intrests
AvatarInterestsUpdatePacket aiup = new AvatarInterestsUpdatePacket();
AvatarInterestsUpdatePacket.AgentDataBlock iadb = new AvatarInterestsUpdatePacket.AgentDataBlock();
iadb.AgentID = a.ID;
iadb.SessionID = Client.Network.SessionID;
aiup.AgentData = iadb;
AvatarInterestsUpdatePacket.PropertiesDataBlock ipdb = new AvatarInterestsUpdatePacket.PropertiesDataBlock();
ipdb.LanguagesText = Helpers.StringToField(a.LanguagesText);
ipdb.SkillsMask = a.SkillsMask;
ipdb.SkillsText = Helpers.StringToField(a.SkillsText);
ipdb.WantToMask = a.WantToMask;
ipdb.WantToText = Helpers.StringToField(a.WantToText);
aiup.PropertiesData = ipdb;
//Send packets
Client.Network.SendPacket(apup);
Client.Network.SendPacket(aiup);
}
/// <summary>
/// This function will only check if the avatar name exists locally,
/// it will not do any networking calls to fetch the name
@@ -341,6 +375,7 @@ namespace libsecondlife
av.MaturePublish = reply.PropertiesData.MaturePublish;
av.Identified = reply.PropertiesData.Identified;
av.Transacted = reply.PropertiesData.Transacted;
av.ProfileURL = Helpers.FieldToString(reply.PropertiesData.ProfileURL);
//reassign in the cache
Avatars[av.ID] = av;
//Heaven forbid that we actually get a packet we didn't ask for.