From 1c76ea281ffdcf39e12b9236d5ef5bca9634e0ca Mon Sep 17 00:00:00 2001 From: mindtriggerz Date: Sun, 5 Nov 2006 01:51:29 +0000 Subject: [PATCH] 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 --- libsecondlife-cs/Avatar.cs | 2 ++ libsecondlife-cs/AvatarManager.cs | 35 +++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/libsecondlife-cs/Avatar.cs b/libsecondlife-cs/Avatar.cs index 8bd0ad99..4413bc6c 100644 --- a/libsecondlife-cs/Avatar.cs +++ b/libsecondlife-cs/Avatar.cs @@ -150,6 +150,8 @@ namespace libsecondlife public string LanguagesText; public TextureEntry Textures; + + public string ProfileURL; } /// diff --git a/libsecondlife-cs/AvatarManager.cs b/libsecondlife-cs/AvatarManager.cs index 8f6a05a9..2d5453aa 100644 --- a/libsecondlife-cs/AvatarManager.cs +++ b/libsecondlife-cs/AvatarManager.cs @@ -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); + } + /// /// 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.