本文整理汇总了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);
}
示例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;
}
示例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());
}
示例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());
}
示例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);
}
示例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());
}
示例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());
}