aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application/OpenSimBase.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-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 37cfe1d..aed10f6 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();
@@ -382,7 +397,41 @@ namespace OpenSim
382 } 397 }
383 else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing..."); 398 else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing...");
384 399
400 if (m_securePermissionsLoading)
401 {
402 foreach (string s in m_permsModules)
403 {
404 if (!scene.RegionModules.ContainsKey(s))
405 {
406 bool found = false;
407 foreach (IRegionModule m in modules)
408 {
409 if (m.Name == s)
410 {
411 found = true;
412 }
413 }
414 if (!found)
415 {
416 m_log.Fatal("[MODULES]: Required module " + s + " not found.");
417 Environment.Exit(0);
418 }
419 }
420 }
421 }
422
385 scene.SetModuleInterfaces(); 423 scene.SetModuleInterfaces();
424// First Step of bootreport sequence
425 if (scene.SnmpService != null)
426 {
427 scene.SnmpService.ColdStart(1,scene);
428 scene.SnmpService.LinkDown(scene);
429 }
430
431 if (scene.SnmpService != null)
432 {
433 scene.SnmpService.BootInfo("Loading prins", scene);
434 }
386 435
387 while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) 436 while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null)
388 SetUpEstateOwner(scene); 437 SetUpEstateOwner(scene);
@@ -396,6 +445,11 @@ namespace OpenSim
396 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); 445 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
397 scene.EventManager.TriggerParcelPrimCountUpdate(); 446 scene.EventManager.TriggerParcelPrimCountUpdate();
398 447
448 if (scene.SnmpService != null)
449 {
450 scene.SnmpService.BootInfo("Grid Registration in progress", scene);
451 }
452
399 try 453 try
400 { 454 {
401 scene.RegisterRegionWithGrid(); 455 scene.RegisterRegionWithGrid();
@@ -406,15 +460,29 @@ namespace OpenSim
406 "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}", 460 "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}",
407 e.Message, e.StackTrace); 461 e.Message, e.StackTrace);
408 462
463 if (scene.SnmpService != null)
464 {
465 scene.SnmpService.Critical("Grid registration failed. Startup aborted.", scene);
466 }
409 // Carrying on now causes a lot of confusion down the 467 // Carrying on now causes a lot of confusion down the
410 // line - we need to get the user's attention 468 // line - we need to get the user's attention
411 Environment.Exit(1); 469 Environment.Exit(1);
412 } 470 }
413 471
472 if (scene.SnmpService != null)
473 {
474 scene.SnmpService.BootInfo("Grid Registration done", scene);
475 }
476
414 // We need to do this after we've initialized the 477 // We need to do this after we've initialized the
415 // scripting engines. 478 // scripting engines.
416 scene.CreateScriptInstances(); 479 scene.CreateScriptInstances();
417 480
481 if (scene.SnmpService != null)
482 {
483 scene.SnmpService.BootInfo("ScriptEngine started", scene);
484 }
485
418 SceneManager.Add(scene); 486 SceneManager.Add(scene);
419 487
420 if (m_autoCreateClientStack) 488 if (m_autoCreateClientStack)
@@ -423,6 +491,10 @@ namespace OpenSim
423 clientServer.Start(); 491 clientServer.Start();
424 } 492 }
425 493
494 if (scene.SnmpService != null)
495 {
496 scene.SnmpService.BootInfo("Initializing region modules", scene);
497 }
426 if (do_post_init) 498 if (do_post_init)
427 { 499 {
428 foreach (IRegionModule module in modules) 500 foreach (IRegionModule module in modules)
@@ -434,6 +506,12 @@ namespace OpenSim
434 506
435 mscene = scene; 507 mscene = scene;
436 508
509 if (scene.SnmpService != null)
510 {
511 scene.SnmpService.BootInfo("The region is operational", scene);
512 scene.SnmpService.LinkUp(scene);
513 }
514
437 scene.Start(); 515 scene.Start();
438 scene.StartScripts(); 516 scene.StartScripts();
439 517
@@ -552,6 +630,11 @@ namespace OpenSim
552 private void ShutdownRegion(Scene scene) 630 private void ShutdownRegion(Scene scene)
553 { 631 {
554 m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); 632 m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName);
633 if (scene.SnmpService != null)
634 {
635 scene.SnmpService.BootInfo("The region is shutting down", scene);
636 scene.SnmpService.LinkDown(scene);
637 }
555 IRegionModulesController controller; 638 IRegionModulesController controller;
556 if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller)) 639 if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller))
557 { 640 {