aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application/OpenSimBase.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs86
1 files changed, 81 insertions, 5 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index c555915..88bd869 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>
@@ -188,6 +192,13 @@ namespace OpenSim
188 CreatePIDFile(pidFile); 192 CreatePIDFile(pidFile);
189 193
190 userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); 194 userStatsURI = startupConfig.GetString("Stats_URI", String.Empty);
195
196 m_securePermissionsLoading = startupConfig.GetBoolean("SecurePermissionsLoading", true);
197
198 string permissionModules = Util.GetConfigVarFromSections<string>(Config, "permissionmodules",
199 new string[] { "Startup", "Permissions" }, "DefaultPermissionsModule");
200
201 m_permsModules = new List<string>(permissionModules.Split(','));
191 } 202 }
192 203
193 // Load the simulation data service 204 // Load the simulation data service
@@ -225,6 +236,12 @@ namespace OpenSim
225 base.StartupSpecific(); 236 base.StartupSpecific();
226 237
227 LoadPlugins(); 238 LoadPlugins();
239
240 if (m_plugins.Count == 0) // We failed to load any modules. Mono Addins glitch!
241 {
242 Environment.Exit(1);
243 }
244
228 foreach (IApplicationPlugin plugin in m_plugins) 245 foreach (IApplicationPlugin plugin in m_plugins)
229 { 246 {
230 plugin.PostInitialise(); 247 plugin.PostInitialise();
@@ -251,10 +268,10 @@ namespace OpenSim
251 "help " + capitalizedTopic, 268 "help " + capitalizedTopic,
252 "Get help on plugin command '" + topic + "'", 269 "Get help on plugin command '" + topic + "'",
253 HandleCommanderHelp); 270 HandleCommanderHelp);
254 console.Commands.AddCommand(capitalizedTopic, false, "help " + capitalizedTopic, 271// console.Commands.AddCommand(capitalizedTopic, false, "help " + capitalizedTopic,
255 "help " + capitalizedTopic, 272// "help " + capitalizedTopic,
256 "Get help on plugin command '" + topic + "'", 273// "Get help on plugin command '" + topic + "'",
257 HandleCommanderHelp); 274// HandleCommanderHelp);
258 275
259 ICommander commander = null; 276 ICommander commander = null;
260 277
@@ -377,7 +394,32 @@ namespace OpenSim
377 } 394 }
378 else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing..."); 395 else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing...");
379 396
397 if (m_securePermissionsLoading)
398 {
399 foreach (string s in m_permsModules)
400 {
401 if (!scene.RegionModules.ContainsKey(s))
402 {
403 m_log.Fatal("[MODULES]: Required module " + s + " not found.");
404 Environment.Exit(0);
405 }
406 }
407
408 m_log.InfoFormat("[SCENE]: Secure permissions loading enabled, modules loaded: {0}", String.Join(" ", m_permsModules.ToArray()));
409 }
410
380 scene.SetModuleInterfaces(); 411 scene.SetModuleInterfaces();
412// First Step of bootreport sequence
413 if (scene.SnmpService != null)
414 {
415 scene.SnmpService.ColdStart(1,scene);
416 scene.SnmpService.LinkDown(scene);
417 }
418
419 if (scene.SnmpService != null)
420 {
421 scene.SnmpService.BootInfo("Loading prins", scene);
422 }
381 423
382 while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) 424 while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null)
383 SetUpEstateOwner(scene); 425 SetUpEstateOwner(scene);
@@ -391,6 +433,11 @@ namespace OpenSim
391 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); 433 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
392 scene.EventManager.TriggerParcelPrimCountUpdate(); 434 scene.EventManager.TriggerParcelPrimCountUpdate();
393 435
436 if (scene.SnmpService != null)
437 {
438 scene.SnmpService.BootInfo("Grid Registration in progress", scene);
439 }
440
394 try 441 try
395 { 442 {
396 scene.RegisterRegionWithGrid(); 443 scene.RegisterRegionWithGrid();
@@ -401,15 +448,29 @@ namespace OpenSim
401 "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}", 448 "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}",
402 e.Message, e.StackTrace); 449 e.Message, e.StackTrace);
403 450
451 if (scene.SnmpService != null)
452 {
453 scene.SnmpService.Critical("Grid registration failed. Startup aborted.", scene);
454 }
404 // Carrying on now causes a lot of confusion down the 455 // Carrying on now causes a lot of confusion down the
405 // line - we need to get the user's attention 456 // line - we need to get the user's attention
406 Environment.Exit(1); 457 Environment.Exit(1);
407 } 458 }
408 459
460 if (scene.SnmpService != null)
461 {
462 scene.SnmpService.BootInfo("Grid Registration done", scene);
463 }
464
409 // We need to do this after we've initialized the 465 // We need to do this after we've initialized the
410 // scripting engines. 466 // scripting engines.
411 scene.CreateScriptInstances(); 467 scene.CreateScriptInstances();
412 468
469 if (scene.SnmpService != null)
470 {
471 scene.SnmpService.BootInfo("ScriptEngine started", scene);
472 }
473
413 SceneManager.Add(scene); 474 SceneManager.Add(scene);
414 475
415 if (m_autoCreateClientStack) 476 if (m_autoCreateClientStack)
@@ -421,10 +482,20 @@ namespace OpenSim
421 } 482 }
422 } 483 }
423 484
485 if (scene.SnmpService != null)
486 {
487 scene.SnmpService.BootInfo("Initializing region modules", scene);
488 }
424 scene.EventManager.OnShutdown += delegate() { ShutdownRegion(scene); }; 489 scene.EventManager.OnShutdown += delegate() { ShutdownRegion(scene); };
425 490
426 mscene = scene; 491 mscene = scene;
427 492
493 if (scene.SnmpService != null)
494 {
495 scene.SnmpService.BootInfo("The region is operational", scene);
496 scene.SnmpService.LinkUp(scene);
497 }
498
428 scene.Start(); 499 scene.Start();
429 scene.StartScripts(); 500 scene.StartScripts();
430 501
@@ -543,6 +614,11 @@ namespace OpenSim
543 private void ShutdownRegion(Scene scene) 614 private void ShutdownRegion(Scene scene)
544 { 615 {
545 m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); 616 m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName);
617 if (scene.SnmpService != null)
618 {
619 scene.SnmpService.BootInfo("The region is shutting down", scene);
620 scene.SnmpService.LinkDown(scene);
621 }
546 IRegionModulesController controller; 622 IRegionModulesController controller;
547 if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller)) 623 if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller))
548 { 624 {
@@ -1089,4 +1165,4 @@ namespace OpenSim
1089 { 1165 {
1090 public IConfigSource Source; 1166 public IConfigSource Source;
1091 } 1167 }
1092} \ No newline at end of file 1168}