Ejemplo n.º 1
0
        public bool UpdateUserProfile(IUserProfileInfo Profile)
        {
            NameValueCollection requestArgs = new NameValueCollection
            {
                { "RequestMethod", "AddUserData" },
                { "AgentID", Profile.PrincipalID.ToString() },
                { "Profile", OSDParser.SerializeJsonString(Util.DictionaryToOSD(Profile.ToKeyValuePairs())) }
            };

            OSDMap result = PostData(Profile.PrincipalID, requestArgs);

            if (result == null)
                return false;

            bool success = result["Success"].AsBoolean();
            return success;
        }
Ejemplo n.º 2
0
        public void CreateNewProfile(UUID AgentID)
		{
			List<object> values = new List<object>();
            values.Add(AgentID.ToString()); //ID
            values.Add("LLProfile"); //Key
            IUserProfileInfo profile = new IUserProfileInfo();
            profile.PrincipalID = AgentID;
            values.Add(OSDParser.SerializeLLSDXmlString(Util.DictionaryToOSD(profile.ToKeyValuePairs()))); //Value which is a default Profile
			GD.Insert("userdata", values.ToArray());
		}
Ejemplo n.º 3
0
        public bool UpdateUserProfile(IUserProfileInfo Profile)
        {
            Dictionary<string, object> sendData = Profile.ToKeyValuePairs();

            sendData["PRINCIPALID"] = Profile.PrincipalID.ToString();
            sendData["METHOD"] = "updateprofile";

            string reqString = WebUtils.BuildXmlResponse(sendData);

            try
            {
                foreach (string m_ServerURI in m_ServerURIs)
                {
                    string reply = SynchronousRestFormsRequester.MakeRequest("POST",
                        m_ServerURI + "/auroradata",
                        reqString);
                    if (reply != string.Empty)
                    {
                        Dictionary<string, object> replyData = WebUtils.ParseXmlResponse(reply);

                        if (replyData != null)
                        {
                            if (replyData.ContainsKey("result") && (replyData["result"].ToString().ToLower() == "null"))
                            {
                                m_log.DebugFormat("[AuroraRemoteProfileConnector]: UpdateProfile {0} received null response",
                                    Profile.PrincipalID);
                                return false;
                            }
                        }

                        else
                        {
                            m_log.DebugFormat("[AuroraRemoteProfileConnector]: UpdateProfile {0} received null response",
                                Profile.PrincipalID);
                            return false;
                        }

                    }
                }
                return true;
            }
            catch (Exception e)
            {
                m_log.DebugFormat("[AuroraRemoteProfileConnector]: Exception when contacting server: {0}", e.ToString());
            }
            return false;
        }