aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorUbitUmarov2014-09-09 21:53:27 +0100
committerUbitUmarov2014-09-09 21:53:27 +0100
commit016e58e354e11825510e1c4bc534e275168577bc (patch)
tree9fe32c4d9739df545096f88d47d30c45cb0758c0
parentPlumb the rest of the serverside AO (diff)
downloadopensim-SC-016e58e354e11825510e1c4bc534e275168577bc.zip
opensim-SC-016e58e354e11825510e1c4bc534e275168577bc.tar.gz
opensim-SC-016e58e354e11825510e1c4bc534e275168577bc.tar.bz2
opensim-SC-016e58e354e11825510e1c4bc534e275168577bc.tar.xz
*test*
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/ChildAgentDataUpdate.cs36
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/MovementAnimationOverrides.cs17
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs6
3 files changed, 58 insertions, 1 deletions
diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs
index 91df64d..538e1b5 100644
--- a/OpenSim/Framework/ChildAgentDataUpdate.cs
+++ b/OpenSim/Framework/ChildAgentDataUpdate.cs
@@ -349,6 +349,8 @@ namespace OpenSim.Framework
349 public List<ISceneObject> AttachmentObjects; 349 public List<ISceneObject> AttachmentObjects;
350 public List<string> AttachmentObjectStates; 350 public List<string> AttachmentObjectStates;
351 351
352 public Dictionary<string, UUID> MovementAnimationOverRides = new Dictionary<string, UUID>();
353
352 public virtual OSDMap Pack() 354 public virtual OSDMap Pack()
353 { 355 {
354// m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Pack data"); 356// m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Pack data");
@@ -417,6 +419,21 @@ namespace OpenSim.Framework
417 args["animation_state"] = AnimState.PackUpdateMessage(); 419 args["animation_state"] = AnimState.PackUpdateMessage();
418 } 420 }
419 421
422 if (MovementAnimationOverRides.Count > 0)
423 {
424 OSDArray AOs = new OSDArray(MovementAnimationOverRides.Count);
425 {
426 foreach (KeyValuePair<string, UUID> kvp in MovementAnimationOverRides)
427 {
428 OSDMap ao = new OSDMap(2);
429 ao["state"] = OSD.FromString(kvp.Key);
430 ao["uuid"] = OSD.FromUUID(kvp.Value);
431 AOs.Add(ao);
432 }
433 }
434 args["movementAO"] = AOs;
435 }
436
420 if (Appearance != null) 437 if (Appearance != null)
421 args["packed_appearance"] = Appearance.Pack(); 438 args["packed_appearance"] = Appearance.Pack();
422 439
@@ -640,6 +657,25 @@ namespace OpenSim.Framework
640 } 657 }
641 } 658 }
642 659
660 MovementAnimationOverRides.Clear();
661
662 if (args["movementAO"] != null && args["movementAO"].Type == OSDType.Array)
663 {
664 OSDArray AOs = (OSDArray)(args["movementAO"]);
665 int count = AOs.Count;
666
667 for (int i = 0; i < count; i++)
668 {
669 OSDMap ao = (OSDMap)AOs[i];
670 if (ao["state"] != null && ao["uuid"] != null)
671 {
672 string state = ao["state"].AsString();
673 UUID id = ao["uuid"].AsUUID();
674 MovementAnimationOverRides[state] = id;
675 }
676 }
677 }
678
643 //if ((args["agent_textures"] != null) && (args["agent_textures"]).Type == OSDType.Array) 679 //if ((args["agent_textures"] != null) && (args["agent_textures"]).Type == OSDType.Array)
644 //{ 680 //{
645 // OSDArray textures = (OSDArray)(args["agent_textures"]); 681 // OSDArray textures = (OSDArray)(args["agent_textures"]);
diff --git a/OpenSim/Region/Framework/Scenes/Animation/MovementAnimationOverrides.cs b/OpenSim/Region/Framework/Scenes/Animation/MovementAnimationOverrides.cs
index db4003e..31fdb2c 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/MovementAnimationOverrides.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation/MovementAnimationOverrides.cs
@@ -80,5 +80,22 @@ namespace OpenSim.Region.Framework.Scenes
80 80
81 return UUID.Zero; 81 return UUID.Zero;
82 } 82 }
83
84 public Dictionary<string, UUID> CloneAOPairs()
85 {
86 lock (m_overrides)
87 {
88 return new Dictionary<string, UUID>(m_overrides);
89 }
90 }
91
92 public void CopyAOPairsFrom(Dictionary<string, UUID> src)
93 {
94 lock (m_overrides)
95 {
96 m_overrides.Clear();
97 m_overrides = new Dictionary<string, UUID>(src);
98 }
99 }
83 } 100 }
84} 101}
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index b6eb4e4..7c515d5 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -4212,6 +4212,8 @@ namespace OpenSim.Region.Framework.Scenes
4212 cAgent.DefaultAnim = Animator.Animations.DefaultAnimation; 4212 cAgent.DefaultAnim = Animator.Animations.DefaultAnimation;
4213 cAgent.AnimState = Animator.Animations.ImplicitDefaultAnimation; 4213 cAgent.AnimState = Animator.Animations.ImplicitDefaultAnimation;
4214 4214
4215 cAgent.MovementAnimationOverRides = Overrides.CloneAOPairs();
4216
4215 if (Scene.AttachmentsModule != null) 4217 if (Scene.AttachmentsModule != null)
4216 Scene.AttachmentsModule.CopyAttachments(this, cAgent); 4218 Scene.AttachmentsModule.CopyAttachments(this, cAgent);
4217 } 4219 }
@@ -4282,7 +4284,9 @@ namespace OpenSim.Region.Framework.Scenes
4282 catch { } 4284 catch { }
4283 4285
4284 Animator.ResetAnimations(); 4286 Animator.ResetAnimations();
4285 4287
4288 Overrides.CopyAOPairsFrom(cAgent.MovementAnimationOverRides);
4289
4286 // FIXME: Why is this null check necessary? Where are the cases where we get a null Anims object? 4290 // FIXME: Why is this null check necessary? Where are the cases where we get a null Anims object?
4287 if (cAgent.DefaultAnim != null) 4291 if (cAgent.DefaultAnim != null)
4288 Animator.Animations.SetDefaultAnimation(cAgent.DefaultAnim.AnimID, cAgent.DefaultAnim.SequenceNum, UUID.Zero); 4292 Animator.Animations.SetDefaultAnimation(cAgent.DefaultAnim.AnimID, cAgent.DefaultAnim.SequenceNum, UUID.Zero);