diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 92 |
1 files changed, 89 insertions, 3 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 8662ea8..4b87f84 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -91,6 +91,10 @@ namespace OpenSim | |||
91 | 91 | ||
92 | protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); | 92 | protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); |
93 | 93 | ||
94 | private List<string> m_permsModules; | ||
95 | |||
96 | private bool m_securePermissionsLoading = true; | ||
97 | |||
94 | /// <value> | 98 | /// <value> |
95 | /// The config information passed into the OpenSimulator region server. | 99 | /// The config information passed into the OpenSimulator region server. |
96 | /// </value> | 100 | /// </value> |
@@ -188,6 +192,11 @@ namespace OpenSim | |||
188 | CreatePIDFile(pidFile); | 192 | CreatePIDFile(pidFile); |
189 | 193 | ||
190 | userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); | 194 | userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); |
195 | |||
196 | m_securePermissionsLoading = startupConfig.GetBoolean("SecurePermissionsLoading", true); | ||
197 | |||
198 | string permissionModules = startupConfig.GetString("permissionmodules", "DefaultPermissionsModule"); | ||
199 | m_permsModules = new List<string>(permissionModules.Split(',')); | ||
191 | } | 200 | } |
192 | 201 | ||
193 | // Load the simulation data service | 202 | // Load the simulation data service |
@@ -216,6 +225,12 @@ namespace OpenSim | |||
216 | m_moduleLoader = new ModuleLoader(m_config.Source); | 225 | m_moduleLoader = new ModuleLoader(m_config.Source); |
217 | 226 | ||
218 | LoadPlugins(); | 227 | LoadPlugins(); |
228 | |||
229 | if (m_plugins.Count == 0) // We failed to load any modules. Mono Addins glitch! | ||
230 | { | ||
231 | Environment.Exit(1); | ||
232 | } | ||
233 | |||
219 | foreach (IApplicationPlugin plugin in m_plugins) | 234 | foreach (IApplicationPlugin plugin in m_plugins) |
220 | { | 235 | { |
221 | plugin.PostInitialise(); | 236 | plugin.PostInitialise(); |
@@ -363,7 +378,41 @@ namespace OpenSim | |||
363 | } | 378 | } |
364 | else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing..."); | 379 | else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing..."); |
365 | 380 | ||
381 | if (m_securePermissionsLoading) | ||
382 | { | ||
383 | foreach (string s in m_permsModules) | ||
384 | { | ||
385 | if (!scene.RegionModules.ContainsKey(s)) | ||
386 | { | ||
387 | bool found = false; | ||
388 | foreach (IRegionModule m in modules) | ||
389 | { | ||
390 | if (m.Name == s) | ||
391 | { | ||
392 | found = true; | ||
393 | } | ||
394 | } | ||
395 | if (!found) | ||
396 | { | ||
397 | m_log.Fatal("[MODULES]: Required module " + s + " not found."); | ||
398 | Environment.Exit(0); | ||
399 | } | ||
400 | } | ||
401 | } | ||
402 | } | ||
403 | |||
366 | scene.SetModuleInterfaces(); | 404 | scene.SetModuleInterfaces(); |
405 | // First Step of bootreport sequence | ||
406 | if (scene.SnmpService != null) | ||
407 | { | ||
408 | scene.SnmpService.ColdStart(1,scene); | ||
409 | scene.SnmpService.LinkDown(scene); | ||
410 | } | ||
411 | |||
412 | if (scene.SnmpService != null) | ||
413 | { | ||
414 | scene.SnmpService.BootInfo("Loading prins", scene); | ||
415 | } | ||
367 | 416 | ||
368 | while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) | 417 | while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) |
369 | SetUpEstateOwner(scene); | 418 | SetUpEstateOwner(scene); |
@@ -374,6 +423,10 @@ namespace OpenSim | |||
374 | // TODO : Try setting resource for region xstats here on scene | 423 | // TODO : Try setting resource for region xstats here on scene |
375 | MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo)); | 424 | MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo)); |
376 | 425 | ||
426 | if (scene.SnmpService != null) | ||
427 | { | ||
428 | scene.SnmpService.BootInfo("Grid Registration in progress", scene); | ||
429 | } | ||
377 | try | 430 | try |
378 | { | 431 | { |
379 | scene.RegisterRegionWithGrid(); | 432 | scene.RegisterRegionWithGrid(); |
@@ -384,11 +437,20 @@ namespace OpenSim | |||
384 | "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}", | 437 | "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}", |
385 | e.Message, e.StackTrace); | 438 | e.Message, e.StackTrace); |
386 | 439 | ||
440 | if (scene.SnmpService != null) | ||
441 | { | ||
442 | scene.SnmpService.Critical("Grid registration failed. Startup aborted.", scene); | ||
443 | } | ||
387 | // Carrying on now causes a lot of confusion down the | 444 | // Carrying on now causes a lot of confusion down the |
388 | // line - we need to get the user's attention | 445 | // line - we need to get the user's attention |
389 | Environment.Exit(1); | 446 | Environment.Exit(1); |
390 | } | 447 | } |
391 | 448 | ||
449 | if (scene.SnmpService != null) | ||
450 | { | ||
451 | scene.SnmpService.BootInfo("Grid Registration done", scene); | ||
452 | } | ||
453 | |||
392 | scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); | 454 | scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); |
393 | scene.EventManager.TriggerParcelPrimCountUpdate(); | 455 | scene.EventManager.TriggerParcelPrimCountUpdate(); |
394 | 456 | ||
@@ -396,6 +458,11 @@ namespace OpenSim | |||
396 | // scripting engines. | 458 | // scripting engines. |
397 | scene.CreateScriptInstances(); | 459 | scene.CreateScriptInstances(); |
398 | 460 | ||
461 | if (scene.SnmpService != null) | ||
462 | { | ||
463 | scene.SnmpService.BootInfo("ScriptEngine started", scene); | ||
464 | } | ||
465 | |||
399 | m_sceneManager.Add(scene); | 466 | m_sceneManager.Add(scene); |
400 | 467 | ||
401 | if (m_autoCreateClientStack) | 468 | if (m_autoCreateClientStack) |
@@ -404,6 +471,10 @@ namespace OpenSim | |||
404 | clientServer.Start(); | 471 | clientServer.Start(); |
405 | } | 472 | } |
406 | 473 | ||
474 | if (scene.SnmpService != null) | ||
475 | { | ||
476 | scene.SnmpService.BootInfo("Initializing region modules", scene); | ||
477 | } | ||
407 | if (do_post_init) | 478 | if (do_post_init) |
408 | { | 479 | { |
409 | foreach (IRegionModule module in modules) | 480 | foreach (IRegionModule module in modules) |
@@ -415,7 +486,14 @@ namespace OpenSim | |||
415 | 486 | ||
416 | mscene = scene; | 487 | mscene = scene; |
417 | 488 | ||
489 | if (scene.SnmpService != null) | ||
490 | { | ||
491 | scene.SnmpService.BootInfo("The region is operational", scene); | ||
492 | scene.SnmpService.LinkUp(scene); | ||
493 | } | ||
494 | |||
418 | scene.StartTimer(); | 495 | scene.StartTimer(); |
496 | scene.StartTimerWatchdog(); | ||
419 | 497 | ||
420 | scene.StartScripts(); | 498 | scene.StartScripts(); |
421 | 499 | ||
@@ -474,6 +552,11 @@ namespace OpenSim | |||
474 | private void ShutdownRegion(Scene scene) | 552 | private void ShutdownRegion(Scene scene) |
475 | { | 553 | { |
476 | m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); | 554 | m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); |
555 | if (scene.SnmpService != null) | ||
556 | { | ||
557 | scene.SnmpService.BootInfo("The region is shutting down", scene); | ||
558 | scene.SnmpService.LinkDown(scene); | ||
559 | } | ||
477 | IRegionModulesController controller; | 560 | IRegionModulesController controller; |
478 | if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller)) | 561 | if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller)) |
479 | { | 562 | { |
@@ -917,7 +1000,7 @@ namespace OpenSim | |||
917 | = MainConsole.Instance.CmdPrompt( | 1000 | = MainConsole.Instance.CmdPrompt( |
918 | string.Format( | 1001 | string.Format( |
919 | "Do you wish to join region {0} to an existing estate (yes/no)?", regInfo.RegionName), | 1002 | "Do you wish to join region {0} to an existing estate (yes/no)?", regInfo.RegionName), |
920 | "yes", | 1003 | "no", |
921 | new List<string>() { "yes", "no" }); | 1004 | new List<string>() { "yes", "no" }); |
922 | 1005 | ||
923 | if (response == "no") | 1006 | if (response == "no") |
@@ -933,12 +1016,15 @@ namespace OpenSim | |||
933 | = MainConsole.Instance.CmdPrompt( | 1016 | = MainConsole.Instance.CmdPrompt( |
934 | string.Format( | 1017 | string.Format( |
935 | "Name of estate to join. Existing estate names are ({0})", string.Join(", ", estateNames.ToArray())), | 1018 | "Name of estate to join. Existing estate names are ({0})", string.Join(", ", estateNames.ToArray())), |
936 | estateNames[0]); | 1019 | "None"); |
1020 | |||
1021 | if (response == "None") | ||
1022 | continue; | ||
937 | 1023 | ||
938 | List<int> estateIDs = EstateDataService.GetEstates(response); | 1024 | List<int> estateIDs = EstateDataService.GetEstates(response); |
939 | if (estateIDs.Count < 1) | 1025 | if (estateIDs.Count < 1) |
940 | { | 1026 | { |
941 | MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again."); | 1027 | MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again."); |
942 | continue; | 1028 | continue; |
943 | } | 1029 | } |
944 | 1030 | ||