aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules
diff options
context:
space:
mode:
authorMelanie2012-03-11 02:29:43 +0000
committerMelanie2012-03-11 02:29:43 +0000
commitf292e19689f9b01a5706e765543064b6ad61caa9 (patch)
tree0752aaa6a4ddc23c2f3a9296f02143cea3b6e6e1 /OpenSim/Region/OptionalModules
parentMerge branch 'master' into careminster (diff)
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-f292e19689f9b01a5706e765543064b6ad61caa9.zip
opensim-SC_OLD-f292e19689f9b01a5706e765543064b6ad61caa9.tar.gz
opensim-SC_OLD-f292e19689f9b01a5706e765543064b6ad61caa9.tar.bz2
opensim-SC_OLD-f292e19689f9b01a5706e765543064b6ad61caa9.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/Application/OpenSimBase.cs
Diffstat (limited to 'OpenSim/Region/OptionalModules')
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs36
1 files changed, 2 insertions, 34 deletions
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index cbc3813..d88b2bd 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
42{ 42{
43 public class NPCAvatar : IClientAPI, INPC 43 public class NPCAvatar : IClientAPI, INPC
44 { 44 {
45 private static readonly Dictionary<string, UUID> m_defaultAnimations = new Dictionary<string, UUID>();
46
47 public bool SenseAsAgent { get; set; } 45 public bool SenseAsAgent { get; set; }
46
48 private readonly string m_firstname; 47 private readonly string m_firstname;
49 private readonly string m_lastname; 48 private readonly string m_lastname;
50 private readonly Vector3 m_startPos; 49 private readonly Vector3 m_startPos;
@@ -61,16 +60,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC
61 m_scene = scene; 60 m_scene = scene;
62 m_ownerID = ownerID; 61 m_ownerID = ownerID;
63 SenseAsAgent = senseAsAgent; 62 SenseAsAgent = senseAsAgent;
64
65 } 63 }
66 64
67 static NPCAvatar()
68 {
69 InitDefaultAnimations();
70 }
71
72
73
74 public IScene Scene 65 public IScene Scene
75 { 66 {
76 get { return m_scene; } 67 get { return m_scene; }
@@ -142,32 +133,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC
142 133
143 } 134 }
144 135
145 private static void InitDefaultAnimations()
146 {
147 using (XmlTextReader reader = new XmlTextReader("data/avataranimations.xml"))
148 {
149 XmlDocument doc = new XmlDocument();
150 doc.Load(reader);
151 if (doc.DocumentElement != null)
152 foreach (XmlNode nod in doc.DocumentElement.ChildNodes)
153 {
154 if (nod.Attributes["name"] != null)
155 {
156 string name = nod.Attributes["name"].Value.ToLower();
157 string id = nod.InnerText;
158 m_defaultAnimations.Add(name, (UUID)id);
159 }
160 }
161 }
162 }
163
164 public UUID GetDefaultAnimation(string name) 136 public UUID GetDefaultAnimation(string name)
165 { 137 {
166 if (m_defaultAnimations.ContainsKey(name)) 138 return SLUtil.GetDefaultAvatarAnimation(name);
167 {
168 return m_defaultAnimations[name];
169 }
170 return UUID.Zero;
171 } 139 }
172 140
173 public Vector3 Position 141 public Vector3 Position