From 69104f38f9297e6bbe4bdd97791df602d1c65a1f Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 10 Jan 2013 23:56:11 +0000 Subject: [PATCH] Add "debug scene get" console command to list current scene options --- .../SceneCommands/SceneCommandsModule.cs | 45 ++++++++++++++++++- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs b/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs index 5dbf207653..555231758f 100644 --- a/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs +++ b/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs @@ -88,6 +88,19 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments { // 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( "Debug", this, "debug scene set", "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 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.", - 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 ' 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) {