mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 09:45:47 +08:00
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.
This commit is contained in:
@@ -46,5 +46,6 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
|
||||
void Run(object[] args);
|
||||
void ShowConsoleHelp();
|
||||
string ShortHelp();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
/// <param name="cmdparams"></param>
|
||||
public void HandleEditCommand(string[] cmdparams)
|
||||
{
|
||||
Console.WriteLine("Searching for Primitive: '" + cmdparams[0] + "'");
|
||||
Console.WriteLine("Searching for Primitive: '" + cmdparams[2] + "'");
|
||||
|
||||
List<EntityBase> 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user