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.cs95
1 files changed, 91 insertions, 4 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 54caac4..77f38ed 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -46,7 +46,8 @@ using OpenSim.Region.Framework;
46using OpenSim.Region.Framework.Interfaces; 46using OpenSim.Region.Framework.Interfaces;
47using OpenSim.Region.Framework.Scenes; 47using OpenSim.Region.Framework.Scenes;
48using OpenSim.Region.Physics.Manager; 48using OpenSim.Region.Physics.Manager;
49using OpenSim.Server.Base; 49using OpenSim.Server.Base;
50using OpenSim.Services.Base;
50using OpenSim.Services.Interfaces; 51using OpenSim.Services.Interfaces;
51using OpenSim.Services.UserAccountService; 52using OpenSim.Services.UserAccountService;
52 53
@@ -91,6 +92,10 @@ namespace OpenSim
91 92
92 protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); 93 protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>();
93 94
95 private List<string> m_permsModules;
96
97 private bool m_securePermissionsLoading = true;
98
94 /// <value> 99 /// <value>
95 /// The config information passed into the OpenSimulator region server. 100 /// The config information passed into the OpenSimulator region server.
96 /// </value> 101 /// </value>
@@ -188,6 +193,11 @@ namespace OpenSim
188 CreatePIDFile(pidFile); 193 CreatePIDFile(pidFile);
189 194
190 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(','));
191 } 201 }
192 202
193 // Load the simulation data service 203 // Load the simulation data service
@@ -216,6 +226,12 @@ namespace OpenSim
216 m_moduleLoader = new ModuleLoader(m_config.Source); 226 m_moduleLoader = new ModuleLoader(m_config.Source);
217 227
218 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
219 foreach (IApplicationPlugin plugin in m_plugins) 235 foreach (IApplicationPlugin plugin in m_plugins)
220 { 236 {
221 plugin.PostInitialise(); 237 plugin.PostInitialise();
@@ -363,7 +379,41 @@ namespace OpenSim
363 } 379 }
364 else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing..."); 380 else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing...");
365 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
366 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 }
367 417
368 while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) 418 while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null)
369 SetUpEstateOwner(scene); 419 SetUpEstateOwner(scene);
@@ -374,6 +424,10 @@ namespace OpenSim
374 // TODO : Try setting resource for region xstats here on scene 424 // TODO : Try setting resource for region xstats here on scene
375 MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo)); 425 MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo));
376 426
427 if (scene.SnmpService != null)
428 {
429 scene.SnmpService.BootInfo("Grid Registration in progress", scene);
430 }
377 try 431 try
378 { 432 {
379 scene.RegisterRegionWithGrid(); 433 scene.RegisterRegionWithGrid();
@@ -384,11 +438,20 @@ namespace OpenSim
384 "[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}",
385 e.Message, e.StackTrace); 439 e.Message, e.StackTrace);
386 440
441 if (scene.SnmpService != null)
442 {
443 scene.SnmpService.Critical("Grid registration failed. Startup aborted.", scene);
444 }
387 // Carrying on now causes a lot of confusion down the 445 // Carrying on now causes a lot of confusion down the
388 // line - we need to get the user's attention 446 // line - we need to get the user's attention
389 Environment.Exit(1); 447 Environment.Exit(1);
390 } 448 }
391 449
450 if (scene.SnmpService != null)
451 {
452 scene.SnmpService.BootInfo("Grid Registration done", scene);
453 }
454
392 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); 455 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
393 scene.EventManager.TriggerParcelPrimCountUpdate(); 456 scene.EventManager.TriggerParcelPrimCountUpdate();
394 457
@@ -396,6 +459,11 @@ namespace OpenSim
396 // scripting engines. 459 // scripting engines.
397 scene.CreateScriptInstances(); 460 scene.CreateScriptInstances();
398 461
462 if (scene.SnmpService != null)
463 {
464 scene.SnmpService.BootInfo("ScriptEngine started", scene);
465 }
466
399 m_sceneManager.Add(scene); 467 m_sceneManager.Add(scene);
400 468
401 if (m_autoCreateClientStack) 469 if (m_autoCreateClientStack)
@@ -404,6 +472,10 @@ namespace OpenSim
404 clientServer.Start(); 472 clientServer.Start();
405 } 473 }
406 474
475 if (scene.SnmpService != null)
476 {
477 scene.SnmpService.BootInfo("Initializing region modules", scene);
478 }
407 if (do_post_init) 479 if (do_post_init)
408 { 480 {
409 foreach (IRegionModule module in modules) 481 foreach (IRegionModule module in modules)
@@ -415,7 +487,14 @@ namespace OpenSim
415 487
416 mscene = scene; 488 mscene = scene;
417 489
490 if (scene.SnmpService != null)
491 {
492 scene.SnmpService.BootInfo("The region is operational", scene);
493 scene.SnmpService.LinkUp(scene);
494 }
495
418 scene.StartTimer(); 496 scene.StartTimer();
497 scene.StartTimerWatchdog();
419 498
420 scene.StartScripts(); 499 scene.StartScripts();
421 500
@@ -483,6 +562,11 @@ namespace OpenSim
483 private void ShutdownRegion(Scene scene) 562 private void ShutdownRegion(Scene scene)
484 { 563 {
485 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 }
486 IRegionModulesController controller; 570 IRegionModulesController controller;
487 if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller)) 571 if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller))
488 { 572 {
@@ -926,7 +1010,7 @@ namespace OpenSim
926 = MainConsole.Instance.CmdPrompt( 1010 = MainConsole.Instance.CmdPrompt(
927 string.Format( 1011 string.Format(
928 "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),
929 "yes", 1013 "no",
930 new List<string>() { "yes", "no" }); 1014 new List<string>() { "yes", "no" });
931 1015
932 if (response == "no") 1016 if (response == "no")
@@ -942,12 +1026,15 @@ namespace OpenSim
942 = MainConsole.Instance.CmdPrompt( 1026 = MainConsole.Instance.CmdPrompt(
943 string.Format( 1027 string.Format(
944 "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())),
945 estateNames[0]); 1029 "None");
1030
1031 if (response == "None")
1032 continue;
946 1033
947 List<int> estateIDs = EstateDataService.GetEstates(response); 1034 List<int> estateIDs = EstateDataService.GetEstates(response);
948 if (estateIDs.Count < 1) 1035 if (estateIDs.Count < 1)
949 { 1036 {
950 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.");
951 continue; 1038 continue;
952 } 1039 }
953 1040