mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 20:05:33 +08:00
Merge branch 'master' into careminster
Conflicts: OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
This commit is contained in:
@@ -87,6 +87,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
return;
|
||||
|
||||
// m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Adding animation {0} for {1}", animID, m_scenePresence.Name);
|
||||
if (m_scenePresence.Scene.DebugAnimations)
|
||||
m_log.DebugFormat(
|
||||
"[SCENE PRESENCE ANIMATOR]: Adding animation {0} {1} for {2}",
|
||||
GetAnimName(animID), animID, m_scenePresence.Name);
|
||||
|
||||
if (m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, objectID))
|
||||
SendAnimPack();
|
||||
@@ -109,14 +113,25 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
AddAnimation(animID, objectID);
|
||||
}
|
||||
|
||||
public void RemoveAnimation(UUID animID)
|
||||
/// <summary>
|
||||
/// Remove the specified animation
|
||||
/// </summary>
|
||||
/// <param name='animID'></param>
|
||||
/// <param name='allowNoDefault'>
|
||||
/// If true, then the default animation can be entirely removed.
|
||||
/// If false, then removing the default animation will reset it to the simulator default (currently STAND).
|
||||
/// </param>
|
||||
public void RemoveAnimation(UUID animID, bool allowNoDefault)
|
||||
{
|
||||
if (m_scenePresence.IsChildAgent)
|
||||
return;
|
||||
|
||||
// m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Removing animation {0} for {1}", animID, m_scenePresence.Name);
|
||||
if (m_scenePresence.Scene.DebugAnimations)
|
||||
m_log.DebugFormat(
|
||||
"[SCENE PRESENCE ANIMATOR]: Removing animation {0} {1} for {2}",
|
||||
GetAnimName(animID), animID, m_scenePresence.Name);
|
||||
|
||||
if (m_animations.Remove(animID))
|
||||
if (m_animations.Remove(animID, allowNoDefault))
|
||||
SendAnimPack();
|
||||
}
|
||||
|
||||
@@ -130,7 +145,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
if (addRemove)
|
||||
m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, UUID.Zero);
|
||||
else
|
||||
m_animations.Remove(animID);
|
||||
m_animations.Remove(animID, true);
|
||||
}
|
||||
if(sendPack)
|
||||
SendAnimPack();
|
||||
@@ -148,14 +163,15 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
if (animID == UUID.Zero)
|
||||
return;
|
||||
|
||||
RemoveAnimation(animID);
|
||||
RemoveAnimation(animID, true);
|
||||
}
|
||||
|
||||
public void ResetAnimations()
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENE PRESENCE ANIMATOR]: Resetting animations for {0} in {1}",
|
||||
// m_scenePresence.Name, m_scenePresence.Scene.RegionInfo.RegionName);
|
||||
if (m_scenePresence.Scene.DebugAnimations)
|
||||
m_log.DebugFormat(
|
||||
"[SCENE PRESENCE ANIMATOR]: Resetting animations for {0} in {1}",
|
||||
m_scenePresence.Name, m_scenePresence.Scene.RegionInfo.RegionName);
|
||||
|
||||
m_animations.Clear();
|
||||
}
|
||||
@@ -566,5 +582,21 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
|
||||
SendAnimPack(animIDs, sequenceNums, objectIDs);
|
||||
}
|
||||
|
||||
public string GetAnimName(UUID animId)
|
||||
{
|
||||
string animName;
|
||||
|
||||
if (!DefaultAvatarAnimations.AnimsNames.TryGetValue(animId, out animName))
|
||||
{
|
||||
AssetMetadata amd = m_scenePresence.Scene.AssetService.GetMetadata(animId.ToString());
|
||||
if (amd != null)
|
||||
animName = amd.Name;
|
||||
else
|
||||
animName = "Unknown";
|
||||
}
|
||||
|
||||
return animName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user