• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Framework.IUserProfileInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Aurora.Framework.IUserProfileInfo的典型用法代码示例。如果您正苦于以下问题:C# IUserProfileInfo类的具体用法?C# IUserProfileInfo怎么用?C# IUserProfileInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IUserProfileInfo类属于Aurora.Framework命名空间,在下文中一共展示了IUserProfileInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetUserProfile

        public IUserProfileInfo GetUserProfile(UUID PrincipalID)
        {
            try
            {
                List<string> serverURIs =
                    m_registry.RequestModuleInterface<IConfigurationService>().FindValueOf(PrincipalID.ToString(),
                                                                                           "RemoteServerURI");
                foreach (string url in serverURIs)
                {
                    OSDMap map = new OSDMap();
                    map["Method"] = "getprofile";
                    map["PrincipalID"] = PrincipalID;
                    OSDMap response = WebUtils.PostToService(url + "osd", map, true, true);
                    if (response["_Result"].Type == OSDType.Map)
                    {
                        OSDMap responsemap = (OSDMap) response["_Result"];
                        if (responsemap.Count == 0)
                            continue;
                        IUserProfileInfo info = new IUserProfileInfo();
                        info.FromOSD(responsemap);
                        return info;
                    }
                }
            }
            catch (Exception e)
            {
                MainConsole.Instance.DebugFormat("[AuroraRemoteProfileConnector]: Exception when contacting server: {0}", e);
            }

            return null;
        }
开发者ID:satlanski2,项目名称:Aurora-Sim,代码行数:31,代码来源:RemoteProfileConnector.cs


示例2: GetUserProfile

        /// <summary>
        /// Get a user's profile
        /// </summary>
        /// <param name="agentID"></param>
        /// <returns></returns>
		public IUserProfileInfo GetUserProfile(UUID agentID)
		{
			IUserProfileInfo UserProfile = new IUserProfileInfo();
            //Try from the user profile first before getting from the DB
            if (UserProfilesCache.TryGetValue(agentID, out UserProfile)) 
				return UserProfile;
            else 
            {
                UserProfile = new IUserProfileInfo();
                List<string> query = null;
                //Grab it from the almost generic interface
                query = GD.Query(new string[]{"ID", "`Key`"}, new object[]{agentID, "LLProfile"}, "userdata", "Value");
                
                if (query == null || query.Count == 0)
					return null;
                //Pull out the OSDmap
                OSDMap profile = (OSDMap)OSDParser.DeserializeLLSDXml(query[0]);
                UserProfile.FromOSD(profile);

				//Add to the cache
			    UserProfilesCache[agentID] = UserProfile;

				return UserProfile;
			}
		}
开发者ID:rknop,项目名称:Aurora-Sim,代码行数:30,代码来源:LocalProfileConnector.cs


示例3: UpdateUserProfile

        /// <summary>
        /// Update a user's profile (Note: this does not work if the user does not have a profile)
        /// </summary>
        /// <param name="Profile"></param>
        /// <returns></returns>
        public bool UpdateUserProfile(IUserProfileInfo Profile)
        {
            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;

            List<object> SetValues = new List<object>();
            List<string> SetRows = new List<string>();
            SetRows.Add("Value");
            SetValues.Add(OSDParser.SerializeLLSDXmlString(Profile.ToOSD()));

            List<object> KeyValue = new List<object>();
			List<string> KeyRow = new List<string>();
			KeyRow.Add("ID");
            KeyValue.Add(Profile.PrincipalID.ToString());
            KeyRow.Add("`Key`");
            KeyValue.Add("LLProfile");

            //Update cache
            UserProfilesCache[Profile.PrincipalID] = Profile;

            return GD.Update("userdata", SetValues.ToArray(), SetRows.ToArray(), KeyRow.ToArray(), KeyValue.ToArray());
		}
开发者ID:kow,项目名称:Aurora-Sim,代码行数:34,代码来源:LocalProfileConnector.cs


