aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie2019-08-21 21:23:54 +0100
committerMelanie2019-08-21 21:23:54 +0100
commit110644c23a8f6c2dedc4392c833101d369c58f3e (patch)
tree3cf78807d9e116fa3c1ec27ef8cee8f93cab2493 /OpenSim
parentCall SetServer on consoles reflectively to avoid having type checks in places... (diff)
downloadopensim-SC-110644c23a8f6c2dedc4392c833101d369c58f3e.zip
opensim-SC-110644c23a8f6c2dedc4392c833101d369c58f3e.tar.gz
opensim-SC-110644c23a8f6c2dedc4392c833101d369c58f3e.tar.bz2
opensim-SC-110644c23a8f6c2dedc4392c833101d369c58f3e.tar.xz
Make ReadConfig a general features of consoles, rather than type dependent
Diffstat (limited to 'OpenSim')
-rwxr-xr-x[-rw-r--r--]OpenSim/Framework/Console/CommandConsole.cs5
-rwxr-xr-xOpenSim/Framework/Console/MockConsole.cs3
-rwxr-xr-xOpenSim/Framework/Console/RemoteConsole.cs2
-rwxr-xr-xOpenSim/Framework/ICommandConsole.cs3
-rwxr-xr-xOpenSim/Region/Application/OpenSim.cs3
-rwxr-xr-x[-rw-r--r--]OpenSim/Server/Base/ServicesServerBase.cs10
6 files changed, 15 insertions, 11 deletions
diff --git a/OpenSim/Framework/Console/CommandConsole.cs b/OpenSim/Framework/Console/CommandConsole.cs
index 52360b4..d2b6618 100644..100755
--- a/OpenSim/Framework/Console/CommandConsole.cs
+++ b/OpenSim/Framework/Console/CommandConsole.cs
@@ -36,6 +36,7 @@ using System.Text.RegularExpressions;
36using System.Threading; 36using System.Threading;
37using log4net; 37using log4net;
38using OpenSim.Framework; 38using OpenSim.Framework;
39using Nini.Config;
39 40
40namespace OpenSim.Framework.Console 41namespace OpenSim.Framework.Console
41{ 42{
@@ -789,5 +790,9 @@ namespace OpenSim.Framework.Console
789 } 790 }
790 return cmdinput; 791 return cmdinput;
791 } 792 }
793
794 public virtual void ReadConfig(IConfigSource configSource)
795 {
796 }
792 } 797 }
793} 798}
diff --git a/OpenSim/Framework/Console/MockConsole.cs b/OpenSim/Framework/Console/MockConsole.cs
index d68b066..6adc678 100755
--- a/OpenSim/Framework/Console/MockConsole.cs
+++ b/OpenSim/Framework/Console/MockConsole.cs
@@ -30,6 +30,7 @@ using System.Threading;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Text; 31using System.Text;
32using System.Xml; 32using System.Xml;
33using Nini.Config;
33 34
34namespace OpenSim.Framework.Console 35namespace OpenSim.Framework.Console
35{ 36{
@@ -69,6 +70,8 @@ namespace OpenSim.Framework.Console
69 public string Prompt(string prompt, string defaultresponse, List<string> options) { return ""; } 70 public string Prompt(string prompt, string defaultresponse, List<string> options) { return ""; }
70 71
71 public string PasswdPrompt(string p) { return ""; } 72 public string PasswdPrompt(string p) { return ""; }
73
74 public void ReadConfig(IConfigSource configSource) { }
72 } 75 }
73 76
74 public class MockCommands : ICommands 77 public class MockCommands : ICommands
diff --git a/OpenSim/Framework/Console/RemoteConsole.cs b/OpenSim/Framework/Console/RemoteConsole.cs
index 11006a9..8dc7333 100755
--- a/OpenSim/Framework/Console/RemoteConsole.cs
+++ b/OpenSim/Framework/Console/RemoteConsole.cs
@@ -155,7 +155,7 @@ namespace OpenSim.Framework.Console
155 m_expireTimer.Start(); 155 m_expireTimer.Start();
156 } 156 }
157 157
158 public void ReadConfig(IConfigSource config) 158 public override void ReadConfig(IConfigSource config)
159 { 159 {
160 m_Config = config; 160 m_Config = config;
161 161
diff --git a/OpenSim/Framework/ICommandConsole.cs b/OpenSim/Framework/ICommandConsole.cs
index 3db2765..043056f 100755
--- a/OpenSim/Framework/ICommandConsole.cs
+++ b/OpenSim/Framework/ICommandConsole.cs
@@ -25,6 +25,7 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using Nini.Config;
28using System; 29using System;
29using System.Collections.Generic; 30using System.Collections.Generic;
30using System.Xml; 31using System.Xml;
@@ -102,5 +103,7 @@ namespace OpenSim.Framework
102 void RunCommand(string cmd); 103 void RunCommand(string cmd);
103 104
104 string ReadLine(string p, bool isCommand, bool e); 105 string ReadLine(string p, bool isCommand, bool e);
106
107 void ReadConfig(IConfigSource configSource);
105 } 108 }
106} 109}
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 5cfca6c..50bad61 100755
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -199,7 +199,6 @@ namespace OpenSim
199 break; 199 break;
200 case "rest": 200 case "rest":
201 m_console = new RemoteConsole("Region"); 201 m_console = new RemoteConsole("Region");
202 ((RemoteConsole)m_console).ReadConfig(Config);
203 break; 202 break;
204 default: 203 default:
205 m_console = new LocalConsole("Region", Config.Configs["Startup"]); 204 m_console = new LocalConsole("Region", Config.Configs["Startup"]);
@@ -207,6 +206,8 @@ namespace OpenSim
207 } 206 }
208 } 207 }
209 208
209 m_console.ReadConfig(Config);
210
210 MainConsole.Instance = m_console; 211 MainConsole.Instance = m_console;
211 212
212 LogEnvironmentInformation(); 213 LogEnvironmentInformation();
diff --git a/OpenSim/Server/Base/ServicesServerBase.cs b/OpenSim/Server/Base/ServicesServerBase.cs
index 422a8bc..3bede45 100644..100755
--- a/OpenSim/Server/Base/ServicesServerBase.cs
+++ b/OpenSim/Server/Base/ServicesServerBase.cs
@@ -147,23 +147,15 @@ namespace OpenSim.Server.Base
147 consoleType = startupConfig.GetString("console", consoleType); 147 consoleType = startupConfig.GetString("console", consoleType);
148 148
149 if (consoleType == "basic") 149 if (consoleType == "basic")
150 {
151 MainConsole.Instance = new CommandConsole(prompt); 150 MainConsole.Instance = new CommandConsole(prompt);
152 }
153 else if (consoleType == "rest") 151 else if (consoleType == "rest")
154 {
155 MainConsole.Instance = new RemoteConsole(prompt); 152 MainConsole.Instance = new RemoteConsole(prompt);
156 ((RemoteConsole)MainConsole.Instance).ReadConfig(Config);
157 }
158 else if (consoleType == "mock") 153 else if (consoleType == "mock")
159 {
160 MainConsole.Instance = new MockConsole(); 154 MainConsole.Instance = new MockConsole();
161 }
162 else if (consoleType == "local") 155 else if (consoleType == "local")
163 {
164 MainConsole.Instance = new LocalConsole(prompt, startupConfig); 156 MainConsole.Instance = new LocalConsole(prompt, startupConfig);
165 }
166 157
158 MainConsole.Instance.ReadConfig(Config);
167 m_console = MainConsole.Instance; 159 m_console = MainConsole.Instance;
168 160
169 if (logConfig != null) 161 if (logConfig != null)