aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorMelanie Thielker2009-02-07 12:25:39 +0000
committerMelanie Thielker2009-02-07 12:25:39 +0000
commit54c6a920baa0ef02a9ea09e08cc1effcef3b0a3a (patch)
treef606cbdbc383ec21fee28f0a1454140a1c714278 /OpenSim/Region/Framework
parentThank you dslake for a patch that: (diff)
downloadopensim-SC-54c6a920baa0ef02a9ea09e08cc1effcef3b0a3a.zip
opensim-SC-54c6a920baa0ef02a9ea09e08cc1effcef3b0a3a.tar.gz
opensim-SC-54c6a920baa0ef02a9ea09e08cc1effcef3b0a3a.tar.bz2
opensim-SC-54c6a920baa0ef02a9ea09e08cc1effcef3b0a3a.tar.xz
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.
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Interfaces/ICommand.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs18
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneBase.cs8
3 files changed, 23 insertions, 4 deletions
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
46 46
47 void Run(object[] args); 47 void Run(object[] args);
48 void ShowConsoleHelp(); 48 void ShowConsoleHelp();
49 string ShortHelp();
49 } 50 }
50} 51}
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;
37using OpenMetaverse.Imaging; 37using OpenMetaverse.Imaging;
38using OpenMetaverse.Packets; 38using OpenMetaverse.Packets;
39using OpenSim.Framework; 39using OpenSim.Framework;
40using OpenSim.Framework.Console;
40using OpenSim.Framework.Communications; 41using OpenSim.Framework.Communications;
41using OpenSim.Framework.Communications.Cache; 42using OpenSim.Framework.Communications.Cache;
42using OpenSim.Framework.Servers; 43using OpenSim.Framework.Servers;
@@ -3384,7 +3385,7 @@ namespace OpenSim.Region.Framework.Scenes
3384 /// <param name="cmdparams"></param> 3385 /// <param name="cmdparams"></param>
3385 public void HandleEditCommand(string[] cmdparams) 3386 public void HandleEditCommand(string[] cmdparams)
3386 { 3387 {
3387 Console.WriteLine("Searching for Primitive: '" + cmdparams[0] + "'"); 3388 Console.WriteLine("Searching for Primitive: '" + cmdparams[2] + "'");
3388 3389
3389 List<EntityBase> EntityList = GetEntities(); 3390 List<EntityBase> EntityList = GetEntities();
3390 3391
@@ -3395,11 +3396,11 @@ namespace OpenSim.Region.Framework.Scenes
3395 SceneObjectPart part = ((SceneObjectGroup)ent).GetChildPart(((SceneObjectGroup)ent).UUID); 3396 SceneObjectPart part = ((SceneObjectGroup)ent).GetChildPart(((SceneObjectGroup)ent).UUID);
3396 if (part != null) 3397 if (part != null)
3397 { 3398 {
3398 if (part.Name == cmdparams[0]) 3399 if (part.Name == cmdparams[2])
3399 { 3400 {
3400 part.Resize( 3401 part.Resize(
3401 new Vector3(Convert.ToSingle(cmdparams[1]), Convert.ToSingle(cmdparams[2]), 3402 new Vector3(Convert.ToSingle(cmdparams[3]), Convert.ToSingle(cmdparams[4]),
3402 Convert.ToSingle(cmdparams[3]))); 3403 Convert.ToSingle(cmdparams[5])));
3403 3404
3404 Console.WriteLine("Edited scale of Primitive: " + part.Name); 3405 Console.WriteLine("Edited scale of Primitive: " + part.Name);
3405 } 3406 }
@@ -4235,5 +4236,14 @@ namespace OpenSim.Region.Framework.Scenes
4235 } 4236 }
4236 } 4237 }
4237 } 4238 }
4239
4240 public Scene ConsoleScene()
4241 {
4242 if (MainConsole.Instance == null)
4243 return null;
4244 if (MainConsole.Instance.ConsoleScene is Scene)
4245 return (Scene)MainConsole.Instance.ConsoleScene;
4246 return null;
4247 }
4238 } 4248 }
4239} 4249}
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;
32using OpenMetaverse; 32using OpenMetaverse;
33using log4net; 33using log4net;
34using OpenSim.Framework; 34using OpenSim.Framework;
35using OpenSim.Framework.Console;
35using OpenSim.Framework.Communications.Cache; 36using OpenSim.Framework.Communications.Cache;
36using OpenSim.Region.Framework.Interfaces; 37using OpenSim.Region.Framework.Interfaces;
37 38
@@ -458,5 +459,12 @@ namespace OpenSim.Region.Framework.Scenes
458 break; 459 break;
459 } 460 }
460 } 461 }
462
463 public void AddCommand(string module, string command, string shorthelp, string longhelp, CommandDelegate callback)
464 {
465 if (MainConsole.Instance == null)
466 return;
467 MainConsole.Instance.Commands.AddCommand(module, command, shorthelp, longhelp, callback);
468 }
461 } 469 }
462} 470}