aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/UserServer/Main.cs
diff options
context:
space:
mode:
authorDiva Canto2009-08-19 00:31:51 -0700
committerDiva Canto2009-08-19 00:31:51 -0700
commit4818d11b9d3f9839a041ade0d0d3c6fd9848026e (patch)
treebb728cdc54bc0bd4dd5c931297a8a6c48357bc7a /OpenSim/Grid/UserServer/Main.cs
parentA better purge of trash folder. (diff)
parentGraft the REST console onto the message server as well. What a dirty hack! (diff)
downloadopensim-SC_OLD-4818d11b9d3f9839a041ade0d0d3c6fd9848026e.zip
opensim-SC_OLD-4818d11b9d3f9839a041ade0d0d3c6fd9848026e.tar.gz
opensim-SC_OLD-4818d11b9d3f9839a041ade0d0d3c6fd9848026e.tar.bz2
opensim-SC_OLD-4818d11b9d3f9839a041ade0d0d3c6fd9848026e.tar.xz
Merge branch 'master' of ssh://diva@opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Grid/UserServer/Main.cs')
-rw-r--r--OpenSim/Grid/UserServer/Main.cs38
1 files changed, 37 insertions, 1 deletions
diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs
index 86c2abb..1ee53ef 100644
--- a/OpenSim/Grid/UserServer/Main.cs
+++ b/OpenSim/Grid/UserServer/Main.cs
@@ -43,6 +43,7 @@ using OpenSim.Framework.Statistics;
43using OpenSim.Grid.Communications.OGS1; 43using OpenSim.Grid.Communications.OGS1;
44using OpenSim.Grid.Framework; 44using OpenSim.Grid.Framework;
45using OpenSim.Grid.UserServer.Modules; 45using OpenSim.Grid.UserServer.Modules;
46using Nini.Config;
46 47
47namespace OpenSim.Grid.UserServer 48namespace OpenSim.Grid.UserServer
48{ 49{
@@ -73,8 +74,22 @@ namespace OpenSim.Grid.UserServer
73 74
74 protected AvatarCreationModule m_appearanceModule; 75 protected AvatarCreationModule m_appearanceModule;
75 76
77 protected static string m_consoleType = "local";
78 protected static IConfigSource m_config = null;
79
76 public static void Main(string[] args) 80 public static void Main(string[] args)
77 { 81 {
82 ArgvConfigSource argvSource = new ArgvConfigSource(args);
83 argvSource.AddSwitch("Startup", "console", "c");
84
85 IConfig startupConfig = argvSource.Configs["Startup"];
86 if (startupConfig != null)
87 {
88 m_consoleType = startupConfig.GetString("console", "local");
89 }
90
91 m_config = argvSource;
92
78 XmlConfigurator.Configure(); 93 XmlConfigurator.Configure();
79 94
80 m_log.Info("Launching UserServer..."); 95 m_log.Info("Launching UserServer...");
@@ -87,7 +102,18 @@ namespace OpenSim.Grid.UserServer
87 102
88 public OpenUser_Main() 103 public OpenUser_Main()
89 { 104 {
90 m_console = new LocalConsole("User"); 105 switch (m_consoleType)
106 {
107 case "rest":
108 m_console = new RemoteConsole("User");
109 break;
110 case "basic":
111 m_console = new CommandConsole("User");
112 break;
113 default:
114 m_console = new LocalConsole("User");
115 break;
116 }
91 MainConsole.Instance = m_console; 117 MainConsole.Instance = m_console;
92 } 118 }
93 119
@@ -129,6 +155,16 @@ namespace OpenSim.Grid.UserServer
129 155
130 m_httpServer = new BaseHttpServer(Cfg.HttpPort); 156 m_httpServer = new BaseHttpServer(Cfg.HttpPort);
131 157
158 if (m_console is RemoteConsole)
159 {
160 RemoteConsole c = (RemoteConsole)m_console;
161 c.SetServer(m_httpServer);
162 IConfig netConfig = m_config.AddConfig("Network");
163 netConfig.Set("ConsoleUser", Cfg.ConsoleUser);
164 netConfig.Set("ConsolePass", Cfg.ConsolePass);
165 c.ReadConfig(m_config);
166 }
167
132 RegisterInterface<CommandConsole>(m_console); 168 RegisterInterface<CommandConsole>(m_console);
133 RegisterInterface<UserConfig>(Cfg); 169 RegisterInterface<UserConfig>(Cfg);
134 170