示例4: UpdateUserProfile

 public bool UpdateUserProfile (IUserProfileInfo Profile)
 {
     bool success = m_localService.UpdateUserProfile (Profile);
     if (!success)
         success = m_remoteService.UpdateUserProfile (Profile);
     return success;
 }
开发者ID:kow,项目名称:Aurora-Sim,代码行数:7,代码来源:IWCProfileConnector.cs


示例5: GetUserProfile

        public IUserProfileInfo GetUserProfile(UUID PrincipalID)
        {
            NameValueCollection requestArgs = new NameValueCollection
            {
                { "RequestMethod", "GetUser" },
                { "UserID", PrincipalID.ToString() }
            };

            OSDMap result = PostUserData(PrincipalID, requestArgs);

            if (result == null)
                return null;

            if (result.ContainsKey("Profile"))
            {
                OSDMap profilemap = (OSDMap)OSDParser.DeserializeJson(result["Profile"].AsString());

                IUserProfileInfo profile = new IUserProfileInfo();
                profile.FromOSD(profilemap);

                return profile;
            }

            return null;
        }
开发者ID:NickyPerian,项目名称:Aurora,代码行数:25,代码来源:SimianProfileConnector.cs


示例6: GetUserProfile

        /// <summary>
        ///   Get a user's profile
        /// </summary>
        /// <param name = "agentID"></param>
        /// <returns></returns>
        public IUserProfileInfo GetUserProfile(UUID agentID)
        {
            IUserProfileInfo UserProfile = new IUserProfileInfo();
            //Try from the user profile first before getting from the DB
            if (UserProfilesCache.TryGetValue(agentID, out UserProfile))
                return UserProfile;
            else
            {
                Dictionary<string, object> where = new Dictionary<string, object>();
                where["ID"] = agentID;
                where["`Key`"] = "LLProfile";
                List<string> query = null;
                //Grab it from the almost generic interface
                query = GD.Query(new string[] { "Value" }, "userdata", new QueryFilter
                {
                    andFilters = where
                }, null, null, null);

                if (query == null || query.Count == 0)
                    return null;
                //Pull out the OSDmap
                OSDMap profile = (OSDMap) OSDParser.DeserializeLLSDXml(query[0]);

                UserProfile = new IUserProfileInfo();
                UserProfile.FromOSD(profile);

                //Add to the cache
                UserProfilesCache[agentID] = UserProfile;

                return UserProfile;
            }
        }
开发者ID:satlanski2,项目名称:Aurora-Sim,代码行数:37,代码来源:LocalProfileConnector.cs


示例7: GetUserProfile

        public IUserProfileInfo GetUserProfile(UUID agentID)
        {
            object remoteValue = DoRemote(agentID);
            if (remoteValue != null || m_doRemoteOnly)
                return (IUserProfileInfo)remoteValue;

            IUserProfileInfo UserProfile = new IUserProfileInfo();
            //Try from the user profile first before getting from the DB
            if (UserProfilesCache.TryGetValue(agentID, out UserProfile))
                return UserProfile;

            var connector = GetWhetherUserIsForeign(agentID);
            if (connector != null)
                return connector.GetUserProfile(agentID);

            QueryFilter filter = new QueryFilter();
            filter.andFilters["ID"] = agentID;
            filter.andFilters["`Key`"] = "LLProfile";
            List<string> query = null;
            //Grab it from the almost generic interface
            query = GD.Query(new[] { "Value" }, "userdata", filter, null, null, null);

            if (query == null || query.Count == 0)
                return null;
            //Pull out the OSDmap
            OSDMap profile = (OSDMap) OSDParser.DeserializeLLSDXml(query[0]);

            UserProfile = new IUserProfileInfo();
            UserProfile.FromOSD(profile);

            //Add to the cache
            UserProfilesCache[agentID] = UserProfile;

            return UserProfile;
        }
开发者ID:samiam123,项目名称:Aurora-Sim,代码行数:35,代码来源:LocalProfileConnector.cs


