本文整理汇总了C#中OpenSim.Services.Interfaces.UserAccount.FromOSD方法的典型用法代码示例。如果您正苦于以下问题:C# UserAccount.FromOSD方法的具体用法?C# UserAccount.FromOSD怎么用?C# UserAccount.FromOSD使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSim.Services.Interfaces.UserAccount
的用法示例。
在下文中一共展示了UserAccount.FromOSD方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FromOSD
public override void FromOSD(OSDMap map)
{
AgentInfo = new IAgentInfo();
AgentInfo.FromOSD((OSDMap)(map["AgentInfo"]));
UserAccount = new UserAccount();
UserAccount.FromOSD((OSDMap)(map["UserAccount"]));
if (!map.ContainsKey("ActiveGroup"))
ActiveGroup = null;
else
{
ActiveGroup = new GroupMembershipData();
ActiveGroup.FromOSD((OSDMap)(map["ActiveGroup"]));
}
GroupMemberships = ((OSDArray)map["GroupMemberships"]).ConvertAll<GroupMembershipData>((o) =>
{
GroupMembershipData group = new GroupMembershipData();
group.FromOSD((OSDMap)o);
return group;
});
}
示例2: ParseQuery
private List<UserAccount> ParseQuery(List<UUID> scopeIDs, List<string> query)
{
List<UserAccount> list = new List<UserAccount>();
for (int i = 0; i < query.Count; i += 12)
{
UserAccount data = new UserAccount { PrincipalID = UUID.Parse(query[i + 0]), ScopeID = UUID.Parse(query[i + 1]) };
if(query[i + 11] != "")
data.FromOSD((OSDMap)OSDParser.DeserializeJson(query[i + 11]));
//We keep these even though we don't always use them because we might need to create the "Name" from them
string FirstName = query[i + 2];
string LastName = query[i + 3];
data.Email = query[i + 4];
data.ServiceURLs = new Dictionary<string, object>();
if ((query[i + 5] != null) && (query[i + 5].Contains("=")))
{
Dictionary<string, string> dict = Util.ConvertToDictionary(query[i + 5]);
foreach (var v in dict)
data.ServiceURLs[v.Key] = v.Value;
}
data.Created = Int32.Parse(query[i + 6]);
data.UserLevel = Int32.Parse(query[i + 7]);
data.UserFlags = Int32.Parse(query[i + 8]);
data.UserTitle = query[i + 9];
data.Name = query[i + 10];
if (string.IsNullOrEmpty(data.Name))
{
data.Name = FirstName + " " + LastName;
//Save the change!
Store(data);
}
list.Add(data);
}
return AllScopeIDImpl.CheckScopeIDs(scopeIDs, list);
}