aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/AvatarAnimations.cs
diff options
context:
space:
mode:
authorJeff Ames2008-02-06 10:19:30 +0000
committerJeff Ames2008-02-06 10:19:30 +0000
commit3b42b5f0984fd10de8f49794764f1efd688e8dcd (patch)
tree1d1ea31c04bfd56bd5ac71d425f14b29f239c1e4 /OpenSim/Region/Environment/Scenes/AvatarAnimations.cs
parent* Fixed script count incrementer. Was decrementing but only incrementing wh... (diff)
downloadopensim-SC_OLD-3b42b5f0984fd10de8f49794764f1efd688e8dcd.zip
opensim-SC_OLD-3b42b5f0984fd10de8f49794764f1efd688e8dcd.tar.gz
opensim-SC_OLD-3b42b5f0984fd10de8f49794764f1efd688e8dcd.tar.bz2
opensim-SC_OLD-3b42b5f0984fd10de8f49794764f1efd688e8dcd.tar.xz
Consolidated LoadAnims and AvatarAnimations constructor.
Fixes locking issues with Animations in ScenePresence (bug #324)
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/AvatarAnimations.cs31
1 files changed, 7 insertions, 24 deletions
diff --git a/OpenSim/Region/Environment/Scenes/AvatarAnimations.cs b/OpenSim/Region/Environment/Scenes/AvatarAnimations.cs
index daaa319..be882e0 100644
--- a/OpenSim/Region/Environment/Scenes/AvatarAnimations.cs
+++ b/OpenSim/Region/Environment/Scenes/AvatarAnimations.cs
@@ -25,6 +25,7 @@
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28
28using System; 29using System;
29using System.Collections.Generic; 30using System.Collections.Generic;
30using System.Xml; 31using System.Xml;
@@ -35,18 +36,11 @@ namespace OpenSim.Region.Environment.Scenes
35{ 36{
36 public class AvatarAnimations 37 public class AvatarAnimations
37 { 38 {
38 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
39
40 public Dictionary<string, LLUUID> AnimsLLUUID = new Dictionary<string, LLUUID>(); 39 public Dictionary<string, LLUUID> AnimsLLUUID = new Dictionary<string, LLUUID>();
41 public Dictionary<LLUUID, string> AnimsNames = new Dictionary<LLUUID, string>(); 40 public Dictionary<LLUUID, string> AnimsNames = new Dictionary<LLUUID, string>();
42 41
43 public AvatarAnimations() 42 public AvatarAnimations()
44 { 43 {
45 }
46
47 public void LoadAnims()
48 {
49 //m_log.Info("[CLIENT]: Loading avatar animations");
50 using (XmlTextReader reader = new XmlTextReader("data/avataranimations.xml")) 44 using (XmlTextReader reader = new XmlTextReader("data/avataranimations.xml"))
51 { 45 {
52 XmlDocument doc = new XmlDocument(); 46 XmlDocument doc = new XmlDocument();
@@ -55,25 +49,14 @@ namespace OpenSim.Region.Environment.Scenes
55 { 49 {
56 if (nod.Attributes["name"] != null) 50 if (nod.Attributes["name"] != null)
57 { 51 {
58 AnimsLLUUID.Add((string)nod.Attributes["name"].Value, (LLUUID)nod.InnerText); 52 string name = (string)nod.Attributes["name"].Value;
59 } 53 LLUUID id = (LLUUID)nod.InnerText;
60 }
61 }
62
63 // m_log.Info("[CLIENT]: Loaded " + AnimsLLUUID.Count.ToString() + " animation(s)");
64 54
65 try 55 AnimsLLUUID.Add(name, id);
66 { 56 AnimsNames.Add(id, name);
67 //Mantis: 0000224: 2755 - Enumeration Operation may not execute [immediate crash] (ODE/2750/WIN2003) 57 }
68 foreach (KeyValuePair<string, LLUUID> kp in ScenePresence.Animations.AnimsLLUUID)
69 {
70 AnimsNames.Add(kp.Value, kp.Key);
71 } 58 }
72 } 59 }
73 catch (InvalidOperationException)
74 {
75 m_log.Warn("[AVATAR]: Unable to load animation names for an Avatar");
76 }
77 } 60 }
78 } 61 }
79} \ No newline at end of file 62}