Add "debug set set animations true|false" region console command.

Setting this logs extra information about animation add/remove, such as uuid and animation name
Unfortunately cannot be done per client yet
This commit is contained in:
Justin Clark-Casey (justincc)
2013-01-18 23:22:02 +00:00
parent 74256c0cc4
commit 115e1c2abb
4 changed files with 48 additions and 24 deletions

View File

@@ -86,7 +86,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation
if (m_scenePresence.IsChildAgent)
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();
@@ -122,7 +125,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation
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, allowNoDefault))
SendAnimPack();
@@ -145,9 +151,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation
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();
}
@@ -558,5 +565,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;
}
}
}

View File

@@ -67,6 +67,11 @@ namespace OpenSim.Region.Framework.Scenes
public bool EmergencyMonitoring = false;
/// <summary>
/// Show debug information about animations.
/// </summary>
public bool DebugAnimations { get; set; }
/// <summary>
/// Show debug information about teleports.
/// </summary>