diff options
Diffstat (limited to 'OpenSim/Region/Application/OpenSimBase.cs')
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index f784398..d107b7a 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(); |
@@ -387,7 +402,41 @@ namespace OpenSim | |||
387 | } | 402 | } |
388 | else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing..."); | 403 | else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing..."); |
389 | 404 | ||
405 | if (m_securePermissionsLoading) | ||
406 | { | ||
407 | foreach (string s in m_permsModules) | ||
408 | { | ||
409 | if (!scene.RegionModules.ContainsKey(s)) | ||
410 | { | ||
411 | bool found = false; | ||
412 | foreach (IRegionModule m in modules) | ||
413 | { | ||
414 | if (m.Name == s) | ||
415 | { | ||
416 | found = true; | ||
417 | } | ||
418 | } | ||
419 | if (!found) | ||
420 | { | ||
421 | m_log.Fatal("[MODULES]: Required module " + s + " not found."); | ||
422 | Environment.Exit(0); | ||
423 | } | ||
424 | } | ||
425 | } | ||
426 | } | ||
427 | |||
390 | scene.SetModuleInterfaces(); | 428 | scene.SetModuleInterfaces(); |
429 | // First Step of bootreport sequence | ||
430 | if (scene.SnmpService != null) | ||
431 | { | ||
432 | scene.SnmpService.ColdStart(1,scene); | ||
433 | scene.SnmpService.LinkDown(scene); | ||
434 | } | ||
435 | |||
436 | if (scene.SnmpService != null) | ||
437 | { | ||
438 | scene.SnmpService.BootInfo("Loading prins", scene); | ||
439 | } | ||
391 | 440 | ||
392 | while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) | 441 | while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) |
393 | SetUpEstateOwner(scene); | 442 | SetUpEstateOwner(scene); |
@@ -401,6 +450,11 @@ namespace OpenSim | |||
401 | scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); | 450 | scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); |
402 | scene.EventManager.TriggerParcelPrimCountUpdate(); | 451 | scene.EventManager.TriggerParcelPrimCountUpdate(); |
403 | 452 | ||
453 | if (scene.SnmpService != null) | ||
454 | { | ||
455 | scene.SnmpService.BootInfo("Grid Registration in progress", scene); | ||
456 | } | ||
457 | |||
404 | try | 458 | try |
405 | { | 459 | { |
406 | scene.RegisterRegionWithGrid(); | 460 | scene.RegisterRegionWithGrid(); |
@@ -411,15 +465,29 @@ namespace OpenSim | |||
411 | "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}", | 465 | "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}", |
412 | e.Message, e.StackTrace); | 466 | e.Message, e.StackTrace); |
413 | 467 | ||
468 | if (scene.SnmpService != null) | ||
469 | { | ||
470 | scene.SnmpService.Critical("Grid registration failed. Startup aborted.", scene); | ||
471 | } | ||
414 | // Carrying on now causes a lot of confusion down the | 472 | // Carrying on now causes a lot of confusion down the |
415 | // line - we need to get the user's attention | 473 | // line - we need to get the user's attention |
416 | Environment.Exit(1); | 474 | Environment.Exit(1); |
417 | } | 475 | } |
418 | 476 | ||
477 | if (scene.SnmpService != null) | ||
478 | { | ||
479 | scene.SnmpService.BootInfo("Grid Registration done", scene); | ||
480 | } | ||
481 | |||
419 | // We need to do this after we've initialized the | 482 | // We need to do this after we've initialized the |
420 | // scripting engines. | 483 | // scripting engines. |
421 | scene.CreateScriptInstances(); | 484 | scene.CreateScriptInstances(); |
422 | 485 | ||
486 | if (scene.SnmpService != null) | ||
487 | { | ||
488 | scene.SnmpService.BootInfo("ScriptEngine started", scene); | ||
489 | } | ||
490 | |||
423 | SceneManager.Add(scene); | 491 | SceneManager.Add(scene); |
424 | 492 | ||
425 | if (m_autoCreateClientStack) | 493 | if (m_autoCreateClientStack) |
@@ -428,6 +496,10 @@ namespace OpenSim | |||
428 | clientServer.Start(); | 496 | clientServer.Start(); |
429 | } | 497 | } |
430 | 498 | ||
499 | if (scene.SnmpService != null) | ||
500 | { | ||
501 | scene.SnmpService.BootInfo("Initializing region modules", scene); | ||
502 | } | ||
431 | if (do_post_init) | 503 | if (do_post_init) |
432 | { | 504 | { |
433 | foreach (IRegionModule module in modules) | 505 | foreach (IRegionModule module in modules) |
@@ -439,6 +511,12 @@ namespace OpenSim | |||
439 | 511 | ||
440 | mscene = scene; | 512 | mscene = scene; |
441 | 513 | ||
514 | if (scene.SnmpService != null) | ||
515 | { | ||
516 | scene.SnmpService.BootInfo("The region is operational", scene); | ||
517 | scene.SnmpService.LinkUp(scene); | ||
518 | } | ||
519 | |||
442 | scene.Start(); | 520 | scene.Start(); |
443 | scene.StartScripts(); | 521 | scene.StartScripts(); |
444 | 522 | ||
@@ -557,6 +635,11 @@ namespace OpenSim | |||
557 | private void ShutdownRegion(Scene scene) | 635 | private void ShutdownRegion(Scene scene) |
558 | { | 636 | { |
559 | m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); | 637 | m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); |
638 | if (scene.SnmpService != null) | ||
639 | { | ||
640 | scene.SnmpService.BootInfo("The region is shutting down", scene); | ||
641 | scene.SnmpService.LinkDown(scene); | ||
642 | } | ||
560 | IRegionModulesController controller; | 643 | IRegionModulesController controller; |
561 | if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller)) | 644 | if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller)) |
562 | { | 645 | { |