aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid
diff options
context:
space:
mode:
authorMelanie2009-08-19 04:39:02 +0100
committerMelanie2009-08-19 04:39:02 +0100
commit99c7a43ffdb9c3b4dee984f7cd788742c6ee3e53 (patch)
tree81cbdfaeae6ce37ce16463c602e6cb8b9077f275 /OpenSim/Grid
parentFixes mantis #4020 (http://opensimulator.org/mantis/view.php?id=4020) (diff)
downloadopensim-SC_OLD-99c7a43ffdb9c3b4dee984f7cd788742c6ee3e53.zip
opensim-SC_OLD-99c7a43ffdb9c3b4dee984f7cd788742c6ee3e53.tar.gz
opensim-SC_OLD-99c7a43ffdb9c3b4dee984f7cd788742c6ee3e53.tar.bz2
opensim-SC_OLD-99c7a43ffdb9c3b4dee984f7cd788742c6ee3e53.tar.xz
Add rest console support to the user server. Will ask new questions at
startup. To use, run it normally once, answering the questions, then run again with -console=rest. Also now supports -console=basic for a console that reads stdin
Diffstat (limited to '')
-rw-r--r--OpenSim/Grid/UserServer/Main.cs39
1 files changed, 38 insertions, 1 deletions
diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs
index 86c2abb..f47a96e 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,17 @@ 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 System.Console.WriteLine("Initialized REST console");
161 RemoteConsole c = (RemoteConsole)m_console;
162 c.SetServer(m_httpServer);
163 IConfig netConfig = m_config.AddConfig("Network");
164 netConfig.Set("ConsoleUser", Cfg.ConsoleUser);
165 netConfig.Set("ConsolePass", Cfg.ConsolePass);
166 c.ReadConfig(m_config);
167 }
168
132 RegisterInterface<CommandConsole>(m_console); 169 RegisterInterface<CommandConsole>(m_console);
133 RegisterInterface<UserConfig>(Cfg); 170 RegisterInterface<UserConfig>(Cfg);
134 171