From 31307849342c36c133b5cb8039296116c5456136 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Tue, 17 Feb 2009 04:16:42 +0000
Subject: Re-add the objectID field to the anim pack, that was deemed
unneccessary and dropped nonths ago, because it is required to get smooth
region crossings with AO running. Without it, in some corner cases, anims
will continue to run in an unstoppable state.
---
OpenSim/Region/Framework/Scenes/Animation.cs | 10 +++++++-
OpenSim/Region/Framework/Scenes/AnimationSet.cs | 18 ++++++++-------
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 29 +++++++++++++-----------
3 files changed, 35 insertions(+), 22 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Animation.cs b/OpenSim/Region/Framework/Scenes/Animation.cs
index cb0afa7..6f0681c 100644
--- a/OpenSim/Region/Framework/Scenes/Animation.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation.cs
@@ -45,14 +45,22 @@ namespace OpenSim.Region.Framework.Scenes
set { sequenceNum = value; }
}
+ private UUID objectID;
+ public UUID ObjectID
+ {
+ get { return objectID; }
+ set { objectID = value; }
+ }
+
public Animation()
{
}
- public Animation(UUID animID, int sequenceNum)
+ public Animation(UUID animID, int sequenceNum, UUID objectID)
{
this.animID = animID;
this.sequenceNum = sequenceNum;
+ this.objectID = objectID;
}
}
}
diff --git a/OpenSim/Region/Framework/Scenes/AnimationSet.cs b/OpenSim/Region/Framework/Scenes/AnimationSet.cs
index 49bcda8..864e599 100644
--- a/OpenSim/Region/Framework/Scenes/AnimationSet.cs
+++ b/OpenSim/Region/Framework/Scenes/AnimationSet.cs
@@ -60,13 +60,13 @@ namespace OpenSim.Region.Framework.Scenes
return false;
}
- public bool Add(UUID animID, int sequenceNum)
+ public bool Add(UUID animID, int sequenceNum, UUID objectID)
{
lock (m_animations)
{
if (!HasAnimation(animID))
{
- m_animations.Add(new Animation(animID, sequenceNum));
+ m_animations.Add(new Animation(animID, sequenceNum, objectID));
return true;
}
}
@@ -106,11 +106,11 @@ namespace OpenSim.Region.Framework.Scenes
/// The default animation is reserved for "main" animations
/// that are mutually exclusive, e.g. flying and sitting.
///
- public bool SetDefaultAnimation(UUID animID, int sequenceNum)
+ public bool SetDefaultAnimation(UUID animID, int sequenceNum, UUID objectID)
{
if (m_defaultAnimation.AnimID != animID)
{
- m_defaultAnimation = new Animation(animID, sequenceNum);
+ m_defaultAnimation = new Animation(animID, sequenceNum, objectID);
return true;
}
return false;
@@ -118,27 +118,28 @@ namespace OpenSim.Region.Framework.Scenes
protected bool ResetDefaultAnimation()
{
- return TrySetDefaultAnimation("STAND", 1);
+ return TrySetDefaultAnimation("STAND", 1, UUID.Zero);
}
///
/// Set the animation as the default animation if it's known
///
- public bool TrySetDefaultAnimation(string anim, int sequenceNum)
+ public bool TrySetDefaultAnimation(string anim, int sequenceNum, UUID objectID)
{
if (Animations.AnimsUUID.ContainsKey(anim))
{
- return SetDefaultAnimation(Animations.AnimsUUID[anim], sequenceNum);
+ return SetDefaultAnimation(Animations.AnimsUUID[anim], sequenceNum, objectID);
}
return false;
}
- public void GetArrays(out UUID[] animIDs, out int[] sequenceNums)
+ public void GetArrays(out UUID[] animIDs, out int[] sequenceNums, out UUID[] objectIDs)
{
lock (m_animations)
{
animIDs = new UUID[m_animations.Count + 1];
sequenceNums = new int[m_animations.Count + 1];
+ objectIDs = new UUID[m_animations.Count + 1];
animIDs[0] = m_defaultAnimation.AnimID;
sequenceNums[0] = m_defaultAnimation.SequenceNum;
@@ -147,6 +148,7 @@ namespace OpenSim.Region.Framework.Scenes
{
animIDs[i + 1] = m_animations[i].AnimID;
sequenceNums[i + 1] = m_animations[i].SequenceNum;
+ objectIDs[i + i] = m_animations[i].ObjectID;
}
}
}
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index fc3166a..a488f59 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1754,18 +1754,18 @@ namespace OpenSim.Region.Framework.Scenes
}
}
- public void AddAnimation(UUID animID)
+ public void AddAnimation(UUID animID, UUID objectID)
{
if (m_isChildAgent)
return;
- if (m_animations.Add(animID, m_controllingClient.NextAnimationSequenceNumber))
+ if (m_animations.Add(animID, m_controllingClient.NextAnimationSequenceNumber, objectID))
{
SendAnimPack();
}
}
- public void AddAnimation(string name)
+ public void AddAnimation(string name, UUID objectID)
{
if (m_isChildAgent)
return;
@@ -1774,7 +1774,7 @@ namespace OpenSim.Region.Framework.Scenes
if (animID == UUID.Zero)
return;
- AddAnimation(animID);
+ AddAnimation(animID, objectID);
}
public void RemoveAnimation(UUID animID)
@@ -1804,13 +1804,14 @@ namespace OpenSim.Region.Framework.Scenes
{
UUID[] animIDs;
int[] sequenceNums;
- m_animations.GetArrays( out animIDs, out sequenceNums );
+ UUID[] objectIDs;
+ m_animations.GetArrays( out animIDs, out sequenceNums, out objectIDs);
return animIDs;
}
public void HandleStartAnim(IClientAPI remoteClient, UUID animID)
{
- AddAnimation(animID);
+ AddAnimation(animID, UUID.Zero);
}
public void HandleStopAnim(IClientAPI remoteClient, UUID animID)
@@ -1826,7 +1827,7 @@ namespace OpenSim.Region.Framework.Scenes
{
//m_log.DebugFormat("Updating movement animation to {0}", anim);
- if (m_animations.TrySetDefaultAnimation(anim, m_controllingClient.NextAnimationSequenceNumber))
+ if (m_animations.TrySetDefaultAnimation(anim, m_controllingClient.NextAnimationSequenceNumber, UUID.Zero))
{
SendAnimPack();
}
@@ -2284,13 +2285,13 @@ namespace OpenSim.Region.Framework.Scenes
///
///
///
- public void SendAnimPack(UUID[] animations, int[] seqs)
+ public void SendAnimPack(UUID[] animations, int[] seqs, UUID[] objectIDs)
{
if (m_isChildAgent)
return;
m_scene.Broadcast(
- delegate(IClientAPI client) { client.SendAnimations(animations, seqs, m_controllingClient.AgentId); });
+ delegate(IClientAPI client) { client.SendAnimations(animations, seqs, m_controllingClient.AgentId, objectIDs); });
}
public void SendAnimPackToClient(IClientAPI client)
@@ -2299,10 +2300,11 @@ namespace OpenSim.Region.Framework.Scenes
return;
UUID[] animIDs;
int[] sequenceNums;
+ UUID[] objectIDs;
- m_animations.GetArrays(out animIDs, out sequenceNums);
+ m_animations.GetArrays(out animIDs, out sequenceNums, out objectIDs);
- client.SendAnimations(animIDs, sequenceNums, m_controllingClient.AgentId);
+ client.SendAnimations(animIDs, sequenceNums, m_controllingClient.AgentId, objectIDs);
}
///
@@ -2317,10 +2319,11 @@ namespace OpenSim.Region.Framework.Scenes
UUID[] animIDs;
int[] sequenceNums;
+ UUID[] objectIDs;
- m_animations.GetArrays(out animIDs, out sequenceNums);
+ m_animations.GetArrays(out animIDs, out sequenceNums, out objectIDs);
- SendAnimPack(animIDs, sequenceNums);
+ SendAnimPack(animIDs, sequenceNums, objectIDs);
}
#endregion
--
cgit v1.1