diff options
author | Melanie | 2009-08-19 05:40:23 +0100 |
---|---|---|
committer | Melanie | 2009-08-19 05:40:23 +0100 |
commit | 2111c66f89033b3426ceedba6a3ec6ed8fb3363f (patch) | |
tree | e29ff3ccb6d99d63164db25772115fa8b176ed3c /OpenSim | |
parent | Graft the REST console onto the grid server. Same procedure as with (diff) | |
download | opensim-SC_OLD-2111c66f89033b3426ceedba6a3ec6ed8fb3363f.zip opensim-SC_OLD-2111c66f89033b3426ceedba6a3ec6ed8fb3363f.tar.gz opensim-SC_OLD-2111c66f89033b3426ceedba6a3ec6ed8fb3363f.tar.bz2 opensim-SC_OLD-2111c66f89033b3426ceedba6a3ec6ed8fb3363f.tar.xz |
Graft the REST console onto the message server as well. What a dirty hack!
Works the same as the others.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Framework/MessageServerConfig.cs | 16 | ||||
-rw-r--r-- | OpenSim/Grid/MessagingServer/Main.cs | 79 |
2 files changed, 74 insertions, 21 deletions
diff --git a/OpenSim/Framework/MessageServerConfig.cs b/OpenSim/Framework/MessageServerConfig.cs index d0ceebc..61e5ea7 100644 --- a/OpenSim/Framework/MessageServerConfig.cs +++ b/OpenSim/Framework/MessageServerConfig.cs | |||
@@ -46,6 +46,8 @@ namespace OpenSim.Framework | |||
46 | public string UserRecvKey = String.Empty; | 46 | public string UserRecvKey = String.Empty; |
47 | public string UserSendKey = String.Empty; | 47 | public string UserSendKey = String.Empty; |
48 | public string UserServerURL = String.Empty; | 48 | public string UserServerURL = String.Empty; |
49 | public string ConsoleUser = String.Empty; | ||
50 | public string ConsolePass = String.Empty; | ||
49 | 51 | ||
50 | public MessageServerConfig(string description, string filename) | 52 | public MessageServerConfig(string description, string filename) |
51 | { | 53 | { |
@@ -88,6 +90,12 @@ namespace OpenSim.Framework | |||
88 | "Use SSL? true/false", ConfigSettings.DefaultMessageServerHttpSSL.ToString(), false); | 90 | "Use SSL? true/false", ConfigSettings.DefaultMessageServerHttpSSL.ToString(), false); |
89 | m_configMember.addConfigurationOption("published_ip", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | 91 | m_configMember.addConfigurationOption("published_ip", ConfigurationOption.ConfigurationTypes.TYPE_STRING, |
90 | "My Published IP Address", "127.0.0.1", false); | 92 | "My Published IP Address", "127.0.0.1", false); |
93 | m_configMember.addConfigurationOption("console_user", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
94 | "Remote console access user name [Default: disabled]", "0", false); | ||
95 | |||
96 | m_configMember.addConfigurationOption("console_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
97 | "Remote console access password [Default: disabled]", "0", false); | ||
98 | |||
91 | } | 99 | } |
92 | 100 | ||
93 | public bool handleIncomingConfiguration(string configuration_key, object configuration_result) | 101 | public bool handleIncomingConfiguration(string configuration_key, object configuration_result) |
@@ -130,9 +138,15 @@ namespace OpenSim.Framework | |||
130 | case "published_ip": | 138 | case "published_ip": |
131 | MessageServerIP = (string) configuration_result; | 139 | MessageServerIP = (string) configuration_result; |
132 | break; | 140 | break; |
141 | case "console_user": | ||
142 | ConsoleUser = (string)configuration_result; | ||
143 | break; | ||
144 | case "console_pass": | ||
145 | ConsolePass = (string)configuration_result; | ||
146 | break; | ||
133 | } | 147 | } |
134 | 148 | ||
135 | return true; | 149 | return true; |
136 | } | 150 | } |
137 | } | 151 | } |
138 | } \ No newline at end of file | 152 | } |
diff --git a/OpenSim/Grid/MessagingServer/Main.cs b/OpenSim/Grid/MessagingServer/Main.cs index dcefeea..654e770 100644 --- a/OpenSim/Grid/MessagingServer/Main.cs +++ b/OpenSim/Grid/MessagingServer/Main.cs | |||
@@ -30,6 +30,7 @@ using System.Collections.Generic; | |||
30 | using System.IO; | 30 | using System.IO; |
31 | using System.Reflection; | 31 | using System.Reflection; |
32 | using log4net; | 32 | using log4net; |
33 | using Nini.Config; | ||
33 | using log4net.Config; | 34 | using log4net.Config; |
34 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Console; | 36 | using OpenSim.Framework.Console; |
@@ -56,8 +57,22 @@ namespace OpenSim.Grid.MessagingServer | |||
56 | 57 | ||
57 | // private UUID m_lastCreatedUser = UUID.Random(); | 58 | // private UUID m_lastCreatedUser = UUID.Random(); |
58 | 59 | ||
60 | protected static string m_consoleType = "local"; | ||
61 | protected static IConfigSource m_config = null; | ||
62 | |||
59 | public static void Main(string[] args) | 63 | public static void Main(string[] args) |
60 | { | 64 | { |
65 | ArgvConfigSource argvSource = new ArgvConfigSource(args); | ||
66 | argvSource.AddSwitch("Startup", "console", "c"); | ||
67 | |||
68 | IConfig startupConfig = argvSource.Configs["Startup"]; | ||
69 | if (startupConfig != null) | ||
70 | { | ||
71 | m_consoleType = startupConfig.GetString("console", "local"); | ||
72 | } | ||
73 | |||
74 | m_config = argvSource; | ||
75 | |||
61 | XmlConfigurator.Configure(); | 76 | XmlConfigurator.Configure(); |
62 | 77 | ||
63 | m_log.Info("[SERVER]: Launching MessagingServer..."); | 78 | m_log.Info("[SERVER]: Launching MessagingServer..."); |
@@ -70,7 +85,18 @@ namespace OpenSim.Grid.MessagingServer | |||
70 | 85 | ||
71 | public OpenMessage_Main() | 86 | public OpenMessage_Main() |
72 | { | 87 | { |
73 | m_console = new LocalConsole("Messaging"); | 88 | switch (m_consoleType) |
89 | { | ||
90 | case "rest": | ||
91 | m_console = new RemoteConsole("Messaging"); | ||
92 | break; | ||
93 | case "basic": | ||
94 | m_console = new CommandConsole("Messaging"); | ||
95 | break; | ||
96 | default: | ||
97 | m_console = new LocalConsole("Messaging"); | ||
98 | break; | ||
99 | } | ||
74 | MainConsole.Instance = m_console; | 100 | MainConsole.Instance = m_console; |
75 | } | 101 | } |
76 | 102 | ||
@@ -88,20 +114,33 @@ namespace OpenSim.Grid.MessagingServer | |||
88 | { | 114 | { |
89 | if (m_userServerModule.registerWithUserServer()) | 115 | if (m_userServerModule.registerWithUserServer()) |
90 | { | 116 | { |
91 | m_log.Info("[SERVER]: Starting HTTP process"); | 117 | if (m_httpServer == null) |
92 | m_httpServer = new BaseHttpServer(Cfg.HttpPort); | 118 | { |
93 | 119 | m_log.Info("[SERVER]: Starting HTTP process"); | |
94 | m_httpServer.AddXmlRPCHandler("login_to_simulator", msgsvc.UserLoggedOn); | 120 | m_httpServer = new BaseHttpServer(Cfg.HttpPort); |
95 | m_httpServer.AddXmlRPCHandler("logout_of_simulator", msgsvc.UserLoggedOff); | 121 | |
96 | m_httpServer.AddXmlRPCHandler("get_presence_info_bulk", msgsvc.GetPresenceInfoBulk); | 122 | if (m_console is RemoteConsole) |
97 | m_httpServer.AddXmlRPCHandler("process_region_shutdown", msgsvc.ProcessRegionShutdown); | 123 | { |
98 | m_httpServer.AddXmlRPCHandler("agent_location", msgsvc.AgentLocation); | 124 | RemoteConsole c = (RemoteConsole)m_console; |
99 | m_httpServer.AddXmlRPCHandler("agent_leaving", msgsvc.AgentLeaving); | 125 | c.SetServer(m_httpServer); |
100 | 126 | IConfig netConfig = m_config.AddConfig("Network"); | |
101 | m_httpServer.AddXmlRPCHandler("region_startup", m_regionModule.RegionStartup); | 127 | netConfig.Set("ConsoleUser", Cfg.ConsoleUser); |
102 | m_httpServer.AddXmlRPCHandler("region_shutdown", m_regionModule.RegionShutdown); | 128 | netConfig.Set("ConsolePass", Cfg.ConsolePass); |
103 | 129 | c.ReadConfig(m_config); | |
104 | m_httpServer.Start(); | 130 | } |
131 | |||
132 | m_httpServer.AddXmlRPCHandler("login_to_simulator", msgsvc.UserLoggedOn); | ||
133 | m_httpServer.AddXmlRPCHandler("logout_of_simulator", msgsvc.UserLoggedOff); | ||
134 | m_httpServer.AddXmlRPCHandler("get_presence_info_bulk", msgsvc.GetPresenceInfoBulk); | ||
135 | m_httpServer.AddXmlRPCHandler("process_region_shutdown", msgsvc.ProcessRegionShutdown); | ||
136 | m_httpServer.AddXmlRPCHandler("agent_location", msgsvc.AgentLocation); | ||
137 | m_httpServer.AddXmlRPCHandler("agent_leaving", msgsvc.AgentLeaving); | ||
138 | |||
139 | m_httpServer.AddXmlRPCHandler("region_startup", m_regionModule.RegionStartup); | ||
140 | m_httpServer.AddXmlRPCHandler("region_shutdown", m_regionModule.RegionShutdown); | ||
141 | |||
142 | m_httpServer.Start(); | ||
143 | } | ||
105 | m_log.Info("[SERVER]: Userserver registration was successful"); | 144 | m_log.Info("[SERVER]: Userserver registration was successful"); |
106 | } | 145 | } |
107 | else | 146 | else |
@@ -114,12 +153,12 @@ namespace OpenSim.Grid.MessagingServer | |||
114 | private void deregisterFromUserServer() | 153 | private void deregisterFromUserServer() |
115 | { | 154 | { |
116 | m_userServerModule.deregisterWithUserServer(); | 155 | m_userServerModule.deregisterWithUserServer(); |
117 | if (m_httpServer != null) | 156 | // if (m_httpServer != null) |
118 | { | 157 | // { |
119 | // try a completely fresh registration, with fresh handlers, too | 158 | // try a completely fresh registration, with fresh handlers, too |
120 | m_httpServer.Stop(); | 159 | // m_httpServer.Stop(); |
121 | m_httpServer = null; | 160 | // m_httpServer = null; |
122 | } | 161 | // } |
123 | m_console.Output("[SERVER]: Deregistered from userserver."); | 162 | m_console.Output("[SERVER]: Deregistered from userserver."); |
124 | } | 163 | } |
125 | 164 | ||