diff options
author | Justin Clark-Casey (justincc) | 2012-03-09 23:57:24 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-03-09 23:57:24 +0000 |
commit | bdc968f1fcd4008e9f2a6099a7d30edb075ca0f1 (patch) | |
tree | 7c2c45cc97fb1b2181605313ed50e5db9cd6ec0f /OpenSim/Region | |
parent | Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff) | |
download | opensim-SC_OLD-bdc968f1fcd4008e9f2a6099a7d30edb075ca0f1.zip opensim-SC_OLD-bdc968f1fcd4008e9f2a6099a7d30edb075ca0f1.tar.gz opensim-SC_OLD-bdc968f1fcd4008e9f2a6099a7d30edb075ca0f1.tar.bz2 opensim-SC_OLD-bdc968f1fcd4008e9f2a6099a7d30edb075ca0f1.tar.xz |
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.
Diffstat (limited to 'OpenSim/Region')
3 files changed, 4 insertions, 61 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index d98ff68..b388b10 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -317,7 +317,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
317 | protected readonly UUID m_agentId; | 317 | protected readonly UUID m_agentId; |
318 | private readonly uint m_circuitCode; | 318 | private readonly uint m_circuitCode; |
319 | private readonly byte[] m_channelVersion = Utils.EmptyBytes; | 319 | private readonly byte[] m_channelVersion = Utils.EmptyBytes; |
320 | private readonly Dictionary<string, UUID> m_defaultAnimations = new Dictionary<string, UUID>(); | ||
321 | private readonly IGroupsModule m_GroupsModule; | 320 | private readonly IGroupsModule m_GroupsModule; |
322 | 321 | ||
323 | private int m_cachedTextureSerial; | 322 | private int m_cachedTextureSerial; |
@@ -452,10 +451,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
452 | RegisterInterface<IClientChat>(this); | 451 | RegisterInterface<IClientChat>(this); |
453 | RegisterInterface<IClientIPEndpoint>(this); | 452 | RegisterInterface<IClientIPEndpoint>(this); |
454 | 453 | ||
455 | InitDefaultAnimations(); | ||
456 | |||
457 | m_scene = scene; | 454 | m_scene = scene; |
458 | |||
459 | m_entityUpdates = new PriorityQueue(m_scene.Entities.Count); | 455 | m_entityUpdates = new PriorityQueue(m_scene.Entities.Count); |
460 | m_entityProps = new PriorityQueue(m_scene.Entities.Count); | 456 | m_entityProps = new PriorityQueue(m_scene.Entities.Count); |
461 | m_fullUpdateDataBlocksBuilder = new List<ObjectUpdatePacket.ObjectDataBlock>(); | 457 | m_fullUpdateDataBlocksBuilder = new List<ObjectUpdatePacket.ObjectDataBlock>(); |
@@ -11210,30 +11206,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11210 | OutPacket(scriptQuestion, ThrottleOutPacketType.Task); | 11206 | OutPacket(scriptQuestion, ThrottleOutPacketType.Task); |
11211 | } | 11207 | } |
11212 | 11208 | ||
11213 | private void InitDefaultAnimations() | ||
11214 | { | ||
11215 | using (XmlTextReader reader = new XmlTextReader("data/avataranimations.xml")) | ||
11216 | { | ||
11217 | XmlDocument doc = new XmlDocument(); | ||
11218 | doc.Load(reader); | ||
11219 | if (doc.DocumentElement != null) | ||
11220 | foreach (XmlNode nod in doc.DocumentElement.ChildNodes) | ||
11221 | { | ||
11222 | if (nod.Attributes["name"] != null) | ||
11223 | { | ||
11224 | string name = nod.Attributes["name"].Value.ToLower(); | ||
11225 | string id = nod.InnerText; | ||
11226 | m_defaultAnimations.Add(name, (UUID)id); | ||
11227 | } | ||
11228 | } | ||
11229 | } | ||
11230 | } | ||
11231 | |||
11232 | public UUID GetDefaultAnimation(string name) | 11209 | public UUID GetDefaultAnimation(string name) |
11233 | { | 11210 | { |
11234 | if (m_defaultAnimations.ContainsKey(name)) | 11211 | return SLUtil.GetDefaultAvatarAnimation(name); |
11235 | return m_defaultAnimations[name]; | ||
11236 | return UUID.Zero; | ||
11237 | } | 11212 | } |
11238 | 11213 | ||
11239 | /// <summary> | 11214 | /// <summary> |
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 | |||
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 |
diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs index eb633b3..a142f26 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs +++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs | |||
@@ -712,7 +712,7 @@ namespace OpenSim.Region.RegionCombinerModule | |||
712 | 712 | ||
713 | List<Vector3> CoarseLocations = new List<Vector3>(); | 713 | List<Vector3> CoarseLocations = new List<Vector3>(); |
714 | List<UUID> AvatarUUIDs = new List<UUID>(); | 714 | List<UUID> AvatarUUIDs = new List<UUID>(); |
715 | 715 | ||
716 | connectiondata.RegionScene.ForEachRootScenePresence(delegate(ScenePresence sp) | 716 | connectiondata.RegionScene.ForEachRootScenePresence(delegate(ScenePresence sp) |
717 | { | 717 | { |
718 | if (sp.UUID != presence.UUID) | 718 | if (sp.UUID != presence.UUID) |