aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/GridServer/GridServerBase.cs
diff options
context:
space:
mode:
authorMelanie2009-08-19 05:15:25 +0100
committerMelanie2009-08-19 05:15:25 +0100
commitdd0234f5005127c03760c2b9862ed1672f4a2e91 (patch)
treeceb6e9b1c182618063cf0cab5d1e10378eade99b /OpenSim/Grid/GridServer/GridServerBase.cs
parentMerge branch 'master' of ssh://melanie@opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-dd0234f5005127c03760c2b9862ed1672f4a2e91.zip
opensim-SC_OLD-dd0234f5005127c03760c2b9862ed1672f4a2e91.tar.gz
opensim-SC_OLD-dd0234f5005127c03760c2b9862ed1672f4a2e91.tar.bz2
opensim-SC_OLD-dd0234f5005127c03760c2b9862ed1672f4a2e91.tar.xz
Graft the REST console onto the grid server. Same procedure as with
the user server.
Diffstat (limited to '')
-rw-r--r--OpenSim/Grid/GridServer/GridServerBase.cs27
1 files changed, 25 insertions, 2 deletions
diff --git a/OpenSim/Grid/GridServer/GridServerBase.cs b/OpenSim/Grid/GridServer/GridServerBase.cs
index c41a728..e3ad52a 100644
--- a/OpenSim/Grid/GridServer/GridServerBase.cs
+++ b/OpenSim/Grid/GridServer/GridServerBase.cs
@@ -31,6 +31,7 @@ using System.IO;
31using System.Reflection; 31using System.Reflection;
32using System.Timers; 32using System.Timers;
33using log4net; 33using log4net;
34using Nini.Config;
34using OpenSim.Framework; 35using OpenSim.Framework;
35using OpenSim.Framework.Console; 36using OpenSim.Framework.Console;
36using OpenSim.Framework.Servers; 37using OpenSim.Framework.Servers;
@@ -46,6 +47,8 @@ namespace OpenSim.Grid.GridServer
46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47 48
48 protected GridConfig m_config; 49 protected GridConfig m_config;
50 public string m_consoleType = "local";
51 public IConfigSource m_configSource = null;
49 52
50 public GridConfig Config 53 public GridConfig Config
51 { 54 {
@@ -71,16 +74,36 @@ namespace OpenSim.Grid.GridServer
71 74
72 public GridServerBase() 75 public GridServerBase()
73 { 76 {
74 m_console = new LocalConsole("Grid");
75 MainConsole.Instance = m_console;
76 } 77 }
77 78
78 protected override void StartupSpecific() 79 protected override void StartupSpecific()
79 { 80 {
81 switch (m_consoleType)
82 {
83 case "rest":
84 m_console = new RemoteConsole("Grid");
85 break;
86 case "basic":
87 m_console = new CommandConsole("Grid");
88 break;
89 default:
90 m_console = new LocalConsole("Grid");
91 break;
92 }
93 MainConsole.Instance = m_console;
80 m_config = new GridConfig("GRID SERVER", (Path.Combine(Util.configDir(), "GridServer_Config.xml"))); 94 m_config = new GridConfig("GRID SERVER", (Path.Combine(Util.configDir(), "GridServer_Config.xml")));
81 95
82 m_log.Info("[GRID]: Starting HTTP process"); 96 m_log.Info("[GRID]: Starting HTTP process");
83 m_httpServer = new BaseHttpServer(m_config.HttpPort); 97 m_httpServer = new BaseHttpServer(m_config.HttpPort);
98 if (m_console is RemoteConsole)
99 {
100 RemoteConsole c = (RemoteConsole)m_console;
101 c.SetServer(m_httpServer);
102 IConfig netConfig = m_configSource.AddConfig("Network");
103 netConfig.Set("ConsoleUser", m_config.ConsoleUser);
104 netConfig.Set("ConsolePass", m_config.ConsolePass);
105 c.ReadConfig(m_configSource);
106 }
84 107
85 LoadPlugins(); 108 LoadPlugins();
86 109