本文整理汇总了C#中OpenSim.Services.Interfaces.AvatarData.ToAvatarAppearance方法的典型用法代码示例。如果您正苦于以下问题:C# AvatarData.ToAvatarAppearance方法的具体用法?C# AvatarData.ToAvatarAppearance怎么用?C# AvatarData.ToAvatarAppearance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSim.Services.Interfaces.AvatarData
的用法示例。
在下文中一共展示了AvatarData.ToAvatarAppearance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MakeAgent
private AgentCircuitData MakeAgent(GridRegion region, UserAccount account,
AvatarData avatar, UUID session, UUID secureSession, uint circuit, Vector3 position, string viewer)
{
AgentCircuitData aCircuit = new AgentCircuitData();
aCircuit.AgentID = account.PrincipalID;
if (avatar != null)
aCircuit.Appearance = avatar.ToAvatarAppearance(account.PrincipalID);
else
aCircuit.Appearance = new AvatarAppearance(account.PrincipalID);
//aCircuit.BaseFolder = irrelevant
aCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath();
aCircuit.child = false; // the first login agent is root
aCircuit.ChildrenCapSeeds = new Dictionary<ulong, string>();
aCircuit.circuitcode = circuit;
aCircuit.firstname = account.FirstName;
//aCircuit.InventoryFolder = irrelevant
aCircuit.lastname = account.LastName;
aCircuit.SecureSessionID = secureSession;
aCircuit.SessionID = session;
aCircuit.startpos = position;
aCircuit.Viewer = viewer;
SetServiceURLs(aCircuit, account);
return aCircuit;
//m_UserAgentService.LoginAgentToGrid(aCircuit, GatekeeperServiceConnector, region, out reason);
//if (simConnector.CreateAgent(region, aCircuit, 0, out reason))
// return aCircuit;
//return null;
}
示例2: SetAvatar
// <summary>
// </summary>
// <param name=""></param>
public bool SetAvatar(UUID userID, AvatarData avatar)
{
m_log.Debug("[SIMIAN AVATAR CONNECTOR]: SetAvatar called for " + userID);
if (avatar.AvatarType == 1) // LLAvatar
{
AvatarAppearance appearance = avatar.ToAvatarAppearance();
OSDMap map = new OSDMap();
map["Height"] = OSD.FromReal(appearance.AvatarHeight);
map["BodyItem"] = appearance.Wearables[AvatarWearable.BODY][0].ItemID.ToString();
map["EyesItem"] = appearance.Wearables[AvatarWearable.EYES][0].ItemID.ToString();
map["GlovesItem"] = appearance.Wearables[AvatarWearable.GLOVES][0].ItemID.ToString();
map["HairItem"] = appearance.Wearables[AvatarWearable.HAIR][0].ItemID.ToString();
map["JacketItem"] = appearance.Wearables[AvatarWearable.JACKET][0].ItemID.ToString();
map["PantsItem"] = appearance.Wearables[AvatarWearable.PANTS][0].ItemID.ToString();
map["ShirtItem"] = appearance.Wearables[AvatarWearable.SHIRT][0].ItemID.ToString();
map["ShoesItem"] = appearance.Wearables[AvatarWearable.SHOES][0].ItemID.ToString();
map["SkinItem"] = appearance.Wearables[AvatarWearable.SKIN][0].ItemID.ToString();
map["SkirtItem"] = appearance.Wearables[AvatarWearable.SKIRT][0].ItemID.ToString();
map["SocksItem"] = appearance.Wearables[AvatarWearable.SOCKS][0].ItemID.ToString();
map["UnderPantsItem"] = appearance.Wearables[AvatarWearable.UNDERPANTS][0].ItemID.ToString();
map["UnderShirtItem"] = appearance.Wearables[AvatarWearable.UNDERSHIRT][0].ItemID.ToString();
map["BodyAsset"] = appearance.Wearables[AvatarWearable.BODY][0].AssetID.ToString();
map["EyesAsset"] = appearance.Wearables[AvatarWearable.EYES][0].AssetID.ToString();
map["GlovesAsset"] = appearance.Wearables[AvatarWearable.GLOVES][0].AssetID.ToString();
map["HairAsset"] = appearance.Wearables[AvatarWearable.HAIR][0].AssetID.ToString();
map["JacketAsset"] = appearance.Wearables[AvatarWearable.JACKET][0].AssetID.ToString();
map["PantsAsset"] = appearance.Wearables[AvatarWearable.PANTS][0].AssetID.ToString();
map["ShirtAsset"] = appearance.Wearables[AvatarWearable.SHIRT][0].AssetID.ToString();
map["ShoesAsset"] = appearance.Wearables[AvatarWearable.SHOES][0].AssetID.ToString();
map["SkinAsset"] = appearance.Wearables[AvatarWearable.SKIN][0].AssetID.ToString();
map["SkirtAsset"] = appearance.Wearables[AvatarWearable.SKIRT][0].AssetID.ToString();
map["SocksAsset"] = appearance.Wearables[AvatarWearable.SOCKS][0].AssetID.ToString();
map["UnderPantsAsset"] = appearance.Wearables[AvatarWearable.UNDERPANTS][0].AssetID.ToString();
map["UnderShirtAsset"] = appearance.Wearables[AvatarWearable.UNDERSHIRT][0].AssetID.ToString();
OSDMap items = new OSDMap();
foreach (KeyValuePair<string, string> kvp in avatar.Data)
{
if (kvp.Key.StartsWith("_ap_"))
items.Add(kvp.Key, OSD.FromString(kvp.Value));
}
NameValueCollection requestArgs = new NameValueCollection
{
{ "RequestMethod", "AddUserData" },
{ "UserID", userID.ToString() },
{ "LLAppearance", OSDParser.SerializeJsonString(map) },
{ "LLAttachments", OSDParser.SerializeJsonString(items) }
};
OSDMap response = WebUtil.PostToService(m_serverUrl, requestArgs);
bool success = response["Success"].AsBoolean();
if (!success)
m_log.Warn("[SIMIAN AVATAR CONNECTOR]: Failed saving appearance for " + userID + ": " + response["Message"].AsString());
return success;
}
else
{
m_log.Error("[SIMIAN AVATAR CONNECTOR]: Can't save appearance for " + userID + ". Unhandled avatar type " + avatar.AvatarType);
return false;
}
}
示例3: SetAvatar
public bool SetAvatar(UUID principalID, AvatarData avatar)
{
object remoteValue = DoRemote(principalID, avatar);
if (remoteValue != null || m_doRemoteOnly)
return remoteValue == null ? false : (bool)remoteValue;
m_registry.RequestModuleInterface<ISimulationBase>().EventManager.FireGenericEventHandler("SetAppearance",
new object[2]
{
principalID,
avatar
});
RemoveOldBaked(principalID, avatar);
avatar = FixWearables(principalID, avatar.ToAvatarAppearance(principalID));
return m_Database.Store(principalID, avatar);
}