aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2012-08-14 21:54:47 +0200
committerMelanie2012-08-14 22:22:20 +0100
commitfaa710aee13347c4c55690f516ffda9179a92f3c (patch)
tree033ca7546d3853f28587bc8216e4c0aef1499a55
parentminor: Add Gryc Ueusp to CREDITS for commit 884edac amongst others, by request. (diff)
downloadopensim-SC-faa710aee13347c4c55690f516ffda9179a92f3c.zip
opensim-SC-faa710aee13347c4c55690f516ffda9179a92f3c.tar.gz
opensim-SC-faa710aee13347c4c55690f516ffda9179a92f3c.tar.bz2
opensim-SC-faa710aee13347c4c55690f516ffda9179a92f3c.tar.xz
Allow the use of the region debug console found in recent viewers. This console
will be available to estate owners and managers. If the user using the console had god privs, they can use "set console on" and "set console off" to switch on the actual region console. This allows console access from within the viewer. The region debug console can coexist with any other main console.
-rw-r--r--OpenSim/Framework/Console/CommandConsole.cs9
-rw-r--r--OpenSim/Framework/Console/LocalConsole.cs4
-rw-r--r--OpenSim/Framework/Console/MockConsole.cs4
-rw-r--r--OpenSim/Framework/Console/RemoteConsole.cs1
-rw-r--r--OpenSim/Framework/ICommandConsole.cs6
-rw-r--r--OpenSim/Region/Framework/Interfaces/IRegionConsole.cs39
6 files changed, 60 insertions, 3 deletions
diff --git a/OpenSim/Framework/Console/CommandConsole.cs b/OpenSim/Framework/Console/CommandConsole.cs
index 87bdacd..bd23d1c 100644
--- a/OpenSim/Framework/Console/CommandConsole.cs
+++ b/OpenSim/Framework/Console/CommandConsole.cs
@@ -678,6 +678,8 @@ namespace OpenSim.Framework.Console
678 { 678 {
679// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 679// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
680 680
681 public event OnOutputDelegate OnOutput;
682
681 public ICommands Commands { get; private set; } 683 public ICommands Commands { get; private set; }
682 684
683 public CommandConsole(string defaultPrompt) : base(defaultPrompt) 685 public CommandConsole(string defaultPrompt) : base(defaultPrompt)
@@ -697,6 +699,13 @@ namespace OpenSim.Framework.Console
697 Output(s); 699 Output(s);
698 } 700 }
699 701
702 protected void FireOnOutput(string text)
703 {
704 OnOutputDelegate onOutput = OnOutput;
705 if (onOutput != null)
706 onOutput(text);
707 }
708
700 /// <summary> 709 /// <summary>
701 /// Display a command prompt on the console and wait for user input 710 /// Display a command prompt on the console and wait for user input
702 /// </summary> 711 /// </summary>
diff --git a/OpenSim/Framework/Console/LocalConsole.cs b/OpenSim/Framework/Console/LocalConsole.cs
index f65813b..d41481f 100644
--- a/OpenSim/Framework/Console/LocalConsole.cs
+++ b/OpenSim/Framework/Console/LocalConsole.cs
@@ -319,6 +319,8 @@ namespace OpenSim.Framework.Console
319 319
320 public override void Output(string text, string level) 320 public override void Output(string text, string level)
321 { 321 {
322 FireOnOutput(text);
323
322 lock (m_commandLine) 324 lock (m_commandLine)
323 { 325 {
324 if (m_cursorYPosition == -1) 326 if (m_cursorYPosition == -1)
@@ -509,4 +511,4 @@ namespace OpenSim.Framework.Console
509 } 511 }
510 } 512 }
511 } 513 }
512} \ No newline at end of file 514}
diff --git a/OpenSim/Framework/Console/MockConsole.cs b/OpenSim/Framework/Console/MockConsole.cs
index 4d8751f..b489f93 100644
--- a/OpenSim/Framework/Console/MockConsole.cs
+++ b/OpenSim/Framework/Console/MockConsole.cs
@@ -40,6 +40,8 @@ namespace OpenSim.Framework.Console
40 /// </summary> 40 /// </summary>
41 public class MockConsole : ICommandConsole 41 public class MockConsole : ICommandConsole
42 { 42 {
43 public event OnOutputDelegate OnOutput;
44
43 private MockCommands m_commands = new MockCommands(); 45 private MockCommands m_commands = new MockCommands();
44 46
45 public ICommands Commands { get { return m_commands; } } 47 public ICommands Commands { get { return m_commands; } }
@@ -76,4 +78,4 @@ namespace OpenSim.Framework.Console
76 public string[] Resolve(string[] cmd) { return null; } 78 public string[] Resolve(string[] cmd) { return null; }
77 public XmlElement GetXml(XmlDocument doc) { return null; } 79 public XmlElement GetXml(XmlDocument doc) { return null; }
78 } 80 }
79} \ No newline at end of file 81}
diff --git a/OpenSim/Framework/Console/RemoteConsole.cs b/OpenSim/Framework/Console/RemoteConsole.cs
index eabb62d..27edd4b 100644
--- a/OpenSim/Framework/Console/RemoteConsole.cs
+++ b/OpenSim/Framework/Console/RemoteConsole.cs
@@ -100,6 +100,7 @@ namespace OpenSim.Framework.Console
100 m_LineNumber++; 100 m_LineNumber++;
101 m_Scrollback.Add(String.Format("{0}", m_LineNumber)+":"+level+":"+text); 101 m_Scrollback.Add(String.Format("{0}", m_LineNumber)+":"+level+":"+text);
102 } 102 }
103 FireOnOutput(text.Trim());
103 System.Console.WriteLine(text.Trim()); 104 System.Console.WriteLine(text.Trim());
104 } 105 }
105 106
diff --git a/OpenSim/Framework/ICommandConsole.cs b/OpenSim/Framework/ICommandConsole.cs
index ca0ff93..8cd20da 100644
--- a/OpenSim/Framework/ICommandConsole.cs
+++ b/OpenSim/Framework/ICommandConsole.cs
@@ -74,8 +74,12 @@ namespace OpenSim.Framework
74 XmlElement GetXml(XmlDocument doc); 74 XmlElement GetXml(XmlDocument doc);
75 } 75 }
76 76
77 public delegate void OnOutputDelegate(string message);
78
77 public interface ICommandConsole : IConsole 79 public interface ICommandConsole : IConsole
78 { 80 {
81 event OnOutputDelegate OnOutput;
82
79 ICommands Commands { get; } 83 ICommands Commands { get; }
80 84
81 /// <summary> 85 /// <summary>
@@ -87,4 +91,4 @@ namespace OpenSim.Framework
87 91
88 string ReadLine(string p, bool isCommand, bool e); 92 string ReadLine(string p, bool isCommand, bool e);
89 } 93 }
90} \ No newline at end of file 94}
diff --git a/OpenSim/Region/Framework/Interfaces/IRegionConsole.cs b/OpenSim/Region/Framework/Interfaces/IRegionConsole.cs
new file mode 100644
index 0000000..4d261d6
--- /dev/null
+++ b/OpenSim/Region/Framework/Interfaces/IRegionConsole.cs
@@ -0,0 +1,39 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using OpenMetaverse;
29using OpenSim.Framework;
30
31namespace OpenSim.Region.Framework.Interfaces
32{
33 public interface IRegionConsole
34 {
35 bool RunCommand(string command, UUID invokerID);
36 void SendConsoleOutput(UUID agentID, string message);
37 void AddCommand(string module, bool shared, string command, string help, string longhelp, CommandDelegate fn);
38 }
39}