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.cs82
1 files changed, 82 insertions, 0 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 1652b82..b74a392 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -88,6 +88,10 @@ namespace OpenSim
88 88
89 protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); 89 protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>();
90 90
91 private List<string> m_permsModules;
92
93 private bool m_securePermissionsLoading = true;
94
91 /// <value> 95 /// <value>
92 /// The config information passed into the OpenSimulator region server. 96 /// The config information passed into the OpenSimulator region server.
93 /// </value> 97 /// </value>
@@ -185,6 +189,11 @@ namespace OpenSim
185 CreatePIDFile(pidFile); 189 CreatePIDFile(pidFile);
186 190
187 userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); 191 userStatsURI = startupConfig.GetString("Stats_URI", String.Empty);
192
193 m_securePermissionsLoading = startupConfig.GetBoolean("SecurePermissionsLoading", true);
194
195 string permissionModules = startupConfig.GetString("permissionmodules", "DefaultPermissionsModule");
196 m_permsModules = new List<string>(permissionModules.Split(','));
188 } 197 }
189 198
190 // Load the simulation data service 199 // Load the simulation data service
@@ -213,6 +222,12 @@ namespace OpenSim
213 m_moduleLoader = new ModuleLoader(m_config.Source); 222 m_moduleLoader = new ModuleLoader(m_config.Source);
214 223
215 LoadPlugins(); 224 LoadPlugins();
225
226 if (m_plugins.Count == 0) // We failed to load any modules. Mono Addins glitch!
227 {
228 Environment.Exit(1);
229 }
230
216 foreach (IApplicationPlugin plugin in m_plugins) 231 foreach (IApplicationPlugin plugin in m_plugins)
217 { 232 {
218 plugin.PostInitialise(); 233 plugin.PostInitialise();
@@ -360,7 +375,41 @@ namespace OpenSim
360 } 375 }
361 else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing..."); 376 else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing...");
362 377
378 if (m_securePermissionsLoading)
379 {
380 foreach (string s in m_permsModules)
381 {
382 if (!scene.RegionModules.ContainsKey(s))
383 {
384 bool found = false;
385 foreach (IRegionModule m in modules)
386 {
387 if (m.Name == s)
388 {
389 found = true;
390 }
391 }
392 if (!found)
393 {
394 m_log.Fatal("[MODULES]: Required module " + s + " not found.");
395 Environment.Exit(0);
396 }
397 }
398 }
399 }
400
363 scene.SetModuleInterfaces(); 401 scene.SetModuleInterfaces();
402// First Step of bootreport sequence
403 if (scene.SnmpService != null)
404 {
405 scene.SnmpService.ColdStart(1,scene);
406 scene.SnmpService.LinkDown(scene);
407 }
408
409 if (scene.SnmpService != null)
410 {
411 scene.SnmpService.BootInfo("Loading prins", scene);
412 }
364 413
365 // Prims have to be loaded after module configuration since some modules may be invoked during the load 414 // Prims have to be loaded after module configuration since some modules may be invoked during the load
366 scene.LoadPrimsFromStorage(regionInfo.originRegionID); 415 scene.LoadPrimsFromStorage(regionInfo.originRegionID);
@@ -368,6 +417,10 @@ namespace OpenSim
368 // TODO : Try setting resource for region xstats here on scene 417 // TODO : Try setting resource for region xstats here on scene
369 MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo)); 418 MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo));
370 419
420 if (scene.SnmpService != null)
421 {
422 scene.SnmpService.BootInfo("Grid Registration in progress", scene);
423 }
371 try 424 try
372 { 425 {
373 scene.RegisterRegionWithGrid(); 426 scene.RegisterRegionWithGrid();
@@ -378,11 +431,20 @@ namespace OpenSim
378 "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}", 431 "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}",
379 e.Message, e.StackTrace); 432 e.Message, e.StackTrace);
380 433
434 if (scene.SnmpService != null)
435 {
436 scene.SnmpService.Critical("Grid registration failed. Startup aborted.", scene);
437 }
381 // Carrying on now causes a lot of confusion down the 438 // Carrying on now causes a lot of confusion down the
382 // line - we need to get the user's attention 439 // line - we need to get the user's attention
383 Environment.Exit(1); 440 Environment.Exit(1);
384 } 441 }
385 442
443 if (scene.SnmpService != null)
444 {
445 scene.SnmpService.BootInfo("Grid Registration done", scene);
446 }
447
386 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); 448 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
387 scene.EventManager.TriggerParcelPrimCountUpdate(); 449 scene.EventManager.TriggerParcelPrimCountUpdate();
388 450
@@ -390,6 +452,11 @@ namespace OpenSim
390 // scripting engines. 452 // scripting engines.
391 scene.CreateScriptInstances(); 453 scene.CreateScriptInstances();
392 454
455 if (scene.SnmpService != null)
456 {
457 scene.SnmpService.BootInfo("ScriptEngine started", scene);
458 }
459
393 m_sceneManager.Add(scene); 460 m_sceneManager.Add(scene);
394 461
395 if (m_autoCreateClientStack) 462 if (m_autoCreateClientStack)
@@ -398,6 +465,10 @@ namespace OpenSim
398 clientServer.Start(); 465 clientServer.Start();
399 } 466 }
400 467
468 if (scene.SnmpService != null)
469 {
470 scene.SnmpService.BootInfo("Initializing region modules", scene);
471 }
401 if (do_post_init) 472 if (do_post_init)
402 { 473 {
403 foreach (IRegionModule module in modules) 474 foreach (IRegionModule module in modules)
@@ -409,6 +480,12 @@ namespace OpenSim
409 480
410 mscene = scene; 481 mscene = scene;
411 482
483 if (scene.SnmpService != null)
484 {
485 scene.SnmpService.BootInfo("The region is operational", scene);
486 scene.SnmpService.LinkUp(scene);
487 }
488
412 scene.StartTimer(); 489 scene.StartTimer();
413 490
414 return clientServer; 491 return clientServer;
@@ -417,6 +494,11 @@ namespace OpenSim
417 private void ShutdownRegion(Scene scene) 494 private void ShutdownRegion(Scene scene)
418 { 495 {
419 m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); 496 m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName);
497 if (scene.SnmpService != null)
498 {
499 scene.SnmpService.BootInfo("The region is shutting down", scene);
500 scene.SnmpService.LinkDown(scene);
501 }
420 IRegionModulesController controller; 502 IRegionModulesController controller;
421 if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller)) 503 if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller))
422 { 504 {