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.cs92
1 files changed, 89 insertions, 3 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 0a78df2..8e1eb95 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -92,6 +92,10 @@ namespace OpenSim
92 92
93 protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); 93 protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>();
94 94
95 private List<string> m_permsModules;
96
97 private bool m_securePermissionsLoading = true;
98
95 /// <value> 99 /// <value>
96 /// The config information passed into the OpenSimulator region server. 100 /// The config information passed into the OpenSimulator region server.
97 /// </value> 101 /// </value>
@@ -196,6 +200,11 @@ namespace OpenSim
196 CreatePIDFile(pidFile); 200 CreatePIDFile(pidFile);
197 201
198 userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); 202 userStatsURI = startupConfig.GetString("Stats_URI", String.Empty);
203
204 m_securePermissionsLoading = startupConfig.GetBoolean("SecurePermissionsLoading", true);
205
206 string permissionModules = startupConfig.GetString("permissionmodules", "DefaultPermissionsModule");
207 m_permsModules = new List<string>(permissionModules.Split(','));
199 } 208 }
200 209
201 // Load the simulation data service 210 // Load the simulation data service
@@ -224,6 +233,12 @@ namespace OpenSim
224 m_moduleLoader = new ModuleLoader(m_config.Source); 233 m_moduleLoader = new ModuleLoader(m_config.Source);
225 234
226 LoadPlugins(); 235 LoadPlugins();
236
237 if (m_plugins.Count == 0) // We failed to load any modules. Mono Addins glitch!
238 {
239 Environment.Exit(1);
240 }
241
227 foreach (IApplicationPlugin plugin in m_plugins) 242 foreach (IApplicationPlugin plugin in m_plugins)
228 { 243 {
229 plugin.PostInitialise(); 244 plugin.PostInitialise();
@@ -371,7 +386,41 @@ namespace OpenSim
371 } 386 }
372 else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing..."); 387 else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing...");
373 388
389 if (m_securePermissionsLoading)
390 {
391 foreach (string s in m_permsModules)
392 {
393 if (!scene.RegionModules.ContainsKey(s))
394 {
395 bool found = false;
396 foreach (IRegionModule m in modules)
397 {
398 if (m.Name == s)
399 {
400 found = true;
401 }
402 }
403 if (!found)
404 {
405 m_log.Fatal("[MODULES]: Required module " + s + " not found.");
406 Environment.Exit(0);
407 }
408 }
409 }
410 }
411
374 scene.SetModuleInterfaces(); 412 scene.SetModuleInterfaces();
413// First Step of bootreport sequence
414 if (scene.SnmpService != null)
415 {
416 scene.SnmpService.ColdStart(1,scene);
417 scene.SnmpService.LinkDown(scene);
418 }
419
420 if (scene.SnmpService != null)
421 {
422 scene.SnmpService.BootInfo("Loading prins", scene);
423 }
375 424
376 while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) 425 while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null)
377 SetUpEstateOwner(scene); 426 SetUpEstateOwner(scene);
@@ -382,6 +431,10 @@ namespace OpenSim
382 // TODO : Try setting resource for region xstats here on scene 431 // TODO : Try setting resource for region xstats here on scene
383 MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo)); 432 MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo));
384 433
434 if (scene.SnmpService != null)
435 {
436 scene.SnmpService.BootInfo("Grid Registration in progress", scene);
437 }
385 try 438 try
386 { 439 {
387 scene.RegisterRegionWithGrid(); 440 scene.RegisterRegionWithGrid();
@@ -392,11 +445,20 @@ namespace OpenSim
392 "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}", 445 "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}",
393 e.Message, e.StackTrace); 446 e.Message, e.StackTrace);
394 447
448 if (scene.SnmpService != null)
449 {
450 scene.SnmpService.Critical("Grid registration failed. Startup aborted.", scene);
451 }
395 // Carrying on now causes a lot of confusion down the 452 // Carrying on now causes a lot of confusion down the
396 // line - we need to get the user's attention 453 // line - we need to get the user's attention
397 Environment.Exit(1); 454 Environment.Exit(1);
398 } 455 }
399 456
457 if (scene.SnmpService != null)
458 {
459 scene.SnmpService.BootInfo("Grid Registration done", scene);
460 }
461
400 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); 462 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
401 scene.EventManager.TriggerParcelPrimCountUpdate(); 463 scene.EventManager.TriggerParcelPrimCountUpdate();
402 464
@@ -404,6 +466,11 @@ namespace OpenSim
404 // scripting engines. 466 // scripting engines.
405 scene.CreateScriptInstances(); 467 scene.CreateScriptInstances();
406 468
469 if (scene.SnmpService != null)
470 {
471 scene.SnmpService.BootInfo("ScriptEngine started", scene);
472 }
473
407 m_sceneManager.Add(scene); 474 m_sceneManager.Add(scene);
408 475
409 if (m_autoCreateClientStack) 476 if (m_autoCreateClientStack)
@@ -412,6 +479,10 @@ namespace OpenSim
412 clientServer.Start(); 479 clientServer.Start();
413 } 480 }
414 481
482 if (scene.SnmpService != null)
483 {
484 scene.SnmpService.BootInfo("Initializing region modules", scene);
485 }
415 if (do_post_init) 486 if (do_post_init)
416 { 487 {
417 foreach (IRegionModule module in modules) 488 foreach (IRegionModule module in modules)
@@ -423,7 +494,14 @@ namespace OpenSim
423 494
424 mscene = scene; 495 mscene = scene;
425 496
497 if (scene.SnmpService != null)
498 {
499 scene.SnmpService.BootInfo("The region is operational", scene);
500 scene.SnmpService.LinkUp(scene);
501 }
502
426 scene.StartTimer(); 503 scene.StartTimer();
504 scene.StartTimerWatchdog();
427 505
428 scene.StartScripts(); 506 scene.StartScripts();
429 507
@@ -500,6 +578,11 @@ namespace OpenSim
500 private void ShutdownRegion(Scene scene) 578 private void ShutdownRegion(Scene scene)
501 { 579 {
502 m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); 580 m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName);
581 if (scene.SnmpService != null)
582 {
583 scene.SnmpService.BootInfo("The region is shutting down", scene);
584 scene.SnmpService.LinkDown(scene);
585 }
503 IRegionModulesController controller; 586 IRegionModulesController controller;
504 if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller)) 587 if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller))
505 { 588 {
@@ -943,7 +1026,7 @@ namespace OpenSim
943 = MainConsole.Instance.CmdPrompt( 1026 = MainConsole.Instance.CmdPrompt(
944 string.Format( 1027 string.Format(
945 "Do you wish to join region {0} to an existing estate (yes/no)?", regInfo.RegionName), 1028 "Do you wish to join region {0} to an existing estate (yes/no)?", regInfo.RegionName),
946 "yes", 1029 "no",
947 new List<string>() { "yes", "no" }); 1030 new List<string>() { "yes", "no" });
948 1031
949 if (response == "no") 1032 if (response == "no")
@@ -959,12 +1042,15 @@ namespace OpenSim
959 = MainConsole.Instance.CmdPrompt( 1042 = MainConsole.Instance.CmdPrompt(
960 string.Format( 1043 string.Format(
961 "Name of estate to join. Existing estate names are ({0})", string.Join(", ", estateNames.ToArray())), 1044 "Name of estate to join. Existing estate names are ({0})", string.Join(", ", estateNames.ToArray())),
962 estateNames[0]); 1045 "None");
1046
1047 if (response == "None")
1048 continue;
963 1049
964 List<int> estateIDs = EstateDataService.GetEstates(response); 1050 List<int> estateIDs = EstateDataService.GetEstates(response);
965 if (estateIDs.Count < 1) 1051 if (estateIDs.Count < 1)
966 { 1052 {
967 MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again."); 1053 MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again.");
968 continue; 1054 continue;
969 } 1055 }
970 1056