示例8: GetUserProfile

		public IUserProfileInfo GetUserProfile(UUID agentID)
		{
			IUserProfileInfo UserProfile = new IUserProfileInfo();
            if (UserProfilesCache.TryGetValue(agentID, out UserProfile)) 
				return UserProfile;
            else 
            {
                UserProfile = new IUserProfileInfo();
                List<string> query = null;
                try
                {
                    query = GD.Query(new string[]{"ID", "`Key`"}, new object[]{agentID, "LLProfile"}, "userdata", "Value");
                }
                catch
                {
                }
                if (query == null || query.Count == 0)
					return null;

                OSDMap profile = (OSDMap)OSDParser.DeserializeLLSDXml(query[0]);

				UserProfile.PrincipalID = agentID;
                UserProfile.AllowPublish = profile["AllowPublish"].AsInteger() == 1;
                UserProfile.MaturePublish = profile["MaturePublish"].AsInteger() == 1;
                UserProfile.Partner = profile["Partner"].AsUUID();
                UserProfile.WebURL = profile["WebURL"].AsString();
                UserProfile.AboutText = profile["AboutText"].AsString();
                UserProfile.FirstLifeAboutText = profile["FirstLifeAboutText"].AsString();
                UserProfile.Image = profile["Image"].AsUUID();
                UserProfile.FirstLifeImage = profile["FirstLifeImage"].AsUUID();
                UserProfile.CustomType = profile["CustomType"].AsString();
                UserProfile.Visible = profile["Visible"].AsInteger() == 1;
                UserProfile.IMViaEmail = profile["IMViaEmail"].AsInteger() == 1;
                UserProfile.MembershipGroup = profile["MembershipGroup"].AsString();
                UserProfile.AArchiveName = profile["AArchiveName"].AsString();
                UserProfile.IsNewUser = profile["IsNewUser"].AsInteger() == 1;
                UserProfile.Created = profile["Created"].AsInteger();
                UserProfile.DisplayName = profile["DisplayName"].AsString();
                UserProfile.Interests.CanDoMask = profile["CanDoMask"].AsUInteger();
                UserProfile.Interests.WantToText = profile["WantToText"].AsString();
                UserProfile.Interests.CanDoMask = profile["CanDoMask"].AsUInteger();
                UserProfile.Interests.CanDoText = profile["CanDoText"].AsString();
                UserProfile.Interests.Languages = profile["Languages"].AsString();

                OSD onotes = OSDParser.DeserializeLLSDXml(profile["Notes"].AsString());
                OSDMap notes = onotes.Type == OSDType.Unknown ? new OSDMap() : (OSDMap)onotes;
                UserProfile.Notes = Util.OSDToDictionary(notes);
                OSD opicks = OSDParser.DeserializeLLSDXml(profile["Picks"].AsString());
                OSDMap picks = opicks.Type == OSDType.Unknown ? new OSDMap() : (OSDMap)opicks;
                UserProfile.Picks = Util.OSDToDictionary(picks);
                OSD oclassifieds = OSDParser.DeserializeLLSDXml(profile["Classifieds"].AsString());
                OSDMap classifieds = oclassifieds.Type == OSDType.Unknown ? new OSDMap() : (OSDMap)oclassifieds;
                UserProfile.Classifieds = Util.OSDToDictionary(classifieds);

			    UserProfilesCache[agentID] = UserProfile;

				return UserProfile;
			}
		}
开发者ID:shangcheng,项目名称:Aurora,代码行数:59,代码来源:LocalProfileConnector.cs


示例9: GetUserProfile

        public IUserProfileInfo GetUserProfile(UUID PrincipalID)
        {
            Dictionary<string, object> sendData = new Dictionary<string, object>();

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

            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"))
                                return null;

                            IUserProfileInfo profile = null;
                            foreach (object f in replyData.Values)
                            {
                                if (f is Dictionary<string, object>)
                                {
                                    profile = new IUserProfileInfo();
                                    profile.FromKVP((Dictionary<string, object>)f);
                                }
                                else
                                    m_log.DebugFormat("[AuroraRemoteProfileConnector]: GetProfile {0} received invalid response type {1}",
                                        PrincipalID, f.GetType());
                            }
                            // Success
                            return profile;
                        }

                        else
                            m_log.DebugFormat("[AuroraRemoteProfileConnector]: GetProfile {0} received null response",
                                PrincipalID);
                    }
                }
            }
            catch (Exception e)
            {
                m_log.DebugFormat("[AuroraRemoteProfileConnector]: Exception when contacting server: {0}", e.ToString());
            }

            return null;
        }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:54,代码来源:RemoteProfileConnector.cs


