diff options
author | David Walter Seikel | 2016-11-03 21:44:39 +1000 |
---|---|---|
committer | David Walter Seikel | 2016-11-03 21:44:39 +1000 |
commit | 134f86e8d5c414409631b25b8c6f0ee45fbd8631 (patch) | |
tree | 216b89d3fb89acfb81be1e440c25c41ab09fa96d /OpenSim/Server/Base | |
parent | More changing to production grid. Double oops. (diff) | |
download | opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.zip opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.gz opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.bz2 opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.xz |
Initial update to OpenSim 0.8.2.1 source code.
Diffstat (limited to 'OpenSim/Server/Base')
-rw-r--r-- | OpenSim/Server/Base/HttpServerBase.cs | 39 | ||||
-rw-r--r-- | OpenSim/Server/Base/Properties/AssemblyInfo.cs | 4 | ||||
-rw-r--r-- | OpenSim/Server/Base/ProtocolVersions.cs | 8 | ||||
-rw-r--r-- | OpenSim/Server/Base/ServerUtils.cs | 53 | ||||
-rw-r--r-- | OpenSim/Server/Base/ServicesServerBase.cs | 74 |
5 files changed, 87 insertions, 91 deletions
diff --git a/OpenSim/Server/Base/HttpServerBase.cs b/OpenSim/Server/Base/HttpServerBase.cs index 954783c..44ef124 100644 --- a/OpenSim/Server/Base/HttpServerBase.cs +++ b/OpenSim/Server/Base/HttpServerBase.cs | |||
@@ -56,15 +56,16 @@ namespace OpenSim.Server.Base | |||
56 | 56 | ||
57 | if (networkConfig == null) | 57 | if (networkConfig == null) |
58 | { | 58 | { |
59 | System.Console.WriteLine("Section 'Network' not found, server can't start"); | 59 | System.Console.WriteLine("ERROR: Section [Network] not found, server can't start"); |
60 | Thread.CurrentThread.Abort(); | 60 | Environment.Exit(1); |
61 | } | 61 | } |
62 | 62 | ||
63 | uint port = (uint)networkConfig.GetInt("port", 0); | 63 | uint port = (uint)networkConfig.GetInt("port", 0); |
64 | 64 | ||
65 | if (port == 0) | 65 | if (port == 0) |
66 | { | 66 | { |
67 | Thread.CurrentThread.Abort(); | 67 | System.Console.WriteLine("ERROR: No 'port' entry found in [Network]. Server can't start"); |
68 | Environment.Exit(1); | ||
68 | } | 69 | } |
69 | 70 | ||
70 | bool ssl_main = networkConfig.GetBoolean("https_main",false); | 71 | bool ssl_main = networkConfig.GetBoolean("https_main",false); |
@@ -83,23 +84,24 @@ namespace OpenSim.Server.Base | |||
83 | // Then, check for https settings and ADD a server to | 84 | // Then, check for https settings and ADD a server to |
84 | // m_Servers | 85 | // m_Servers |
85 | // | 86 | // |
86 | if ( !ssl_main ) | 87 | if (!ssl_main) |
87 | { | 88 | { |
88 | httpServer = new BaseHttpServer(port); | 89 | httpServer = new BaseHttpServer(port); |
89 | } | 90 | } |
90 | else | 91 | else |
91 | { | 92 | { |
92 | string cert_path = networkConfig.GetString("cert_path",String.Empty); | 93 | string cert_path = networkConfig.GetString("cert_path",String.Empty); |
93 | if ( cert_path == String.Empty ) | 94 | if (cert_path == String.Empty) |
94 | { | 95 | { |
95 | System.Console.WriteLine("Path to X509 certificate is missing, server can't start."); | 96 | System.Console.WriteLine("ERROR: Path to X509 certificate is missing, server can't start."); |
96 | Thread.CurrentThread.Abort(); | 97 | Environment.Exit(1); |
97 | } | 98 | } |
99 | |||
98 | string cert_pass = networkConfig.GetString("cert_pass",String.Empty); | 100 | string cert_pass = networkConfig.GetString("cert_pass",String.Empty); |
99 | if ( cert_pass == String.Empty ) | 101 | if (cert_pass == String.Empty) |
100 | { | 102 | { |
101 | System.Console.WriteLine("Password for X509 certificate is missing, server can't start."); | 103 | System.Console.WriteLine("ERROR: Password for X509 certificate is missing, server can't start."); |
102 | Thread.CurrentThread.Abort(); | 104 | Environment.Exit(1); |
103 | } | 105 | } |
104 | 106 | ||
105 | httpServer = new BaseHttpServer(port, ssl_main, cert_path, cert_pass); | 107 | httpServer = new BaseHttpServer(port, ssl_main, cert_path, cert_pass); |
@@ -109,21 +111,22 @@ namespace OpenSim.Server.Base | |||
109 | MainServer.Instance = httpServer; | 111 | MainServer.Instance = httpServer; |
110 | 112 | ||
111 | // If https_listener = true, then add an ssl listener on the https_port... | 113 | // If https_listener = true, then add an ssl listener on the https_port... |
112 | if ( ssl_listener == true ) { | 114 | if (ssl_listener == true) |
113 | 115 | { | |
114 | uint https_port = (uint)networkConfig.GetInt("https_port", 0); | 116 | uint https_port = (uint)networkConfig.GetInt("https_port", 0); |
115 | 117 | ||
116 | string cert_path = networkConfig.GetString("cert_path",String.Empty); | 118 | string cert_path = networkConfig.GetString("cert_path",String.Empty); |
117 | if ( cert_path == String.Empty ) | 119 | if (cert_path == String.Empty) |
118 | { | 120 | { |
119 | System.Console.WriteLine("Path to X509 certificate is missing, server can't start."); | 121 | System.Console.WriteLine("ERROR: Path to X509 certificate is missing, server can't start."); |
120 | Thread.CurrentThread.Abort(); | 122 | Environment.Exit(1); |
121 | } | 123 | } |
124 | |||
122 | string cert_pass = networkConfig.GetString("cert_pass",String.Empty); | 125 | string cert_pass = networkConfig.GetString("cert_pass",String.Empty); |
123 | if ( cert_pass == String.Empty ) | 126 | if (cert_pass == String.Empty) |
124 | { | 127 | { |
125 | System.Console.WriteLine("Password for X509 certificate is missing, server can't start."); | 128 | System.Console.WriteLine("ERROR: Password for X509 certificate is missing, server can't start."); |
126 | Thread.CurrentThread.Abort(); | 129 | Environment.Exit(1); |
127 | } | 130 | } |
128 | 131 | ||
129 | MainServer.AddHttpServer(new BaseHttpServer(https_port, ssl_listener, cert_path, cert_pass)); | 132 | MainServer.AddHttpServer(new BaseHttpServer(https_port, ssl_listener, cert_path, cert_pass)); |
diff --git a/OpenSim/Server/Base/Properties/AssemblyInfo.cs b/OpenSim/Server/Base/Properties/AssemblyInfo.cs index 4bbe358..3c634a7 100644 --- a/OpenSim/Server/Base/Properties/AssemblyInfo.cs +++ b/OpenSim/Server/Base/Properties/AssemblyInfo.cs | |||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices; | |||
29 | // Build Number | 29 | // Build Number |
30 | // Revision | 30 | // Revision |
31 | // | 31 | // |
32 | [assembly: AssemblyVersion("0.7.5.*")] | 32 | [assembly: AssemblyVersion("0.8.3.*")] |
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | 33 | |
diff --git a/OpenSim/Server/Base/ProtocolVersions.cs b/OpenSim/Server/Base/ProtocolVersions.cs index 8db5bb6..5c2278c 100644 --- a/OpenSim/Server/Base/ProtocolVersions.cs +++ b/OpenSim/Server/Base/ProtocolVersions.cs | |||
@@ -46,11 +46,11 @@ namespace OpenSim.Server.Base | |||
46 | /// </value> | 46 | /// </value> |
47 | 47 | ||
48 | // The range of acceptable servers for client-side connectors | 48 | // The range of acceptable servers for client-side connectors |
49 | public readonly static int ClientProtocolVersionMin = 0; | 49 | public readonly static int ClientProtocolVersionMin = 1; |
50 | public readonly static int ClientProtocolVersionMax = 0; | 50 | public readonly static int ClientProtocolVersionMax = 1; |
51 | 51 | ||
52 | // The range of acceptable clients in server-side handlers | 52 | // The range of acceptable clients in server-side handlers |
53 | public readonly static int ServerProtocolVersionMin = 0; | 53 | public readonly static int ServerProtocolVersionMin = 1; |
54 | public readonly static int ServerProtocolVersionMax = 0; | 54 | public readonly static int ServerProtocolVersionMax = 1; |
55 | } | 55 | } |
56 | } | 56 | } |
diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs index 2e6d279..18a4266 100644 --- a/OpenSim/Server/Base/ServerUtils.cs +++ b/OpenSim/Server/Base/ServerUtils.cs | |||
@@ -41,7 +41,7 @@ using OpenSim.Framework.Servers.HttpServer; | |||
41 | using OpenSim.Framework.Servers; | 41 | using OpenSim.Framework.Servers; |
42 | 42 | ||
43 | 43 | ||
44 | [assembly:AddinRoot("Robust", "0.1")] | 44 | [assembly:AddinRoot("Robust", OpenSim.VersionInfo.VersionNumber)] |
45 | namespace OpenSim.Server.Base | 45 | namespace OpenSim.Server.Base |
46 | { | 46 | { |
47 | [TypeExtensionPoint(Path="/Robust/Connector", Name="RobustConnector")] | 47 | [TypeExtensionPoint(Path="/Robust/Connector", Name="RobustConnector")] |
@@ -89,9 +89,9 @@ namespace OpenSim.Server.Base | |||
89 | Config = config; | 89 | Config = config; |
90 | 90 | ||
91 | Registry = new AddinRegistry(registryPath, "."); | 91 | Registry = new AddinRegistry(registryPath, "."); |
92 | suppress_console_output_(true); | 92 | //suppress_console_output_(true); |
93 | AddinManager.Initialize(registryPath); | 93 | AddinManager.Initialize(registryPath); |
94 | suppress_console_output_(false); | 94 | //suppress_console_output_(false); |
95 | AddinManager.Registry.Update(); | 95 | AddinManager.Registry.Update(); |
96 | CommandManager commandmanager = new CommandManager(Registry); | 96 | CommandManager commandmanager = new CommandManager(Registry); |
97 | AddinManager.AddExtensionNodeHandler("/Robust/Connector", OnExtensionChanged); | 97 | AddinManager.AddExtensionNodeHandler("/Robust/Connector", OnExtensionChanged); |
@@ -138,17 +138,17 @@ namespace OpenSim.Server.Base | |||
138 | case ExtensionChange.Add: | 138 | case ExtensionChange.Add: |
139 | if (a.AddinFile.Contains(Registry.DefaultAddinsFolder)) | 139 | if (a.AddinFile.Contains(Registry.DefaultAddinsFolder)) |
140 | { | 140 | { |
141 | m_log.InfoFormat("[SERVER]: Adding {0} from registry", a.Name); | 141 | m_log.InfoFormat("[SERVER UTILS]: Adding {0} from registry", a.Name); |
142 | connector.PluginPath = System.IO.Path.Combine(Registry.DefaultAddinsFolder,a.Name.Replace(',', '.')); } | 142 | connector.PluginPath = System.IO.Path.Combine(Registry.DefaultAddinsFolder,a.Name.Replace(',', '.')); } |
143 | else | 143 | else |
144 | { | 144 | { |
145 | m_log.InfoFormat("[SERVER]: Adding {0} from ./bin", a.Name); | 145 | m_log.InfoFormat("[SERVER UTILS]: Adding {0} from ./bin", a.Name); |
146 | connector.PluginPath = a.AddinFile; | 146 | connector.PluginPath = a.AddinFile; |
147 | } | 147 | } |
148 | LoadPlugin(connector); | 148 | LoadPlugin(connector); |
149 | break; | 149 | break; |
150 | case ExtensionChange.Remove: | 150 | case ExtensionChange.Remove: |
151 | m_log.InfoFormat("[SERVER]: Removing {0}", a.Name); | 151 | m_log.InfoFormat("[SERVER UTILS]: Removing {0}", a.Name); |
152 | UnloadPlugin(connector); | 152 | UnloadPlugin(connector); |
153 | break; | 153 | break; |
154 | } | 154 | } |
@@ -166,13 +166,13 @@ namespace OpenSim.Server.Base | |||
166 | } | 166 | } |
167 | else | 167 | else |
168 | { | 168 | { |
169 | m_log.InfoFormat("[SERVER]: {0} Disabled.", connector.ConfigName); | 169 | m_log.InfoFormat("[SERVER UTILS]: {0} Disabled.", connector.ConfigName); |
170 | } | 170 | } |
171 | } | 171 | } |
172 | 172 | ||
173 | private void UnloadPlugin(IRobustConnector connector) | 173 | private void UnloadPlugin(IRobustConnector connector) |
174 | { | 174 | { |
175 | m_log.InfoFormat("[Server]: Unloading {0}", connector.ConfigName); | 175 | m_log.InfoFormat("[SERVER UTILS]: Unloading {0}", connector.ConfigName); |
176 | 176 | ||
177 | connector.Unload(); | 177 | connector.Unload(); |
178 | } | 178 | } |
@@ -196,17 +196,19 @@ namespace OpenSim.Server.Base | |||
196 | 196 | ||
197 | public static byte[] SerializeResult(XmlSerializer xs, object data) | 197 | public static byte[] SerializeResult(XmlSerializer xs, object data) |
198 | { | 198 | { |
199 | MemoryStream ms = new MemoryStream(); | 199 | using (MemoryStream ms = new MemoryStream()) |
200 | XmlTextWriter xw = new XmlTextWriter(ms, Util.UTF8); | 200 | using (XmlTextWriter xw = new XmlTextWriter(ms, Util.UTF8)) |
201 | xw.Formatting = Formatting.Indented; | 201 | { |
202 | xs.Serialize(xw, data); | 202 | xw.Formatting = Formatting.Indented; |
203 | xw.Flush(); | 203 | xs.Serialize(xw, data); |
204 | xw.Flush(); | ||
204 | 205 | ||
205 | ms.Seek(0, SeekOrigin.Begin); | 206 | ms.Seek(0, SeekOrigin.Begin); |
206 | byte[] ret = ms.GetBuffer(); | 207 | byte[] ret = ms.GetBuffer(); |
207 | Array.Resize(ref ret, (int)ms.Length); | 208 | Array.Resize(ref ret, (int)ms.Length); |
208 | 209 | ||
209 | return ret; | 210 | return ret; |
211 | } | ||
210 | } | 212 | } |
211 | 213 | ||
212 | /// <summary> | 214 | /// <summary> |
@@ -266,7 +268,7 @@ namespace OpenSim.Server.Base | |||
266 | && pluginType.ToString() != pluginType.Namespace + "." + className) | 268 | && pluginType.ToString() != pluginType.Namespace + "." + className) |
267 | continue; | 269 | continue; |
268 | 270 | ||
269 | Type typeInterface = pluginType.GetInterface(interfaceName, true); | 271 | Type typeInterface = pluginType.GetInterface(interfaceName); |
270 | 272 | ||
271 | if (typeInterface != null) | 273 | if (typeInterface != null) |
272 | { | 274 | { |
@@ -280,12 +282,13 @@ namespace OpenSim.Server.Base | |||
280 | { | 282 | { |
281 | if (!(e is System.MissingMethodException)) | 283 | if (!(e is System.MissingMethodException)) |
282 | { | 284 | { |
283 | m_log.ErrorFormat("Error loading plugin {0} from {1}. Exception: {2}, {3}", | 285 | m_log.Error(string.Format("[SERVER UTILS]: Error loading plugin {0} from {1}. Exception: {2}", |
284 | interfaceName, | 286 | interfaceName, |
285 | dllName, | 287 | dllName, |
286 | e.InnerException == null ? e.Message : e.InnerException.Message, | 288 | e.InnerException == null ? e.Message : e.InnerException.Message), |
287 | e.StackTrace); | 289 | e); |
288 | } | 290 | } |
291 | m_log.ErrorFormat("[SERVER UTILS]: Error loading plugin {0}: {1} args.Length {2}", dllName, e.Message, args.Length); | ||
289 | return null; | 292 | return null; |
290 | } | 293 | } |
291 | 294 | ||
@@ -298,14 +301,14 @@ namespace OpenSim.Server.Base | |||
298 | } | 301 | } |
299 | catch (ReflectionTypeLoadException rtle) | 302 | catch (ReflectionTypeLoadException rtle) |
300 | { | 303 | { |
301 | m_log.Error(string.Format("Error loading plugin from {0}:\n{1}", dllName, | 304 | m_log.Error(string.Format("[SERVER UTILS]: Error loading plugin from {0}:\n{1}", dllName, |
302 | String.Join("\n", Array.ConvertAll(rtle.LoaderExceptions, e => e.ToString()))), | 305 | String.Join("\n", Array.ConvertAll(rtle.LoaderExceptions, e => e.ToString()))), |
303 | rtle); | 306 | rtle); |
304 | return null; | 307 | return null; |
305 | } | 308 | } |
306 | catch (Exception e) | 309 | catch (Exception e) |
307 | { | 310 | { |
308 | m_log.Error(string.Format("Error loading plugin from {0}", dllName), e); | 311 | m_log.Error(string.Format("[SERVER UTILS]: Error loading plugin from {0}", dllName), e); |
309 | return null; | 312 | return null; |
310 | } | 313 | } |
311 | } | 314 | } |
@@ -517,7 +520,7 @@ namespace OpenSim.Server.Base | |||
517 | public static IConfigSource LoadInitialConfig(string url) | 520 | public static IConfigSource LoadInitialConfig(string url) |
518 | { | 521 | { |
519 | IConfigSource source = new XmlConfigSource(); | 522 | IConfigSource source = new XmlConfigSource(); |
520 | m_log.InfoFormat("[CONFIG]: {0} is a http:// URI, fetching ...", url); | 523 | m_log.InfoFormat("[SERVER UTILS]: {0} is a http:// URI, fetching ...", url); |
521 | 524 | ||
522 | // The ini file path is a http URI | 525 | // The ini file path is a http URI |
523 | // Try to read it | 526 | // Try to read it |
@@ -529,7 +532,7 @@ namespace OpenSim.Server.Base | |||
529 | } | 532 | } |
530 | catch (Exception e) | 533 | catch (Exception e) |
531 | { | 534 | { |
532 | m_log.FatalFormat("[CONFIG]: Exception reading config from URI {0}\n" + e.ToString(), url); | 535 | m_log.FatalFormat("[SERVER UTILS]: Exception reading config from URI {0}\n" + e.ToString(), url); |
533 | Environment.Exit(1); | 536 | Environment.Exit(1); |
534 | } | 537 | } |
535 | 538 | ||
diff --git a/OpenSim/Server/Base/ServicesServerBase.cs b/OpenSim/Server/Base/ServicesServerBase.cs index ecd69b0..1f2c54d 100644 --- a/OpenSim/Server/Base/ServicesServerBase.cs +++ b/OpenSim/Server/Base/ServicesServerBase.cs | |||
@@ -34,6 +34,7 @@ using System.Text; | |||
34 | using System.Xml; | 34 | using System.Xml; |
35 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
36 | using OpenSim.Framework.Console; | 36 | using OpenSim.Framework.Console; |
37 | using OpenSim.Framework.Monitoring; | ||
37 | using OpenSim.Framework.Servers; | 38 | using OpenSim.Framework.Servers; |
38 | using log4net; | 39 | using log4net; |
39 | using log4net.Config; | 40 | using log4net.Config; |
@@ -48,9 +49,7 @@ namespace OpenSim.Server.Base | |||
48 | { | 49 | { |
49 | // Logger | 50 | // Logger |
50 | // | 51 | // |
51 | private static readonly ILog m_log = | 52 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
52 | LogManager.GetLogger( | ||
53 | MethodBase.GetCurrentMethod().DeclaringType); | ||
54 | 53 | ||
55 | // Command line args | 54 | // Command line args |
56 | // | 55 | // |
@@ -71,11 +70,9 @@ namespace OpenSim.Server.Base | |||
71 | public ServicesServerBase(string prompt, string[] args) : base() | 70 | public ServicesServerBase(string prompt, string[] args) : base() |
72 | { | 71 | { |
73 | // Save raw arguments | 72 | // Save raw arguments |
74 | // | ||
75 | m_Arguments = args; | 73 | m_Arguments = args; |
76 | 74 | ||
77 | // Read command line | 75 | // Read command line |
78 | // | ||
79 | ArgvConfigSource argvConfig = new ArgvConfigSource(args); | 76 | ArgvConfigSource argvConfig = new ArgvConfigSource(args); |
80 | 77 | ||
81 | argvConfig.AddSwitch("Startup", "console", "c"); | 78 | argvConfig.AddSwitch("Startup", "console", "c"); |
@@ -85,8 +82,9 @@ namespace OpenSim.Server.Base | |||
85 | argvConfig.AddSwitch("Startup", "logconfig", "g"); | 82 | argvConfig.AddSwitch("Startup", "logconfig", "g"); |
86 | 83 | ||
87 | // Automagically create the ini file name | 84 | // Automagically create the ini file name |
88 | // | 85 | string fileName = ""; |
89 | string fileName = Path.GetFileNameWithoutExtension(Assembly.GetEntryAssembly().Location); | 86 | if (Assembly.GetEntryAssembly() != null) |
87 | fileName = Path.GetFileNameWithoutExtension(Assembly.GetEntryAssembly().Location); | ||
90 | string iniFile = fileName + ".ini"; | 88 | string iniFile = fileName + ".ini"; |
91 | string logConfig = null; | 89 | string logConfig = null; |
92 | 90 | ||
@@ -94,19 +92,17 @@ namespace OpenSim.Server.Base | |||
94 | if (startupConfig != null) | 92 | if (startupConfig != null) |
95 | { | 93 | { |
96 | // Check if a file name was given on the command line | 94 | // Check if a file name was given on the command line |
97 | // | ||
98 | iniFile = startupConfig.GetString("inifile", iniFile); | 95 | iniFile = startupConfig.GetString("inifile", iniFile); |
99 | // | 96 | |
100 | // Check if a prompt was given on the command line | 97 | // Check if a prompt was given on the command line |
101 | prompt = startupConfig.GetString("prompt", prompt); | 98 | prompt = startupConfig.GetString("prompt", prompt); |
102 | // | 99 | |
103 | // Check for a Log4Net config file on the command line | 100 | // Check for a Log4Net config file on the command line |
104 | logConfig =startupConfig.GetString("logconfig",logConfig); | 101 | logConfig =startupConfig.GetString("logconfig", logConfig); |
105 | } | 102 | } |
106 | 103 | ||
107 | // Find out of the file name is a URI and remote load it | 104 | // Find out of the file name is a URI and remote load it if possible. |
108 | // if it's possible. Load it as a local file otherwise. | 105 | // Load it as a local file otherwise. |
109 | // | ||
110 | Uri configUri; | 106 | Uri configUri; |
111 | 107 | ||
112 | try | 108 | try |
@@ -128,13 +124,16 @@ namespace OpenSim.Server.Base | |||
128 | Environment.Exit(1); | 124 | Environment.Exit(1); |
129 | } | 125 | } |
130 | 126 | ||
131 | // Merge the configuration from the command line into the | 127 | // Merge OpSys env vars |
132 | // loaded file | 128 | m_log.Info("[CONFIG]: Loading environment variables for Config"); |
133 | // | 129 | Util.MergeEnvironmentToConfig(Config); |
130 | |||
131 | // Merge the configuration from the command line into the loaded file | ||
134 | Config.Merge(argvConfig); | 132 | Config.Merge(argvConfig); |
135 | 133 | ||
134 | Config.ReplaceKeyValues(); | ||
135 | |||
136 | // Refresh the startupConfig post merge | 136 | // Refresh the startupConfig post merge |
137 | // | ||
138 | if (Config.Configs["Startup"] != null) | 137 | if (Config.Configs["Startup"] != null) |
139 | { | 138 | { |
140 | startupConfig = Config.Configs["Startup"]; | 139 | startupConfig = Config.Configs["Startup"]; |
@@ -144,13 +143,10 @@ namespace OpenSim.Server.Base | |||
144 | 143 | ||
145 | prompt = startupConfig.GetString("Prompt", prompt); | 144 | prompt = startupConfig.GetString("Prompt", prompt); |
146 | 145 | ||
147 | // Allow derived classes to load config before the console is | 146 | // Allow derived classes to load config before the console is opened. |
148 | // opened. | ||
149 | // | ||
150 | ReadConfig(); | 147 | ReadConfig(); |
151 | 148 | ||
152 | // Create main console | 149 | // Create main console |
153 | // | ||
154 | string consoleType = "local"; | 150 | string consoleType = "local"; |
155 | if (startupConfig != null) | 151 | if (startupConfig != null) |
156 | consoleType = startupConfig.GetString("console", consoleType); | 152 | consoleType = startupConfig.GetString("console", consoleType); |
@@ -164,18 +160,17 @@ namespace OpenSim.Server.Base | |||
164 | MainConsole.Instance = new RemoteConsole(prompt); | 160 | MainConsole.Instance = new RemoteConsole(prompt); |
165 | ((RemoteConsole)MainConsole.Instance).ReadConfig(Config); | 161 | ((RemoteConsole)MainConsole.Instance).ReadConfig(Config); |
166 | } | 162 | } |
167 | else | 163 | else if (consoleType == "mock") |
164 | { | ||
165 | MainConsole.Instance = new MockConsole(); | ||
166 | } | ||
167 | else if (consoleType == "local") | ||
168 | { | 168 | { |
169 | MainConsole.Instance = new LocalConsole(prompt); | 169 | MainConsole.Instance = new LocalConsole(prompt, startupConfig); |
170 | } | 170 | } |
171 | 171 | ||
172 | m_console = MainConsole.Instance; | 172 | m_console = MainConsole.Instance; |
173 | 173 | ||
174 | // Configure the appenders for log4net | ||
175 | // | ||
176 | OpenSimAppender consoleAppender = null; | ||
177 | FileAppender fileAppender = null; | ||
178 | |||
179 | if (logConfig != null) | 174 | if (logConfig != null) |
180 | { | 175 | { |
181 | FileInfo cfg = new FileInfo(logConfig); | 176 | FileInfo cfg = new FileInfo(logConfig); |
@@ -186,6 +181,7 @@ namespace OpenSim.Server.Base | |||
186 | XmlConfigurator.Configure(); | 181 | XmlConfigurator.Configure(); |
187 | } | 182 | } |
188 | 183 | ||
184 | LogEnvironmentInformation(); | ||
189 | RegisterCommonAppenders(startupConfig); | 185 | RegisterCommonAppenders(startupConfig); |
190 | 186 | ||
191 | if (startupConfig.GetString("PIDFile", String.Empty) != String.Empty) | 187 | if (startupConfig.GetString("PIDFile", String.Empty) != String.Empty) |
@@ -194,20 +190,10 @@ namespace OpenSim.Server.Base | |||
194 | } | 190 | } |
195 | 191 | ||
196 | RegisterCommonCommands(); | 192 | RegisterCommonCommands(); |
197 | 193 | RegisterCommonComponents(Config); | |
198 | // Register the quit command | ||
199 | // | ||
200 | MainConsole.Instance.Commands.AddCommand("General", false, "quit", | ||
201 | "quit", | ||
202 | "Quit the application", HandleQuit); | ||
203 | |||
204 | MainConsole.Instance.Commands.AddCommand("General", false, "shutdown", | ||
205 | "shutdown", | ||
206 | "Quit the application", HandleQuit); | ||
207 | 194 | ||
208 | // Allow derived classes to perform initialization that | 195 | // Allow derived classes to perform initialization that |
209 | // needs to be done after the console has opened | 196 | // needs to be done after the console has opened |
210 | // | ||
211 | Initialise(); | 197 | Initialise(); |
212 | } | 198 | } |
213 | 199 | ||
@@ -218,6 +204,9 @@ namespace OpenSim.Server.Base | |||
218 | 204 | ||
219 | public virtual int Run() | 205 | public virtual int Run() |
220 | { | 206 | { |
207 | Watchdog.Enabled = true; | ||
208 | MemoryWatchdog.Enabled = true; | ||
209 | |||
221 | while (m_Running) | 210 | while (m_Running) |
222 | { | 211 | { |
223 | try | 212 | try |
@@ -235,11 +224,12 @@ namespace OpenSim.Server.Base | |||
235 | return 0; | 224 | return 0; |
236 | } | 225 | } |
237 | 226 | ||
238 | protected virtual void HandleQuit(string module, string[] args) | 227 | protected override void ShutdownSpecific() |
239 | { | 228 | { |
240 | m_Running = false; | 229 | m_Running = false; |
241 | m_log.Info("[CONSOLE] Quitting"); | 230 | m_log.Info("[CONSOLE] Quitting"); |
242 | 231 | ||
232 | base.ShutdownSpecific(); | ||
243 | } | 233 | } |
244 | 234 | ||
245 | protected virtual void ReadConfig() | 235 | protected virtual void ReadConfig() |
@@ -250,4 +240,4 @@ namespace OpenSim.Server.Base | |||
250 | { | 240 | { |
251 | } | 241 | } |
252 | } | 242 | } |
253 | } | 243 | } \ No newline at end of file |