diff options
Diffstat (limited to 'OpenSim/Region/Application/OpenSimBase.cs')
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 808c760..7bef1aa 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> |
@@ -193,6 +197,11 @@ namespace OpenSim | |||
193 | CreatePIDFile(pidFile); | 197 | CreatePIDFile(pidFile); |
194 | 198 | ||
195 | userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); | 199 | userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); |
200 | |||
201 | m_securePermissionsLoading = startupConfig.GetBoolean("SecurePermissionsLoading", true); | ||
202 | |||
203 | string permissionModules = startupConfig.GetString("permissionmodules", "DefaultPermissionsModule"); | ||
204 | m_permsModules = new List<string>(permissionModules.Split(',')); | ||
196 | } | 205 | } |
197 | 206 | ||
198 | // Load the simulation data service | 207 | // Load the simulation data service |
@@ -230,6 +239,12 @@ namespace OpenSim | |||
230 | base.StartupSpecific(); | 239 | base.StartupSpecific(); |
231 | 240 | ||
232 | LoadPlugins(); | 241 | LoadPlugins(); |
242 | |||
243 | if (m_plugins.Count == 0) // We failed to load any modules. Mono Addins glitch! | ||
244 | { | ||
245 | Environment.Exit(1); | ||
246 | } | ||
247 | |||
233 | foreach (IApplicationPlugin plugin in m_plugins) | 248 | foreach (IApplicationPlugin plugin in m_plugins) |
234 | { | 249 | { |
235 | plugin.PostInitialise(); | 250 | plugin.PostInitialise(); |
@@ -382,7 +397,42 @@ 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 | // XPTO: Fix this | ||
401 | // if (m_securePermissionsLoading) | ||
402 | // { | ||
403 | // foreach (string s in m_permsModules) | ||
404 | // { | ||
405 | // if (!scene.RegionModules.ContainsKey(s)) | ||
406 | // { | ||
407 | // bool found = false; | ||
408 | // foreach (IRegionModule m in modules) | ||
409 | // { | ||
410 | // if (m.Name == s) | ||
411 | // { | ||
412 | // found = true; | ||
413 | // } | ||
414 | // } | ||
415 | // if (!found) | ||
416 | // { | ||
417 | // m_log.Fatal("[MODULES]: Required module " + s + " not found."); | ||
418 | // Environment.Exit(0); | ||
419 | // } | ||
420 | // } | ||
421 | // } | ||
422 | // } | ||
423 | |||
385 | scene.SetModuleInterfaces(); | 424 | scene.SetModuleInterfaces(); |
425 | // First Step of bootreport sequence | ||
426 | if (scene.SnmpService != null) | ||
427 | { | ||
428 | scene.SnmpService.ColdStart(1,scene); | ||
429 | scene.SnmpService.LinkDown(scene); | ||
430 | } | ||
431 | |||
432 | if (scene.SnmpService != null) | ||
433 | { | ||
434 | scene.SnmpService.BootInfo("Loading prins", scene); | ||
435 | } | ||
386 | 436 | ||
387 | while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) | 437 | while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) |
388 | SetUpEstateOwner(scene); | 438 | SetUpEstateOwner(scene); |
@@ -396,6 +446,11 @@ namespace OpenSim | |||
396 | scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); | 446 | scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); |
397 | scene.EventManager.TriggerParcelPrimCountUpdate(); | 447 | scene.EventManager.TriggerParcelPrimCountUpdate(); |
398 | 448 | ||
449 | if (scene.SnmpService != null) | ||
450 | { | ||
451 | scene.SnmpService.BootInfo("Grid Registration in progress", scene); | ||
452 | } | ||
453 | |||
399 | try | 454 | try |
400 | { | 455 | { |
401 | scene.RegisterRegionWithGrid(); | 456 | scene.RegisterRegionWithGrid(); |
@@ -406,15 +461,29 @@ namespace OpenSim | |||
406 | "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}", | 461 | "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}", |
407 | e.Message, e.StackTrace); | 462 | e.Message, e.StackTrace); |
408 | 463 | ||
464 | if (scene.SnmpService != null) | ||
465 | { | ||
466 | scene.SnmpService.Critical("Grid registration failed. Startup aborted.", scene); | ||
467 | } | ||
409 | // Carrying on now causes a lot of confusion down the | 468 | // Carrying on now causes a lot of confusion down the |
410 | // line - we need to get the user's attention | 469 | // line - we need to get the user's attention |
411 | Environment.Exit(1); | 470 | Environment.Exit(1); |
412 | } | 471 | } |
413 | 472 | ||
473 | if (scene.SnmpService != null) | ||
474 | { | ||
475 | scene.SnmpService.BootInfo("Grid Registration done", scene); | ||
476 | } | ||
477 | |||
414 | // We need to do this after we've initialized the | 478 | // We need to do this after we've initialized the |
415 | // scripting engines. | 479 | // scripting engines. |
416 | scene.CreateScriptInstances(); | 480 | scene.CreateScriptInstances(); |
417 | 481 | ||
482 | if (scene.SnmpService != null) | ||
483 | { | ||
484 | scene.SnmpService.BootInfo("ScriptEngine started", scene); | ||
485 | } | ||
486 | |||
418 | SceneManager.Add(scene); | 487 | SceneManager.Add(scene); |
419 | 488 | ||
420 | if (m_autoCreateClientStack) | 489 | if (m_autoCreateClientStack) |
@@ -423,10 +492,20 @@ namespace OpenSim | |||
423 | clientServer.Start(); | 492 | clientServer.Start(); |
424 | } | 493 | } |
425 | 494 | ||
495 | if (scene.SnmpService != null) | ||
496 | { | ||
497 | scene.SnmpService.BootInfo("Initializing region modules", scene); | ||
498 | } | ||
426 | scene.EventManager.OnShutdown += delegate() { ShutdownRegion(scene); }; | 499 | scene.EventManager.OnShutdown += delegate() { ShutdownRegion(scene); }; |
427 | 500 | ||
428 | mscene = scene; | 501 | mscene = scene; |
429 | 502 | ||
503 | if (scene.SnmpService != null) | ||
504 | { | ||
505 | scene.SnmpService.BootInfo("The region is operational", scene); | ||
506 | scene.SnmpService.LinkUp(scene); | ||
507 | } | ||
508 | |||
430 | scene.Start(); | 509 | scene.Start(); |
431 | scene.StartScripts(); | 510 | scene.StartScripts(); |
432 | 511 | ||
@@ -545,6 +624,11 @@ namespace OpenSim | |||
545 | private void ShutdownRegion(Scene scene) | 624 | private void ShutdownRegion(Scene scene) |
546 | { | 625 | { |
547 | m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); | 626 | m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); |
627 | if (scene.SnmpService != null) | ||
628 | { | ||
629 | scene.SnmpService.BootInfo("The region is shutting down", scene); | ||
630 | scene.SnmpService.LinkDown(scene); | ||
631 | } | ||
548 | IRegionModulesController controller; | 632 | IRegionModulesController controller; |
549 | if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller)) | 633 | if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller)) |
550 | { | 634 | { |