From 3f25128e77af2a53e765436454b8fddeb8f88894 Mon Sep 17 00:00:00 2001 From: diva Date: Wed, 18 Feb 2009 01:49:18 +0000 Subject: Adds support for preserving animations on region crossings and TPs. Known issue: after TP, the self client doesn't see the animations going, but others can see them. So there's a bug there (TPs only, crossings seem to be all fine). Untested: did not test animation overriders; only tested playing animations from the viewer. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 46 +++++++++++++++--------- 1 file changed, 30 insertions(+), 16 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index fed541f..df6c97a 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1049,7 +1049,6 @@ namespace OpenSim.Region.Framework.Scenes } m_controllingClient.MoveAgentIntoRegion(m_regionInfo, AbsolutePosition, look); - SendInitialData(); } @@ -1760,11 +1759,10 @@ namespace OpenSim.Region.Framework.Scenes return; if (m_animations.Add(animID, m_controllingClient.NextAnimationSequenceNumber, objectID)) - { SendAnimPack(); - } } + // Called from scripts public void AddAnimation(string name, UUID objectID) { if (m_isChildAgent) @@ -1783,11 +1781,10 @@ namespace OpenSim.Region.Framework.Scenes return; if (m_animations.Remove(animID)) - { SendAnimPack(); - } } + // Called from scripts public void RemoveAnimation(string name) { if (m_isChildAgent) @@ -2152,6 +2149,8 @@ namespace OpenSim.Region.Framework.Scenes } m_scene.AddAgentUpdates(avatars.Count); m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); + + //SendAnimPack(); } public void SendFullUpdateToAllClients() @@ -2256,7 +2255,6 @@ namespace OpenSim.Region.Framework.Scenes m_scene.CommsManager.AvatarService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance); SendAppearanceToAllOtherAgents(); - //SendWearables(); if (!m_startAnimationSet) { UpdateMovementAnimations(); @@ -2312,7 +2310,7 @@ namespace OpenSim.Region.Framework.Scenes /// public void SendAnimPack() { - //m_log.Debug("Sending animation pack"); + //m_log.Debug("Sending animation pack to all"); if (m_isChildAgent) return; @@ -2326,6 +2324,7 @@ namespace OpenSim.Region.Framework.Scenes SendAnimPack(animIDs, sequenceNums, objectIDs); } + #endregion #region Significant Movement Method @@ -2454,6 +2453,13 @@ namespace OpenSim.Region.Framework.Scenes AddToPhysicalScene(false); // not exactly false } + public void Reset() + { + // Put the child agent back at the center + AbsolutePosition = new Vector3(128, 128, 70); + m_animations.Clear(); + } + /// /// Computes which child agents to close when the scene presence moves to another region. /// Removes those regions from m_knownRegions. @@ -2618,11 +2624,6 @@ namespace OpenSim.Region.Framework.Scenes cAgent.AlwaysRun = m_setAlwaysRun; - //cAgent.GroupID = ?? - // Groups??? - - // Animations??? - try { int i = 0; @@ -2644,10 +2645,16 @@ namespace OpenSim.Region.Framework.Scenes { m_log.Warn("[SCENE PRESENCE]: exception in CopyTo " + e.Message); } - //cAgent.GroupID = ?? - // Groups??? - // Animations??? + // Animations + try + { + cAgent.Anims = m_animations.ToArray(); + } + catch { } + + // cAgent.GroupID = ?? + // Groups??? } @@ -2697,10 +2704,17 @@ namespace OpenSim.Region.Framework.Scenes m_log.Warn("[SCENE PRESENCE]: exception in CopyFrom " + e.Message); } + // Animations + try + { + m_animations.Clear(); + m_animations.FromArray(cAgent.Anims); + } + catch { } + //cAgent.GroupID = ?? //Groups??? - // Animations??? } -- cgit v1.1