From 54c6a920baa0ef02a9ea09e08cc1effcef3b0a3a Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 7 Feb 2009 12:25:39 +0000 Subject: Replace the console for all OpenSim apps with a new console featuring command line editing, context sensitive help (press ? at any time), command line history, a new plugin command system and new appender features thet let you type while the console is scrolling. Seamlessly integrates the ICommander interfaces. --- OpenSim/Region/Framework/Interfaces/ICommand.cs | 1 + OpenSim/Region/Framework/Scenes/Scene.cs | 18 ++++++++++++++---- OpenSim/Region/Framework/Scenes/SceneBase.cs | 8 ++++++++ 3 files changed, 23 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Interfaces/ICommand.cs b/OpenSim/Region/Framework/Interfaces/ICommand.cs index 1551b58..15e55c4 100644 --- a/OpenSim/Region/Framework/Interfaces/ICommand.cs +++ b/OpenSim/Region/Framework/Interfaces/ICommand.cs @@ -46,5 +46,6 @@ namespace OpenSim.Region.Framework.Interfaces void Run(object[] args); void ShowConsoleHelp(); + string ShortHelp(); } } diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index f07391d..55fc02a 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -37,6 +37,7 @@ using OpenMetaverse; using OpenMetaverse.Imaging; using OpenMetaverse.Packets; using OpenSim.Framework; +using OpenSim.Framework.Console; using OpenSim.Framework.Communications; using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Servers; @@ -3384,7 +3385,7 @@ namespace OpenSim.Region.Framework.Scenes /// public void HandleEditCommand(string[] cmdparams) { - Console.WriteLine("Searching for Primitive: '" + cmdparams[0] + "'"); + Console.WriteLine("Searching for Primitive: '" + cmdparams[2] + "'"); List EntityList = GetEntities(); @@ -3395,11 +3396,11 @@ namespace OpenSim.Region.Framework.Scenes SceneObjectPart part = ((SceneObjectGroup)ent).GetChildPart(((SceneObjectGroup)ent).UUID); if (part != null) { - if (part.Name == cmdparams[0]) + if (part.Name == cmdparams[2]) { part.Resize( - new Vector3(Convert.ToSingle(cmdparams[1]), Convert.ToSingle(cmdparams[2]), - Convert.ToSingle(cmdparams[3]))); + new Vector3(Convert.ToSingle(cmdparams[3]), Convert.ToSingle(cmdparams[4]), + Convert.ToSingle(cmdparams[5]))); Console.WriteLine("Edited scale of Primitive: " + part.Name); } @@ -4235,5 +4236,14 @@ namespace OpenSim.Region.Framework.Scenes } } } + + public Scene ConsoleScene() + { + if (MainConsole.Instance == null) + return null; + if (MainConsole.Instance.ConsoleScene is Scene) + return (Scene)MainConsole.Instance.ConsoleScene; + return null; + } } } diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs index e58d3ce..cee9037 100644 --- a/OpenSim/Region/Framework/Scenes/SceneBase.cs +++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs @@ -32,6 +32,7 @@ using System.Threading; using OpenMetaverse; using log4net; using OpenSim.Framework; +using OpenSim.Framework.Console; using OpenSim.Framework.Communications.Cache; using OpenSim.Region.Framework.Interfaces; @@ -458,5 +459,12 @@ namespace OpenSim.Region.Framework.Scenes break; } } + + public void AddCommand(string module, string command, string shorthelp, string longhelp, CommandDelegate callback) + { + if (MainConsole.Instance == null) + return; + MainConsole.Instance.Commands.AddCommand(module, command, shorthelp, longhelp, callback); + } } } -- cgit v1.1