Merge branch 'master' into careminster

avinationmerge
Melanie 2010-01-11 03:50:24 +00:00
commit 20e748205e
5 changed files with 22 additions and 4 deletions

View File

@ -32,7 +32,7 @@ namespace OpenSim.Framework
{ {
public class MainServer public class MainServer
{ {
private static BaseHttpServer instance; private static BaseHttpServer instance = null;
private static Dictionary<uint, BaseHttpServer> m_Servers = private static Dictionary<uint, BaseHttpServer> m_Servers =
new Dictionary<uint, BaseHttpServer>(); new Dictionary<uint, BaseHttpServer>();
@ -46,7 +46,7 @@ namespace OpenSim.Framework
{ {
if (port == 0) if (port == 0)
return Instance; return Instance;
if (port == Instance.Port) if (instance != null && port == Instance.Port)
return Instance; return Instance;
if (m_Servers.ContainsKey(port)) if (m_Servers.ContainsKey(port))

View File

@ -53,6 +53,7 @@ namespace OpenSim
protected string m_shutdownCommandsFile; protected string m_shutdownCommandsFile;
protected bool m_gui = false; protected bool m_gui = false;
protected string m_consoleType = "local"; protected string m_consoleType = "local";
protected uint m_consolePort = 0;
private string m_timedScript = "disabled"; private string m_timedScript = "disabled";
private Timer m_scriptTimer; private Timer m_scriptTimer;
@ -79,6 +80,7 @@ namespace OpenSim
else else
m_consoleType= startupConfig.GetString("console", String.Empty); m_consoleType= startupConfig.GetString("console", String.Empty);
m_consolePort = (uint)startupConfig.GetInt("console_port", 0);
m_timedScript = startupConfig.GetString("timer_Script", "disabled"); m_timedScript = startupConfig.GetString("timer_Script", "disabled");
if (m_logFileAppender != null) if (m_logFileAppender != null)
{ {
@ -151,7 +153,16 @@ namespace OpenSim
base.StartupSpecific(); base.StartupSpecific();
if (m_console is RemoteConsole) if (m_console is RemoteConsole)
{
if (m_consolePort == 0)
{
((RemoteConsole)m_console).SetServer(m_httpServer); ((RemoteConsole)m_console).SetServer(m_httpServer);
}
else
{
((RemoteConsole)m_console).SetServer(MainServer.GetHttpServer(m_consolePort));
}
}
//Run Startup Commands //Run Startup Commands
if (String.IsNullOrEmpty(m_startupCommandsFile)) if (String.IsNullOrEmpty(m_startupCommandsFile))

View File

@ -49,6 +49,7 @@ namespace OpenSim.Server.Base
protected uint m_Port = 0; protected uint m_Port = 0;
protected Dictionary<uint, BaseHttpServer> m_Servers = protected Dictionary<uint, BaseHttpServer> m_Servers =
new Dictionary<uint, BaseHttpServer>(); new Dictionary<uint, BaseHttpServer>();
protected uint m_consolePort = 0;
public IHttpServer HttpServer public IHttpServer HttpServer
{ {
@ -98,6 +99,7 @@ namespace OpenSim.Server.Base
Thread.CurrentThread.Abort(); Thread.CurrentThread.Abort();
} }
m_consolePort = (uint)networkConfig.GetInt("ConsolePort", 0);
m_Port = port; m_Port = port;
m_HttpServer = new BaseHttpServer(port); m_HttpServer = new BaseHttpServer(port);
@ -111,7 +113,10 @@ namespace OpenSim.Server.Base
if (MainConsole.Instance is RemoteConsole) if (MainConsole.Instance is RemoteConsole)
{ {
if (m_consolePort == 0)
((RemoteConsole)MainConsole.Instance).SetServer(m_HttpServer); ((RemoteConsole)MainConsole.Instance).SetServer(m_HttpServer);
else
((RemoteConsole)MainConsole.Instance).SetServer(GetHttpServer(m_consolePort));
} }
} }
} }

View File

@ -22,6 +22,7 @@ port = 8003
; * Leave commented to diable logins to the console ; * Leave commented to diable logins to the console
;ConsoleUser = Test ;ConsoleUser = Test
;ConsolePass = secret ;ConsolePass = secret
;ConsolePort = 0
; * As an example, the below configuration precisely mimicks the legacy ; * As an example, the below configuration precisely mimicks the legacy
; * asset server. It is read by the asset IN connector (defined above) ; * asset server. It is read by the asset IN connector (defined above)

View File

@ -326,6 +326,7 @@
ConsoleUser = "Test" ConsoleUser = "Test"
ConsolePass = "secret" ConsolePass = "secret"
http_listener_port = 9000 http_listener_port = 9000
console_port = 0
default_location_x = 1000 default_location_x = 1000
default_location_y = 1000 default_location_y = 1000