aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authordiva2009-02-18 01:49:18 +0000
committerdiva2009-02-18 01:49:18 +0000
commit3f25128e77af2a53e765436454b8fddeb8f88894 (patch)
tree461d17a9e357e262a08583789617749986978881 /OpenSim/Region/Framework/Scenes
parentMakes SP.CopyFrom a bit more robust with respect to sims in older versions wh... (diff)
downloadopensim-SC-3f25128e77af2a53e765436454b8fddeb8f88894.zip
opensim-SC-3f25128e77af2a53e765436454b8fddeb8f88894.tar.gz
opensim-SC-3f25128e77af2a53e765436454b8fddeb8f88894.tar.bz2
opensim-SC-3f25128e77af2a53e765436454b8fddeb8f88894.tar.xz
Adds support for preserving animations on region crossings and TPs.
Known issue: after TP, the self client doesn't see the animations going, but others can see them. So there's a bug there (TPs only, crossings seem to be all fine). Untested: did not test animation overriders; only tested playing animations from the viewer.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation.cs26
-rw-r--r--OpenSim/Region/Framework/Scenes/AnimationSet.cs22
-rw-r--r--OpenSim/Region/Framework/Scenes/ChildAgentDataUpdate.cs506
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs46
5 files changed, 589 insertions, 18 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation.cs b/OpenSim/Region/Framework/Scenes/Animation.cs
index 6f0681c..7c3e010 100644
--- a/OpenSim/Region/Framework/Scenes/Animation.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation.cs
@@ -26,6 +26,7 @@
26 */ 26 */
27 27
28using OpenMetaverse; 28using OpenMetaverse;
29using OpenMetaverse.StructuredData;
29 30
30namespace OpenSim.Region.Framework.Scenes 31namespace OpenSim.Region.Framework.Scenes
31{ 32{
@@ -62,5 +63,30 @@ namespace OpenSim.Region.Framework.Scenes
62 this.sequenceNum = sequenceNum; 63 this.sequenceNum = sequenceNum;
63 this.objectID = objectID; 64 this.objectID = objectID;
64 } 65 }
66
67 public Animation(OSDMap args)
68 {
69 UnpackUpdateMessage(args);
70 }
71
72 public OSDMap PackUpdateMessage()
73 {
74 OSDMap anim = new OSDMap();
75 anim["animation"] = OSD.FromUUID(animID);
76 anim["object_id"] = OSD.FromUUID(objectID);
77 anim["seq_num"] = OSD.FromInteger(sequenceNum);
78 return anim;
79 }
80
81 public void UnpackUpdateMessage(OSDMap args)
82 {
83 if (args["animation"] != null)
84 animID = args["animation"].AsUUID();
85 if (args["object_id"] != null)
86 objectID = args["object_id"].AsUUID();
87 if (args["seq_num"] != null)
88 sequenceNum = args["seq_num"].AsInteger();
89 }
90
65 } 91 }
66} 92}
diff --git a/OpenSim/Region/Framework/Scenes/AnimationSet.cs b/OpenSim/Region/Framework/Scenes/AnimationSet.cs
index 80e20fc..ab65166 100644
--- a/OpenSim/Region/Framework/Scenes/AnimationSet.cs
+++ b/OpenSim/Region/Framework/Scenes/AnimationSet.cs
@@ -153,5 +153,27 @@ namespace OpenSim.Region.Framework.Scenes
153 } 153 }
154 } 154 }
155 } 155 }
156
157 public Animation[] ToArray()
158 {
159 Animation[] theArray = new Animation[m_animations.Count];
160 uint i = 0;
161 try
162 {
163 foreach (Animation anim in m_animations)
164 theArray[i++] = anim;
165 }
166 catch
167 {
168 /* S%^t happens. Ignore. */
169 }
170 return theArray;
171 }
172
173 public void FromArray(Animation[] theArray)
174 {
175 foreach (Animation anim in theArray)
176 m_animations.Add(anim);
177 }
156 } 178 }
157} 179}
diff --git a/OpenSim/Region/Framework/Scenes/ChildAgentDataUpdate.cs b/OpenSim/Region/Framework/Scenes/ChildAgentDataUpdate.cs
new file mode 100644
index 0000000..e181b91
--- /dev/null
+++ b/OpenSim/Region/Framework/Scenes/ChildAgentDataUpdate.cs
@@ -0,0 +1,506 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSim Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections;
30using System.Collections.Generic;
31using OpenSim.Framework;
32using OpenMetaverse;
33using OpenMetaverse.StructuredData;
34
35namespace OpenSim.Region.Framework.Scenes
36{
37 public interface IAgentData
38 {
39 UUID AgentID { get; set; }
40
41 OSDMap PackUpdateMessage();
42 void UnpackUpdateMessage(OSDMap map);
43 }
44
45 /// <summary>
46 /// Replacement for ChildAgentDataUpdate. Used over RESTComms and LocalComms.
47 /// </summary>
48 public class AgentPosition : IAgentData
49 {
50 private UUID m_id;
51 public UUID AgentID
52 {
53 get { return m_id; }
54 set { m_id = value; }
55 }
56
57 public ulong RegionHandle;
58 public uint CircuitCode;
59 public UUID SessionID;
60
61 public float Far;
62 public Vector3 Position;
63 public Vector3 Velocity;
64 public Vector3 Center;
65 public Vector3 Size;
66 public Vector3 AtAxis;
67 public Vector3 LeftAxis;
68 public Vector3 UpAxis;
69 public bool ChangedGrid;
70
71 // This probably shouldn't be here
72 public byte[] Throttles;
73
74
75 public OSDMap PackUpdateMessage()
76 {
77 OSDMap args = new OSDMap();
78 args["message_type"] = OSD.FromString("AgentPosition");
79
80 args["region_handle"] = OSD.FromString(RegionHandle.ToString());
81 args["circuit_code"] = OSD.FromString(CircuitCode.ToString());
82 args["agent_uuid"] = OSD.FromUUID(AgentID);
83 args["session_uuid"] = OSD.FromUUID(SessionID);
84
85 args["position"] = OSD.FromString(Position.ToString());
86 args["velocity"] = OSD.FromString(Velocity.ToString());
87 args["center"] = OSD.FromString(Center.ToString());
88 args["size"] = OSD.FromString(Size.ToString());
89 args["at_axis"] = OSD.FromString(AtAxis.ToString());
90 args["left_axis"] = OSD.FromString(LeftAxis.ToString());
91 args["up_axis"] = OSD.FromString(UpAxis.ToString());
92
93 args["far"] = OSD.FromReal(Far);
94 args["changed_grid"] = OSD.FromBoolean(ChangedGrid);
95
96 if ((Throttles != null) && (Throttles.Length > 0))
97 args["throttles"] = OSD.FromBinary(Throttles);
98
99 return args;
100 }
101
102 public void UnpackUpdateMessage(OSDMap args)
103 {
104 if (args.ContainsKey("region_handle"))
105 UInt64.TryParse(args["region_handle"].AsString(), out RegionHandle);
106
107 if (args["circuit_code"] != null)
108 UInt32.TryParse((string)args["circuit_code"].AsString(), out CircuitCode);
109
110 if (args["agent_uuid"] != null)
111 AgentID = args["agent_uuid"].AsUUID();
112
113 if (args["session_uuid"] != null)
114 SessionID = args["session_uuid"].AsUUID();
115
116 if (args["position"] != null)
117 Vector3.TryParse(args["position"].AsString(), out Position);
118
119 if (args["velocity"] != null)
120 Vector3.TryParse(args["velocity"].AsString(), out Velocity);
121
122 if (args["center"] != null)
123 Vector3.TryParse(args["center"].AsString(), out Center);
124
125 if (args["size"] != null)
126 Vector3.TryParse(args["size"].AsString(), out Size);
127
128 if (args["at_axis"] != null)
129 Vector3.TryParse(args["at_axis"].AsString(), out AtAxis);
130
131 if (args["left_axis"] != null)
132 Vector3.TryParse(args["left_axis"].AsString(), out AtAxis);
133
134 if (args["up_axis"] != null)
135 Vector3.TryParse(args["up_axis"].AsString(), out AtAxis);
136
137 if (args["changed_grid"] != null)
138 ChangedGrid = args["changed_grid"].AsBoolean();
139
140 if (args["far"] != null)
141 Far = (float)(args["far"].AsReal());
142
143 if (args["throttles"] != null)
144 Throttles = args["throttles"].AsBinary();
145 }
146
147 /// <summary>
148 /// Soon to be decommissioned
149 /// </summary>
150 /// <param name="cAgent"></param>
151 public void CopyFrom(ChildAgentDataUpdate cAgent)
152 {
153 AgentID = new UUID(cAgent.AgentID);
154
155 // next: ???
156 Size = new Vector3();
157 Size.Z = cAgent.AVHeight;
158
159 Center = new Vector3(cAgent.cameraPosition.x, cAgent.cameraPosition.y, cAgent.cameraPosition.z);
160 Far = cAgent.drawdistance;
161 Position = new Vector3(cAgent.Position.x, cAgent.Position.y, cAgent.Position.z);
162 RegionHandle = cAgent.regionHandle;
163 Throttles = cAgent.throttles;
164 Velocity = new Vector3(cAgent.Velocity.x, cAgent.Velocity.y, cAgent.Velocity.z);
165 }
166
167 }
168
169 public class AgentGroupData
170 {
171 public UUID GroupID;
172 public ulong GroupPowers;
173 public bool AcceptNotices;
174
175 public AgentGroupData(UUID id, ulong powers, bool notices)
176 {
177 GroupID = id;
178 GroupPowers = powers;
179 AcceptNotices = notices;
180 }
181
182 public AgentGroupData(OSDMap args)
183 {
184 UnpackUpdateMessage(args);
185 }
186
187 public OSDMap PackUpdateMessage()
188 {
189 OSDMap groupdata = new OSDMap();
190 groupdata["group_id"] = OSD.FromUUID(GroupID);
191 groupdata["group_powers"] = OSD.FromString(GroupPowers.ToString());
192 groupdata["accept_notices"] = OSD.FromBoolean(AcceptNotices);
193
194 return groupdata;
195 }
196
197 public void UnpackUpdateMessage(OSDMap args)
198 {
199 if (args["group_id"] != null)
200 GroupID = args["group_id"].AsUUID();
201 if (args["group_powers"] != null)
202 UInt64.TryParse((string)args["group_powers"].AsString(), out GroupPowers);
203 if (args["accept_notices"] != null)
204 AcceptNotices = args["accept_notices"].AsBoolean();
205 }
206 }
207
208 //public class AgentAnimationData
209 //{
210 // public UUID Animation;
211 // public UUID ObjectID;
212
213 // public AgentAnimationData(UUID anim, UUID obj)
214 // {
215 // Animation = anim;
216 // ObjectID = obj;
217 // }
218
219 // public AgentAnimationData(OSDMap args)
220 // {
221 // UnpackUpdateMessage(args);
222 // }
223
224 // public OSDMap PackUpdateMessage()
225 // {
226 // OSDMap anim = new OSDMap();
227 // anim["animation"] = OSD.FromUUID(Animation);
228 // anim["object_id"] = OSD.FromUUID(ObjectID);
229 // return anim;
230 // }
231
232 // public void UnpackUpdateMessage(OSDMap args)
233 // {
234 // if (args["animation"] != null)
235 // Animation = args["animation"].AsUUID();
236 // if (args["object_id"] != null)
237 // ObjectID = args["object_id"].AsUUID();
238 // }
239 //}
240
241 public class AgentData : IAgentData
242 {
243 private UUID m_id;
244 public UUID AgentID
245 {
246 get { return m_id; }
247 set { m_id = value; }
248 }
249 public ulong RegionHandle;
250 public uint CircuitCode;
251 public UUID SessionID;
252
253 public Vector3 Position;
254 public Vector3 Velocity;
255 public Vector3 Center;
256 public Vector3 Size;
257 public Vector3 AtAxis;
258 public Vector3 LeftAxis;
259 public Vector3 UpAxis;
260 public bool ChangedGrid;
261
262 public float Far;
263 public float Aspect;
264 //public int[] Throttles;
265 public byte[] Throttles;
266
267 public uint LocomotionState;
268 public Quaternion HeadRotation;
269 public Quaternion BodyRotation;
270 public uint ControlFlags;
271 public float EnergyLevel;
272 public Byte GodLevel;
273 public bool AlwaysRun;
274 public UUID PreyAgent;
275 public Byte AgentAccess;
276 public UUID[] AgentTextures;
277 public UUID ActiveGroupID;
278
279 public AgentGroupData[] Groups;
280 public Animation[] Anims;
281
282 public UUID GranterID;
283 public Dictionary<string, string> NVPairs;
284
285 public byte[] VisualParams;
286
287 public string CallbackURI;
288
289 public OSDMap PackUpdateMessage()
290 {
291 OSDMap args = new OSDMap();
292 args["message_type"] = OSD.FromString("AgentData");
293
294 args["region_handle"] = OSD.FromString(RegionHandle.ToString());
295 args["circuit_code"] = OSD.FromString(CircuitCode.ToString());
296 args["agent_uuid"] = OSD.FromUUID(AgentID);
297 args["session_uuid"] = OSD.FromUUID(SessionID);
298
299 args["position"] = OSD.FromString(Position.ToString());
300 args["velocity"] = OSD.FromString(Velocity.ToString());
301 args["center"] = OSD.FromString(Center.ToString());
302 args["size"] = OSD.FromString(Size.ToString());
303 args["at_axis"] = OSD.FromString(AtAxis.ToString());
304 args["left_axis"] = OSD.FromString(LeftAxis.ToString());
305 args["up_axis"] = OSD.FromString(UpAxis.ToString());
306
307 args["changed_grid"] = OSD.FromBoolean(ChangedGrid);
308 args["far"] = OSD.FromReal(Far);
309 args["aspect"] = OSD.FromReal(Aspect);
310
311 if ((Throttles != null) && (Throttles.Length > 0))
312 args["throttles"] = OSD.FromBinary(Throttles);
313
314 args["locomotion_state"] = OSD.FromString(LocomotionState.ToString());
315 args["head_rotation"] = OSD.FromString(HeadRotation.ToString());
316 args["body_rotation"] = OSD.FromString(BodyRotation.ToString());
317 args["control_flags"] = OSD.FromString(ControlFlags.ToString());
318
319 args["energy_level"] = OSD.FromReal(EnergyLevel);
320 args["god_level"] = OSD.FromString(GodLevel.ToString());
321 args["always_run"] = OSD.FromBoolean(AlwaysRun);
322 args["prey_agent"] = OSD.FromUUID(PreyAgent);
323 args["agent_access"] = OSD.FromString(AgentAccess.ToString());
324
325 if ((AgentTextures != null) && (AgentTextures.Length > 0))
326 {
327 OSDArray textures = new OSDArray(AgentTextures.Length);
328 foreach (UUID uuid in AgentTextures)
329 textures.Add(OSD.FromUUID(uuid));
330 args["agent_textures"] = textures;
331 }
332
333 args["active_group_id"] = OSD.FromUUID(ActiveGroupID);
334
335 if ((Groups != null) && (Groups.Length > 0))
336 {
337 OSDArray groups = new OSDArray(Groups.Length);
338 foreach (AgentGroupData agd in Groups)
339 groups.Add(agd.PackUpdateMessage());
340 args["groups"] = groups;
341 }
342
343 if ((Anims != null) && (Anims.Length > 0))
344 {
345 OSDArray anims = new OSDArray(Anims.Length);
346 foreach (Animation aanim in Anims)
347 anims.Add(aanim.PackUpdateMessage());
348 args["animations"] = anims;
349 }
350
351 if ((VisualParams != null) && (VisualParams.Length > 0))
352 args["visual_params"] = OSD.FromBinary(VisualParams);
353
354 // Last few fields are still missing: granter and NVPais
355
356 if ((CallbackURI != null) && (!CallbackURI.Equals("")))
357 args["callback_uri"] = OSD.FromString(CallbackURI);
358
359 return args;
360 }
361
362 /// <summary>
363 /// Deserialization of agent data.
364 /// Avoiding reflection makes it painful to write, but that's the price!
365 /// </summary>
366 /// <param name="hash"></param>
367 public void UnpackUpdateMessage(OSDMap args)
368 {
369 if (args.ContainsKey("region_handle"))
370 UInt64.TryParse(args["region_handle"].AsString(), out RegionHandle);
371
372 if (args["circuit_code"] != null)
373 UInt32.TryParse((string)args["circuit_code"].AsString(), out CircuitCode);
374
375 if (args["agent_uuid"] != null)
376 AgentID = args["agent_uuid"].AsUUID();
377
378 if (args["session_uuid"] != null)
379 SessionID = args["session_uuid"].AsUUID();
380
381 if (args["position"] != null)
382 Vector3.TryParse(args["position"].AsString(), out Position);
383
384 if (args["velocity"] != null)
385 Vector3.TryParse(args["velocity"].AsString(), out Velocity);
386
387 if (args["center"] != null)
388 Vector3.TryParse(args["center"].AsString(), out Center);
389
390 if (args["size"] != null)
391 Vector3.TryParse(args["size"].AsString(), out Size);
392
393 if (args["at_axis"] != null)
394 Vector3.TryParse(args["at_axis"].AsString(), out AtAxis);
395
396 if (args["left_axis"] != null)
397 Vector3.TryParse(args["left_axis"].AsString(), out AtAxis);
398
399 if (args["up_axis"] != null)
400 Vector3.TryParse(args["up_axis"].AsString(), out AtAxis);
401
402 if (args["changed_grid"] != null)
403 ChangedGrid = args["changed_grid"].AsBoolean();
404
405 if (args["far"] != null)
406 Far = (float)(args["far"].AsReal());
407
408 if (args["aspect"] != null)
409 Aspect = (float)args["aspect"].AsReal();
410
411 if (args["throttles"] != null)
412 Throttles = args["throttles"].AsBinary();
413
414 if (args["locomotion_state"] != null)
415 UInt32.TryParse(args["locomotion_state"].AsString(), out LocomotionState);
416
417 if (args["head_rotation"] != null)
418 Quaternion.TryParse(args["head_rotation"].AsString(), out HeadRotation);
419
420 if (args["body_rotation"] != null)
421 Quaternion.TryParse(args["body_rotation"].AsString(), out BodyRotation);
422
423 if (args["control_flags"] != null)
424 UInt32.TryParse(args["control_flags"].AsString(), out ControlFlags);
425
426 if (args["energy_level"] != null)
427 EnergyLevel = (float)(args["energy_level"].AsReal());
428
429 if (args["god_level"] != null)
430 Byte.TryParse(args["god_level"].AsString(), out GodLevel);
431
432 if (args["always_run"] != null)
433 AlwaysRun = args["always_run"].AsBoolean();
434
435 if (args["prey_agent"] != null)
436 PreyAgent = args["prey_agent"].AsUUID();
437
438 if (args["agent_access"] != null)
439 Byte.TryParse(args["agent_access"].AsString(), out AgentAccess);
440
441 if ((args["agent_textures"] != null) && (args["agent_textures"]).Type == OSDType.Array)
442 {
443 OSDArray textures = (OSDArray)(args["agent_textures"]);
444 AgentTextures = new UUID[textures.Count];
445 int i = 0;
446 foreach (OSD o in textures)
447 AgentTextures[i++] = o.AsUUID();
448 }
449
450 if (args["active_group_id"] != null)
451 ActiveGroupID = args["active_group_id"].AsUUID();
452
453 if ((args["groups"] != null) && (args["groups"]).Type == OSDType.Array)
454 {
455 OSDArray groups = (OSDArray)(args["groups"]);
456 Groups = new AgentGroupData[groups.Count];
457 int i = 0;
458 foreach (OSD o in groups)
459 {
460 if (o.Type == OSDType.Map)
461 {
462 Groups[i++] = new AgentGroupData((OSDMap)o);
463 }
464 }
465 }
466
467 if ((args["animations"] != null) && (args["animations"]).Type == OSDType.Array)
468 {
469 OSDArray anims = (OSDArray)(args["animations"]);
470 Anims = new Animation[anims.Count];
471 int i = 0;
472 foreach (OSD o in anims)
473 {
474 if (o.Type == OSDType.Map)
475 {
476 Anims[i++] = new Animation((OSDMap)o);
477 }
478 }
479 }
480
481 if (args["visual_params"] != null)
482 VisualParams = args["visual_params"].AsBinary();
483
484 if (args["callback_uri"] != null)
485 CallbackURI = args["callback_uri"].AsString();
486 }
487
488 public AgentData()
489 {
490 }
491
492 public AgentData(Hashtable hash)
493 {
494 //UnpackUpdateMessage(hash);
495 }
496
497 public void Dump()
498 {
499 System.Console.WriteLine("------------ AgentData ------------");
500 System.Console.WriteLine("UUID: " + AgentID);
501 System.Console.WriteLine("Region: " + RegionHandle);
502 System.Console.WriteLine("Position: " + Position);
503 }
504 }
505
506}
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
index 4c10e2c..d0156e1 100644
--- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
@@ -904,6 +904,10 @@ namespace OpenSim.Region.Framework.Scenes
904 avatar.Close(); 904 avatar.Close();
905 CloseConnection(avatar.UUID); 905 CloseConnection(avatar.UUID);
906 } 906 }
907 else
908 // now we have a child agent in this region.
909 avatar.Reset();
910
907 911
908 // if (teleport success) // seems to be always success here 912 // if (teleport success) // seems to be always success here
909 // the user may change their profile information in other region, 913 // the user may change their profile information in other region,
@@ -1180,8 +1184,7 @@ namespace OpenSim.Region.Framework.Scenes
1180 // If the cross was successful, this agent is a child agent 1184 // If the cross was successful, this agent is a child agent
1181 if (agent.IsChildAgent) 1185 if (agent.IsChildAgent)
1182 { 1186 {
1183 // Put the child agent back at the center 1187 agent.Reset();
1184 agent.AbsolutePosition = new Vector3(128, 128, 70);
1185 } 1188 }
1186 else // Not successful 1189 else // Not successful
1187 { 1190 {
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index fed541f..df6c97a 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1049,7 +1049,6 @@ namespace OpenSim.Region.Framework.Scenes
1049 } 1049 }
1050 1050
1051 m_controllingClient.MoveAgentIntoRegion(m_regionInfo, AbsolutePosition, look); 1051 m_controllingClient.MoveAgentIntoRegion(m_regionInfo, AbsolutePosition, look);
1052
1053 SendInitialData(); 1052 SendInitialData();
1054 1053
1055 } 1054 }
@@ -1760,11 +1759,10 @@ namespace OpenSim.Region.Framework.Scenes
1760 return; 1759 return;
1761 1760
1762 if (m_animations.Add(animID, m_controllingClient.NextAnimationSequenceNumber, objectID)) 1761 if (m_animations.Add(animID, m_controllingClient.NextAnimationSequenceNumber, objectID))
1763 {
1764 SendAnimPack(); 1762 SendAnimPack();
1765 }
1766 } 1763 }
1767 1764
1765 // Called from scripts
1768 public void AddAnimation(string name, UUID objectID) 1766 public void AddAnimation(string name, UUID objectID)
1769 { 1767 {
1770 if (m_isChildAgent) 1768 if (m_isChildAgent)
@@ -1783,11 +1781,10 @@ namespace OpenSim.Region.Framework.Scenes
1783 return; 1781 return;
1784 1782
1785 if (m_animations.Remove(animID)) 1783 if (m_animations.Remove(animID))
1786 {
1787 SendAnimPack(); 1784 SendAnimPack();
1788 }
1789 } 1785 }
1790 1786
1787 // Called from scripts
1791 public void RemoveAnimation(string name) 1788 public void RemoveAnimation(string name)
1792 { 1789 {
1793 if (m_isChildAgent) 1790 if (m_isChildAgent)
@@ -2152,6 +2149,8 @@ namespace OpenSim.Region.Framework.Scenes
2152 } 2149 }
2153 m_scene.AddAgentUpdates(avatars.Count); 2150 m_scene.AddAgentUpdates(avatars.Count);
2154 m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); 2151 m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS);
2152
2153 //SendAnimPack();
2155 } 2154 }
2156 2155
2157 public void SendFullUpdateToAllClients() 2156 public void SendFullUpdateToAllClients()
@@ -2256,7 +2255,6 @@ namespace OpenSim.Region.Framework.Scenes
2256 m_scene.CommsManager.AvatarService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance); 2255 m_scene.CommsManager.AvatarService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance);
2257 2256
2258 SendAppearanceToAllOtherAgents(); 2257 SendAppearanceToAllOtherAgents();
2259 //SendWearables();
2260 if (!m_startAnimationSet) 2258 if (!m_startAnimationSet)
2261 { 2259 {
2262 UpdateMovementAnimations(); 2260 UpdateMovementAnimations();
@@ -2312,7 +2310,7 @@ namespace OpenSim.Region.Framework.Scenes
2312 /// </summary> 2310 /// </summary>
2313 public void SendAnimPack() 2311 public void SendAnimPack()
2314 { 2312 {
2315 //m_log.Debug("Sending animation pack"); 2313 //m_log.Debug("Sending animation pack to all");
2316 2314
2317 if (m_isChildAgent) 2315 if (m_isChildAgent)
2318 return; 2316 return;
@@ -2326,6 +2324,7 @@ namespace OpenSim.Region.Framework.Scenes
2326 SendAnimPack(animIDs, sequenceNums, objectIDs); 2324 SendAnimPack(animIDs, sequenceNums, objectIDs);
2327 } 2325 }
2328 2326
2327
2329 #endregion 2328 #endregion
2330 2329
2331 #region Significant Movement Method 2330 #region Significant Movement Method
@@ -2454,6 +2453,13 @@ namespace OpenSim.Region.Framework.Scenes
2454 AddToPhysicalScene(false); // not exactly false 2453 AddToPhysicalScene(false); // not exactly false
2455 } 2454 }
2456 2455
2456 public void Reset()
2457 {
2458 // Put the child agent back at the center
2459 AbsolutePosition = new Vector3(128, 128, 70);
2460 m_animations.Clear();
2461 }
2462
2457 /// <summary> 2463 /// <summary>
2458 /// Computes which child agents to close when the scene presence moves to another region. 2464 /// Computes which child agents to close when the scene presence moves to another region.
2459 /// Removes those regions from m_knownRegions. 2465 /// Removes those regions from m_knownRegions.
@@ -2618,11 +2624,6 @@ namespace OpenSim.Region.Framework.Scenes
2618 2624
2619 cAgent.AlwaysRun = m_setAlwaysRun; 2625 cAgent.AlwaysRun = m_setAlwaysRun;
2620 2626
2621 //cAgent.GroupID = ??
2622 // Groups???
2623
2624 // Animations???
2625
2626 try 2627 try
2627 { 2628 {
2628 int i = 0; 2629 int i = 0;
@@ -2644,10 +2645,16 @@ namespace OpenSim.Region.Framework.Scenes
2644 { 2645 {
2645 m_log.Warn("[SCENE PRESENCE]: exception in CopyTo " + e.Message); 2646 m_log.Warn("[SCENE PRESENCE]: exception in CopyTo " + e.Message);
2646 } 2647 }
2647 //cAgent.GroupID = ??
2648 // Groups???
2649 2648
2650 // Animations??? 2649 // Animations
2650 try
2651 {
2652 cAgent.Anims = m_animations.ToArray();
2653 }
2654 catch { }
2655
2656 // cAgent.GroupID = ??
2657 // Groups???
2651 2658
2652 } 2659 }
2653 2660
@@ -2697,10 +2704,17 @@ namespace OpenSim.Region.Framework.Scenes
2697 m_log.Warn("[SCENE PRESENCE]: exception in CopyFrom " + e.Message); 2704 m_log.Warn("[SCENE PRESENCE]: exception in CopyFrom " + e.Message);
2698 } 2705 }
2699 2706
2707 // Animations
2708 try
2709 {
2710 m_animations.Clear();
2711 m_animations.FromArray(cAgent.Anims);
2712 }
2713 catch { }
2714
2700 //cAgent.GroupID = ?? 2715 //cAgent.GroupID = ??
2701 //Groups??? 2716 //Groups???
2702 2717
2703 // Animations???
2704 2718
2705 } 2719 }
2706 2720