示例10: UpdateUserProfile

        public bool UpdateUserProfile(IUserProfileInfo Profile)
        {
            NameValueCollection requestArgs = new NameValueCollection
            {
                { "RequestMethod", "AddUserData" },
                { "UserID", Profile.PrincipalID.ToString() },
                { "Profile", OSDParser.SerializeJsonString(Profile.ToOSD()) }
            };

            return PostData(Profile.PrincipalID, requestArgs);
        }
开发者ID:NickyPerian,项目名称:Aurora,代码行数:11,代码来源:SimianProfileConnector.cs


示例11: UpdateUserProfile

        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;
        }
开发者ID:shangcheng,项目名称:Aurora,代码行数:17,代码来源:SimianProfileConnector.cs


示例12: GetUserProfile

        public IUserProfileInfo GetUserProfile(UUID PrincipalID)
        {
            NameValueCollection requestArgs = new NameValueCollection
            {
                { "RequestMethod", "GetUser" },
                { "AgentID", PrincipalID.ToString() }
            };

            OSDMap result = PostData(PrincipalID, requestArgs);

            if (result == null)
                return null;

            Dictionary<string, object> dresult = Util.OSDToDictionary(result);
            IUserProfileInfo profile = new IUserProfileInfo(dresult);

            return profile;
        }
开发者ID:shangcheng,项目名称:Aurora,代码行数:18,代码来源:SimianProfileConnector.cs


示例13: UpdateUserProfile

 public bool UpdateUserProfile(IUserProfileInfo Profile)
 {
     try
     {
         List<string> serverURIs = m_registry.RequestModuleInterface<IConfigurationService> ().FindValueOf (Profile.PrincipalID.ToString (), "RemoteServerURI");
         foreach (string url in serverURIs)
         {
             OSDMap map = new OSDMap ();
             map["Method"] = "updateprofile";
             map["Profile"] = Profile.ToOSD();
             WebUtils.PostToService (url + "osd", map);
         }
         return true;
     }
     catch (Exception e)
     {
         m_log.DebugFormat("[AuroraRemoteProfileConnector]: Exception when contacting server: {0}", e.ToString());
     }
     return false;
 }
开发者ID:kow,项目名称:Aurora-Sim,代码行数:20,代码来源:RemoteProfileConnector.cs


示例14: HandleLoadAvatarProfile

        protected void HandleLoadAvatarProfile(string[] cmdparams)
        {
            if (cmdparams.Length != 6)
            {
                m_log.Info("[AvatarProfileArchiver] Not enough parameters!");
                return;
            }
            StreamReader reader = new StreamReader(cmdparams[5]);
            string document = reader.ReadToEnd();
            reader.Close();
            reader.Dispose();

            string[] lines = document.Split('\n');
            List<string> file = new List<string>(lines);
            Dictionary<string, object> replyData = WebUtils.ParseXmlResponse(file[1]);

            Dictionary<string, object> results = replyData["result"] as Dictionary<string, object>;
            UserAccount UDA = new UserAccount();
            UDA.Name = cmdparams[3] + cmdparams[4];
            UDA.PrincipalID = UUID.Random();
            UDA.ScopeID = UUID.Zero;
            UDA.UserFlags = int.Parse(results["UserFlags"].ToString());
            UDA.UserLevel = 0; //For security... Don't want everyone loading full god mode.
            UDA.UserTitle = results["UserTitle"].ToString();
            UDA.Email = results["Email"].ToString();
            UDA.Created = int.Parse(results["Created"].ToString());
            UserAccountService.StoreUserAccount(UDA);

            replyData = WebUtils.ParseXmlResponse(file[2]);
            IUserProfileInfo UPI = new IUserProfileInfo();
            UPI.FromKVP(replyData["result"] as Dictionary<string, object>);
            //Update the principle ID to the new user.
            UPI.PrincipalID = UDA.PrincipalID;

            IProfileConnector profileData = Aurora.DataManager.DataManager.RequestPlugin<IProfileConnector>();
            if (profileData.GetUserProfile(UPI.PrincipalID) == null)
                profileData.CreateNewProfile(UPI.PrincipalID);

            profileData.UpdateUserProfile(UPI);

            m_log.Info("[AvatarProfileArchiver] Loaded Avatar Profile from " + cmdparams[5]);
        }
