mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 06:06:06 +08:00
Major refactoring of appearance handling.
AvatarService -- add two new methods, GetAppearance and SetAppearance to get around the lossy encoding in AvatarData. Preseve the old functions to avoid changing the behavior for ROBUST services. AvatarAppearance -- major refactor, moved the various encoding methods used by AgentCircuitData, ClientAgentUpdate and ScenePresence into one location. Changed initialization. AvatarAttachments -- added a class specifically to handle attachments in preparation for additional functionality that will be needed for viewer 2. AvatarFactory -- removed a number of unused or methods duplicated in other locations. Moved in all appearance event handling from ScenePresence. Required a change to IClientAPI that propogated throughout all the IClientAPI implementations.
This commit is contained in:
@@ -1472,12 +1472,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
{
|
||||
m_log.DebugFormat("[RADMIN] Initializing inventory for {0} from {1}", destination, source);
|
||||
Scene scene = m_application.SceneManager.CurrentOrFirstScene;
|
||||
AvatarAppearance avatarAppearance = null;
|
||||
AvatarData avatar = scene.AvatarService.GetAvatar(source);
|
||||
if (avatar != null)
|
||||
avatarAppearance = avatar.ToAvatarAppearance(source);
|
||||
|
||||
// If the model has no associated appearance we're done.
|
||||
AvatarAppearance avatarAppearance = scene.AvatarService.GetAppearance(source);
|
||||
if (avatarAppearance == null)
|
||||
return;
|
||||
|
||||
@@ -1491,8 +1488,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
{
|
||||
CopyWearablesAndAttachments(destination, source, avatarAppearance);
|
||||
|
||||
AvatarData avatarData = new AvatarData(avatarAppearance);
|
||||
scene.AvatarService.SetAvatar(destination, avatarData);
|
||||
scene.AvatarService.SetAppearance(destination, avatarAppearance);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -1523,8 +1519,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
}
|
||||
}
|
||||
|
||||
AvatarData avatarData = new AvatarData(avatarAppearance);
|
||||
scene.AvatarService.SetAvatar(destination, avatarData);
|
||||
scene.AvatarService.SetAppearance(destination, avatarAppearance);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -1619,12 +1614,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
}
|
||||
|
||||
// Attachments
|
||||
Dictionary<int, UUID[]> attachments = avatarAppearance.GetAttachmentDictionary();
|
||||
Dictionary<int, AvatarAttachment> attachments = avatarAppearance.Attachments;
|
||||
|
||||
foreach (KeyValuePair<int, UUID[]> attachment in attachments)
|
||||
foreach (KeyValuePair<int, AvatarAttachment> attachment in attachments)
|
||||
{
|
||||
int attachpoint = attachment.Key;
|
||||
UUID itemID = attachment.Value[0];
|
||||
int attachpoint = attachment.Value.AttachPoint;
|
||||
UUID itemID = attachment.Value.ItemID;
|
||||
|
||||
if (itemID != UUID.Zero)
|
||||
{
|
||||
@@ -1908,10 +1903,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
if (include)
|
||||
{
|
||||
// Setup for appearance processing
|
||||
AvatarData avatarData = scene.AvatarService.GetAvatar(ID);
|
||||
if (avatarData != null)
|
||||
avatarAppearance = avatarData.ToAvatarAppearance(ID);
|
||||
else
|
||||
avatarAppearance = scene.AvatarService.GetAppearance(ID);
|
||||
if (avatarAppearance == null)
|
||||
avatarAppearance = new AvatarAppearance();
|
||||
|
||||
AvatarWearable[] wearables = avatarAppearance.Wearables;
|
||||
@@ -2076,8 +2069,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
m_log.DebugFormat("[RADMIN] Outfit {0} load completed", outfitName);
|
||||
} // foreach outfit
|
||||
m_log.DebugFormat("[RADMIN] Inventory update complete for {0}", name);
|
||||
AvatarData avatarData2 = new AvatarData(avatarAppearance);
|
||||
scene.AvatarService.SetAvatar(ID, avatarData2);
|
||||
scene.AvatarService.SetAppearance(ID, avatarAppearance);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user