From bdc968f1fcd4008e9f2a6099a7d30edb075ca0f1 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 9 Mar 2012 23:57:24 +0000 Subject: Factor out common default animations code into SLUtil. LLClientView now makes use of the SLUtil copy via a method rather than each LLClientView loading a separate copy. As per opensim-users mailing list discussion. --- .../Region/OptionalModules/World/NPC/NPCAvatar.cs | 36 ++-------------------- 1 file changed, 2 insertions(+), 34 deletions(-) (limited to 'OpenSim/Region/OptionalModules/World') diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 69c16c7..24b9e6b 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs @@ -42,9 +42,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC { public class NPCAvatar : IClientAPI, INPC { - private static readonly Dictionary m_defaultAnimations = new Dictionary(); - public bool SenseAsAgent { get; set; } + private readonly string m_firstname; private readonly string m_lastname; private readonly Vector3 m_startPos; @@ -61,16 +60,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC m_scene = scene; m_ownerID = ownerID; SenseAsAgent = senseAsAgent; - } - static NPCAvatar() - { - InitDefaultAnimations(); - } - - - public IScene Scene { get { return m_scene; } @@ -142,32 +133,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC } - private static void InitDefaultAnimations() - { - using (XmlTextReader reader = new XmlTextReader("data/avataranimations.xml")) - { - XmlDocument doc = new XmlDocument(); - doc.Load(reader); - if (doc.DocumentElement != null) - foreach (XmlNode nod in doc.DocumentElement.ChildNodes) - { - if (nod.Attributes["name"] != null) - { - string name = nod.Attributes["name"].Value.ToLower(); - string id = nod.InnerText; - m_defaultAnimations.Add(name, (UUID)id); - } - } - } - } - public UUID GetDefaultAnimation(string name) { - if (m_defaultAnimations.ContainsKey(name)) - { - return m_defaultAnimations[name]; - } - return UUID.Zero; + return SLUtil.GetDefaultAvatarAnimation(name); } public Vector3 Position -- cgit v1.1