开发者ID:NickyPerian,项目名称:Aurora-Sim,代码行数:42,代码来源:AvatarProfileArchiver.cs


示例15: SendProfile

        private void SendProfile(IClientAPI remoteClient, IUserProfileInfo Profile, UserAccount account, uint agentOnline)
        {
            Byte[] charterMember;
            if (Profile.MembershipGroup == "")
            {
                charterMember = new Byte[1];
                charterMember[0] = (Byte) ((account.UserFlags & 0xf00) >> 8);
            }
            else
                charterMember = Utils.StringToBytes(Profile.MembershipGroup);

            uint membershipGroupINT = 0;
            if (Profile.MembershipGroup != "")
                membershipGroupINT = 4;

            uint flags = Convert.ToUInt32(Profile.AllowPublish) + Convert.ToUInt32(Profile.MaturePublish) +
                         membershipGroupINT + agentOnline + (uint) account.UserFlags;
            remoteClient.SendAvatarInterestsReply(account.PrincipalID, Convert.ToUInt32(Profile.Interests.WantToMask),
                                                  Profile.Interests.WantToText,
                                                  Convert.ToUInt32(Profile.Interests.CanDoMask),
                                                  Profile.Interests.CanDoText, Profile.Interests.Languages);
            remoteClient.SendAvatarProperties(account.PrincipalID, Profile.AboutText,
                                              Util.ToDateTime(account.Created).ToString("M/d/yyyy",
                                                                                        CultureInfo.InvariantCulture),
                                              charterMember, Profile.FirstLifeAboutText, flags,
                                              Profile.FirstLifeImage, Profile.Image, Profile.WebURL,
                                              new UUID(Profile.Partner));
        }
开发者ID:SignpostMarv,项目名称:Aurora-Sim,代码行数:28,代码来源:AvatarProfileModule.cs


