From 7556a0f699f8474b7ac23cbebacc695c93f374fa Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Tue, 11 Jun 2013 17:18:12 -0700 Subject: [PATCH] Add TriggerScenePresenceUpdated events when an animation is added or removed. Shouldn't impact anyone as only DSG seems to use OnScenePresenceUpdated event. Some minor format changes to AnimationSet's ToString(). --- OpenSim/Framework/Animation.cs | 5 ++--- OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs | 8 ++++++-- .../Framework/Scenes/Animation/ScenePresenceAnimator.cs | 2 ++ OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/OpenSim/Framework/Animation.cs b/OpenSim/Framework/Animation.cs index 8bdf8f4373..34255058ca 100644 --- a/OpenSim/Framework/Animation.cs +++ b/OpenSim/Framework/Animation.cs @@ -125,11 +125,10 @@ namespace OpenSim.Framework Animation other = obj as Animation; if (other != null) { - return (other.AnimID == this.AnimID + return (other.AnimID.Equals(this.AnimID) && other.SequenceNum == this.SequenceNum - && other.ObjectID == this.ObjectID); + && other.ObjectID.Equals(this.ObjectID) ); } - return base.Equals(obj); } diff --git a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs index 5dee64d0b5..b7400ea8ca 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs @@ -312,18 +312,22 @@ namespace OpenSim.Region.Framework.Scenes.Animation buff.Append("dflt="); buff.Append(DefaultAnimation.ToString()); buff.Append(",iDflt="); - if (DefaultAnimation == ImplicitDefaultAnimation) + if (DefaultAnimation.Equals(ImplicitDefaultAnimation)) buff.Append("same"); else buff.Append(ImplicitDefaultAnimation.ToString()); if (m_animations.Count > 0) { buff.Append(",anims="); + bool firstTime = true; foreach (OpenSim.Framework.Animation anim in m_animations) { + if (!firstTime) + buff.Append(","); buff.Append("<"); buff.Append(anim.ToString()); - buff.Append(">,"); + buff.Append(">"); + firstTime = false; } } return buff.ToString(); diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index a701a79081..3b5a5bd6f2 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -94,6 +94,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation if (m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, objectID)) { SendAnimPack(); + m_scenePresence.TriggerScenePresenceUpdated(); } } @@ -135,6 +136,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation if (m_animations.Remove(animID, allowNoDefault)) { SendAnimPack(); + m_scenePresence.TriggerScenePresenceUpdated(); } } diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index bab14dd3de..774546c693 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -77,7 +77,7 @@ namespace OpenSim.Region.Framework.Scenes // m_log.DebugFormat("[SCENE PRESENCE]: Destructor called on {0}", Name); // } - private void TriggerScenePresenceUpdated() + public void TriggerScenePresenceUpdated() { if (m_scene != null) m_scene.EventManager.TriggerScenePresenceUpdated(this);