From fadd19f3140107d7c09e7a82a97dfb490146ccb9 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sun, 30 Mar 2008 09:03:38 +0000 Subject: **Big ass update warning** * Renamed plugin console message, to send a message to a plugin, use either "plugin ", or any unrecognised message will be sent ("plugin" sends explicitly) This replaces the old "script ". * Terrain commands - "terrain " now works again. "Script terrain " does not. Many of the commands have now been reimplemented, eg load-tile. However some have new syntax. * New console command handler, you can now use things like "terrain help" or "terrain save help". See TerrainModule.cs for an example of how to use the new "Commander" class. * Commander class - advanced processing of console input and also enables a script API to be generated from registered console commands. --- OpenSim/Region/Environment/Interfaces/ICommand.cs | 16 ++++++++++++++++ .../Region/Environment/Interfaces/ICommandableModule.cs | 16 ++++++++++++++++ OpenSim/Region/Environment/Interfaces/ICommander.cs | 14 ++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 OpenSim/Region/Environment/Interfaces/ICommand.cs create mode 100644 OpenSim/Region/Environment/Interfaces/ICommandableModule.cs create mode 100644 OpenSim/Region/Environment/Interfaces/ICommander.cs (limited to 'OpenSim/Region/Environment/Interfaces') diff --git a/OpenSim/Region/Environment/Interfaces/ICommand.cs b/OpenSim/Region/Environment/Interfaces/ICommand.cs new file mode 100644 index 0000000..bccd8d3 --- /dev/null +++ b/OpenSim/Region/Environment/Interfaces/ICommand.cs @@ -0,0 +1,16 @@ +using System; + +using OpenSim.Region.Environment.Modules.ModuleFramework; + +namespace OpenSim.Region.Environment.Interfaces +{ + public interface ICommand + { + void AddArgument(string name, string helptext, string type); + System.Collections.Generic.Dictionary Arguments { get; } + string Help { get; } + string Name { get; } + void Run(object[] args); + void ShowConsoleHelp(); + } +} diff --git a/OpenSim/Region/Environment/Interfaces/ICommandableModule.cs b/OpenSim/Region/Environment/Interfaces/ICommandableModule.cs new file mode 100644 index 0000000..31ef49b --- /dev/null +++ b/OpenSim/Region/Environment/Interfaces/ICommandableModule.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Text; + +using OpenSim.Region.Environment.Modules.ModuleFramework; + +namespace OpenSim.Region.Environment.Interfaces +{ + public interface ICommandableModule + { + ICommander CommandInterface + { + get; + } + } +} diff --git a/OpenSim/Region/Environment/Interfaces/ICommander.cs b/OpenSim/Region/Environment/Interfaces/ICommander.cs new file mode 100644 index 0000000..93a9956 --- /dev/null +++ b/OpenSim/Region/Environment/Interfaces/ICommander.cs @@ -0,0 +1,14 @@ +using System; + +using OpenSim.Region.Environment.Modules.ModuleFramework; + +namespace OpenSim.Region.Environment.Interfaces +{ + public interface ICommander + { + void ProcessConsoleCommand(string function, string[] args); + void RegisterCommand(string commandName, ICommand command); + void Run(string function, object[] args); + string GenerateRuntimeAPI(); + } +} -- cgit v1.1