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 866ba9a..77f38ed 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>
@@ -189,6 +193,11 @@ namespace OpenSim
189 CreatePIDFile(pidFile); 193 CreatePIDFile(pidFile);
190 194
191 userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); 195 userStatsURI = startupConfig.GetString("Stats_URI", String.Empty);
196
197 m_securePermissionsLoading = startupConfig.GetBoolean("SecurePermissionsLoading", true);
198
199 string permissionModules = startupConfig.GetString("permissionmodules", "DefaultPermissionsModule");
200 m_permsModules = new List<string>(permissionModules.Split(','));
192 } 201 }
193 202
194 // Load the simulation data service 203 // Load the simulation data service
@@ -217,6 +226,12 @@ namespace OpenSim
217 m_moduleLoader = new ModuleLoader(m_config.Source); 226 m_moduleLoader = new ModuleLoader(m_config.Source);
218 227
219 LoadPlugins(); 228 LoadPlugins();
229
230 if (m_plugins.Count == 0) // We failed to load any modules. Mono Addins glitch!
231 {
232 Environment.Exit(1);
233 }
234
220 foreach (IApplicationPlugin plugin in m_plugins) 235 foreach (IApplicationPlugin plugin in m_plugins)
221 { 236 {
222 plugin.PostInitialise(); 237 plugin.PostInitialise();
@@ -364,7 +379,41 @@ namespace OpenSim
364 } 379 }
365 else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing..."); 380 else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing...");
366 381
382 if (m_securePermissionsLoading)
383 {
384 foreach (string s in m_permsModules)
385 {
386 if (!scene.RegionModules.ContainsKey(s))
387 {
388 bool found = false;
389 foreach (IRegionModule m in modules)
390 {
391 if (m.Name == s)
392 {
393 found = true;
394 }
395 }
396 if (!found)
397 {
398 m_log.Fatal("[MODULES]: Required module " + s + " not found.");
399 Environment.Exit(0);
400 }
401 }
402 }
403 }
404
367 scene.SetModuleInterfaces(); 405 scene.SetModuleInterfaces();
406// First Step of bootreport sequence
407 if (scene.SnmpService != null)
408 {
409 scene.SnmpService.ColdStart(1,scene);
410 scene.SnmpService.LinkDown(scene);
411 }
412
413 if (scene.SnmpService != null)
414 {
415 scene.SnmpService.BootInfo("Loading prins", scene);
416 }
368 417
369 while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) 418 while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null)
370 SetUpEstateOwner(scene); 419 SetUpEstateOwner(scene);
@@ -375,6 +424,10 @@ namespace OpenSim
375 // TODO : Try setting resource for region xstats here on scene 424 // TODO : Try setting resource for region xstats here on scene
376 MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo)); 425 MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo));
377 426
427 if (scene.SnmpService != null)
428 {
429 scene.SnmpService.BootInfo("Grid Registration in progress", scene);
430 }
378 try 431 try
379 { 432 {
380 scene.RegisterRegionWithGrid(); 433 scene.RegisterRegionWithGrid();
@@ -385,11 +438,20 @@ namespace OpenSim
385 "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}", 438 "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}",
386 e.Message, e.StackTrace); 439 e.Message, e.StackTrace);
387 440
441 if (scene.SnmpService != null)
442 {
443 scene.SnmpService.Critical("Grid registration failed. Startup aborted.", scene);
444 }
388 // Carrying on now causes a lot of confusion down the 445 // Carrying on now causes a lot of confusion down the
389 // line - we need to get the user's attention 446 // line - we need to get the user's attention
390 Environment.Exit(1); 447 Environment.Exit(1);
391 } 448 }
392 449
450 if (scene.SnmpService != null)
451 {
452 scene.SnmpService.BootInfo("Grid Registration done", scene);
453 }
454
393 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); 455 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
394 scene.EventManager.TriggerParcelPrimCountUpdate(); 456 scene.EventManager.TriggerParcelPrimCountUpdate();
395 457
@@ -397,6 +459,11 @@ namespace OpenSim
397 // scripting engines. 459 // scripting engines.
398 scene.CreateScriptInstances(); 460 scene.CreateScriptInstances();
399 461
462 if (scene.SnmpService != null)
463 {
464 scene.SnmpService.BootInfo("ScriptEngine started", scene);
465 }
466
400 m_sceneManager.Add(scene); 467 m_sceneManager.Add(scene);
401 468
402 if (m_autoCreateClientStack) 469 if (m_autoCreateClientStack)
@@ -405,6 +472,10 @@ namespace OpenSim
405 clientServer.Start(); 472 clientServer.Start();
406 } 473 }
407 474
475 if (scene.SnmpService != null)
476 {
477 scene.SnmpService.BootInfo("Initializing region modules", scene);
478 }
408 if (do_post_init) 479 if (do_post_init)
409 { 480 {
410 foreach (IRegionModule module in modules) 481 foreach (IRegionModule module in modules)
@@ -416,7 +487,14 @@ namespace OpenSim
416 487
417 mscene = scene; 488 mscene = scene;
418 489
490 if (scene.SnmpService != null)
491 {
492 scene.SnmpService.BootInfo("The region is operational", scene);
493 scene.SnmpService.LinkUp(scene);
494 }
495
419 scene.StartTimer(); 496 scene.StartTimer();
497 scene.StartTimerWatchdog();
420 498
421 scene.StartScripts(); 499 scene.StartScripts();
422 500
@@ -484,6 +562,11 @@ namespace OpenSim
484 private void ShutdownRegion(Scene scene) 562 private void ShutdownRegion(Scene scene)
485 { 563 {
486 m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); 564 m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName);
565 if (scene.SnmpService != null)
566 {
567 scene.SnmpService.BootInfo("The region is shutting down", scene);
568 scene.SnmpService.LinkDown(scene);
569 }
487 IRegionModulesController controller; 570 IRegionModulesController controller;
488 if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller)) 571 if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller))
489 { 572 {
@@ -927,7 +1010,7 @@ namespace OpenSim
927 = MainConsole.Instance.CmdPrompt( 1010 = MainConsole.Instance.CmdPrompt(
928 string.Format( 1011 string.Format(
929 "Do you wish to join region {0} to an existing estate (yes/no)?", regInfo.RegionName), 1012 "Do you wish to join region {0} to an existing estate (yes/no)?", regInfo.RegionName),
930 "yes", 1013 "no",
931 new List<string>() { "yes", "no" }); 1014 new List<string>() { "yes", "no" });
932 1015
933 if (response == "no") 1016 if (response == "no")
@@ -943,12 +1026,15 @@ namespace OpenSim
943 = MainConsole.Instance.CmdPrompt( 1026 = MainConsole.Instance.CmdPrompt(
944 string.Format( 1027 string.Format(
945 "Name of estate to join. Existing estate names are ({0})", string.Join(", ", estateNames.ToArray())), 1028 "Name of estate to join. Existing estate names are ({0})", string.Join(", ", estateNames.ToArray())),
946 estateNames[0]); 1029 "None");
1030
1031 if (response == "None")
1032 continue;
947 1033
948 List<int> estateIDs = EstateDataService.GetEstates(response); 1034 List<int> estateIDs = EstateDataService.GetEstates(response);
949 if (estateIDs.Count < 1) 1035 if (estateIDs.Count < 1)
950 { 1036 {
951 MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again."); 1037 MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again.");
952 continue; 1038 continue;
953 } 1039 }
954 1040