Make the console output from the reigon console hookable

avinationmerge
Melanie 2012-08-18 22:36:48 +02:00
parent 2efd13ae18
commit 0a959343a5
2 changed files with 11 additions and 0 deletions

View File

@ -64,6 +64,8 @@ namespace OpenSim.Region.ClientStack.Linden
private Commands m_commands = new Commands();
public ICommands Commands { get { return m_commands; } }
public event ConsoleMessage OnConsoleMessage;
public void Initialise(IConfigSource source)
{
m_commands.AddCommand( "Help", false, "help", "help [<item>]", "Display help on a particular command or on a list of commands in a category", Help);
@ -118,6 +120,11 @@ namespace OpenSim.Region.ClientStack.Linden
OSD osd = OSD.FromString(message);
m_eventQueue.Enqueue(EventQueueHelper.BuildEvent("SimConsoleResponse", osd), agentID);
ConsoleMessage handlerConsoleMessage = OnConsoleMessage;
if (handlerConsoleMessage != null)
handlerConsoleMessage( agentID, message);
}
public bool RunCommand(string command, UUID invokerID)

View File

@ -30,8 +30,12 @@ using OpenSim.Framework;
namespace OpenSim.Region.Framework.Interfaces
{
public delegate void ConsoleMessage(UUID toAgentID, string message);
public interface IRegionConsole
{
event ConsoleMessage OnConsoleMessage;
bool RunCommand(string command, UUID invokerID);
void SendConsoleOutput(UUID agentID, string message);
void AddCommand(string module, bool shared, string command, string help, string longhelp, CommandDelegate fn);