From b1c8d0588829dfa76f89460eeb8406d9c4fc479f Mon Sep 17 00:00:00 2001 From: Master ScienceSim Date: Wed, 20 Oct 2010 16:17:54 -0700 Subject: 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. --- .../RemoteController/RemoteAdminPlugin.cs | 28 ++++++++-------------- 1 file changed, 10 insertions(+), 18 deletions(-) (limited to 'OpenSim/ApplicationPlugins') diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index aeed467..0589748 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -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 attachments = avatarAppearance.GetAttachmentDictionary(); + Dictionary attachments = avatarAppearance.Attachments; - foreach (KeyValuePair attachment in attachments) + foreach (KeyValuePair 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) { -- cgit v1.1