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); }
private void AvatarPropertiesUpdateHandler(Packet packet, LLAgent agent) { AvatarPropertiesUpdatePacket update = (AvatarPropertiesUpdatePacket)packet; User user; if (m_userClient != null && m_userClient.TryGetUser(agent.ID, out user)) { OSDMap updates = new OSDMap { { "About", OSD.FromString(Utils.BytesToString(update.PropertiesData.AboutText)) }, { "AllowPublish", OSD.FromBoolean(update.PropertiesData.AllowPublish) }, { "FLAbout", OSD.FromString(Utils.BytesToString(update.PropertiesData.FLAboutText)) }, { "FLImage", OSD.FromUUID(update.PropertiesData.FLImageID) }, { "Image", OSD.FromUUID(update.PropertiesData.ImageID) }, { "AllowMaturePublish", OSD.FromBoolean(update.PropertiesData.MaturePublish) }, { "URL", OSD.FromString(Utils.BytesToString(update.PropertiesData.ProfileURL)) } }; m_userClient.UpdateUserFields(agent.ID, updates); SendAvatarProperties(agent, agent.ID, user); } else { m_log.Warn("Could not find user " + agent.ID + ", not updating profile for " + agent.Name); SendAvatarProperties(agent, agent.ID, null); } }
public void updateProfile(string img, string rlimg, string about, string rlabout, string web) { AvatarPropertiesUpdatePacket up = new AvatarPropertiesUpdatePacket(); up.AgentData = new AvatarPropertiesUpdatePacket.AgentDataBlock(); up.AgentData.AgentID = frame.AgentID; up.AgentData.SessionID = frame.SessionID; up.PropertiesData = new AvatarPropertiesUpdatePacket.PropertiesDataBlock(); up.PropertiesData.ImageID = UUID.Parse(img); up.PropertiesData.FLImageID = UUID.Parse(rlimg); up.PropertiesData.AboutText = Utils.StringToBytes(about); up.PropertiesData.FLAboutText = Utils.StringToBytes(rlabout); up.PropertiesData.ProfileURL = Utils.StringToBytes(web); up.PropertiesData.MaturePublish = false; up.PropertiesData.AllowPublish = true; proxy.InjectPacket(up, Direction.Outgoing); }
/// <summary> /// Update agent profile /// </summary> /// <param name="profile"><seealso cref="OpenMetaverse.Avatar.AvatarProperties"/> struct containing updated /// profile information</param> public void UpdateProfile(Avatar.AvatarProperties profile) { AvatarPropertiesUpdatePacket apup = new AvatarPropertiesUpdatePacket(); apup.AgentData.AgentID = id; apup.AgentData.SessionID = sessionID; apup.PropertiesData.AboutText = Utils.StringToBytes(profile.AboutText); apup.PropertiesData.AllowPublish = profile.AllowPublish; apup.PropertiesData.FLAboutText = Utils.StringToBytes(profile.FirstLifeText); apup.PropertiesData.FLImageID = profile.FirstLifeImage; apup.PropertiesData.ImageID = profile.ProfileImage; apup.PropertiesData.MaturePublish = profile.MaturePublish; apup.PropertiesData.ProfileURL = Utils.StringToBytes(profile.ProfileURL); Client.Network.SendPacket(apup); }
/// <summary> /// Synchronize the local profile and interests information to the server /// </summary> public void SetAvatarInformation() { // Basic profile properties AvatarPropertiesUpdatePacket apup = new AvatarPropertiesUpdatePacket(); apup.AgentData.AgentID = this.ID; apup.AgentData.SessionID = Client.Network.SessionID; apup.PropertiesData.AboutText = Helpers.StringToField(this.ProfileProperties.AboutText); apup.PropertiesData.AllowPublish = this.ProfileProperties.AllowPublish; apup.PropertiesData.FLAboutText = Helpers.StringToField(this.ProfileProperties.FirstLifeText); apup.PropertiesData.FLImageID = this.ProfileProperties.FirstLifeImage; apup.PropertiesData.ImageID = this.ProfileProperties.ProfileImage; apup.PropertiesData.MaturePublish = this.ProfileProperties.MaturePublish; apup.PropertiesData.ProfileURL = Helpers.StringToField(this.ProfileProperties.ProfileURL); // Interests AvatarInterestsUpdatePacket aiup = new AvatarInterestsUpdatePacket(); aiup.AgentData.AgentID = this.ID; aiup.AgentData.SessionID = Client.Network.SessionID; aiup.PropertiesData.LanguagesText = Helpers.StringToField(this.ProfileInterests.LanguagesText); aiup.PropertiesData.SkillsMask = this.ProfileInterests.SkillsMask; aiup.PropertiesData.SkillsText = Helpers.StringToField(this.ProfileInterests.SkillsText); aiup.PropertiesData.WantToMask = this.ProfileInterests.WantToMask; aiup.PropertiesData.WantToText = Helpers.StringToField(this.ProfileInterests.WantToText); //Send packets Client.Network.SendPacket(apup); Client.Network.SendPacket(aiup); }