/// <summary> /// Create a new profile for a user /// </summary> /// <param name="AgentID"></param> //[CanBeReflected(ThreatLevel = ThreatLevel.Full)] public void CreateNewProfile(UUID AgentID) { /*object remoteValue = DoRemote(AgentID); if (remoteValue != null || m_doRemoteOnly) return;*/ List<object> values = new List<object> {AgentID.ToString(), "LLProfile"}; //Create a new basic profile for them IUserProfileInfo profile = new IUserProfileInfo {PrincipalID = AgentID}; values.Add(OSDParser.SerializeLLSDXmlString(profile.ToOSD())); //Value which is a default Profile GD.Insert(m_userProfileTable, values.ToArray()); }
public bool UpdateUserProfile(IUserProfileInfo Profile) { if (m_doRemoteOnly) { object remoteValue = DoRemote (Profile); return remoteValue != null && (bool)remoteValue; } IUserProfileInfo previousProfile = GetUserProfile(Profile.PrincipalID); //Make sure the previous one exists if (previousProfile == null) return false; //Now fix values that the sim cannot change Profile.Partner = previousProfile.Partner; Profile.CustomType = previousProfile.CustomType; Profile.MembershipGroup = previousProfile.MembershipGroup; Profile.Created = previousProfile.Created; Dictionary<string, object> values = new Dictionary<string, object>(1); values["Value"] = OSDParser.SerializeLLSDXmlString(Profile.ToOSD()); QueryFilter filter = new QueryFilter(); filter.andFilters["ID"] = Profile.PrincipalID.ToString(); filter.andFilters["`Key`"] = "LLProfile"; //Update cache lock(UserProfilesCache) UserProfilesCache[Profile.PrincipalID] = Profile; return GD.Update(m_userProfileTable, values, null, filter, null, null); }