Add "debug scene get" console command to list current scene options

0.7.5-pf-bulletsim
Justin Clark-Casey (justincc) 2013-01-10 23:56:11 +00:00
parent 0ba0ac4669
commit 1cda887d9b
1 changed files with 43 additions and 2 deletions

View File

@ -88,6 +88,19 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
{ {
// m_log.DebugFormat("[ATTACHMENTS COMMAND MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName); // m_log.DebugFormat("[ATTACHMENTS COMMAND MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName);
scene.AddCommand(
"Debug", this, "debug scene get",
"debug scene get",
"List current scene options.",
"If active is false then main scene update and maintenance loops are suspended.\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"
+ "If scripting is false then no scripting operations happen.\n"
+ "If teleport is true then some extra teleport debug information is logged.\n"
+ "If updates is true then any frame which exceeds double the maximum desired frame time is logged.",
HandleDebugSceneGetCommand);
scene.AddCommand( scene.AddCommand(
"Debug", this, "debug scene set", "Debug", this, "debug scene set",
"debug scene set active|collisions|pbackup|physics|scripting|teleport|updates true|false", "debug scene set active|collisions|pbackup|physics|scripting|teleport|updates true|false",
@ -99,10 +112,38 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
+ "If scripting is false then no scripting operations happen.\n" + "If scripting is false then no scripting operations happen.\n"
+ "If teleport is true then some extra teleport debug information is logged.\n" + "If teleport is true then some extra teleport debug information is logged.\n"
+ "If updates is true then any frame which exceeds double the maximum desired frame time is logged.", + "If updates is true then any frame which exceeds double the maximum desired frame time is logged.",
HandleDebugSceneCommand); HandleDebugSceneSetCommand);
} }
private void HandleDebugSceneCommand(string module, string[] args) private void HandleDebugSceneGetCommand(string module, string[] args)
{
if (args.Length == 3)
{
if (MainConsole.Instance.ConsoleScene == null)
MainConsole.Instance.Output("Please use 'change region <regioname>' first");
else
OutputSceneDebugOptions();
}
else
{
MainConsole.Instance.Output("Usage: debug scene get");
}
}
private void OutputSceneDebugOptions()
{
ConsoleDisplayList cdl = new ConsoleDisplayList();
cdl.AddRow("active", m_scene.Active);
cdl.AddRow("pbackup", m_scene.PeriodicBackup);
cdl.AddRow("physics", m_scene.PhysicsEnabled);
cdl.AddRow("scripting", m_scene.ScriptsEnabled);
cdl.AddRow("teleport", m_scene.DebugTeleporting);
cdl.AddRow("updates", m_scene.DebugUpdates);
MainConsole.Instance.Output(cdl.ToString());
}
private void HandleDebugSceneSetCommand(string module, string[] args)
{ {
if (args.Length == 5) if (args.Length == 5)
{ {