示例16: UpdateUserProfile

        /// <summary>
        /// Update a user's profile (Note: this does not work if the user does not have a profile)
        /// </summary>
        /// <param name="Profile"></param>
        /// <returns></returns>
        public bool UpdateUserProfile(IUserProfileInfo Profile)
        {
            Dictionary<string, object> Values = new Dictionary<string, object>();
            Values.Add("AllowPublish", Profile.AllowPublish ? 1 : 0);
            Values.Add("MaturePublish", Profile.MaturePublish ? 1 : 0);
            //Can't change from the region
            //Values.Add("Partner");
            Values.Add("WebURL", Profile.WebURL);
            Values.Add("AboutText", Profile.AboutText);
            Values.Add("FirstLifeAboutText", Profile.FirstLifeAboutText);
            Values.Add("Image", Profile.Image);
            Values.Add("FirstLifeImage", Profile.FirstLifeImage);
            //Can't change from the region
            //Values.Add("CustomType");
            Values.Add("Visible", Profile.Visible ? 1 : 0);
            Values.Add("IMViaEmail", Profile.IMViaEmail ? 1 : 0);
            //Can't change from the region
            //Values.Add("MembershipGroup", Profile.MembershipGroup);
            //The next two really shouldn't be able to be changed, but the grid server sets them... so we can't comment them out, but they shouldn't be able to be changed remotely
            Values.Add("AArchiveName", Profile.AArchiveName);
            Values.Add("IsNewUser", Profile.IsNewUser ? 1 : 0);
            //Can't change from the region
            //Values.Add("Created", Profile.Created);
            Values.Add("DisplayName", Profile.DisplayName);
            Values.Add("WantToMask", Profile.Interests.WantToMask);
            Values.Add("WantToText", Profile.Interests.WantToText);
            Values.Add("CanDoMask", Profile.Interests.CanDoMask);
            Values.Add("CanDoText", Profile.Interests.CanDoText);
            Values.Add("Languages", Profile.Interests.Languages);
            Values.Add("Notes", OSDParser.SerializeLLSDXmlString(Util.DictionaryToOSD(Profile.Notes)));
            Values.Add("Picks", OSDParser.SerializeLLSDXmlString(Util.DictionaryToOSD(Profile.Picks)));
            Values.Add("Classifieds", OSDParser.SerializeLLSDXmlString(Util.DictionaryToOSD(Profile.Classifieds)));


            List<object> SetValues = new List<object>();
            List<string> SetRows = new List<string>();
            SetRows.Add("Value");

            //We do do this on purpose. It cuts out values that we should not be putting in the database
            OSDMap map = Util.DictionaryToOSD(Values);
            SetValues.Add(OSDParser.SerializeLLSDXmlString(map));

            List<object> KeyValue = new List<object>();
			List<string> KeyRow = new List<string>();
			KeyRow.Add("ID");
            KeyValue.Add(Profile.PrincipalID.ToString());
            KeyRow.Add("`Key`");
            KeyValue.Add("LLProfile");

            //Update cache
            UserProfilesCache[Profile.PrincipalID] = Profile;

            IUserProfileInfo UPI = GetUserProfile(Profile.PrincipalID);
            if (UPI != null)
            {
                IDirectoryServiceConnector dirServiceConnector = DataManager.DataManager.RequestPlugin<IDirectoryServiceConnector>();
                if (dirServiceConnector != null)
                {
                    dirServiceConnector.RemoveClassifieds(UPI.Classifieds);
                    dirServiceConnector.AddClassifieds(Profile.Classifieds);
                }
            }

            return GD.Update("userdata", SetValues.ToArray(), SetRows.ToArray(), KeyRow.ToArray(), KeyValue.ToArray());
		}
开发者ID:WordfromtheWise,项目名称:Aurora,代码行数:70,代码来源:LocalProfileConnector.cs


示例17: UpdateProfile

        public byte[] UpdateProfile(OSDMap request)
        {
            IUserProfileInfo UserProfile = new IUserProfileInfo();
            UserProfile.FromOSD((OSDMap)request["Profile"]);
            ProfileConnector.UpdateUserProfile(UserProfile);
            OSDMap result = new OSDMap ();
            result["result"] = "Successful";

            string xmlString = OSDParser.SerializeJsonString (result);
            //m_log.DebugFormat("[AuroraDataServerPostHandler]: resp string: {0}", xmlString);
            UTF8Encoding encoding = new UTF8Encoding();
            return encoding.GetBytes(xmlString);
        }
开发者ID:kow,项目名称:Aurora-Sim,代码行数:13,代码来源:AuroraDataServerPostOSDHandler.cs


示例18: UpdateUserProfile

        /// <summary>
        /// Update a user's profile (Note: this does not work if the user does not have a profile)
        /// </summary>
        /// <param name="Profile"></param>
        /// <returns></returns>
        public bool UpdateUserProfile(IUserProfileInfo Profile)
        {
            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;

            List<object> SetValues = new List<object>();
            List<string> SetRows = new List<string>();
            SetRows.Add("Value");
            SetValues.Add(OSDParser.SerializeLLSDXmlString(Profile.ToOSD()));

            List<object> KeyValue = new List<object>();
			List<string> KeyRow = new List<string>();
			KeyRow.Add("ID");
            KeyValue.Add(Profile.PrincipalID.ToString());
            KeyRow.Add("`Key`");
            KeyValue.Add("LLProfile");

            //Update cache
            UserProfilesCache[Profile.PrincipalID] = Profile;

            IUserProfileInfo UPI = GetUserProfile(Profile.PrincipalID);
            if (UPI != null)
            {
                IDirectoryServiceConnector dirServiceConnector = DataManager.DataManager.RequestPlugin<IDirectoryServiceConnector>();
                if (dirServiceConnector != null)
                {
                    dirServiceConnector.RemoveClassifieds(UPI.Classifieds);
                    dirServiceConnector.AddClassifieds(Profile.Classifieds);
                }
            }

            return GD.Update("userdata", SetValues.ToArray(), SetRows.ToArray(), KeyRow.ToArray(), KeyValue.ToArray());
		}
