aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application/OpenSimMain.cs
diff options
context:
space:
mode:
authorTedd Hansen2008-01-05 16:38:37 +0000
committerTedd Hansen2008-01-05 16:38:37 +0000
commit130dea789a281f51c1099054790144c00219c2a6 (patch)
tree721c9b14d21733776a26eeebbe77e645f1214dc0 /OpenSim/Region/Application/OpenSimMain.cs
parentChanges to ScriptServer to (hopefully) make it compile on both .Net and Mono. (diff)
downloadopensim-SC_OLD-130dea789a281f51c1099054790144c00219c2a6.zip
opensim-SC_OLD-130dea789a281f51c1099054790144c00219c2a6.tar.gz
opensim-SC_OLD-130dea789a281f51c1099054790144c00219c2a6.tar.bz2
opensim-SC_OLD-130dea789a281f51c1099054790144c00219c2a6.tar.xz
Added some comments + Ahlotta Debugging in startup sequence
Diffstat (limited to 'OpenSim/Region/Application/OpenSimMain.cs')
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs106
1 files changed, 69 insertions, 37 deletions
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index e8453bc..f41ec21 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -279,16 +279,30 @@ namespace OpenSim
279 /// </summary> 279 /// </summary>
280 public override void StartUp() 280 public override void StartUp()
281 { 281 {
282 //
283 // Called from app startup (OpenSim.Application)
284 //
285
286
287 // Create log directory if it doesn't exist
282 if (!Directory.Exists(Util.logDir())) 288 if (!Directory.Exists(Util.logDir()))
283 { 289 {
284 Directory.CreateDirectory(Util.logDir()); 290 Directory.CreateDirectory(Util.logDir());
285 } 291 }
286 292
293 // Create a log instance
287 m_log = CreateLog(); 294 m_log = CreateLog();
288 MainLog.Instance = m_log; 295 MainLog.Instance = m_log;
289 296
297 MainLog.Instance.Verbose("STARTUP", "TEDD DEBUG #1");
298 // Do baseclass startup sequence: OpenSim.Region.ClientStack.RegionApplicationBase.StartUp
299 // TerrainManager, StorageManager, HTTP Server
300 // This base will call abstract Initialize
290 base.StartUp(); 301 base.StartUp();
291 302
303
304 MainLog.Instance.Verbose("STARTUP", "TEDD DEBUG #2");
305 // StandAlone mode? m_sandbox is determined by !startupConfig.GetBoolean("gridmode", false)
292 if (m_sandbox) 306 if (m_sandbox)
293 { 307 {
294 LocalInventoryService inventoryService = new LocalInventoryService(); 308 LocalInventoryService inventoryService = new LocalInventoryService();
@@ -321,23 +335,31 @@ namespace OpenSim
321 } 335 }
322 else 336 else
323 { 337 {
338 // We are in grid mode
324 m_commsManager = new CommunicationsOGS1(m_networkServersInfo, m_httpServer, m_assetCache); 339 m_commsManager = new CommunicationsOGS1(m_networkServersInfo, m_httpServer, m_assetCache);
325 m_httpServer.AddStreamHandler(new SimStatusHandler()); 340 m_httpServer.AddStreamHandler(new SimStatusHandler());
326 } 341 }
327 342
343 MainLog.Instance.Verbose("STARTUP", "TEDD DEBUG #3");
344 // Create a ModuleLoader instance
328 m_moduleLoader = new ModuleLoader(m_log, m_config); 345 m_moduleLoader = new ModuleLoader(m_log, m_config);
329 346
347 MainLog.Instance.Verbose("STARTUP", "TEDD DEBUG #4");
330 ExtensionNodeList nodes = AddinManager.GetExtensionNodes("/OpenSim/Startup"); 348 ExtensionNodeList nodes = AddinManager.GetExtensionNodes("/OpenSim/Startup");
331 MainLog.Instance.Verbose("PLUGINS", "Loading {0} OpenSim application plugins", nodes.Count); 349 MainLog.Instance.Verbose("PLUGINS", "Loading {0} OpenSim application plugins", nodes.Count);
332 350 MainLog.Instance.Verbose("STARTUP", "TEDD DEBUG #5");
351
352 int ctedd = 0;
333 foreach (TypeExtensionNode node in nodes) 353 foreach (TypeExtensionNode node in nodes)
334 { 354 {
335 MainLog.Instance.Verbose("PLUGINS", "Loading OpenSim application plugin: ", node.GetType().AssemblyQualifiedName.ToString());
336 IApplicationPlugin plugin = (IApplicationPlugin)node.CreateInstance(); 355 IApplicationPlugin plugin = (IApplicationPlugin)node.CreateInstance();
356 MainLog.Instance.Debug("PLUGINS", "Loading OpenSim application plugin: ", plugin.GetType().AssemblyQualifiedName.ToString());
337 357
338 plugin.Initialise(this); 358 plugin.Initialise(this);
339 m_plugins.Add(plugin); 359 m_plugins.Add(plugin);
360 MainLog.Instance.Verbose("STARTUP", "TEDD DEBUG #6: " + ++ctedd);
340 } 361 }
362 MainLog.Instance.Verbose("STARTUP", "TEDD DEBUG #7");
341 363
342 // Start UDP servers 364 // Start UDP servers
343 //for (int i = 0; i < m_udpServers.Count; i++) 365 //for (int i = 0; i < m_udpServers.Count; i++)
@@ -355,18 +377,59 @@ namespace OpenSim
355 MainLog.Instance.Verbose("STARTUP", "No startup command script specified. Moving on..."); 377 MainLog.Instance.Verbose("STARTUP", "No startup command script specified. Moving on...");
356 } 378 }
357 379
358 MainLog.Instance.Status("STARTUP", 380 // Start timer script (run a script every xx seconds)
359 "Startup complete, serving " + m_udpServers.Count.ToString() + " region(s)");
360
361 if (m_timedScript != "disabled") 381 if (m_timedScript != "disabled")
362 { 382 {
363 m_scriptTimer = new Timer(); 383 m_scriptTimer = new Timer();
364 m_scriptTimer.Enabled = true; 384 m_scriptTimer.Enabled = true;
365 m_scriptTimer.Interval = (int) (1200*1000); 385 m_scriptTimer.Interval = (int)(1200 * 1000);
366 m_scriptTimer.Elapsed += new ElapsedEventHandler(RunAutoTimerScript); 386 m_scriptTimer.Elapsed += new ElapsedEventHandler(RunAutoTimerScript);
367 } 387 }
388
389 // We are done with startup
390 MainLog.Instance.Status("STARTUP",
391 "Startup complete, serving " + m_udpServers.Count.ToString() + " region(s)");
392
393 // When we return now we will be in a wait for input command loop.
368 } 394 }
369 395
396 protected override void Initialize()
397 {
398 //
399 // Called from base.StartUp()
400 //
401
402 m_httpServerPort = m_networkServersInfo.HttpListenerPort;
403
404 IAssetServer assetServer;
405 if (m_assetStorage == "db4o")
406 {
407 assetServer = new LocalAssetServer();
408 }
409 else if (m_assetStorage == "grid")
410 {
411 assetServer = new GridAssetClient(m_networkServersInfo.AssetURL);
412 }
413 else if (m_assetStorage == "mssql")
414 {
415 SQLAssetServer sqlAssetServer = new SQLAssetServer("OpenSim.Framework.Data.MSSQL.dll");
416 sqlAssetServer.LoadDefaultAssets();
417 assetServer = sqlAssetServer;
418 //assetServer = new GridAssetClient("");
419 }
420 else
421 {
422 SQLAssetServer sqlAssetServer = new SQLAssetServer(m_standaloneAssetPlugin);
423 sqlAssetServer.LoadDefaultAssets();
424 assetServer = sqlAssetServer;
425 }
426
427 m_assetCache = new AssetCache(assetServer, m_log);
428 // m_assetCache = new assetCache("OpenSim.Region.GridInterfaces.Local.dll", m_networkServersInfo.AssetURL, m_networkServersInfo.AssetSendKey);
429 m_sceneManager.OnRestartSim += handleRestartRegion;
430 }
431
432
370 public UDPServer CreateRegion(RegionInfo regionInfo) 433 public UDPServer CreateRegion(RegionInfo regionInfo)
371 { 434 {
372 UDPServer udpServer; 435 UDPServer udpServer;
@@ -424,37 +487,6 @@ namespace OpenSim
424 m_moduleLoader, m_dumpAssetsToFile, m_physicalPrim, m_SendChildAgentTaskData); 487 m_moduleLoader, m_dumpAssetsToFile, m_physicalPrim, m_SendChildAgentTaskData);
425 } 488 }
426 489
427 protected override void Initialize()
428 {
429 m_httpServerPort = m_networkServersInfo.HttpListenerPort;
430
431 IAssetServer assetServer;
432 if (m_assetStorage == "db4o")
433 {
434 assetServer = new LocalAssetServer();
435 }
436 else if (m_assetStorage == "grid")
437 {
438 assetServer = new GridAssetClient(m_networkServersInfo.AssetURL);
439 }
440 else if (m_assetStorage == "mssql")
441 {
442 SQLAssetServer sqlAssetServer = new SQLAssetServer("OpenSim.Framework.Data.MSSQL.dll");
443 sqlAssetServer.LoadDefaultAssets();
444 assetServer = sqlAssetServer;
445 //assetServer = new GridAssetClient("");
446 }
447 else
448 {
449 SQLAssetServer sqlAssetServer = new SQLAssetServer(m_standaloneAssetPlugin);
450 sqlAssetServer.LoadDefaultAssets();
451 assetServer = sqlAssetServer;
452 }
453
454 m_assetCache = new AssetCache(assetServer, m_log);
455 // m_assetCache = new assetCache("OpenSim.Region.GridInterfaces.Local.dll", m_networkServersInfo.AssetURL, m_networkServersInfo.AssetSendKey);
456 m_sceneManager.OnRestartSim += handleRestartRegion;
457 }
458 490
459 public void handleRestartRegion(RegionInfo whichRegion) 491 public void handleRestartRegion(RegionInfo whichRegion)
460 { 492 {