aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application/OpenSimBase.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Application/OpenSimBase.cs')
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs83
1 files changed, 83 insertions, 0 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 484159c..c1d0727 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -97,6 +97,10 @@ namespace OpenSim
97 97
98 protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); 98 protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>();
99 99
100 private List<string> m_permsModules;
101
102 private bool m_securePermissionsLoading = true;
103
100 /// <value> 104 /// <value>
101 /// The config information passed into the OpenSimulator region server. 105 /// The config information passed into the OpenSimulator region server.
102 /// </value> 106 /// </value>
@@ -201,6 +205,11 @@ namespace OpenSim
201 CreatePIDFile(pidFile); 205 CreatePIDFile(pidFile);
202 206
203 userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); 207 userStatsURI = startupConfig.GetString("Stats_URI", String.Empty);
208
209 m_securePermissionsLoading = startupConfig.GetBoolean("SecurePermissionsLoading", true);
210
211 string permissionModules = startupConfig.GetString("permissionmodules", "DefaultPermissionsModule");
212 m_permsModules = new List<string>(permissionModules.Split(','));
204 } 213 }
205 214
206 // Load the simulation data service 215 // Load the simulation data service
@@ -229,6 +238,12 @@ namespace OpenSim
229 m_moduleLoader = new ModuleLoader(m_config.Source); 238 m_moduleLoader = new ModuleLoader(m_config.Source);
230 239
231 LoadPlugins(); 240 LoadPlugins();
241
242 if (m_plugins.Count == 0) // We failed to load any modules. Mono Addins glitch!
243 {
244 Environment.Exit(1);
245 }
246
232 foreach (IApplicationPlugin plugin in m_plugins) 247 foreach (IApplicationPlugin plugin in m_plugins)
233 { 248 {
234 plugin.PostInitialise(); 249 plugin.PostInitialise();
@@ -378,7 +393,41 @@ namespace OpenSim
378 } 393 }
379 else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing..."); 394 else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing...");
380 395
396 if (m_securePermissionsLoading)
397 {
398 foreach (string s in m_permsModules)
399 {
400 if (!scene.RegionModules.ContainsKey(s))
401 {
402 bool found = false;
403 foreach (IRegionModule m in modules)
404 {
405 if (m.Name == s)
406 {
407 found = true;
408 }
409 }
410 if (!found)
411 {
412 m_log.Fatal("[MODULES]: Required module " + s + " not found.");
413 Environment.Exit(0);
414 }
415 }
416 }
417 }
418
381 scene.SetModuleInterfaces(); 419 scene.SetModuleInterfaces();
420// First Step of bootreport sequence
421 if (scene.SnmpService != null)
422 {
423 scene.SnmpService.ColdStart(1,scene);
424 scene.SnmpService.LinkDown(scene);
425 }
426
427 if (scene.SnmpService != null)
428 {
429 scene.SnmpService.BootInfo("Loading prins", scene);
430 }
382 431
383 while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) 432 while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null)
384 SetUpEstateOwner(scene); 433 SetUpEstateOwner(scene);
@@ -392,6 +441,11 @@ namespace OpenSim
392 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); 441 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
393 scene.EventManager.TriggerParcelPrimCountUpdate(); 442 scene.EventManager.TriggerParcelPrimCountUpdate();
394 443
444 if (scene.SnmpService != null)
445 {
446 scene.SnmpService.BootInfo("Grid Registration in progress", scene);
447 }
448
395 try 449 try
396 { 450 {
397 scene.RegisterRegionWithGrid(); 451 scene.RegisterRegionWithGrid();
@@ -402,15 +456,29 @@ namespace OpenSim
402 "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}", 456 "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}",
403 e.Message, e.StackTrace); 457 e.Message, e.StackTrace);
404 458
459 if (scene.SnmpService != null)
460 {
461 scene.SnmpService.Critical("Grid registration failed. Startup aborted.", scene);
462 }
405 // Carrying on now causes a lot of confusion down the 463 // Carrying on now causes a lot of confusion down the
406 // line - we need to get the user's attention 464 // line - we need to get the user's attention
407 Environment.Exit(1); 465 Environment.Exit(1);
408 } 466 }
409 467
468 if (scene.SnmpService != null)
469 {
470 scene.SnmpService.BootInfo("Grid Registration done", scene);
471 }
472
410 // We need to do this after we've initialized the 473 // We need to do this after we've initialized the
411 // scripting engines. 474 // scripting engines.
412 scene.CreateScriptInstances(); 475 scene.CreateScriptInstances();
413 476
477 if (scene.SnmpService != null)
478 {
479 scene.SnmpService.BootInfo("ScriptEngine started", scene);
480 }
481
414 m_sceneManager.Add(scene); 482 m_sceneManager.Add(scene);
415 483
416 if (m_autoCreateClientStack) 484 if (m_autoCreateClientStack)
@@ -419,6 +487,10 @@ namespace OpenSim
419 clientServer.Start(); 487 clientServer.Start();
420 } 488 }
421 489
490 if (scene.SnmpService != null)
491 {
492 scene.SnmpService.BootInfo("Initializing region modules", scene);
493 }
422 if (do_post_init) 494 if (do_post_init)
423 { 495 {
424 foreach (IRegionModule module in modules) 496 foreach (IRegionModule module in modules)
@@ -430,6 +502,12 @@ namespace OpenSim
430 502
431 mscene = scene; 503 mscene = scene;
432 504
505 if (scene.SnmpService != null)
506 {
507 scene.SnmpService.BootInfo("The region is operational", scene);
508 scene.SnmpService.LinkUp(scene);
509 }
510
433 scene.Start(); 511 scene.Start();
434 512
435 scene.StartScripts(); 513 scene.StartScripts();
@@ -549,6 +627,11 @@ namespace OpenSim
549 private void ShutdownRegion(Scene scene) 627 private void ShutdownRegion(Scene scene)
550 { 628 {
551 m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); 629 m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName);
630 if (scene.SnmpService != null)
631 {
632 scene.SnmpService.BootInfo("The region is shutting down", scene);
633 scene.SnmpService.LinkDown(scene);
634 }
552 IRegionModulesController controller; 635 IRegionModulesController controller;
553 if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller)) 636 if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller))
554 { 637 {