开发者ID:KristenMynx,项目名称:Aurora-Sim,代码行数:45,代码来源:LocalProfileConnector.cs


示例19: SendProfile

        private void SendProfile(IClientAPI remoteClient, IUserProfileInfo Profile, UUID target, uint agentOnline)
        {
            UserAccount account = GetRegionUserIsIn(remoteClient.AgentId).UserAccountService.GetUserAccount(UUID.Zero, target);
            if (Profile == null || account == null)
                return;
            Byte[] charterMember;
            if (Profile.MembershipGroup == "")
            {
                charterMember = new Byte[1];
                charterMember[0] = (Byte)((account.UserFlags & 0xf00) >> 8);
            }
            else
            {
                charterMember = OpenMetaverse.Utils.StringToBytes(Profile.MembershipGroup);
            }
            uint membershipGroupINT = 0;
            if (Profile.MembershipGroup != "")
                membershipGroupINT = 4;

            uint flags = Convert.ToUInt32(Profile.AllowPublish) + Convert.ToUInt32(Profile.MaturePublish) + membershipGroupINT + (uint)agentOnline + (uint)account.UserFlags;
            remoteClient.SendAvatarInterestsReply(target, Convert.ToUInt32(Profile.Interests.WantToMask), Profile.Interests.WantToText, Convert.ToUInt32(Profile.Interests.CanDoMask), Profile.Interests.CanDoText, Profile.Interests.Languages);
            remoteClient.SendAvatarProperties(account.PrincipalID, Profile.AboutText,
                                              Util.ToDateTime(account.Created).ToString("M/d/yyyy", CultureInfo.InvariantCulture),
                                              charterMember, Profile.FirstLifeAboutText, flags,
                                              Profile.FirstLifeImage, Profile.Image, Profile.WebURL, new UUID(Profile.Partner));
        }
开发者ID:KristenMynx,项目名称:Aurora-Sim,代码行数:26,代码来源:AvatarProfileModule.cs


示例20: UpdateProfile

        public byte[] UpdateProfile(Dictionary<string, object> request)
        {
            Dictionary<string, object> result = new Dictionary<string, object>();
            
            UUID principalID = UUID.Zero;
            if (request.ContainsKey("PRINCIPALID"))
                UUID.TryParse(request["PRINCIPALID"].ToString(), out principalID);
            else
            {
                m_log.WarnFormat("[AuroraDataServerPostHandler]: no principalID in request to get profile");
                result["result"] = "null";
                string FailedxmlString = WebUtils.BuildXmlResponse(result);
                m_log.DebugFormat("[AuroraDataServerPostHandler]: resp string: {0}", FailedxmlString);
                UTF8Encoding Failedencoding = new UTF8Encoding();
                return Failedencoding.GetBytes(FailedxmlString);
            }

            IUserProfileInfo UserProfile = new IUserProfileInfo();
            UserProfile.FromKVP(request);
            ProfileConnector.UpdateUserProfile(UserProfile);
            result["result"] = "Successful";

            string xmlString = WebUtils.BuildXmlResponse(result);
            //m_log.DebugFormat("[AuroraDataServerPostHandler]: resp string: {0}", xmlString);
            UTF8Encoding encoding = new UTF8Encoding();
            return encoding.GetBytes(xmlString);
        }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:27,代码来源:AuroraDataServerPostHandler.cs



注:本文中的Aurora.Framework.IUserProfileInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Framework.InventoryFolderBase类代码示例发布时间:2022-05-24
下一篇:
C# Framework.GridInstantMessage类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap