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 f482d8f..80bff17 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();
@@ -372,7 +387,41 @@ namespace OpenSim
372 } 387 }
373 else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing..."); 388 else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing...");
374 389
390 if (m_securePermissionsLoading)
391 {
392 foreach (string s in m_permsModules)
393 {
394 if (!scene.RegionModules.ContainsKey(s))
395 {
396 bool found = false;
397 foreach (IRegionModule m in modules)
398 {
399 if (m.Name == s)
400 {
401 found = true;
402 }
403 }
404 if (!found)
405 {
406 m_log.Fatal("[MODULES]: Required module " + s + " not found.");
407 Environment.Exit(0);
408 }
409 }
410 }
411 }
412
375 scene.SetModuleInterfaces(); 413 scene.SetModuleInterfaces();
414// First Step of bootreport sequence
415 if (scene.SnmpService != null)
416 {
417 scene.SnmpService.ColdStart(1,scene);
418 scene.SnmpService.LinkDown(scene);
419 }
420
421 if (scene.SnmpService != null)
422 {
423 scene.SnmpService.BootInfo("Loading prins", scene);
424 }
376 425
377 while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) 426 while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null)
378 SetUpEstateOwner(scene); 427 SetUpEstateOwner(scene);
@@ -386,6 +435,11 @@ namespace OpenSim
386 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); 435 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
387 scene.EventManager.TriggerParcelPrimCountUpdate(); 436 scene.EventManager.TriggerParcelPrimCountUpdate();
388 437
438 if (scene.SnmpService != null)
439 {
440 scene.SnmpService.BootInfo("Grid Registration in progress", scene);
441 }
442
389 try 443 try
390 { 444 {
391 scene.RegisterRegionWithGrid(); 445 scene.RegisterRegionWithGrid();
@@ -396,15 +450,29 @@ namespace OpenSim
396 "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}", 450 "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}",
397 e.Message, e.StackTrace); 451 e.Message, e.StackTrace);
398 452
453 if (scene.SnmpService != null)
454 {
455 scene.SnmpService.Critical("Grid registration failed. Startup aborted.", scene);
456 }
399 // Carrying on now causes a lot of confusion down the 457 // Carrying on now causes a lot of confusion down the
400 // line - we need to get the user's attention 458 // line - we need to get the user's attention
401 Environment.Exit(1); 459 Environment.Exit(1);
402 } 460 }
403 461
462 if (scene.SnmpService != null)
463 {
464 scene.SnmpService.BootInfo("Grid Registration done", scene);
465 }
466
404 // We need to do this after we've initialized the 467 // We need to do this after we've initialized the
405 // scripting engines. 468 // scripting engines.
406 scene.CreateScriptInstances(); 469 scene.CreateScriptInstances();
407 470
471 if (scene.SnmpService != null)
472 {
473 scene.SnmpService.BootInfo("ScriptEngine started", scene);
474 }
475
408 m_sceneManager.Add(scene); 476 m_sceneManager.Add(scene);
409 477
410 if (m_autoCreateClientStack) 478 if (m_autoCreateClientStack)
@@ -413,6 +481,10 @@ namespace OpenSim
413 clientServer.Start(); 481 clientServer.Start();
414 } 482 }
415 483
484 if (scene.SnmpService != null)
485 {
486 scene.SnmpService.BootInfo("Initializing region modules", scene);
487 }
416 if (do_post_init) 488 if (do_post_init)
417 { 489 {
418 foreach (IRegionModule module in modules) 490 foreach (IRegionModule module in modules)
@@ -424,7 +496,14 @@ namespace OpenSim
424 496
425 mscene = scene; 497 mscene = scene;
426 498
499 if (scene.SnmpService != null)
500 {
501 scene.SnmpService.BootInfo("The region is operational", scene);
502 scene.SnmpService.LinkUp(scene);
503 }
504
427 scene.StartTimer(); 505 scene.StartTimer();
506 scene.StartTimerWatchdog();
428 507
429 scene.StartScripts(); 508 scene.StartScripts();
430 509
@@ -501,6 +580,11 @@ namespace OpenSim
501 private void ShutdownRegion(Scene scene) 580 private void ShutdownRegion(Scene scene)
502 { 581 {
503 m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); 582 m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName);
583 if (scene.SnmpService != null)
584 {
585 scene.SnmpService.BootInfo("The region is shutting down", scene);
586 scene.SnmpService.LinkDown(scene);
587 }
504 IRegionModulesController controller; 588 IRegionModulesController controller;
505 if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller)) 589 if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller))
506 { 590 {
@@ -944,7 +1028,7 @@ namespace OpenSim
944 = MainConsole.Instance.CmdPrompt( 1028 = MainConsole.Instance.CmdPrompt(
945 string.Format( 1029 string.Format(
946 "Do you wish to join region {0} to an existing estate (yes/no)?", regInfo.RegionName), 1030 "Do you wish to join region {0} to an existing estate (yes/no)?", regInfo.RegionName),
947 "yes", 1031 "no",
948 new List<string>() { "yes", "no" }); 1032 new List<string>() { "yes", "no" });
949 1033
950 if (response == "no") 1034 if (response == "no")
@@ -960,12 +1044,15 @@ namespace OpenSim
960 = MainConsole.Instance.CmdPrompt( 1044 = MainConsole.Instance.CmdPrompt(
961 string.Format( 1045 string.Format(
962 "Name of estate to join. Existing estate names are ({0})", string.Join(", ", estateNames.ToArray())), 1046 "Name of estate to join. Existing estate names are ({0})", string.Join(", ", estateNames.ToArray())),
963 estateNames[0]); 1047 "None");
1048
1049 if (response == "None")
1050 continue;
964 1051
965 List<int> estateIDs = EstateDataService.GetEstates(response); 1052 List<int> estateIDs = EstateDataService.GetEstates(response);
966 if (estateIDs.Count < 1) 1053 if (estateIDs.Count < 1)
967 { 1054 {
968 MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again."); 1055 MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again.");
969 continue; 1056 continue;
970 } 1057 }
971 1058