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().
cpu-performance
Robert Adams 2013-06-11 17:18:12 -07:00
parent 135e10ba09
commit 7556a0f699
4 changed files with 11 additions and 6 deletions

View File

@ -125,11 +125,10 @@ namespace OpenSim.Framework
Animation other = obj as Animation; Animation other = obj as Animation;
if (other != null) if (other != null)
{ {
return (other.AnimID == this.AnimID return (other.AnimID.Equals(this.AnimID)
&& other.SequenceNum == this.SequenceNum && other.SequenceNum == this.SequenceNum
&& other.ObjectID == this.ObjectID); && other.ObjectID.Equals(this.ObjectID) );
} }
return base.Equals(obj); return base.Equals(obj);
} }

View File

@ -312,18 +312,22 @@ namespace OpenSim.Region.Framework.Scenes.Animation
buff.Append("dflt="); buff.Append("dflt=");
buff.Append(DefaultAnimation.ToString()); buff.Append(DefaultAnimation.ToString());
buff.Append(",iDflt="); buff.Append(",iDflt=");
if (DefaultAnimation == ImplicitDefaultAnimation) if (DefaultAnimation.Equals(ImplicitDefaultAnimation))
buff.Append("same"); buff.Append("same");
else else
buff.Append(ImplicitDefaultAnimation.ToString()); buff.Append(ImplicitDefaultAnimation.ToString());
if (m_animations.Count > 0) if (m_animations.Count > 0)
{ {
buff.Append(",anims="); buff.Append(",anims=");
bool firstTime = true;
foreach (OpenSim.Framework.Animation anim in m_animations) foreach (OpenSim.Framework.Animation anim in m_animations)
{ {
if (!firstTime)
buff.Append(",");
buff.Append("<"); buff.Append("<");
buff.Append(anim.ToString()); buff.Append(anim.ToString());
buff.Append(">,"); buff.Append(">");
firstTime = false;
} }
} }
return buff.ToString(); return buff.ToString();

View File

@ -94,6 +94,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
if (m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, objectID)) if (m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, objectID))
{ {
SendAnimPack(); SendAnimPack();
m_scenePresence.TriggerScenePresenceUpdated();
} }
} }
@ -135,6 +136,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
if (m_animations.Remove(animID, allowNoDefault)) if (m_animations.Remove(animID, allowNoDefault))
{ {
SendAnimPack(); SendAnimPack();
m_scenePresence.TriggerScenePresenceUpdated();
} }
} }

View File

@ -77,7 +77,7 @@ namespace OpenSim.Region.Framework.Scenes
// m_log.DebugFormat("[SCENE PRESENCE]: Destructor called on {0}", Name); // m_log.DebugFormat("[SCENE PRESENCE]: Destructor called on {0}", Name);
// } // }
private void TriggerScenePresenceUpdated() public void TriggerScenePresenceUpdated()
{ {
if (m_scene != null) if (m_scene != null)
m_scene.EventManager.TriggerScenePresenceUpdated(this); m_scene.EventManager.TriggerScenePresenceUpdated(this);