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.cs84
1 files changed, 84 insertions, 0 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index a3d6820..1c28219 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
@@ -216,6 +225,12 @@ namespace OpenSim
216 base.StartupSpecific(); 225 base.StartupSpecific();
217 226
218 LoadPlugins(); 227 LoadPlugins();
228
229 if (m_plugins.Count == 0) // We failed to load any modules. Mono Addins glitch!
230 {
231 Environment.Exit(1);
232 }
233
219 foreach (IApplicationPlugin plugin in m_plugins) 234 foreach (IApplicationPlugin plugin in m_plugins)
220 { 235 {
221 plugin.PostInitialise(); 236 plugin.PostInitialise();
@@ -368,7 +383,42 @@ namespace OpenSim
368 } 383 }
369 else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing..."); 384 else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing...");
370 385
386 // XPTO: Fix this
387// if (m_securePermissionsLoading)
388// {
389// foreach (string s in m_permsModules)
390// {
391// if (!scene.RegionModules.ContainsKey(s))
392// {
393// bool found = false;
394// foreach (IRegionModule m in modules)
395// {
396// if (m.Name == s)
397// {
398// found = true;
399// }
400// }
401// if (!found)
402// {
403// m_log.Fatal("[MODULES]: Required module " + s + " not found.");
404// Environment.Exit(0);
405// }
406// }
407// }
408// }
409
371 scene.SetModuleInterfaces(); 410 scene.SetModuleInterfaces();
411// First Step of bootreport sequence
412 if (scene.SnmpService != null)
413 {
414 scene.SnmpService.ColdStart(1,scene);
415 scene.SnmpService.LinkDown(scene);
416 }
417
418 if (scene.SnmpService != null)
419 {
420 scene.SnmpService.BootInfo("Loading prins", scene);
421 }
372 422
373 while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) 423 while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null)
374 SetUpEstateOwner(scene); 424 SetUpEstateOwner(scene);
@@ -382,6 +432,11 @@ namespace OpenSim
382 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); 432 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
383 scene.EventManager.TriggerParcelPrimCountUpdate(); 433 scene.EventManager.TriggerParcelPrimCountUpdate();
384 434
435 if (scene.SnmpService != null)
436 {
437 scene.SnmpService.BootInfo("Grid Registration in progress", scene);
438 }
439
385 try 440 try
386 { 441 {
387 scene.RegisterRegionWithGrid(); 442 scene.RegisterRegionWithGrid();
@@ -392,15 +447,29 @@ namespace OpenSim
392 "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}", 447 "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}",
393 e.Message, e.StackTrace); 448 e.Message, e.StackTrace);
394 449
450 if (scene.SnmpService != null)
451 {
452 scene.SnmpService.Critical("Grid registration failed. Startup aborted.", scene);
453 }
395 // Carrying on now causes a lot of confusion down the 454 // Carrying on now causes a lot of confusion down the
396 // line - we need to get the user's attention 455 // line - we need to get the user's attention
397 Environment.Exit(1); 456 Environment.Exit(1);
398 } 457 }
399 458
459 if (scene.SnmpService != null)
460 {
461 scene.SnmpService.BootInfo("Grid Registration done", scene);
462 }
463
400 // We need to do this after we've initialized the 464 // We need to do this after we've initialized the
401 // scripting engines. 465 // scripting engines.
402 scene.CreateScriptInstances(); 466 scene.CreateScriptInstances();
403 467
468 if (scene.SnmpService != null)
469 {
470 scene.SnmpService.BootInfo("ScriptEngine started", scene);
471 }
472
404 SceneManager.Add(scene); 473 SceneManager.Add(scene);
405 474
406 if (m_autoCreateClientStack) 475 if (m_autoCreateClientStack)
@@ -409,10 +478,20 @@ namespace OpenSim
409 clientServer.Start(); 478 clientServer.Start();
410 } 479 }
411 480
481 if (scene.SnmpService != null)
482 {
483 scene.SnmpService.BootInfo("Initializing region modules", scene);
484 }
412 scene.EventManager.OnShutdown += delegate() { ShutdownRegion(scene); }; 485 scene.EventManager.OnShutdown += delegate() { ShutdownRegion(scene); };
413 486
414 mscene = scene; 487 mscene = scene;
415 488
489 if (scene.SnmpService != null)
490 {
491 scene.SnmpService.BootInfo("The region is operational", scene);
492 scene.SnmpService.LinkUp(scene);
493 }
494
416 scene.Start(); 495 scene.Start();
417 scene.StartScripts(); 496 scene.StartScripts();
418 497
@@ -531,6 +610,11 @@ namespace OpenSim
531 private void ShutdownRegion(Scene scene) 610 private void ShutdownRegion(Scene scene)
532 { 611 {
533 m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); 612 m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName);
613 if (scene.SnmpService != null)
614 {
615 scene.SnmpService.BootInfo("The region is shutting down", scene);
616 scene.SnmpService.LinkDown(scene);
617 }
534 IRegionModulesController controller; 618 IRegionModulesController controller;
535 if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller)) 619 if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller))
536 { 620 {