diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index ab6f036..41966ff 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -110,6 +110,10 @@ namespace OpenSim | |||
110 | 110 | ||
111 | public List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); | 111 | public List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); |
112 | 112 | ||
113 | private List<string> m_permsModules; | ||
114 | |||
115 | private bool m_securePermissionsLoading = true; | ||
116 | |||
113 | /// <value> | 117 | /// <value> |
114 | /// The config information passed into the OpenSimulator region server. | 118 | /// The config information passed into the OpenSimulator region server. |
115 | /// </value> | 119 | /// </value> |
@@ -219,6 +223,14 @@ namespace OpenSim | |||
219 | CreatePIDFile(pidFile); | 223 | CreatePIDFile(pidFile); |
220 | 224 | ||
221 | userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); | 225 | userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); |
226 | |||
227 | m_securePermissionsLoading = startupConfig.GetBoolean("SecurePermissionsLoading", true); | ||
228 | |||
229 | string permissionModules = Util.GetConfigVarFromSections<string>(Config, "permissionmodules", | ||
230 | new string[] { "Startup", "Permissions" }, "DefaultPermissionsModule"); | ||
231 | |||
232 | m_permsModules = new List<string>(permissionModules.Split(',')); | ||
233 | |||
222 | managedStatsURI = startupConfig.GetString("ManagedStatsRemoteFetchURI", String.Empty); | 234 | managedStatsURI = startupConfig.GetString("ManagedStatsRemoteFetchURI", String.Empty); |
223 | } | 235 | } |
224 | 236 | ||
@@ -410,7 +422,32 @@ namespace OpenSim | |||
410 | } | 422 | } |
411 | else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing..."); | 423 | else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing..."); |
412 | 424 | ||
425 | if (m_securePermissionsLoading) | ||
426 | { | ||
427 | foreach (string s in m_permsModules) | ||
428 | { | ||
429 | if (!scene.RegionModules.ContainsKey(s)) | ||
430 | { | ||
431 | m_log.Fatal("[MODULES]: Required module " + s + " not found."); | ||
432 | Environment.Exit(0); | ||
433 | } | ||
434 | } | ||
435 | |||
436 | m_log.InfoFormat("[SCENE]: Secure permissions loading enabled, modules loaded: {0}", String.Join(" ", m_permsModules.ToArray())); | ||
437 | } | ||
438 | |||
413 | scene.SetModuleInterfaces(); | 439 | scene.SetModuleInterfaces(); |
440 | // First Step of bootreport sequence | ||
441 | if (scene.SnmpService != null) | ||
442 | { | ||
443 | scene.SnmpService.ColdStart(1,scene); | ||
444 | scene.SnmpService.LinkDown(scene); | ||
445 | } | ||
446 | |||
447 | if (scene.SnmpService != null) | ||
448 | { | ||
449 | scene.SnmpService.BootInfo("Loading prins", scene); | ||
450 | } | ||
414 | 451 | ||
415 | while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) | 452 | while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) |
416 | SetUpEstateOwner(scene); | 453 | SetUpEstateOwner(scene); |
@@ -424,6 +461,11 @@ namespace OpenSim | |||
424 | scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); | 461 | scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); |
425 | scene.EventManager.TriggerParcelPrimCountUpdate(); | 462 | scene.EventManager.TriggerParcelPrimCountUpdate(); |
426 | 463 | ||
464 | if (scene.SnmpService != null) | ||
465 | { | ||
466 | scene.SnmpService.BootInfo("Grid Registration in progress", scene); | ||
467 | } | ||
468 | |||
427 | try | 469 | try |
428 | { | 470 | { |
429 | scene.RegisterRegionWithGrid(); | 471 | scene.RegisterRegionWithGrid(); |
@@ -434,15 +476,29 @@ namespace OpenSim | |||
434 | "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}", | 476 | "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}", |
435 | e.Message, e.StackTrace); | 477 | e.Message, e.StackTrace); |
436 | 478 | ||
479 | if (scene.SnmpService != null) | ||
480 | { | ||
481 | scene.SnmpService.Critical("Grid registration failed. Startup aborted.", scene); | ||
482 | } | ||
437 | // Carrying on now causes a lot of confusion down the | 483 | // Carrying on now causes a lot of confusion down the |
438 | // line - we need to get the user's attention | 484 | // line - we need to get the user's attention |
439 | Environment.Exit(1); | 485 | Environment.Exit(1); |
440 | } | 486 | } |
441 | 487 | ||
488 | if (scene.SnmpService != null) | ||
489 | { | ||
490 | scene.SnmpService.BootInfo("Grid Registration done", scene); | ||
491 | } | ||
492 | |||
442 | // We need to do this after we've initialized the | 493 | // We need to do this after we've initialized the |
443 | // scripting engines. | 494 | // scripting engines. |
444 | scene.CreateScriptInstances(); | 495 | scene.CreateScriptInstances(); |
445 | 496 | ||
497 | if (scene.SnmpService != null) | ||
498 | { | ||
499 | scene.SnmpService.BootInfo("ScriptEngine started", scene); | ||
500 | } | ||
501 | |||
446 | SceneManager.Add(scene); | 502 | SceneManager.Add(scene); |
447 | 503 | ||
448 | //if (m_autoCreateClientStack) | 504 | //if (m_autoCreateClientStack) |
@@ -454,10 +510,20 @@ namespace OpenSim | |||
454 | // } | 510 | // } |
455 | //} | 511 | //} |
456 | 512 | ||
513 | if (scene.SnmpService != null) | ||
514 | { | ||
515 | scene.SnmpService.BootInfo("Initializing region modules", scene); | ||
516 | } | ||
457 | scene.EventManager.OnShutdown += delegate() { ShutdownRegion(scene); }; | 517 | scene.EventManager.OnShutdown += delegate() { ShutdownRegion(scene); }; |
458 | 518 | ||
459 | mscene = scene; | 519 | mscene = scene; |
460 | 520 | ||
521 | if (scene.SnmpService != null) | ||
522 | { | ||
523 | scene.SnmpService.BootInfo("The region is operational", scene); | ||
524 | scene.SnmpService.LinkUp(scene); | ||
525 | } | ||
526 | |||
461 | //return clientServers; | 527 | //return clientServers; |
462 | } | 528 | } |
463 | 529 | ||
@@ -573,6 +639,11 @@ namespace OpenSim | |||
573 | private void ShutdownRegion(Scene scene) | 639 | private void ShutdownRegion(Scene scene) |
574 | { | 640 | { |
575 | m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); | 641 | m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); |
642 | if (scene.SnmpService != null) | ||
643 | { | ||
644 | scene.SnmpService.BootInfo("The region is shutting down", scene); | ||
645 | scene.SnmpService.LinkDown(scene); | ||
646 | } | ||
576 | IRegionModulesController controller; | 647 | IRegionModulesController controller; |
577 | if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller)) | 648 | if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller)) |
578 | { | 649 | { |