Make the console output from the reigon console hookable
parent
2efd13ae18
commit
0a959343a5
|
@ -64,6 +64,8 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
private Commands m_commands = new Commands();
|
private Commands m_commands = new Commands();
|
||||||
public ICommands Commands { get { return m_commands; } }
|
public ICommands Commands { get { return m_commands; } }
|
||||||
|
|
||||||
|
public event ConsoleMessage OnConsoleMessage;
|
||||||
|
|
||||||
public void Initialise(IConfigSource source)
|
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);
|
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);
|
OSD osd = OSD.FromString(message);
|
||||||
|
|
||||||
m_eventQueue.Enqueue(EventQueueHelper.BuildEvent("SimConsoleResponse", osd), agentID);
|
m_eventQueue.Enqueue(EventQueueHelper.BuildEvent("SimConsoleResponse", osd), agentID);
|
||||||
|
|
||||||
|
ConsoleMessage handlerConsoleMessage = OnConsoleMessage;
|
||||||
|
|
||||||
|
if (handlerConsoleMessage != null)
|
||||||
|
handlerConsoleMessage( agentID, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool RunCommand(string command, UUID invokerID)
|
public bool RunCommand(string command, UUID invokerID)
|
||||||
|
|
|
@ -30,8 +30,12 @@ using OpenSim.Framework;
|
||||||
|
|
||||||
namespace OpenSim.Region.Framework.Interfaces
|
namespace OpenSim.Region.Framework.Interfaces
|
||||||
{
|
{
|
||||||
|
public delegate void ConsoleMessage(UUID toAgentID, string message);
|
||||||
|
|
||||||
public interface IRegionConsole
|
public interface IRegionConsole
|
||||||
{
|
{
|
||||||
|
event ConsoleMessage OnConsoleMessage;
|
||||||
|
|
||||||
bool RunCommand(string command, UUID invokerID);
|
bool RunCommand(string command, UUID invokerID);
|
||||||
void SendConsoleOutput(UUID agentID, string message);
|
void SendConsoleOutput(UUID agentID, string message);
|
||||||
void AddCommand(string module, bool shared, string command, string help, string longhelp, CommandDelegate fn);
|
void AddCommand(string module, bool shared, string command, string help, string longhelp, CommandDelegate fn);
|
||||||
|
|
Loading…
Reference in New Issue