Adding a script event, changed(CHANGED_ANIMATION)

This is sent to all root prims of all attachments of an avatar when the
animation state changes. llGetAnimation() can thenbe used to find the
new movement animation. This eliminates the need for fast timers in AOs
This commit is contained in:
Melanie Thielker
2009-04-11 16:51:27 +00:00
parent b8619386eb
commit 217b2d93ae
5 changed files with 42 additions and 1 deletions

View File

@@ -223,6 +223,8 @@ namespace OpenSim.Region.Framework.Scenes
string m_callbackURI;
ulong m_rootRegionHandle;
private IScriptModule[] m_scriptEngines;
#region Properties
/// <summary>
@@ -585,6 +587,8 @@ namespace OpenSim.Region.Framework.Scenes
if (gm != null)
m_grouptitle = gm.GetGroupTitle(m_uuid);
m_scriptEngines = m_scene.RequestModuleInterfaces<IScriptModule>();
AbsolutePosition = m_controllingClient.StartPos;
AdjustKnownSeeds();
@@ -1943,7 +1947,24 @@ namespace OpenSim.Region.Framework.Scenes
if (m_animations.TrySetDefaultAnimation(anim, m_controllingClient.NextAnimationSequenceNumber, UUID.Zero))
{
SendAnimPack();
if (m_scriptEngines != null)
{
lock (m_attachments)
{
foreach (SceneObjectGroup grp in m_attachments)
{
// 16384 is CHANGED_ANIMATION
//
// Send this to all attachment root prims
//
foreach (IScriptModule m in m_scriptEngines)
{
m.PostObjectEvent(grp.RootPart.UUID, "changed", new Object[] {16384});
}
SendAnimPack();
}
}
}
}
}