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.cs93
1 files changed, 90 insertions, 3 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index d3c1102..34f513d 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -93,6 +93,10 @@ namespace OpenSim
93 93
94 protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); 94 protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>();
95 95
96 private List<string> m_permsModules;
97
98 private bool m_securePermissionsLoading = true;
99
96 /// <value> 100 /// <value>
97 /// The config information passed into the OpenSimulator region server. 101 /// The config information passed into the OpenSimulator region server.
98 /// </value> 102 /// </value>
@@ -197,6 +201,11 @@ namespace OpenSim
197 CreatePIDFile(pidFile); 201 CreatePIDFile(pidFile);
198 202
199 userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); 203 userStatsURI = startupConfig.GetString("Stats_URI", String.Empty);
204
205 m_securePermissionsLoading = startupConfig.GetBoolean("SecurePermissionsLoading", true);
206
207 string permissionModules = startupConfig.GetString("permissionmodules", "DefaultPermissionsModule");
208 m_permsModules = new List<string>(permissionModules.Split(','));
200 } 209 }
201 210
202 // Load the simulation data service 211 // Load the simulation data service
@@ -225,6 +234,12 @@ namespace OpenSim
225 m_moduleLoader = new ModuleLoader(m_config.Source); 234 m_moduleLoader = new ModuleLoader(m_config.Source);
226 235
227 LoadPlugins(); 236 LoadPlugins();
237
238 if (m_plugins.Count == 0) // We failed to load any modules. Mono Addins glitch!
239 {
240 Environment.Exit(1);
241 }
242
228 foreach (IApplicationPlugin plugin in m_plugins) 243 foreach (IApplicationPlugin plugin in m_plugins)
229 { 244 {
230 plugin.PostInitialise(); 245 plugin.PostInitialise();
@@ -374,7 +389,41 @@ namespace OpenSim
374 } 389 }
375 else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing..."); 390 else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing...");
376 391
392 if (m_securePermissionsLoading)
393 {
394 foreach (string s in m_permsModules)
395 {
396 if (!scene.RegionModules.ContainsKey(s))
397 {
398 bool found = false;
399 foreach (IRegionModule m in modules)
400 {
401 if (m.Name == s)
402 {
403 found = true;
404 }
405 }
406 if (!found)
407 {
408 m_log.Fatal("[MODULES]: Required module " + s + " not found.");
409 Environment.Exit(0);
410 }
411 }
412 }
413 }
414
377 scene.SetModuleInterfaces(); 415 scene.SetModuleInterfaces();
416// First Step of bootreport sequence
417 if (scene.SnmpService != null)
418 {
419 scene.SnmpService.ColdStart(1,scene);
420 scene.SnmpService.LinkDown(scene);
421 }
422
423 if (scene.SnmpService != null)
424 {
425 scene.SnmpService.BootInfo("Loading prins", scene);
426 }
378 427
379 while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) 428 while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null)
380 SetUpEstateOwner(scene); 429 SetUpEstateOwner(scene);
@@ -388,6 +437,11 @@ namespace OpenSim
388 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); 437 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
389 scene.EventManager.TriggerParcelPrimCountUpdate(); 438 scene.EventManager.TriggerParcelPrimCountUpdate();
390 439
440 if (scene.SnmpService != null)
441 {
442 scene.SnmpService.BootInfo("Grid Registration in progress", scene);
443 }
444
391 try 445 try
392 { 446 {
393 scene.RegisterRegionWithGrid(); 447 scene.RegisterRegionWithGrid();
@@ -398,15 +452,29 @@ namespace OpenSim
398 "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}", 452 "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}",
399 e.Message, e.StackTrace); 453 e.Message, e.StackTrace);
400 454
455 if (scene.SnmpService != null)
456 {
457 scene.SnmpService.Critical("Grid registration failed. Startup aborted.", scene);
458 }
401 // Carrying on now causes a lot of confusion down the 459 // Carrying on now causes a lot of confusion down the
402 // line - we need to get the user's attention 460 // line - we need to get the user's attention
403 Environment.Exit(1); 461 Environment.Exit(1);
404 } 462 }
405 463
464 if (scene.SnmpService != null)
465 {
466 scene.SnmpService.BootInfo("Grid Registration done", scene);
467 }
468
406 // We need to do this after we've initialized the 469 // We need to do this after we've initialized the
407 // scripting engines. 470 // scripting engines.
408 scene.CreateScriptInstances(); 471 scene.CreateScriptInstances();
409 472
473 if (scene.SnmpService != null)
474 {
475 scene.SnmpService.BootInfo("ScriptEngine started", scene);
476 }
477
410 m_sceneManager.Add(scene); 478 m_sceneManager.Add(scene);
411 479
412 if (m_autoCreateClientStack) 480 if (m_autoCreateClientStack)
@@ -415,6 +483,10 @@ namespace OpenSim
415 clientServer.Start(); 483 clientServer.Start();
416 } 484 }
417 485
486 if (scene.SnmpService != null)
487 {
488 scene.SnmpService.BootInfo("Initializing region modules", scene);
489 }
418 if (do_post_init) 490 if (do_post_init)
419 { 491 {
420 foreach (IRegionModule module in modules) 492 foreach (IRegionModule module in modules)
@@ -426,7 +498,14 @@ namespace OpenSim
426 498
427 mscene = scene; 499 mscene = scene;
428 500
501 if (scene.SnmpService != null)
502 {
503 scene.SnmpService.BootInfo("The region is operational", scene);
504 scene.SnmpService.LinkUp(scene);
505 }
506
429 scene.StartTimer(); 507 scene.StartTimer();
508 scene.StartTimerWatchdog();
430 509
431 scene.StartScripts(); 510 scene.StartScripts();
432 511
@@ -503,6 +582,11 @@ namespace OpenSim
503 private void ShutdownRegion(Scene scene) 582 private void ShutdownRegion(Scene scene)
504 { 583 {
505 m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); 584 m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName);
585 if (scene.SnmpService != null)
586 {
587 scene.SnmpService.BootInfo("The region is shutting down", scene);
588 scene.SnmpService.LinkDown(scene);
589 }
506 IRegionModulesController controller; 590 IRegionModulesController controller;
507 if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller)) 591 if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller))
508 { 592 {
@@ -946,7 +1030,7 @@ namespace OpenSim
946 = MainConsole.Instance.CmdPrompt( 1030 = MainConsole.Instance.CmdPrompt(
947 string.Format( 1031 string.Format(
948 "Do you wish to join region {0} to an existing estate (yes/no)?", regInfo.RegionName), 1032 "Do you wish to join region {0} to an existing estate (yes/no)?", regInfo.RegionName),
949 "yes", 1033 "no",
950 new List<string>() { "yes", "no" }); 1034 new List<string>() { "yes", "no" });
951 1035
952 if (response == "no") 1036 if (response == "no")
@@ -962,12 +1046,15 @@ namespace OpenSim
962 = MainConsole.Instance.CmdPrompt( 1046 = MainConsole.Instance.CmdPrompt(
963 string.Format( 1047 string.Format(
964 "Name of estate to join. Existing estate names are ({0})", string.Join(", ", estateNames.ToArray())), 1048 "Name of estate to join. Existing estate names are ({0})", string.Join(", ", estateNames.ToArray())),
965 estateNames[0]); 1049 "None");
1050
1051 if (response == "None")
1052 continue;
966 1053
967 List<int> estateIDs = EstateDataService.GetEstates(response); 1054 List<int> estateIDs = EstateDataService.GetEstates(response);
968 if (estateIDs.Count < 1) 1055 if (estateIDs.Count < 1)
969 { 1056 {
970 MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again."); 1057 MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again.");
971 continue; 1058 continue;
972 } 1059 }
973 1060