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

@@ -161,12 +161,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.Animations
UUID defaultAnimId = anims.DefaultAnimation.AnimID;
cdl.AddRow(
"Default anim",
string.Format("{0}, {1}", defaultAnimId, GetAnimName(sp.Scene.AssetService, defaultAnimId)));
string.Format("{0}, {1}", defaultAnimId, sp.Animator.GetAnimName(defaultAnimId)));
UUID implicitDefaultAnimId = anims.ImplicitDefaultAnimation.AnimID;
cdl.AddRow(
"Implicit default anim",
string.Format("{0}, {1}", implicitDefaultAnimId, GetAnimName(sp.Scene.AssetService, implicitDefaultAnimId)));
string.Format("{0}, {1}",
implicitDefaultAnimId, sp.Animator.GetAnimName(implicitDefaultAnimId)));
cdl.AddToStringBuilder(sb);
@@ -185,7 +186,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Animations
for (int i = 0; i < animIds.Length; i++)
{
UUID animId = animIds[i];
string animName = GetAnimName(sp.Scene.AssetService, animId);
string animName = sp.Animator.GetAnimName(animId);
int seq = sequenceNumbers[i];
UUID objectId = objectIds[i];
@@ -195,21 +196,5 @@ namespace OpenSim.Region.OptionalModules.Avatar.Animations
cdt.AddToStringBuilder(sb);
sb.Append("\n");
}
private string GetAnimName(IAssetService assetService, UUID animId)
{
string animName;
if (!DefaultAvatarAnimations.AnimsNames.TryGetValue(animId, out animName))
{
AssetMetadata amd = assetService.GetMetadata(animId.ToString());
if (amd != null)
animName = amd.Name;
else
animName = "Unknown";
}
return animName;
}
}
}

View File

@@ -94,6 +94,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
"debug scene get",
"List current scene options.",
"If active is false then main scene update and maintenance loops are suspended.\n"
+ "If animations is true then extra animations debug information is logged.\n"
+ "If collisions is false then collisions with other objects are turned off.\n"
+ "If pbackup is false then periodic scene backup is turned off.\n"
+ "If physics is false then all physics objects are non-physical.\n"
@@ -107,6 +108,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
"debug scene set active|collisions|pbackup|physics|scripting|teleport|updates true|false",
"Turn on scene debugging options.",
"If active is false then main scene update and maintenance loops are suspended.\n"
+ "If animations is true then extra animations debug information is logged.\n"
+ "If collisions is false then collisions with other objects are turned off.\n"
+ "If pbackup is false then periodic scene backup is turned off.\n"
+ "If physics is false then all physics objects are non-physical.\n"
@@ -135,6 +137,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
{
ConsoleDisplayList cdl = new ConsoleDisplayList();
cdl.AddRow("active", m_scene.Active);
cdl.AddRow("animations", m_scene.DebugAnimations);
cdl.AddRow("pbackup", m_scene.PeriodicBackup);
cdl.AddRow("physics", m_scene.PhysicsEnabled);
cdl.AddRow("scripting", m_scene.ScriptsEnabled);
@@ -178,6 +181,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
m_scene.Active = active;
}
if (options.ContainsKey("animations"))
{
bool active;
if (bool.TryParse(options["animations"], out active))
m_scene.DebugAnimations = active;
}
if (options.ContainsKey("pbackup"))
{
bool active;