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


C# IUserProfileInfo.ToOSD方法代码示例

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


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

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

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

示例3: CreateNewProfile

        /// <summary>
        /// Create a new profile for a user
        /// </summary>
        /// <param name="AgentID"></param>
        public void CreateNewProfile(UUID AgentID)
		{
			List<object> values = new List<object>();
            values.Add(AgentID.ToString()); //ID
            values.Add("LLProfile"); //Key

            //Create a new basic profile for them
            IUserProfileInfo profile = new IUserProfileInfo();
            profile.PrincipalID = AgentID;

            values.Add(OSDParser.SerializeLLSDXmlString(profile.ToOSD())); //Value which is a default Profile
			
            GD.Insert("userdata", values.ToArray());
		}
开发者ID:rknop,项目名称:Aurora-Sim,代码行数:18,代码来源:LocalProfileConnector.cs

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

示例5: UpdateUserProfile

        public bool UpdateUserProfile(IUserProfileInfo Profile)
        {
            object remoteValue = DoRemote(Profile);
            if (remoteValue != null || m_doRemoteOnly)
                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
            UserProfilesCache[Profile.PrincipalID] = Profile;

            return GD.Update("userdata", values, null, filter, null, null);
        }
开发者ID:andsim,项目名称:Aurora-Sim,代码行数:28,代码来源:LocalProfileConnector.cs

示例6: CreateNewProfile

        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("userdata", values.ToArray());
        }
开发者ID:andsim,项目名称:Aurora-Sim,代码行数:15,代码来源:LocalProfileConnector.cs

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


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