当前位置: 首页>>代码示例>>C#>>正文


C# IUserProfileInfo.FromOSD方法代码示例

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


在下文中一共展示了IUserProfileInfo.FromOSD方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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

示例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:KristenMynx,项目名称:Aurora-Sim,代码行数:30,代码来源:LocalProfileConnector.cs

示例3: 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

示例4: 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

示例5: 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;
            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:andsim,项目名称:Aurora-Sim,代码行数:30,代码来源:LocalProfileConnector.cs

示例6: Duplicate

 public override IDataTransferable Duplicate()
 {
     IUserProfileInfo m = new IUserProfileInfo();
     m.FromOSD(ToOSD());
     return m;
 }
开发者ID:KristenMynx,项目名称:Aurora-Sim,代码行数:6,代码来源:IUserProfileInfo.cs

示例7: 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


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